diff --git a/.coderabbit.yaml b/.coderabbit.yaml index ec2953a161..42b705b571 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -8,4 +8,10 @@ reviews: base_branches: - main - 1.6.x - - 1.7.x \ No newline at end of file + - 1.7.x + - 1.8.x + high_level_summary: false + poem: false + sequence_diagrams: false + collapse_walkthrough: true + changed_files_summary: false diff --git a/.env b/.env index d7aa8b8d9e..4d7c038a6b 100644 --- a/.env +++ b/.env @@ -21,12 +21,15 @@ _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_ROUTER_FORCE_HTTPS=disabled _APP_OPENSSL_KEY_V1=your-secret-key +_APP_DNS=8.8.8.8 _APP_DOMAIN=traefik +_APP_CONSOLE_DOMAIN=localhost _APP_DOMAIN_FUNCTIONS=functions.localhost _APP_DOMAIN_SITES=sites.localhost _APP_DOMAIN_TARGET_CNAME=test.localhost _APP_DOMAIN_TARGET_A=127.0.0.1 _APP_DOMAIN_TARGET_AAAA=::1 +_APP_DOMAIN_TARGET_CAA=digicert.com _APP_RULES_FORMAT=md5 _APP_REDIS_HOST=redis _APP_REDIS_PORT=6379 @@ -84,8 +87,9 @@ _APP_COMPUTE_MAINTENANCE_INTERVAL=600 _APP_COMPUTE_RUNTIMES_NETWORK=runtimes _APP_EXECUTOR_SECRET=your-secret-key _APP_EXECUTOR_HOST=http://exc1/v1 -_APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1 -_APP_SITES_RUNTIMES=static-1,node-22,flutter-3.29 +_APP_BROWSER_HOST=http://appwrite-browser:3000/v1 +_APP_FUNCTIONS_RUNTIMES=node-22 +_APP_SITES_RUNTIMES=static-1,node-22 _APP_MAINTENANCE_INTERVAL=86400 _APP_MAINTENANCE_START_TIME=12:00 _APP_MAINTENANCE_RETENTION_CACHE=2592000 diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 6d73787d00..62b4953e27 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -64,8 +64,9 @@ jobs: sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg sudo apt update sudo apt install oha + oha --version - name: Benchmark PR - run: 'oha -z 180s http://localhost/v1/health/version -j > benchmark.json' + run: 'oha -z 180s http://localhost/v1/health/version --output-format json > benchmark.json' - name: Cleaning run: docker compose down -v - name: Installing latest version @@ -78,7 +79,7 @@ jobs: docker compose up -d sleep 10 - name: Benchmark Latest - run: oha -z 180s http://localhost/v1/health/version -j > benchmark-latest.json + run: oha -z 180s http://localhost/v1/health/version --output-format json > benchmark-latest.json - name: Prepare comment run: | echo '## :sparkles: Benchmark results' > benchmark.txt diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 04f8c822c7..1c5f36ace3 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -13,4 +13,9 @@ jobs: - name: Run CodeQL run: | docker run --rm -v $PWD:/app composer:2.6 sh -c \ - "composer install --profile --ignore-platform-reqs && composer check" \ No newline at end of file + "composer install --profile --ignore-platform-reqs && composer check" + + - name: Run Locale check + run: | + docker run --rm -v $PWD:/app node:24-alpine sh -c \ + "cd /app/.github/workflows/static-analysis/locale && node index.js" diff --git a/.github/workflows/static-analysis/locale/index.js b/.github/workflows/static-analysis/locale/index.js new file mode 100644 index 0000000000..dd4594fc4d --- /dev/null +++ b/.github/workflows/static-analysis/locale/index.js @@ -0,0 +1,115 @@ +/* + * Look into all local files, and collect unique keys. + * Ensure fallback locale (English) has translation for all keys. + * If configured as `const strict = true`, all locales will be checked to include all keys. + */ + +import { readdir, readFile } from "fs/promises"; +import { join, dirname } from "path"; +import { fileURLToPath } from "url"; + +const config = { + strict: false, + fallbackLocale: "en.json", +}; + +(async () => { + try { + // Prepare current directory equivalent in ES modules + const __filename = fileURLToPath(import.meta.url); + const __dirname = dirname(__filename); + + const translationsPath = join( + __dirname, + "../../../../app/config/locale/translations", + ); + + const files = (await readdir(translationsPath)).filter((file) => + file.endsWith(".json"), + ); + + if (files.length === 0) { + console.error("No translation files found in ", translationsPath); + process.exit(1); + } + + // Check if fallback locale exists + if (!files.includes(config.fallbackLocale)) { + console.error(`Fallback locale file ${config.fallbackLocale} not found`); + process.exit(1); + } + + console.log( + `Found ${files.length} translation files in ${translationsPath}`, + ); + + // Collect all unique keys from all translation files + const allKeys = new Set(); + + for (const file of files) { + const filePath = join(translationsPath, file); + const content = await readFile(filePath, "utf8"); + const translations = JSON.parse(content); + + // Add all keys from this file + Object.keys(translations).forEach((key) => allKeys.add(key)); + } + + console.log(`Total unique keys found across all locales: ${allKeys.size}`); + + const localesToCheck = []; + if (config.strict) { + localesToCheck.push(...files); + } else { + localesToCheck.push(config.fallbackLocale); + } + + let errorsCount = 0; + let missingLocaleCount = 0; + + for (const localeToCheck of localesToCheck) { + // Read locale + const path = join(translationsPath, localeToCheck); + const content = await readFile(path, "utf8"); + const translations = JSON.parse(content); + + // Check for missing keys in the locale + const keys = new Set(Object.keys(translations)); + console.log(`Keys in locale (${localeToCheck}): ${keys.size}`); + + const missingKeys = []; + for (const key of allKeys) { + if (!keys.has(key)) { + missingKeys.push(key); + } + } + + if (missingKeys.length > 0) { + console.error( + `\nERROR: Fallback locale (${localeToCheck}) is missing ${missingKeys.length} key(s):`, + ); + missingKeys.sort().forEach((key) => { + console.error(` - ${key}`); + }); + console.error( + `\nTo fix this issue, add the missing keys to ${translationsPath}/${localeToCheck}`, + ); + errorsCount++; + missingLocaleCount += missingKeys.length; + } else { + console.log( + `\nSUCCESS: Fallback locale (${localeToCheck}) contains all ${allKeys.size} keys.`, + ); + } + } + + if (errorsCount > 0) { + console.log(`\n${missingLocaleCount} locales missing found across ${errorsCount} locales.`); + process.exit(1); + } + } catch (error) { + console.error("Unexpected error."); + console.error(error); + process.exit(1); + } +})(); diff --git a/.github/workflows/static-analysis/locale/package.json b/.github/workflows/static-analysis/locale/package.json new file mode 100644 index 0000000000..748a3e6d2a --- /dev/null +++ b/.github/workflows/static-analysis/locale/package.json @@ -0,0 +1,13 @@ +{ + "name": "static-analysis-locale", + "version": "1.0.0", + "type": "module", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "" +} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6fd4e89858..cebdc02163 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,15 @@ env: IMAGE: appwrite-dev CACHE_KEY: appwrite-dev-${{ github.event.pull_request.head.sha }} -on: [ pull_request ] +on: + pull_request: + workflow_dispatch: + inputs: + response_format: + description: 'Response format version to test (e.g., 1.5.0, 1.4.0)' + required: false + type: string + default: '' jobs: check_database_changes: @@ -100,7 +108,10 @@ jobs: run: docker compose exec -T appwrite vars - name: Run Unit Tests - run: docker compose exec appwrite test /usr/src/code/tests/unit + run: | + docker compose exec \ + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" \ + appwrite test /usr/src/code/tests/unit e2e_general_test: name: E2E General Test @@ -132,7 +143,18 @@ jobs: done - name: Run General Tests - run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/General --debug + run: | + docker compose exec -T \ + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" \ + appwrite test /usr/src/code/tests/e2e/General --debug + + - name: Failure Logs + if: failure() + run: | + echo "=== Appwrite Worker Builds Logs ===" + docker compose logs appwrite-worker-builds + echo "=== OpenRuntimes Executor Logs ===" + docker compose logs openruntimes-executor e2e_service_test: name: E2E Service Test @@ -145,7 +167,8 @@ jobs: Account, Avatars, Console, - Databases, + Databases/Legacy, + Databases/TablesDB, Functions, FunctionsSchedule, GraphQL, @@ -178,6 +201,7 @@ jobs: - name: Load and Start Appwrite run: | docker load --input /tmp/${{ env.IMAGE }}.tar + sed -i 's|^_APP_BROWSER_HOST=.*|_APP_BROWSER_HOST=http://invalid-browser/v1|' .env docker compose up -d sleep 30 @@ -198,7 +222,16 @@ jobs: docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude=devKeys + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" \ + appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude-group devKeys,screenshots + + - name: Failure Logs + if: failure() + run: | + echo "=== Appwrite Worker Builds Logs ===" + docker compose logs appwrite-worker-builds + echo "=== OpenRuntimes Executor Logs ===" + docker compose logs openruntimes-executor e2e_shared_mode_test: name: E2E Shared Mode Service Test @@ -213,7 +246,8 @@ jobs: Account, Avatars, Console, - Databases, + Databases/Legacy, + Databases/TablesDB, Functions, FunctionsSchedule, GraphQL, @@ -277,14 +311,21 @@ jobs: docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude=devKeys + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" \ + appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude-group devKeys,screenshots + + - name: Failure Logs + if: failure() + run: | + echo "=== Appwrite Worker Builds Logs ===" + docker compose logs appwrite-worker-builds + echo "=== OpenRuntimes Executor Logs ===" + docker compose logs openruntimes-executor e2e_dev_keys: name: E2E Service Test (Dev Keys) runs-on: ubuntu-latest needs: setup - strategy: - fail-fast: false steps: - name: checkout uses: actions/checkout@v4 @@ -312,8 +353,17 @@ jobs: docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" \ appwrite test /usr/src/code/tests/e2e/Services/Projects --debug --group=devKeys + - name: Failure Logs + if: failure() + run: | + echo "=== Appwrite Worker Builds Logs ===" + docker compose logs appwrite-worker-builds + echo "=== OpenRuntimes Executor Logs ===" + docker compose logs openruntimes-executor + e2e_dev_keys_shared_mode: name: E2E Shared Mode Service Test (Dev Keys) runs-on: ubuntu-latest @@ -359,4 +409,113 @@ jobs: docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" \ appwrite test /usr/src/code/tests/e2e/Services/Projects --debug --group=devKeys + + - name: Failure Logs + if: failure() + run: | + echo "=== Appwrite Worker Builds Logs ===" + docker compose logs appwrite-worker-builds + echo "=== OpenRuntimes Executor Logs ===" + docker compose logs openruntimes-executor + + e2e_screenshots_keys: + name: E2E Service Test (Site Screenshots) + runs-on: ubuntu-latest + needs: setup + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Load Cache + uses: actions/cache@v4 + with: + key: ${{ env.CACHE_KEY }} + path: /tmp/${{ env.IMAGE }}.tar + fail-on-cache-miss: true + + - name: Load and Start Appwrite + run: | + docker load --input /tmp/${{ env.IMAGE }}.tar + sed -i 's/_APP_OPTIONS_ABUSE=disabled/_APP_OPTIONS_ABUSE=enabled/' .env + docker compose up -d + sleep 30 + + - name: Run Site tests with browser connected in dedicated table mode + run: | + echo "Keeping original value of _APP_BROWSER_HOST" + echo "Using project tables" + export _APP_DATABASE_SHARED_TABLES= + export _APP_DATABASE_SHARED_TABLES_V1= + + docker compose exec -T \ + -e _APP_DATABASE_SHARED_TABLES \ + -e _APP_DATABASE_SHARED_TABLES_V1 \ + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" \ + appwrite test /usr/src/code/tests/e2e/Services/Sites --debug --group=screenshots + + - name: Failure Logs + if: failure() + run: | + echo "=== Appwrite Worker Builds Logs ===" + docker compose logs appwrite-worker-builds + echo "=== OpenRuntimes Executor Logs ===" + docker compose logs openruntimes-executor + + e2e_screenshots_shared_mode: + name: E2E Shared Mode Service Test (Site Screenshots) + runs-on: ubuntu-latest + needs: [ setup, check_database_changes ] + if: needs.check_database_changes.outputs.database_changed == 'true' + strategy: + fail-fast: false + matrix: + tables-mode: [ + 'Shared V1', + 'Shared V2', + ] + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Load Cache + uses: actions/cache@v4 + with: + key: ${{ env.CACHE_KEY }} + path: /tmp/${{ env.IMAGE }}.tar + fail-on-cache-miss: true + + - name: Load and Start Appwrite + run: | + docker load --input /tmp/${{ env.IMAGE }}.tar + sed -i 's/_APP_OPTIONS_ABUSE=disabled/_APP_OPTIONS_ABUSE=enabled/' .env + docker compose up -d + sleep 30 + + - name: Run Site tests with browser connected in ${{ matrix.tables-mode }} table mode + run: | + echo "Keeping original value of _APP_BROWSER_HOST" + if [ "${{ matrix.tables-mode }}" == "Shared V1" ]; then + echo "Using shared tables V1" + export _APP_DATABASE_SHARED_TABLES=database_db_main + export _APP_DATABASE_SHARED_TABLES_V1=database_db_main + elif [ "${{ matrix.tables-mode }}" == "Shared V2" ]; then + echo "Using shared tables V2" + export _APP_DATABASE_SHARED_TABLES=database_db_main + export _APP_DATABASE_SHARED_TABLES_V1= + fi + + docker compose exec -T \ + -e _APP_DATABASE_SHARED_TABLES \ + -e _APP_DATABASE_SHARED_TABLES_V1 \ + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" \ + appwrite test /usr/src/code/tests/e2e/Services/Sites --debug --group=screenshots + + - name: Failure Logs + if: failure() + run: | + echo "=== Appwrite Worker Builds Logs ===" + docker compose logs appwrite-worker-builds + echo "=== OpenRuntimes Executor Logs ===" + docker compose logs openruntimes-executor \ No newline at end of file diff --git a/.gitignore b/.gitignore index 600a6aeb08..1d0f0533f2 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,5 @@ app/sdks dev/yasd_init.php .phpunit.result.cache Makefile -appwrite.json +appwrite.config.json /.zed/ \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 277a509447..c6837673d5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,31 @@ You can [find issues using this query](https://github.com/search?q=org%3Aappwrit ## How to Start? -If you are worried or don’t know where to start, check out the next section that explains what kind of help we could use and where you can get involved. You can send your questions to [@appwrite on Twitter](https://twitter.com/appwrite) or to anyone from the [Appwrite team on Discord](https://appwrite.io/discord). You can also submit an issue, and a maintainer can guide you! +Welcome! We're excited that you're interested in contributing to Appwrite. To make sure your time is valued and your contributions are successful, please follow these steps before writing any code: + +### 🔍 Step 1: Find an Issue + +Browse open issues and look for ones labeled [good first issue](https://github.com/search?q=org%3Aappwrite+is%3Aopen+type%3Aissue+label%3A%22good+first+issue%22&type=issues) or [help wanted](https://github.com/search?q=org%3Aappwrite+is%3Aopen+type%3Aissue+label%3A%22help+wanted%22&type=issues). + +If you're not sure which issue to pick, ask in our ⁠[maintainers channel](https://discord.com/channels/564160730845151244/636852860709240842) on Discord. + +### 📝 Step 2: Ask to Be Assigned + +Before working on an issue, comment on the GitHub issue asking to be assigned. This prevents multiple people working on the same task. + +Then, create a thread in the ⁠[maintainers channel](https://discord.com/channels/564160730845151244/636852860709240842) on Discord with a link to the issue. + +Our team is small and may not see your GitHub comment right away - posting in the ⁠[maintainers channel](https://discord.com/channels/564160730845151244/636852860709240842) ensures it gets seen. + +### 💬 Step 3: Don’t Submit Random PRs + +If you're not working on an assigned issue, create a GitHub issue first. + +PRs submitted without context or discussion may not align with our roadmap and may be closed without review. + +### ⚠️ Please Note + +We’re a very small team managing a large project. Many PRs are submitted, and while we appreciate every effort, we can only review contributions that follow the process above. This helps us keep things fair and organized. ## Code of Conduct diff --git a/Dockerfile b/Dockerfile index 30b017b573..2a3e176838 100755 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \ --no-plugins --no-scripts --prefer-dist \ `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` -FROM appwrite/base:0.10.1 AS final +FROM appwrite/base:0.10.4 AS final LABEL maintainer="team@appwrite.io" @@ -50,13 +50,13 @@ RUN mkdir -p /storage/uploads && \ mkdir -p /storage/certificates && \ mkdir -p /storage/functions && \ mkdir -p /storage/debug && \ - chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \ - chown -Rf www-data.www-data /storage/imports && chmod -Rf 0755 /storage/imports && \ - chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \ - chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \ - chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \ - chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \ - chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug + chown -Rf www-data:www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \ + chown -Rf www-data:www-data /storage/imports && chmod -Rf 0755 /storage/imports && \ + chown -Rf www-data:www-data /storage/cache && chmod -Rf 0755 /storage/cache && \ + chown -Rf www-data:www-data /storage/config && chmod -Rf 0755 /storage/config && \ + chown -Rf www-data:www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \ + chown -Rf www-data:www-data /storage/functions && chmod -Rf 0755 /storage/functions && \ + chown -Rf www-data:www-data /storage/debug && chmod -Rf 0755 /storage/debug # Executables RUN chmod +x /usr/local/bin/doctor && \ diff --git a/README-CN.md b/README-CN.md index 811fe6435c..ad9ce7d29a 100644 --- a/README-CN.md +++ b/README-CN.md @@ -26,7 +26,7 @@ [**Appwrite 云公开测试版!立即注册!**](https://cloud.appwrite.io) -Appwrite 是一个基于 Docker 的端到端开发者平台,其容器化的微服务库可应用于网页端,移动端,以及后端。Appwrite 通过视觉化界面简化了从零开始编写 API 的繁琐过程,在保证软件安全的前提下为开发者创造了一个高效的开发环境。 +Appwrite 是一个基于 Docker 的端到端开发者平台,其容器化的微服务库可应用于网页端,移动端,原生应用,以及后端。它既包含后端服务器,也提供了用于部署静态和服务器端渲染前端的完全集成托管解决方案。Appwrite 通过视觉化界面简化了从零开始构建现代应用的复杂性和重复性,让您能够更快地构建安全的全栈应用。 Appwrite 可以提供给开发者用户验证,外部授权,用户数据读写检索,文件储存,图像处理,云函数计算,[等多种服务](https://appwrite.io/docs). @@ -72,7 +72,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.7.2 + appwrite/appwrite:1.8.0 ``` ### Windows @@ -84,7 +84,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.7.2 + appwrite/appwrite:1.8.0 ``` #### PowerShell @@ -94,7 +94,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.7.2 + appwrite/appwrite:1.8.0 ``` 运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。 @@ -179,6 +179,8 @@ docker run -it --rm ` - [**消息传递**](https://appwrite.io/docs/references/cloud/client-web/messaging) - 使用 Appwrite 消息传递功能通过推送通知、电子邮件和短信与用户进行通信。 - [**语言适配**](https://appwrite.io/docs/references/cloud/client-web/locale) - 根据用户所在的的国家和地区做出合适的语言适配。 - [**头像**](https://appwrite.io/docs/references/cloud/client-web/avatars) -管理用户头像、国家旗帜、浏览器图标、信用卡符号,和生成二维码。 +- [**MCP**](https://appwrite.io/docs/tooling/mcp) - 使用 Appwrite 的模型上下文协议(Model Context Protocol)服务器,允许大语言模型(LLM)和 AI 工具(如 Claude Desktop、Cursor 和 Windsurf Editor)通过自然语言直接与您的 Appwrite 项目交互。 +- [**站点**](https://appwrite.io/docs/products/sites) - 直接从 Appwrite 开发、部署和扩展您的 Web 应用程序,与您的后端一起。 如需完整的 API 界面文档,请访问 [https://appwrite.io/docs](https://appwrite.io/docs)。如需更多教程、新闻和公告,请订阅我们的 [博客](https://medium.com/appwrite-io) 和 加入我们的[Discord 社区](https://discord.gg/GSeTUeA)。 ### 开发套件 diff --git a/README.md b/README.md index f29be0bd61..9cd5808e33 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,15 @@ +> We just announced Timestamp Overrides for Appwrite Databases - [Learn more](https://appwrite.io/blog/post/announcing-timestamp-overrides) + +> Appwrite Cloud is now Generally Available - [Learn more](https://appwrite.io/cloud-ga) + > [Get started with Appwrite](https://apwr.dev/appcloud) -> [Join the Init kick off event 19th of May: The future of Appwrite with Founder & CEO Eldad Fux](https://www.youtube.com/watch?v=1g8tuogsp7A)

Appwrite banner, with logo and text saying

- Appwrite is a backend platform for developing Web, Mobile, and Flutter applications. Built with the open source community and optimized for developer experience in the coding languages you love. + Appwrite is an all-in-one development platform for Web, Mobile, and Flutter applications. Use built-in backend infrastructure and web hosting, all from a single place. Built with the open source community and optimized for developer experience in the coding languages you love.

@@ -25,7 +28,7 @@ English | [简体中文](README-CN.md) -Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend apps packaged as a set of Docker microservices. Appwrite abstracts the complexity and repetitiveness required to build a modern backend API from scratch and allows you to build secure apps faster. +Appwrite is an end-to-end platform for building Web, Mobile, Native, or Backend apps, packaged as a set of Docker microservices. It includes both a backend server and a fully integrated hosting solution for deploying static and server-side rendered frontends. Appwrite abstracts the complexity and repetitiveness required to build modern apps from scratch and allows you to build secure, full-stack applications faster. Using Appwrite, you can easily integrate your app with user authentication and multiple sign-in methods, a database for storing and querying users and team data, storage and file management, image manipulation, Cloud Functions, messaging, and [more services](https://appwrite.io/docs). @@ -42,7 +45,7 @@ Find out more at: [https://appwrite.io](https://appwrite.io). Table of Contents: -- [Getting Started](#getting-started) +- [Installation \& Setup](#installation--setup) - [Self-Hosting](#self-hosting) - [Unix](#unix) - [Windows](#windows) @@ -62,8 +65,9 @@ Table of Contents: - [Follow Us](#follow-us) - [License](#license) -## Getting Started -The easiest way to get started with Appwrite is by [signing up for Appwrite Cloud](https://cloud.appwrite.io/). While Appwrite Cloud is in public beta, you can build with Appwrite completely free, and we won't collect you credit card information. +## Installation & Setup + +The easiest way to get started with Appwrite is by [signing up for Appwrite Cloud](https://cloud.appwrite.io/). While Appwrite Cloud is in public beta, you can build with Appwrite completely free, and we won't collect your credit card information. ## Self-Hosting @@ -78,7 +82,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.7.2 + appwrite/appwrite:1.8.0 ``` ### Windows @@ -90,7 +94,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.7.2 + appwrite/appwrite:1.8.0 ``` #### PowerShell @@ -100,7 +104,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.7.2 + appwrite/appwrite:1.8.0 ``` Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation. @@ -128,19 +132,19 @@ Choose from one of the providers below: Gitpod Logo -
Gitpod
+
Gitpod Akamai Logo -
Akamai Compute
+
Akamai Compute AWS Logo -
AWS Marketplace
+
AWS Marketplace @@ -186,6 +190,8 @@ Getting started with Appwrite is as easy as creating a new project, choosing you - [**Realtime**](https://appwrite.io/docs/realtime) - Listen to real-time events for any of your Appwrite services including users, storage, functions, databases, and more. - [**Locale**](https://appwrite.io/docs/references/cloud/client-web/locale) - Track your user's location and manage your app locale-based data. - [**Avatars**](https://appwrite.io/docs/references/cloud/client-web/avatars) - Manage your users' avatars, countries' flags, browser icons, and credit card symbols. Generate QR codes from links or plaintext strings. +- [**MCP**](https://appwrite.io/docs/tooling/mcp) - Use Appwrite's Model Context Protocol (MCP) server to allow LLMs and AI tools like Claude Desktop, Cursor, and Windsurf Editor to directly interact with your Appwrite project through natural language. +- [**Sites**](https://appwrite.io/docs/products/sites) - Develop, deploy, and scale your web applications directly from Appwrite, alongside your backend. For the complete API documentation, visit [https://appwrite.io/docs](https://appwrite.io/docs). For more tutorials, news and announcements check out our [blog](https://medium.com/appwrite-io) and [Discord Server](https://discord.gg/GSeTUeA). diff --git a/app/cli.php b/app/cli.php index 224f150a58..0f98cf3458 100644 --- a/app/cli.php +++ b/app/cli.php @@ -125,7 +125,7 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getSequence()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database @@ -145,7 +145,7 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getSequence()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database @@ -167,7 +167,7 @@ CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { return function (?Document $project = null) use ($pools, $cache, $database) { if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getSequence()); + $database->setTenant((int)$project->getSequence()); return $database; } @@ -182,22 +182,36 @@ CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { // set tenant if ($project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getSequence()); + $database->setTenant((int)$project->getSequence()); } return $database; }; }, ['pools', 'cache']); - +CLI::setResource('publisher', function (Group $pools) { + return new BrokerPool(publisher: $pools->get('publisher')); +}, ['pools']); +CLI::setResource('publisherDatabases', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); +CLI::setResource('publisherFunctions', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); +CLI::setResource('publisherMigrations', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); +CLI::setResource('publisherStatsUsage', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); +CLI::setResource('publisherMessaging', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); CLI::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); CLI::setResource('queueForStatsResources', function (Publisher $publisher) { return new StatsResources($publisher); }, ['publisher']); -CLI::setResource('publisher', function (Group $pools) { - return new BrokerPool(publisher: $pools->get('publisher')); -}, ['pools']); CLI::setResource('queueForFunctions', function (Publisher $publisher) { return new Func($publisher); }, ['publisher']); @@ -251,7 +265,7 @@ CLI::setResource('logError', function (Registry $register) { }; }, ['register']); -CLI::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST'))); +CLI::setResource('executor', fn () => new Executor()); CLI::setResource('telemetry', fn () => new NoTelemetry()); @@ -284,6 +298,5 @@ $cli $cli->shutdown()->action(fn () => Timer::clearAll()); -// Enable coroutines, but disable TCP hooks. These don't work until we use `\Utopia\Cache\Adapter\Pool` and `\Utopia\Database\Adapter\Pool`. -Runtime::enableCoroutine(SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_TCP); +Runtime::enableCoroutine(SWOOLE_HOOK_ALL); run($cli->run(...)); diff --git a/app/config/avatars/credit-cards.php b/app/config/avatars/credit-cards.php index 52760bf9dc..b693e99fb2 100644 --- a/app/config/avatars/credit-cards.php +++ b/app/config/avatars/credit-cards.php @@ -13,7 +13,7 @@ return [ 'mastercard' => ['name' => 'Mastercard', 'path' => __DIR__ . '/credit-cards/mastercard.png'], 'naranja' => ['name' => 'Naranja', 'path' => __DIR__ . '/credit-cards/naranja.png'], 'targeta-shopping' => ['name' => 'Tarjeta Shopping', 'path' => __DIR__ . '/credit-cards/tarjeta-shopping.png'], - 'union-china-pay' => ['name' => 'Union China Pay', 'path' => __DIR__ . '/credit-cards/union-china-pay.png'], + 'unionpay' => ['name' => 'Union Pay', 'path' => __DIR__ . '/credit-cards/unionpay.png'], 'visa' => ['name' => 'Visa', 'path' => __DIR__ . '/credit-cards/visa.png'], 'mir' => ['name' => 'MIR', 'path' => __DIR__ . '/credit-cards/mir.png'], 'maestro' => ['name' => 'Maestro', 'path' => __DIR__ . '/credit-cards/maestro.png'], diff --git a/app/config/avatars/credit-cards/union-china-pay.png b/app/config/avatars/credit-cards/unionpay.png similarity index 100% rename from app/config/avatars/credit-cards/union-china-pay.png rename to app/config/avatars/credit-cards/unionpay.png diff --git a/app/config/collections/common.php b/app/config/collections/common.php index e77d5403d2..6de7eb224b 100644 --- a/app/config/collections/common.php +++ b/app/config/collections/common.php @@ -1439,13 +1439,6 @@ return [ 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], - [ - '$id' => ID::custom('_key_roles'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['roles'], - 'lengths' => [128], - 'orders' => [], - ], ], ], diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index 60f181df66..b839e51622 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -407,7 +407,7 @@ return [ 'format' => '', 'size' => Database::LENGTH_KEY, 'signed' => true, - 'required' => true, + 'required' => false, 'default' => null, 'array' => false, 'filters' => [], diff --git a/app/config/collections/projects.php b/app/config/collections/projects.php index 48a0938a1c..7fc82b7441 100644 --- a/app/config/collections/projects.php +++ b/app/config/collections/projects.php @@ -51,6 +51,16 @@ return [ 'default' => null, 'array' => false, ], + [ + '$id' => ID::custom('type'), + 'type' => Database::VAR_STRING, + 'size' => 128, + 'required' => false, + 'default' => 'tablesdb', + 'signed' => true, + 'array' => false, + 'filters' => [], + ], ], 'indexes' => [ [ @@ -1286,6 +1296,7 @@ return [ ] ], ], + 'deployments' => [ '$collection' => ID::custom(Database::METADATA), '$id' => ID::custom('deployments'), @@ -1916,7 +1927,7 @@ return [ '$id' => ID::custom('errors'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 1000000, + 'size' => APP_FUNCTION_ERROR_LENGTH_LIMIT, 'signed' => true, 'required' => false, 'default' => null, @@ -1927,7 +1938,7 @@ return [ '$id' => ID::custom('logs'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 1000000, + 'size' => APP_FUNCTION_LOG_LENGTH_LIMIT, 'signed' => true, 'required' => false, 'default' => null, diff --git a/app/config/console.php b/app/config/console.php index 1de3a99370..faacecaa08 100644 --- a/app/config/console.php +++ b/app/config/console.php @@ -5,7 +5,7 @@ */ use Appwrite\Auth\Auth; -use Appwrite\Network\Validator\Origin; +use Appwrite\Network\Platform; use Utopia\Database\Helpers\ID; use Utopia\System\System; @@ -23,7 +23,7 @@ $console = [ [ '$collection' => ID::custom('platforms'), 'name' => 'Localhost', - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'hostname' => 'localhost', ], // Current host is added on app init ], @@ -39,7 +39,8 @@ $console = [ 'invites' => System::getEnv('_APP_CONSOLE_INVITES', 'enabled') === 'enabled', 'limit' => (System::getEnv('_APP_CONSOLE_WHITELIST_ROOT', 'enabled') === 'enabled') ? 1 : 0, // limit signup to 1 user 'duration' => Auth::TOKEN_EXPIRATION_LOGIN_LONG, // 1 Year in seconds - 'sessionAlerts' => System::getEnv('_APP_CONSOLE_SESSION_ALERTS', 'disabled') === 'enabled' + 'sessionAlerts' => System::getEnv('_APP_CONSOLE_SESSION_ALERTS', 'disabled') === 'enabled', + 'invalidateSessions' => true ], 'authWhitelistEmails' => (!empty(System::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null))) ? \explode(',', System::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null)) : [], 'authWhitelistIPs' => (!empty(System::getEnv('_APP_CONSOLE_WHITELIST_IPS', null))) ? \explode(',', System::getEnv('_APP_CONSOLE_WHITELIST_IPS', null)) : [], diff --git a/app/config/errors.php b/app/config/errors.php index 6d9d29a8ea..156af5db8f 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -69,9 +69,14 @@ return [ 'description' => 'The request contains one or more invalid arguments. Please refer to the endpoint documentation.', 'code' => 400, ], - Exception::GENERAL_QUERY_LIMIT_EXCEEDED => [ - 'name' => Exception::GENERAL_QUERY_LIMIT_EXCEEDED, - 'description' => 'Query limit exceeded for the current attribute. Usage of more than 100 query values on a single attribute is prohibited.', + Exception::GENERAL_ATTRIBUTE_QUERY_LIMIT_EXCEEDED => [ + 'name' => Exception::GENERAL_ATTRIBUTE_QUERY_LIMIT_EXCEEDED, + 'description' => 'Query limit exceeded for the current attribute.', + 'code' => 400, + ], + Exception::GENERAL_COLUMN_QUERY_LIMIT_EXCEEDED => [ + 'name' => Exception::GENERAL_COLUMN_QUERY_LIMIT_EXCEEDED, + 'description' => 'Query limit exceeded for the current column.', 'code' => 400, ], Exception::GENERAL_QUERY_INVALID => [ @@ -393,6 +398,16 @@ return [ 'description' => 'Membership is already confirmed.', 'code' => 409, ], + Exception::MEMBERSHIP_DELETION_PROHIBITED => [ + 'name' => Exception::MEMBERSHIP_DELETION_PROHIBITED, + 'description' => 'Membership deletion is prohibited.', + 'code' => 400, + ], + Exception::MEMBERSHIP_DOWNGRADE_PROHIBITED => [ + 'name' => Exception::MEMBERSHIP_DOWNGRADE_PROHIBITED, + 'description' => 'Membership role downgrade is prohibited.', + 'code' => 400, + ], /** Avatars */ Exception::AVATAR_SET_NOT_FOUND => [ @@ -420,6 +435,11 @@ return [ 'description' => 'The requested favicon could not be found.', 'code' => 404, ], + Exception::AVATAR_SVG_SANITIZATION_FAILED => [ + 'name' => Exception::AVATAR_SVG_SANITIZATION_FAILED, + 'description' => 'SVG sanitization failed.', + 'code' => 400, + ], /** Storage */ Exception::STORAGE_FILE_ALREADY_EXISTS => [ @@ -658,7 +678,7 @@ return [ ], Exception::DATABASE_QUERY_ORDER_NULL => [ 'name' => Exception::DATABASE_QUERY_ORDER_NULL, - 'description' => 'The order attribute had a null value. Cursor pagination requires all documents order attribute values are non-null.', + 'description' => 'The order attribute/column had a null value. Cursor pagination requires all documents/rows order attribute/column values are non-null.', 'code' => 400, ], @@ -679,6 +699,23 @@ return [ 'code' => 400, ], + /** Tables */ + Exception::TABLE_NOT_FOUND => [ + 'name' => Exception::TABLE_NOT_FOUND, + 'description' => 'Table with the requested ID could not be found.', + 'code' => 404, + ], + Exception::TABLE_ALREADY_EXISTS => [ + 'name' => Exception::TABLE_ALREADY_EXISTS, + 'description' => 'A table with the requested ID already exists. Try again with a different ID or use ID.unique() to generate a unique ID.', + 'code' => 409, + ], + Exception::TABLE_LIMIT_EXCEEDED => [ + 'name' => Exception::TABLE_LIMIT_EXCEEDED, + 'description' => 'The maximum number of tables has been reached.', + 'code' => 400, + ], + /** Documents */ Exception::DOCUMENT_NOT_FOUND => [ 'name' => Exception::DOCUMENT_NOT_FOUND, @@ -716,6 +753,43 @@ return [ 'code' => 403, ], + /** Rows */ + Exception::ROW_NOT_FOUND => [ + 'name' => Exception::ROW_NOT_FOUND, + 'description' => 'Row with the requested ID could not be found.', + 'code' => 404, + ], + Exception::ROW_INVALID_STRUCTURE => [ + 'name' => Exception::ROW_INVALID_STRUCTURE, + 'description' => 'The row structure is invalid. Please ensure the columns match the table definition.', + 'code' => 400, + ], + Exception::ROW_MISSING_DATA => [ + 'name' => Exception::ROW_MISSING_DATA, + 'description' => 'The row data is missing. Try again with row data populated', + 'code' => 400, + ], + Exception::ROW_MISSING_PAYLOAD => [ + 'name' => Exception::ROW_MISSING_PAYLOAD, + 'description' => 'The row data and permissions are missing. You must provide either row data or permissions to be updated.', + 'code' => 400, + ], + Exception::ROW_ALREADY_EXISTS => [ + 'name' => Exception::ROW_ALREADY_EXISTS, + 'description' => 'Row with the requested ID already exists. Try again with a different ID or use ID.unique() to generate a unique ID.', + 'code' => 409, + ], + Exception::ROW_UPDATE_CONFLICT => [ + 'name' => Exception::ROW_UPDATE_CONFLICT, + 'description' => 'Remote row is newer than local.', + 'code' => 409, + ], + Exception::ROW_DELETE_RESTRICTED => [ + 'name' => Exception::ROW_DELETE_RESTRICTED, + 'description' => 'Row cannot be deleted because it is referenced by another row.', + 'code' => 403, + ], + /** Attributes */ Exception::ATTRIBUTE_NOT_FOUND => [ 'name' => Exception::ATTRIBUTE_NOT_FOUND, @@ -762,16 +836,81 @@ return [ 'description' => 'The attribute type is invalid.', 'code' => 400, ], + Exception::ATTRIBUTE_INVALID_RESIZE => [ + 'name' => Exception::ATTRIBUTE_INVALID_RESIZE, + 'description' => 'Existing data is too large for new size, truncate your existing data then try again.', + 'code' => 400, + ], + + Exception::ATTRIBUTE_TYPE_NOT_SUPPORTED => [ + 'name' => Exception::ATTRIBUTE_TYPE_NOT_SUPPORTED, + 'description' => 'Attribute type is not supported.', + 'code' => 400, + ], + + /** Exists for both Attributes & Columns */ Exception::RELATIONSHIP_VALUE_INVALID => [ 'name' => Exception::RELATIONSHIP_VALUE_INVALID, 'description' => 'The relationship value is invalid.', 'code' => 400, ], - Exception::ATTRIBUTE_INVALID_RESIZE => [ - 'name' => Exception::ATTRIBUTE_INVALID_RESIZE, + + /** Columns */ + Exception::COLUMN_NOT_FOUND => [ + 'name' => Exception::COLUMN_NOT_FOUND, + 'description' => 'Column with the requested ID could not be found.', + 'code' => 404, + ], + Exception::COLUMN_UNKNOWN => [ + 'name' => Exception::COLUMN_UNKNOWN, + 'description' => 'The column required for the index could not be found. Please confirm all your columns are in the available state.', + 'code' => 400, + ], + Exception::COLUMN_NOT_AVAILABLE => [ + 'name' => Exception::COLUMN_NOT_AVAILABLE, + 'description' => 'The requested column is not yet available. Please try again later.', + 'code' => 400, + ], + Exception::COLUMN_FORMAT_UNSUPPORTED => [ + 'name' => Exception::COLUMN_FORMAT_UNSUPPORTED, + 'description' => 'The requested column format is not supported.', + 'code' => 400, + ], + Exception::COLUMN_DEFAULT_UNSUPPORTED => [ + 'name' => Exception::COLUMN_DEFAULT_UNSUPPORTED, + 'description' => 'Default values cannot be set for array or required columns.', + 'code' => 400, + ], + Exception::COLUMN_ALREADY_EXISTS => [ + 'name' => Exception::COLUMN_ALREADY_EXISTS, + 'description' => 'Column with the requested key already exists. Column keys must be unique, try again with a different key.', + 'code' => 409, + ], + Exception::COLUMN_LIMIT_EXCEEDED => [ + 'name' => Exception::COLUMN_LIMIT_EXCEEDED, + 'description' => 'The maximum number or size of columns for this table has been reached.', + 'code' => 400, + ], + Exception::COLUMN_VALUE_INVALID => [ + 'name' => Exception::COLUMN_VALUE_INVALID, + 'description' => 'The column value is invalid. Please check the type, range and value of the column.', + 'code' => 400, + ], + Exception::COLUMN_TYPE_INVALID => [ + 'name' => Exception::COLUMN_TYPE_INVALID, + 'description' => 'The column type is invalid.', + 'code' => 400, + ], + Exception::COLUMN_INVALID_RESIZE => [ + 'name' => Exception::COLUMN_INVALID_RESIZE, 'description' => "Existing data is too large for new size, truncate your existing data then try again.", 'code' => 400, ], + Exception::COLUMN_TYPE_NOT_SUPPORTED => [ + 'name' => Exception::COLUMN_TYPE_NOT_SUPPORTED, + 'description' => 'Column type is not supported.', + 'code' => 400, + ], /** Indexes */ Exception::INDEX_NOT_FOUND => [ @@ -800,6 +939,33 @@ return [ 'code' => 409, ], + /** Column Indexes, same as Indexes but with different type */ + Exception::COLUMN_INDEX_NOT_FOUND => [ + 'name' => Exception::COLUMN_INDEX_NOT_FOUND, + 'description' => 'Index with the requested ID could not be found.', + 'code' => 404, + ], + Exception::COLUMN_INDEX_LIMIT_EXCEEDED => [ + 'name' => Exception::COLUMN_INDEX_LIMIT_EXCEEDED, + 'description' => 'The maximum number of indexes has been reached.', + 'code' => 400, + ], + Exception::COLUMN_INDEX_ALREADY_EXISTS => [ + 'name' => Exception::COLUMN_INDEX_ALREADY_EXISTS, + 'description' => 'Index with the requested key already exists. Try again with a different key.', + 'code' => 409, + ], + Exception::COLUMN_INDEX_INVALID => [ + 'name' => Exception::COLUMN_INDEX_INVALID, + 'description' => 'Index invalid.', + 'code' => 400, + ], + Exception::COLUMN_INDEX_DEPENDENCY => [ + 'name' => Exception::COLUMN_INDEX_DEPENDENCY, + 'description' => 'Column cannot be renamed or deleted. Please remove the associated index first.', + 'code' => 409, + ], + /** Project Errors */ Exception::PROJECT_NOT_FOUND => [ 'name' => Exception::PROJECT_NOT_FOUND, diff --git a/app/config/events.php b/app/config/events.php index 0bfddf4f1f..c6006b569f 100644 --- a/app/config/events.php +++ b/app/config/events.php @@ -95,6 +95,65 @@ return [ '$model' => Response::MODEL_DATABASE, '$resource' => true, '$description' => 'This event triggers on any database event.', + 'tables' => [ + '$model' => Response::MODEL_TABLE, + '$resource' => true, + '$description' => 'This event triggers on any table event.', + 'rows' => [ + '$model' => Response::MODEL_ROW, + '$resource' => true, + '$description' => 'This event triggers on any rows event.', + 'create' => [ + '$description' => 'This event triggers when a row is created.', + ], + 'update' => [ + '$description' => 'This event triggers when a row is updated.' + ], + 'upsert' => [ + '$description' => 'This event triggers when a document is upserted.', + ], + 'delete' => [ + '$description' => 'This event triggers when a row is deleted.' + ], + ], + 'indexes' => [ + '$model' => Response::MODEL_COLUMN_INDEX, + '$resource' => true, + '$description' => 'This event triggers on any indexes event.', + 'create' => [ + '$description' => 'This event triggers when an index is created.', + ], + 'update' => [ + '$description' => 'This event triggers when an index is updated.', + ], + 'delete' => [ + '$description' => 'This event triggers when an index is deleted.' + ] + ], + 'columns' => [ + '$model' => Response::MODEL_COLUMN, + '$resource' => true, + '$description' => 'This event triggers on any columns event.', + 'create' => [ + '$description' => 'This event triggers when a column is created.', + ], + 'delete' => [ + '$description' => 'This event triggers when an column is deleted.' + ], + 'update' => [ + '$description' => 'This event triggers when a column is created.', + ], + ], + 'create' => [ + '$description' => 'This event triggers when a table is created.' + ], + 'update' => [ + '$description' => 'This event triggers when a table is updated.', + ], + 'delete' => [ + '$description' => 'This event triggers when a table is deleted.', + ], + ], 'collections' => [ '$model' => Response::MODEL_COLLECTION, '$resource' => true, @@ -106,12 +165,15 @@ return [ 'create' => [ '$description' => 'This event triggers when a document is created.', ], - 'delete' => [ - '$description' => 'This event triggers when a document is deleted.' - ], 'update' => [ '$description' => 'This event triggers when a document is updated.' ], + 'upsert' => [ + '$description' => 'This event triggers when a document is upserted.', + ], + 'delete' => [ + '$description' => 'This event triggers when a document is deleted.' + ], ], 'indexes' => [ '$model' => Response::MODEL_INDEX, @@ -122,7 +184,10 @@ return [ ], 'delete' => [ '$description' => 'This event triggers when an index is deleted.' - ] + ], + 'update' => [ + '$description' => 'This event triggers when a column is created.', + ], ], 'attributes' => [ '$model' => Response::MODEL_ATTRIBUTE, @@ -131,6 +196,9 @@ return [ 'create' => [ '$description' => 'This event triggers when an attribute is created.', ], + 'update' => [ + '$description' => 'This event triggers when a column is created.', + ], 'delete' => [ '$description' => 'This event triggers when an attribute is deleted.' ] @@ -138,22 +206,22 @@ return [ 'create' => [ '$description' => 'This event triggers when a collection is created.' ], + 'update' => [ + '$description' => 'This event triggers when a collection is updated.', + ], 'delete' => [ '$description' => 'This event triggers when a collection is deleted.', ], - 'update' => [ - '$description' => 'This event triggers when a collection is updated.', - ] ], 'create' => [ '$description' => 'This event triggers when a database is created.' ], + 'update' => [ + '$description' => 'This event triggers when a database is updated.', + ], 'delete' => [ '$description' => 'This event triggers when a database is deleted.', ], - 'update' => [ - '$description' => 'This event triggers when a database is updated.', - ] ], 'buckets' => [ '$model' => Response::MODEL_BUCKET, diff --git a/app/config/locale/templates/email-base-styled.tpl b/app/config/locale/templates/email-base-styled.tpl index f6d3e8cd63..16036e792c 100644 --- a/app/config/locale/templates/email-base-styled.tpl +++ b/app/config/locale/templates/email-base-styled.tpl @@ -1,9 +1,24 @@ - - - + + - - - - - - - +
+ {{preview}} +
{{previewWhitespace}}
+
+
diff --git a/app/config/locale/templates/email-inner-base.tpl b/app/config/locale/templates/email-inner-base.tpl index 8cef391d2f..677f70ce7d 100644 --- a/app/config/locale/templates/email-inner-base.tpl +++ b/app/config/locale/templates/email-inner-base.tpl @@ -1,6 +1,6 @@

{{hello}}

{{body}}

-

{{redirect}}

+

{{buttonText}}

{{footer}}

{{thanks}} diff --git a/app/config/locale/templates/email-smtp-test.tpl b/app/config/locale/templates/email-smtp-test.tpl index e40b7ba5c8..1b1eccdb7c 100644 --- a/app/config/locale/templates/email-smtp-test.tpl +++ b/app/config/locale/templates/email-smtp-test.tpl @@ -9,4 +9,4 @@

If you have trouble with the sender's image, ensure it is set in the Gravatar database.

Best regards,

-

Appwrtite team

\ No newline at end of file +

Appwrite team

\ No newline at end of file diff --git a/app/config/locale/templates/email-webhook-failed.tpl b/app/config/locale/templates/email-webhook-failed.tpl index 921af9ee29..a176de5754 100644 --- a/app/config/locale/templates/email-webhook-failed.tpl +++ b/app/config/locale/templates/email-webhook-failed.tpl @@ -14,7 +14,7 @@
- Webhook settings + Webhook settings
\ No newline at end of file diff --git a/app/config/locale/translations/af.json b/app/config/locale/translations/af.json index e68fda2c75..db2a234d5e 100644 --- a/app/config/locale/translations/af.json +++ b/app/config/locale/translations/af.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Wie nie waag nie, sal nie wen nie.\"", "settings.locale": "af", "settings.direction": "ltr", - "emails.sender": "%s span", + "emails.sender": "{{project}} span", "emails.verification.subject": "Rekening Bevestiging", "emails.verification.hello": "Goeie dag {{user}},", "emails.verification.body": "Volg hierdie skakel om u e-pos adres te bevestig.", "emails.verification.footer": "Ignoreer gerus hierdie boodskap as u nie die versoek gestuur het om u adres te bevestig nie.", "emails.verification.thanks": "Baie dankie,", + "emails.verification.buttonText": "Bevestig e-posadres", "emails.verification.signature": "Die {{project}} span", "emails.magicSession.subject": "Teken aan", "emails.magicSession.hello": "Goeie dag,", - "emails.magicSession.body": "Volg hierdie skakel om in te teken.", - "emails.magicSession.footer": "Ignoreer gerus hierdie boodskap as u nie die versoek gestuur het om met die' adres in te teken nie.", "emails.magicSession.thanks": "Baie dankie,", "emails.magicSession.signature": "Die {{project}} span", "emails.recovery.subject": "Herstel Wagwoord", @@ -20,12 +19,14 @@ "emails.recovery.body": "Volg hierdie skakel om u {{project}} wagwoord te herstel.", "emails.recovery.footer": "Ignoreer gerus hierdie boodskap as u nie die versoek gestuur het om u wagwoord te herstel nie.", "emails.recovery.thanks": "Baie dankie,", + "emails.recovery.buttonText": "Stel wagwoord terug", "emails.recovery.signature": "Die {{project}} span", - "emails.invitation.subject": "Uitnodiging om by die %s span aan te sluit by %s", + "emails.invitation.subject": "Uitnodiging om by die {{team}} span aan te sluit by {{project}}", "emails.invitation.hello": "Goeie dag,", "emails.invitation.body": "Hierdie boodskap is aan u gestuur omdat {{owner}} u uitnooi om 'n lid van die {{team}} groep by die {{project}} projek te wees.", "emails.invitation.footer": "As u nie belang stel nie, kan u gerus hierdie boodskap ignoreer.", "emails.invitation.thanks": "Baie dankie,", + "emails.invitation.buttonText": "Aanvaar uitnodiging na {{team}}", "emails.invitation.signature": "Die {{project}} span", "locale.country.unknown": "Onbekend", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ar-ma.json b/app/config/locale/translations/ar-ma.json index efd2e95c31..f0a7132aed 100644 --- a/app/config/locale/translations/ar-ma.json +++ b/app/config/locale/translations/ar-ma.json @@ -2,17 +2,16 @@ "settings.inspire": "\"الفن ديال الحكمة هو الفن ديال أنك تعرف أش تنخّل.\"", "settings.locale": "ar-ma", "settings.direction": "rtl", - "emails.sender": "فرقة %s", + "emails.sender": "فرقة {{project}}", "emails.verification.subject": "التيْقان ديال الحساب", "emails.verification.hello": "السلام {{user}}،", "emails.verification.body": "تبّع هاد الوصلة باش تيقّن لادريسة تاع ليميل ديالك.", "emails.verification.footer": "إلا ماشي نتا اللي طلبتي تيقّن هاد لادريسة تاع ليميل، ممكن تنخّل هاد البرية.", "emails.verification.thanks": "شكرا،", + "emails.verification.buttonText": "تأكيد عنوان البريد الإلكتروني", "emails.verification.signature": "فرقة {{project}}", "emails.magicSession.subject": "تكونيكطا", "emails.magicSession.hello": "السلام،", - "emails.magicSession.body": "تبّع هاد الوصلة باش تتكونيكطا.", - "emails.magicSession.footer": "إلا ماشي نتا اللي طلبتي تتكونيكطا بهاد ليميل، ممكن تنخّل هاد البرية.", "emails.magicSession.thanks": "شكرا،", "emails.magicSession.signature": "فرقة {{project}}", "emails.recovery.subject": "تبدال كلمة السر", @@ -20,14 +19,16 @@ "emails.recovery.body": "تبّع هاد الوصلة باش تبدّل كلمة السر تاع {{project}}.", "emails.recovery.footer": "إلا ماشي نتا اللي طلبتي تبدّل كلمة السر، ممكن تنخّل هاد البرية.", "emails.recovery.thanks": "شكرا،", + "emails.recovery.buttonText": "إعادة تعيين كلمة السر", "emails.recovery.signature": "فرقة {{project}}", - "emails.invitation.subject": "عراضة ل فرقة %s ف %s", + "emails.invitation.subject": "عراضة ل فرقة {{team}} ف {{project}}", "emails.invitation.hello": "السلام،", "emails.invitation.body": "هاد البرية تصيفطات ليك حيت {{owner}} بغى يعرض عليك تولّي عضو ف فرقة {{team}} عند {{project}}.", "emails.invitation.footer": "إلا كنتي ما مسوّقش, ممكن تنخّل هاد البرية.", "emails.invitation.thanks": "شكرا،", + "emails.invitation.buttonText": "اقبل الدعوة إلى {{team}}", "emails.invitation.signature": "فرقة {{project}}", - "emails.certificate.subject": "السرتافيكة فشلات ل %s", + "emails.certificate.subject": "السرتافيكة فشلات ل {{domain}}", "emails.certificate.hello": "السلام،", "emails.certificate.body": "السرتافيكة ديال الضومين ديالك '{{domain}}' ما قدّاتش تجينيرا. هادي هي المحاولة نمرة {{attempt}}, السبب ديال هاد الفشل هو: {{error}}", "emails.certificate.footer": "السرتافيكة الفايتة ديالك غاتبقى مزيانة لمدة 30 يوم من عند أول فشل. كانشجعوك بزاف أنك تبقشش فهاد الموضوع, وا إلّا الضومين ديالك ما غايبقاش خدّام فيه الـ SSL.", diff --git a/app/config/locale/translations/ar.json b/app/config/locale/translations/ar.json index 1d67c2ecf7..df077c8685 100644 --- a/app/config/locale/translations/ar.json +++ b/app/config/locale/translations/ar.json @@ -2,17 +2,16 @@ "settings.inspire": "\"فن الحكمة هو فن معرفة ما يجب التغاضي عنه.\"", "settings.locale": "ar", "settings.direction": "rtl", - "emails.sender": "فريق %s", + "emails.sender": "فريق {{project}}", "emails.verification.subject": "تأكيد الحساب", "emails.verification.hello": "مرحبا {{user}}،", "emails.verification.body": "برجاء اتباع الرابط التالي لتأكيد بريدك الإلكتروني", "emails.verification.footer": "لو لم تطلب تأكيد هذا البريد الإلكتروني، يمكنك تجاهل هذه الرسالة", "emails.verification.thanks": "شكرا،", + "emails.verification.buttonText": "تأكيد عنوان البريد الإلكتروني", "emails.verification.signature": "فريق {{project}}", "emails.magicSession.subject": "تسجيل الدخول", "emails.magicSession.hello": "أهلا،", - "emails.magicSession.body": "اتبع هذا الرابط لتسجيل الدخول", - "emails.magicSession.footer": "لو لم تطلب تسجيل الدخول بهذا البريد الاكتروني ، يمكنك تجاهل هذه الرسالة", "emails.magicSession.thanks": "شكرا،", "emails.magicSession.signature": "فريق {{project}}", "emails.recovery.subject": "تغيير كلمة السر", @@ -20,12 +19,14 @@ "emails.recovery.body": "برجاء اتباع الراط التالي لتغيير كلمة السر الخاصة بـ{{project}}", "emails.recovery.footer": "لولم تطلب تغيير كلمة السر، يمكنك تجاهل هذه الرسالة", "emails.recovery.thanks": "شكرا،", + "emails.recovery.buttonText": "إعادة تعيين كلمة المرور", "emails.recovery.signature": "فريق {{project}}", - "emails.invitation.subject": "دعوة لفريق %s في %s", + "emails.invitation.subject": "دعوة لفريق {{team}} في {{project}}", "emails.invitation.hello": "أهلا،", "emails.invitation.body": "هذة الرسالة تم ارسالها لك لأن {{owner}} ارسل لك دعوة لتكون عضوا بفريق {{team}} في {{project}}", "emails.invitation.footer": "اذا كنت غير مهتم، يمكنك تجاهل هذه الرسالة", "emails.invitation.thanks": "شكرا،", + "emails.invitation.buttonText": "قبول الدعوة إلى {{team}}", "emails.invitation.signature": "فريق {{project}}", "locale.country.unknown": "مجهول", "countries.af": "أفغانستان", diff --git a/app/config/locale/translations/as.json b/app/config/locale/translations/as.json index 572ed80f1a..f750c6f3e4 100644 --- a/app/config/locale/translations/as.json +++ b/app/config/locale/translations/as.json @@ -2,17 +2,16 @@ "settings.inspire": "\"জ্ঞানী হোৱাৰ কলা হৈছে কি উপেক্ষা কৰিব লাগে জনাৰ কলা।\"", "settings.locale": "as", "settings.direction": "ltr", - "emails.sender": "%s দল", + "emails.sender": "{{project}} দল", "emails.verification.subject": "একাউণ্ট প্ৰমাণীকৰণ", "emails.verification.hello": "নমস্কাৰ {{user}},", "emails.verification.body": "আপোনাৰ ইমেইল ঠিকনা প্ৰমাণিত কৰিবলৈ এই লিংকটো অনুসৰণ কৰক।", "emails.verification.footer": "যদি আপুনি এই ঠিকনাটো সত্যাপিত কৰিবলৈ কোৱা নাই, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", "emails.verification.thanks": "ধন্যবাদ,", + "emails.verification.buttonText": "ইমেইল ঠিকনা নিশ্চিত কৰক", "emails.verification.signature": "{{project}} দল", "emails.magicSession.subject": "লগইন", "emails.magicSession.hello": "নমস্কাৰ,", - "emails.magicSession.body": "লগইন কৰিবলৈ এই লিংকটো অনুসৰণ কৰক।", - "emails.magicSession.footer": "যদি আপুনি এই ইমেইল ব্যৱহাৰ কৰি লগইন কৰিবলৈ কোৱা নাছিল, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", "emails.magicSession.thanks": "ধন্যবাদ,", "emails.magicSession.signature": "{{project}} দল", "emails.recovery.subject": "পাছৱাৰ্ড ৰিছেট", @@ -20,12 +19,14 @@ "emails.recovery.body": "আপোনাৰ {{project}} পাছৱৰ্ড ৰিছেট কৰিবলৈ এই লিংকটো অনুসৰণ কৰক।.", "emails.recovery.footer": "যদি আপুনি আপোনাৰ পাছৱৰ্ড ৰিছেট কৰিবলৈ কোৱা নাছিল, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", "emails.recovery.thanks": "ধন্যবাদ,", + "emails.recovery.buttonText": "পাছৱৰ্ড ৰিছেট কৰক", "emails.recovery.signature": "{{project}} দল", - "emails.invitation.subject": "%s বছৰত %s দললৈ নিমন্ত্ৰণ", + "emails.invitation.subject": "{{team}} বছৰত {{project}} দললৈ নিমন্ত্ৰণ", "emails.invitation.hello": "নমস্কাৰ,", "emails.invitation.body": "এই মেইলটো আপোনালৈ প্ৰেৰণ কৰা হৈছিল কাৰণ {{owner}} জনে আপোনাক {{project}} বছৰবয়সত {{team}} দলৰ সদস্য হ'বলৈ আমন্ত্ৰণ জনাব বিচাৰিছিল।", "emails.invitation.footer": "যদি আপুনি আগ্ৰহী নহয়, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", "emails.invitation.thanks": "ধন্যবাদ,", + "emails.invitation.buttonText": "{{team}}-লৈ নিমন্ত্ৰণ গ্ৰহণ কৰক", "emails.invitation.signature": "{{project}} দল", "locale.country.unknown": "অজ্ঞাত ", "countries.af": "আফগানিস্তান ", @@ -244,7 +245,7 @@ "emails.otpSession.securityPhrase": "এই ইমেইলৰ সুৰক্ষা বাক্যটো হৈছে {{phrase}}। আপুনি এই ইমেইলটোত আস্থা ৰাখিব পাৰে যদি প্ৰবেশৰ সময়ত দেখুৱাই থকা বাক্যটোৰ লগত এই বাক্যটো মেলে।", "emails.otpSession.thanks": "ধন্যবাদ,", "emails.otpSession.signature": "{{project}} দল", - "emails.certificate.subject": "%sৰ বাবে প্ৰমাণপত্ৰ ব্যৰ্থতা", + "emails.certificate.subject": "{{domain}}ৰ বাবে প্ৰমাণপত্ৰ ব্যৰ্থতা", "emails.certificate.hello": "নমস্কাৰ,", "emails.certificate.body": "আপোনাৰ ডোমেইন '{{domain}}' ৰ বাবে প্ৰমাণপত্ৰটো উত্‌পন্ন কৰিব পৰা নগ'ল। এয়া প্ৰচেষ্টা নম্বৰ {{attempt}}, আৰু বিফলতাৰ কাৰণ হ'ল: {{error}}", "emails.certificate.footer": "আপোনাৰ পূৰ্বৰ প্ৰমাণপত্ৰটো প্ৰথম ব্ৰিফল হোৱাৰ দিনৰ পৰা ৩০ দিনলৈ বৈধ থাকিব। আমি এই ঘটনাটোৰ তদন্ত কৰিবলৈ উচ্চ পৰামৰ্শ দিয়ে, অন্যথা আপোনাৰ ডোমেইনটো অবৈধ SSL যোগাযোগ অবিহনে থাকিব।", diff --git a/app/config/locale/translations/az.json b/app/config/locale/translations/az.json index 5988c51786..7b94b4424e 100644 --- a/app/config/locale/translations/az.json +++ b/app/config/locale/translations/az.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Ağıllı olmaq sənəti, nəyi gözdən qaçıracağını bilmək sənətidir.\"", "settings.locale": "az", "settings.direction": "ltr", - "emails.sender": "%s Komandası", + "emails.sender": "{{project}} Komandası", "emails.verification.subject": "Hesab Doğrulama", "emails.verification.hello": "Salam {{user}},", "emails.verification.body": "E-poçt ünvanınızı təsdiq etmək üçün bu linki izləyin.", "emails.verification.footer": "Bu ünvanı doğrulamağı xahiş etməmisinizsə, bu mesajı gözardı edə bilərsiniz.", "emails.verification.thanks": "Təşəkkürlər,", + "emails.verification.buttonText": "E-poçt ünvanını təsdiqlə", "emails.verification.signature": "{{project}} komandası", "emails.magicSession.subject": "Daxil Olmaq", "emails.magicSession.hello": "Salam,", - "emails.magicSession.body": "Daxil olmaq üçün bu linki izləyin.", - "emails.magicSession.footer": "Bu e-poçtdan istifadə edərək giriş istəməmisinizsə, bu mesajı görməməzlikdən gələ bilərsiniz.", "emails.magicSession.thanks": "Təşəkkürlər,", "emails.magicSession.signature": "{{project}} komandası", "emails.recovery.subject": "Şifrə Sıfırlanması", @@ -20,12 +19,14 @@ "emails.recovery.body": "{{project}} şifrənizi sıfırlamaq üçün bu linki izləyin.", "emails.recovery.footer": "Şifrənizi sıfırlamağı xahiş etməmisinizsə, bu mesajı gözardı edə bilərsiniz.", "emails.recovery.thanks": "Təşəkkürlər,", + "emails.recovery.buttonText": "Şifrəni sıfırla", "emails.recovery.signature": "{{project}} komandası", - "emails.invitation.subject": "%s Komandasına Dəvət %sdə", + "emails.invitation.subject": "{{team}} Komandasına Dəvət {{project}}də", "emails.invitation.hello": "Salam,", "emails.invitation.body": "{{owner}}, {{project}}də {{team}} komandasına üzv olmağa dəvət etmək istədiyi üçün bu məktub sizə göndərildi.", "emails.invitation.footer": "Əgər maraqlanmırsınızsa, bu mesajı gözardı edə bilərsiniz.", "emails.invitation.thanks": "Təşəkkürlər,", + "emails.invitation.buttonText": "{{team}} dəvətini qəbul et", "emails.invitation.signature": "{{project}} komandası", "locale.country.unknown": "Naməlum", "countries.af": "Əfqanıstan", diff --git a/app/config/locale/translations/be.json b/app/config/locale/translations/be.json index f03a9d5bef..2c6d14d79e 100644 --- a/app/config/locale/translations/be.json +++ b/app/config/locale/translations/be.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Мастацтва быць мудрым - гэта мастацтва ведаць, на што нельга звярнуць увагу.\"", "settings.locale": "be", "settings.direction": "ltr", - "emails.sender": "Каманда %s", + "emails.sender": "Каманда {{project}}", "emails.verification.subject": "Верыфікацыя акаўнта", "emails.verification.hello": "Прывітанне {{user}},", "emails.verification.body": "Перайдзіце па гэтай спасылцы, каб пацвердзіць свой адрас электроннай пошты", "emails.verification.footer": "Калі вы не запытвалі пацвярджэнне гэтага адрасу, праігнаруйце гэтае паведамленне.", "emails.verification.thanks": "Дзякуем,", + "emails.verification.buttonText": "Пацвердзіць адрас электроннай пошты", "emails.verification.signature": "каманда {{project}}", "emails.magicSession.subject": "Лагін", "emails.magicSession.hello": "Прывітанне,", - "emails.magicSession.body": "Перайдзіце па спасылцы, каб увайсці.", - "emails.magicSession.footer": "Калі вы не прасілі ўвайсці, выкарыстоўваючы гэты адрас электроннай пошты, праігнаруйце гэтае паведамленне.", "emails.magicSession.thanks": "Дзякуем,", "emails.magicSession.signature": "каманда {{project}}", "emails.recovery.subject": "Скід пароля", @@ -20,12 +19,14 @@ "emails.recovery.body": "Перайдзіце па гэтай спасылцы, каб скінуць пароль для праекта {{project}}.", "emails.recovery.footer": "Калі вы не прасілі скінуць пароль, вы можаце праігнараваць гэта паведамленне.", "emails.recovery.thanks": "Дзякуем,", + "emails.recovery.buttonText": "Аднавіць пароль", "emails.recovery.signature": "каманда {{project}}", - "emails.invitation.subject": "Запрошення до Команди %s у %s", + "emails.invitation.subject": "Запрошення до Команди {{team}} у {{project}}", "emails.invitation.hello": "Прывітанне,", "emails.invitation.body": "Гэта паведамленне было адпраўлена вам, таму што {{owner}} хацеў запрасіць вас стаць членам каманды {{team}} у {{project}}.", "emails.invitation.footer": "Калі вам гэта не цікава, вы можаце праігнараваць гэтае паведамленне.", "emails.invitation.thanks": "Дзякуем,", + "emails.invitation.buttonText": "Прыняць запрашэнне ў {{team}}", "emails.invitation.signature": "каманда {{project}}", "locale.country.unknown": "Невядомы", "countries.af": "Афганістан", @@ -244,7 +245,7 @@ "emails.otpSession.securityPhrase": "Фраза бяспекі для гэтага ліста - {{phrase}}. Вы можаце давяраць гэтаму лісту, калі гэтая фраза супадае з фразай, паказанай пры ўваходзе.", "emails.otpSession.thanks": "Дзякуй,", "emails.otpSession.signature": "каманда {{project}}", - "emails.certificate.subject": "Сведчанне няўдалае для %s", + "emails.certificate.subject": "Сведчанне няўдалае для {{domain}}", "emails.certificate.hello": "Прывітанне,", "emails.certificate.body": "Сертыфікат для вашага дамена '{{domain}}' не можа быць створаны. Гэта спроба нумар {{attempt}}, і прычынай няўдачы з'яўляецца: {{error}}", "emails.certificate.footer": "Ваш папярэдні сертыфікат будзе дзейнічаць 30 дзён з моманту першай няўдачы. Мы высока рэкамендуем расследаваць гэтую сітуацыю, інакш ваш дамен апынецца без дзейнага сертыфіката SSL-злучэння.", diff --git a/app/config/locale/translations/bg.json b/app/config/locale/translations/bg.json index 086c6b283e..4fd1e6fdbf 100644 --- a/app/config/locale/translations/bg.json +++ b/app/config/locale/translations/bg.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Изкуството да бъдеш мъдър е изкуството да знаеш какво да пренебрегнеш.\"", "settings.locale": "bg", "settings.direction": "ltr", - "emails.sender": "%s Екип", + "emails.sender": "{{project}} Екип", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", @@ -11,8 +11,6 @@ "emails.verification.signature": "", "emails.magicSession.subject": "", "emails.magicSession.hello": ",", - "emails.magicSession.body": "", - "emails.magicSession.footer": "", "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", diff --git a/app/config/locale/translations/bh.json b/app/config/locale/translations/bh.json index 5cf06bd1dd..8543e4f241 100644 --- a/app/config/locale/translations/bh.json +++ b/app/config/locale/translations/bh.json @@ -2,17 +2,16 @@ "settings.inspire": "\"बुद्धिमान होइत क कला ई जाने क कला अछि जे की अनदेखा कर्मा चाहि| \"", "settings.locale": "bh", "settings.direction": "ltr", - "emails.sender": "%s टीम", + "emails.sender": "{{project}} टीम", "emails.verification.subject": "खाता प्रमाणिकरण", "emails.verification.hello": "नमस्ते {{user}},", "emails.verification.body": "ईमेल प्रमाणिकरण करे क लेल दिहल गइल लिंक फॉलो करें|", "emails.verification.footer": "अगर ई पता को सत्यापित करे के लिए ना कहाले, तो आप ई संदेश क अनदेखा कर सकत अछि।", "emails.verification.thanks": "धन्यवाद,", + "emails.verification.buttonText": "ईमेल पता के पुष्टि करीं", "emails.verification.signature": "{{project}} टीम", "emails.magicSession.subject": "लॉग इन करीं|", "emails.magicSession.hello": "प्रणाम,", - "emails.magicSession.body": "लॉग इन करें लेल दिहल गइल लिंक फॉलो करें|", - "emails.magicSession.footer": "अगर लॉग इन करे के लिए ना कहाले, तो आप ई संदेश क अनदेखा कर सकत अछि।", "emails.magicSession.thanks": "धन्यवाद,", "emails.magicSession.signature": "{{project}} टीम", "emails.recovery.subject": "पासवर्ड बदल क लेल|", @@ -20,12 +19,14 @@ "emails.recovery.body": "पासवर्ड बदल क लेल दिहल गइल लिंक फॉलो करें|", "emails.recovery.footer": "अगर पासवर्ड बदल क लेल ना कहाले, तो आप ई संदेश क अनदेखा कर सकत अछि।", "emails.recovery.thanks": "धन्यवाद,", + "emails.recovery.buttonText": "पासवर्ड रीसेट करीं", "emails.recovery.signature": "{{project}} टीम", - "emails.invitation.subject": "%s टीम क %s पे न्योता देवे क लेल|", + "emails.invitation.subject": "{{team}} टीम क {{project}} पे न्योता देवे क लेल|", "emails.invitation.hello": "प्रणाम,", "emails.invitation.body": "ई मेल आपके एही लेल भेजल गईल रहल काहे क {{owner}} आपके {{project}} क {{team}} टीम का सदस्य बनावे चाहित रहे|", "emails.invitation.footer": "अगर आवे क इच्छा ना होवत, तो आप ई संदेश क अनदेखा कर सकत अछि।", "emails.invitation.thanks": "धन्यवाद,", + "emails.invitation.buttonText": "{{team}} में नेवता स्वीकार करीं", "emails.invitation.signature": "{{project}} टीम", "locale.country.unknown": "अनजान", "countries.af": "अफ़ग़ानिस्तान", @@ -244,7 +245,7 @@ "emails.otpSession.securityPhrase": "एही ईमेल खातिर सुरक्षा वाक्य {{phrase}} हऽ। अगर ई वाक्य साइन इन कइला के समय देखावल गेल वाक्य से मेल खाता, त एह ईमेल पर भरोसा कर सकैत छी।", "emails.otpSession.thanks": "धन्यवाद,", "emails.otpSession.signature": "{{project}} टीम", - "emails.certificate.subject": "%s लेल प्रमाणपत्र असफलта", + "emails.certificate.subject": "{{domain}} लेल प्रमाणपत्र असफलता", "emails.certificate.hello": "नमस्ते,", "emails.certificate.body": "आपके डोमेन '{{domain}}' के लिए प्रमाणपत्र नहीं बनाया जा सका। ई प्रयास संख्या {{attempt}} है, और ई असफलता के कारण रहे: {{error}}", "emails.certificate.footer": "तोहार पिछलका प्रमाणपत्र पहिल असफलता से 30 दिन धरी मान्य होईत। हम बहुत जोर देके सलाह देतानी कि एह मामला के जांच करीं, नहीं त तोहार डोमेन बिना कोनो मान्य SSL संवाद के रहि जाईत।", diff --git a/app/config/locale/translations/bn.json b/app/config/locale/translations/bn.json index 495f56e012..a1be879e0c 100644 --- a/app/config/locale/translations/bn.json +++ b/app/config/locale/translations/bn.json @@ -2,17 +2,16 @@ "settings.inspire": "\"জ্ঞানী হওয়ার শিল্প হলো কোন বিষয়টিকে উপেক্ষা করা উচিত তা জানার শিল্প\"", "settings.locale": "bn", "settings.direction": "ltr", - "emails.sender": "%s টীম", + "emails.sender": "{{project}} টীম", "emails.verification.subject": "বিষয়", "emails.verification.hello": "নমস্কার {{user}},", "emails.verification.body": "এই লিঙ্কের মাধ্যমে ইমেইল যাচাই করুন।", "emails.verification.footer": "আপনি যদি এই ঠিকানা যাচাই করতে না বলেন, তাহলে আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", "emails.verification.thanks": "ধন্যবাদ,", + "emails.verification.buttonText": "ইমেইল ঠিকানা নিশ্চিত করুন", "emails.verification.signature": "{{project}} টীম", "emails.magicSession.subject": "লগ ইন", "emails.magicSession.hello": "নমস্কার,", - "emails.magicSession.body": "এই লিঙ্কের মাধ্যমে লগ ইন করুন।", - "emails.magicSession.footer": "আপনি যদি এই ইমেলটি ব্যবহার করে লগইন করতে না বলেন, তাহলে আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", "emails.magicSession.thanks": "ধন্যবাদ,", "emails.magicSession.signature": "{{project}} টীম", "emails.recovery.subject": "পাসওয়ার্ড রিসেট", @@ -20,12 +19,14 @@ "emails.recovery.body": "এই লিঙ্কের মাধ্যমে আপনার {{project}} পাসওয়ার্ড পুনরায় সেট করুন।", "emails.recovery.footer": "আপনি যদি আপনার পাসওয়ার্ড পুনরায় সেট করতে না বলেন, তাহলে আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", "emails.recovery.thanks": "ধন্যবাদ,", + "emails.recovery.buttonText": "পাসওয়ার্ড রিসেট করুন", "emails.recovery.signature": "{{project}} টীম", - "emails.invitation.subject": "%s টিমকে %s তে আমন্ত্রণ জানান", + "emails.invitation.subject": "{{team}} টিমকে {{project}} তে আমন্ত্রণ জানান", "emails.invitation.hello": "নমস্কার,", "emails.invitation.body": "এই মেইলটি আপনাকে পাঠানো হয়েছে কারণ {{owner}} আপনাকে {{project}} এর সাথে যুক্ত {{team}} টিমের সদস্য হওয়ার জন্য আমন্ত্রণ জানাতে চেয়েছিলেন।", "emails.invitation.footer": "যদি এটি আপনার জন্য প্রয়োজনীয় না হয়, আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", "emails.invitation.thanks": "ধন্যবাদ,", + "emails.invitation.buttonText": "{{team}}-এর আমন্ত্রণ গ্রহণ করুন", "emails.invitation.signature": "{{project}} টীম", "locale.country.unknown": "অজানা", "countries.af": "আফগানিস্তান", diff --git a/app/config/locale/translations/bs.json b/app/config/locale/translations/bs.json index 1c69619c01..22a54383a9 100644 --- a/app/config/locale/translations/bs.json +++ b/app/config/locale/translations/bs.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Umjetnost mudrosti je umjetnost znanja o tome šta zanemariti.\"", "settings.locale": "bs", "settings.direction": "ltr", - "emails.sender": "%s Tim", + "emails.sender": "{{project}} Tim", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", @@ -11,8 +11,6 @@ "emails.verification.signature": "", "emails.magicSession.subject": "", "emails.magicSession.hello": ",", - "emails.magicSession.body": "", - "emails.magicSession.footer": "", "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", diff --git a/app/config/locale/translations/ca.json b/app/config/locale/translations/ca.json index 98940a4a48..7f4be27f1c 100644 --- a/app/config/locale/translations/ca.json +++ b/app/config/locale/translations/ca.json @@ -2,17 +2,16 @@ "settings.inspire": "\"L'art de ser savi és l'art de saber què passar per alt\"", "settings.locale": "ca", "settings.direction": "ltr", - "emails.sender": "%s Equip", + "emails.sender": "{{project}} Equip", "emails.verification.subject": "Verificació del compte", "emails.verification.hello": "Hola {{user}},", "emails.verification.body": "Accedeix a aquest enllaç per tal de verificar la teva adreça electrònica.", "emails.verification.footer": "Si no has sol·licitat la verificació d'aquesta adreça electrònica, pots ignorar aquest missatge.", "emails.verification.thanks": "Gràcies,", + "emails.verification.buttonText": "Confirma l'adreça electrònica", "emails.verification.signature": "Equip {{project}}", "emails.magicSession.subject": "Entrar", "emails.magicSession.hello": "Hola,", - "emails.magicSession.body": "Accedeix a aquest enllaç per a entrar.", - "emails.magicSession.footer": "Si no has sol·licitat entrar amb aquesta adreça electrònica, pots ignorar aquest missatge.", "emails.magicSession.thanks": "Gràcies,", "emails.magicSession.signature": "Equip {{project}}", "emails.recovery.subject": "Reinicialitzar contrasenya", @@ -20,12 +19,14 @@ "emails.recovery.body": "Accedeix a aquest enllaç per a reinicialitzar la teva contrasenya de {{project}}.", "emails.recovery.footer": "Si no has sol·licitat reinicialitzar la teva contrasenya, pots ignorar aquest missatge.", "emails.recovery.thanks": "Gràcies,", + "emails.recovery.buttonText": "Restableix la contrasenya", "emails.recovery.signature": "Equip {{project}}", - "emails.invitation.subject": "Invitació a l'equip %s a s%", + "emails.invitation.subject": "Invitació a l'equip {{team}} a {{project}}", "emails.invitation.hello": "Hola,", "emails.invitation.body": "Aquest correu se t'ha enviat perquè {{owner}} vol convidar-te a formar part de l'equip {{team}} al {{project}}.", "emails.invitation.footer": "Si no és del teu interès, pots ignorar aquest missatge.", "emails.invitation.thanks": "Gràcies,", + "emails.invitation.buttonText": "Accepta la invitació a {{team}}", "emails.invitation.signature": "Equip {{project}}", "locale.country.unknown": "Desconegut", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/cs.json b/app/config/locale/translations/cs.json index c67e9299da..609f064969 100644 --- a/app/config/locale/translations/cs.json +++ b/app/config/locale/translations/cs.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Umění moudrosti je umění vědět, co přehlédnout.\"", "settings.locale": "cs", "settings.direction": "ltr", - "emails.sender": "%s tým", + "emails.sender": "{{project}} tým", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", @@ -11,8 +11,6 @@ "emails.verification.signature": "", "emails.magicSession.subject": "", "emails.magicSession.hello": ",", - "emails.magicSession.body": "", - "emails.magicSession.footer": "", "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", diff --git a/app/config/locale/translations/da.json b/app/config/locale/translations/da.json index 9cec74dbed..2b52bdb6a9 100644 --- a/app/config/locale/translations/da.json +++ b/app/config/locale/translations/da.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Kunsten at være klog er kunsten at vide, hvad man skal overse.\"", "settings.locale": "da", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Konto Verifikation", "emails.verification.hello": "Hej {{user}},", "emails.verification.body": "Følg dette link, for at verificere din email adresse.", "emails.verification.footer": "Hvis du ikke har bedt om at verificere denne adresse, ignorer venligst denne besked.", "emails.verification.thanks": "Tak,", + "emails.verification.buttonText": "Bekræft e-mailadresse", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Hej,", - "emails.magicSession.body": "Følg dette link for at logge ind.", - "emails.magicSession.footer": "Hvis du ikke har bedt om at logge ind med denne email, ignorer venligst denne besked.", "emails.magicSession.thanks": "Tak,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Nulstil Password", @@ -20,12 +19,14 @@ "emails.recovery.body": "Følg dette link for at nulstille koden til {{project}}.", "emails.recovery.footer": "Hvis du ikke har bedt om at nulstille dit password, ignorer venligst denne besked.", "emails.recovery.thanks": "Tak,", + "emails.recovery.buttonText": "Nulstil adgangskode", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Invitation til %s Team på %s", + "emails.invitation.subject": "Invitation til {{team}} Team på {{project}}", "emails.invitation.hello": "Hej,", "emails.invitation.body": "Denne mail blev sendt til dig, fordi {{owner}} vil invitere dig til at blive medlem af {{team}} teamet på {{project}}.", "emails.invitation.footer": "Hvis du ikke er interesseret, ignorer venligst denne besked.", "emails.invitation.thanks": "Tak,", + "emails.invitation.buttonText": "Accepter invitation til {{team}}", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ukendt", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/de.json b/app/config/locale/translations/de.json index 38b1e46870..0793753789 100644 --- a/app/config/locale/translations/de.json +++ b/app/config/locale/translations/de.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Die Kunst, weise zu sein, ist die Kunst, zu wissen, was zu übersehen ist.\"", "settings.locale": "de", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Kontoverifizierung", "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Folge diesem Link, um deine E-Mail-Adresse zu bestätigen.", "emails.verification.footer": "Solltest du keine Verifizierung dieser E-Mail-Adresse angefordert haben, kannst du diese Nachricht ignorieren.", "emails.verification.thanks": "Danke,", + "emails.verification.buttonText": "E-Mail-Adresse bestätigen", "emails.verification.signature": "{{project}}-Team", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Hey,", - "emails.magicSession.body": "Folge diesem Link, um dich einzuloggen.", - "emails.magicSession.footer": "Solltest du keinen Login für diese E-Mail-Adresse angefordert haben, kannst du diese Nachricht ignorieren.", "emails.magicSession.thanks": "Danke,", "emails.magicSession.signature": "{{project}}-Team", "emails.recovery.subject": "Kennwort zurücksetzen", @@ -20,12 +19,14 @@ "emails.recovery.body": "Folge diesem Link, um dein {{project}}-Kennwort zurückzusetzen.", "emails.recovery.footer": "Solltest du keine Kennwort-Zurücksetzung angefordert haben, kannst du diese Nachricht ignorieren.", "emails.recovery.thanks": "Danke,", + "emails.recovery.buttonText": "Passwort zurücksetzen", "emails.recovery.signature": "{{project}}-Team", - "emails.invitation.subject": "Einladung zum %s-Team auf %s", + "emails.invitation.subject": "Einladung zum {{team}}-Team auf {{project}}", "emails.invitation.hello": "Hello,", "emails.invitation.body": "Du erhälst diese E-Mail, weil {{owner}} dich in das Team {{team}} auf {{project}} eingeladen hat.", "emails.invitation.footer": "Wenn du nicht interessiert bist, kannst du diese Nachricht ignorieren.", "emails.invitation.thanks": "Danke,", + "emails.invitation.buttonText": "Einladung zu {{team}} annehmen", "emails.invitation.signature": "{{project}}-Team", "locale.country.unknown": "Unbekannt", "countries.af": "Afghanistan", @@ -244,5 +245,6 @@ "emails.otpSession.clientInfo": "Diese Anmeldung wurde über {{agentClient}} auf {{agentDevice}} {{agentOs}} angefordert. Wenn Sie die Anmeldung nicht angefordert haben, können Sie diese E-Mail getrost ignorieren.", "emails.otpSession.securityPhrase": "Die Sicherheitsphrase für diese E-Mail lautet {{phrase}}. Sie können dieser E-Mail vertrauen, wenn diese Phrase mit der Phrase übereinstimmt, die beim Anmelden angezeigt wird.", "emails.otpSession.thanks": "Danke,", - "emails.otpSession.signature": "{{project}} Team" + "emails.otpSession.signature": "{{project}} Team", + "mock": "Eine Beispielübersetzung für Testzwecke." } diff --git a/app/config/locale/translations/el.json b/app/config/locale/translations/el.json index 1ef9cd30df..54b14c1846 100644 --- a/app/config/locale/translations/el.json +++ b/app/config/locale/translations/el.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Η τέχνη του να είσαι σοφός, είναι η τέχνη να ξέρεις τι πρέπει να παραβλέψεις.\"", "settings.locale": "gr", "settings.direction": "ltr", - "emails.sender": "Ομάδα %s", + "emails.sender": "Ομάδα {{project}}", "emails.verification.subject": "Επαλήθευση Λογαριασμού", "emails.verification.hello": "Γεια σου {{user}},", "emails.verification.body": "Ακολουθήστε αυτό το link για να επαληθεύσετε τη δ/νση του email σας", "emails.verification.footer": "Εάν δεν ζητήσατε επαλήθευση αυτής της δ/νσης email, μπορείτε να αγνοήσετε αυτό το μήνυμα", "emails.verification.thanks": "Ευχαριστούμε,", + "emails.verification.buttonText": "Επιβεβαιώστε διεύθυνση email", "emails.verification.signature": "Η ομάδα του {{project}}", "emails.magicSession.subject": "Είσοδος", "emails.magicSession.hello": "Γεια σου,", - "emails.magicSession.body": "Ακολουθήστε αυτό το link για να συνδεθείτε", - "emails.magicSession.footer": "Εάν δεν ζητήσατε να συνδεθείτε χρησιμοποιώντας αυτό το email, μπορείτε να αγνοήσετε αυτό το μήνυμα.", "emails.magicSession.thanks": "Ευχαριστούμε,", "emails.magicSession.signature": "Η ομάδα του {{project}}", "emails.recovery.subject": "Αλλαγή κωδικού πρόσβασης", @@ -20,12 +19,14 @@ "emails.recovery.body": "Ακολουθήστε αυτό το link για να αλλάξετε τον {{project}} κωδικό σας", "emails.recovery.footer": "Εάν δεν ζητήσατε αλλαγή του κωδικού σας πρόσβασης, μπορείτε να αγνοήσετε αυτό το μήνυμα", "emails.recovery.thanks": "Ευχαριστούμε,", + "emails.recovery.buttonText": "Επαναφορά κωδικού πρόσβασης", "emails.recovery.signature": "Η ομάδα του {{project}}", - "emails.invitation.subject": "Πρόσκληση στην %s Ομάδα στον %s", + "emails.invitation.subject": "Πρόσκληση στην {{team}} Ομάδα στον {{project}}", "emails.invitation.hello": "Γεια σου,", "emails.invitation.body": "Αυτό το email στάλθηκε επειδή ο/η {{owner}} θέλει να σας προσκαλέσει να γίνετε μέλος της ομάδας {{team}} του {{project}}.", "emails.invitation.footer": "Εάν δεν ενδιαφέρεστε, μπορείτε να αγνοήσετε αυτό το μήνυμα.", "emails.invitation.thanks": "Ευχαριστούμε,", + "emails.invitation.buttonText": "Αποδεχόμενος την πρόσκληση στην {{team}}", "emails.invitation.signature": "Η ομάδα του {{project}}", "locale.country.unknown": "Άγνωστο", "countries.af": "Αφγανιστάν", diff --git a/app/config/locale/translations/en.json b/app/config/locale/translations/en.json index d9dfddb017..e2ee20b2d7 100644 --- a/app/config/locale/translations/en.json +++ b/app/config/locale/translations/en.json @@ -2,14 +2,17 @@ "settings.inspire": "\"The art of being wise is the art of knowing what to overlook.\"", "settings.locale": "en", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Account Verification", + "emails.verification.preview": "Verify your email to activate your {{project}} account.", "emails.verification.hello": "Hello {{user}},", "emails.verification.body": "Follow this link to verify your email address to your {{b}}{{project}}{{/b}} account.", "emails.verification.footer": "If you didn’t ask to verify this address, you can ignore this message.", "emails.verification.thanks": "Thanks,", + "emails.verification.buttonText": "Confirm email address", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "{{project}} Login", + "emails.magicSession.preview": "Sign in to {{project}} with your secure link. Expires in 1 hour.", "emails.magicSession.hello": "Hello {{user}},", "emails.magicSession.optionButton": "Click the button below to securely sign in to your {{b}}{{project}}{{/b}} account. This link will expire in 1 hour.", "emails.magicSession.buttonText": "Sign in to {{project}}", @@ -19,6 +22,7 @@ "emails.magicSession.thanks": "Thanks,", "emails.magicSession.signature": "{{project}} team", "emails.sessionAlert.subject": "Security alert: new session on your {{project}} account", + "emails.sessionAlert.preview": "New login detected on {{project}} at {{time}} UTC.", "emails.sessionAlert.hello": "Hello {{user}},", "emails.sessionAlert.body": "A new session has been created on your {{b}}{{project}}{{/b}} account, {{b}}on {{date}}, {{year}} at {{time}} UTC{{/b}}.\nHere are the details of the new session: ", "emails.sessionAlert.listDevice": "Device: {{b}}{{device}}{{/b}}", @@ -28,6 +32,7 @@ "emails.sessionAlert.thanks": "Thanks,", "emails.sessionAlert.signature": "{{project}} team", "emails.otpSession.subject": "OTP for {{project}} Login", + "emails.otpSession.preview": "Use OTP {{otp}} to sign in to {{project}}. Expires in 15 minutes.", "emails.otpSession.hello": "Hello {{user}},", "emails.otpSession.description": "Enter the following verification code when prompted to securely sign in to your {{b}}{{project}}{{/b}} account. This code will expire in 15 minutes.", "emails.otpSession.clientInfo": "This sign in was requested using {{b}}{{agentClient}}{{/b}} on {{b}}{{agentDevice}}{{/b}} {{b}}{{agentOs}}{{/b}}. If you didn't request the sign in, you can safely ignore this email.", @@ -35,24 +40,30 @@ "emails.otpSession.thanks": "Thanks,", "emails.otpSession.signature": "{{project}} team", "emails.mfaChallenge.subject": "Verification Code for {{project}}", + "emails.mfaChallenge.preview": "Use code {{otp}} for two-step verification in {{project}}. Expires in 15 minutes.", "emails.mfaChallenge.hello": "Hello {{user}},", - "emails.mfaChallenge.description": "Enter the following verification code to verify your email and activate two-step verification in {{b}}{{project}}{{/b}}. This code will expire in 15 minutes.", + "emails.mfaChallenge.description": "Enter the following code to confirm your two-step verification in {{b}}{{project}}{{/b}}. This code will expire in 15 minutes.", "emails.mfaChallenge.clientInfo": "This verification code was requested using {{b}}{{agentClient}}{{/b}} on {{b}}{{agentDevice}}{{/b}} {{b}}{{agentOs}}{{/b}}. If you didn't request the verification code, you can safely ignore this email.", "emails.mfaChallenge.thanks": "Thanks,", "emails.mfaChallenge.signature": "{{project}} team", "emails.recovery.subject": "Password Reset", + "emails.recovery.preview": "Reset your {{project}} password using the link.", "emails.recovery.hello": "Hello {{user}},", "emails.recovery.body": "Follow this link to reset your {{b}}{{project}}{{/b}} password.", "emails.recovery.footer": "If you didn't ask to reset your password, you can ignore this message.", "emails.recovery.thanks": "Thanks,", + "emails.recovery.buttonText": "Reset password", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Invitation to %s Team at %s", + "emails.invitation.subject": "Invitation to {{team}} Team at {{project}}", + "emails.invitation.preview": "{{owner}} invited you to join {{team}} at {{project}}", "emails.invitation.hello": "Hello {{user}},", - "emails.invitation.body": "This mail was sent to you because {{b}}{{owner}}{{/b}} wanted to invite you to become a member of the {{b}}{{team}}{{/b}} team at {{b}}{{project}}{{/b}}.", + "emails.invitation.body": "This mail was sent to you because {{b}}{{owner}}{{/b}} invited you to become a member of the {{b}}{{team}}{{/b}} team at {{b}}{{project}}{{/b}}.", "emails.invitation.footer": "If you are not interested, you can ignore this message.", "emails.invitation.thanks": "Thanks,", + "emails.invitation.buttonText": "Accept invite to {{team}}", "emails.invitation.signature": "{{project}} team", - "emails.certificate.subject": "Certificate failure for %s", + "emails.certificate.subject": "Certificate failure for {{domain}}", + "emails.certificate.preview": "Your domain {{domain}} certificate generation has failed.", "emails.certificate.hello": "Hello,", "emails.certificate.body": "Certificate for your domain '{{domain}}' could not be generated. This is attempt no. {{attempt}}, and the failure was caused by: {{error}}", "emails.certificate.footer": "Your previous certificate will be valid for 30 days since the first failure. We highly recommend investigating this case, otherwise your domain will end up without a valid SSL communication.", @@ -263,5 +274,6 @@ "continents.eu": "Europe", "continents.na": "North America", "continents.oc": "Oceania", - "continents.sa": "South America" + "continents.sa": "South America", + "mock": "A mock translation for testing purposes." } diff --git a/app/config/locale/translations/eo.json b/app/config/locale/translations/eo.json index ba80bc602d..8b5eb0fe90 100644 --- a/app/config/locale/translations/eo.json +++ b/app/config/locale/translations/eo.json @@ -1,17 +1,16 @@ { "settings.locale": "eo", "settings.direction": "ltr", - "emails.sender": "Teamo %s", + "emails.sender": "Teamo {{project}}", "emails.verification.subject": "Konta Konfirmo", "emails.verification.hello": "Saluton {{user}},", "emails.verification.body": "Alklaku ĉi tiun ligon por kontroli vian retpoŝtan adreson.", "emails.verification.footer": "Se vi ne petis ĉi tiun konfirmon de ĉi tiu retpoŝto, vi povas ignori ĉi tiun mesaĝon.", "emails.verification.thanks": "Dankegon.,", + "emails.verification.buttonText": "Konfirmi retadreson", "emails.verification.signature": "Teamo {{project}}", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Saluton,", - "emails.magicSession.body": "Alklaku ĉi tiun ligon por eniri.", - "emails.magicSession.footer": "Se vi ne petis ĉi tiun konfirmon de ĉi tiu retpoŝto, vi povas ignori ĉi tiun mesaĝon.", "emails.magicSession.thanks": "Dankegon,", "emails.magicSession.signature": "Teamo {{project}}", "emails.recovery.subject": "Parsvorta Restarigo", @@ -19,12 +18,14 @@ "emails.recovery.body": "Alklaku ĉi tiun ligon por reagordi vian pasvorton. {{project}}", "emails.recovery.footer": "Se vi ne petis reagordi vian pasvorton, vi povas ignori ĉi tiun mesaĝon.", "emails.recovery.thanks": "Dankegon,", + "emails.recovery.buttonText": "Pasvorton restarigi", "emails.recovery.signature": "Teamo {{project}}", - "emails.invitation.subject": "Invito al la Teamo %s em %s", + "emails.invitation.subject": "Invito al la Teamo {{team}} em {{project}}", "emails.invitation.hello": "Dankegon,", "emails.invitation.body": "Ĉi tiu retpoŝto estis sendita ĉar la {{owner}} volas inviti vin fariĝi membro de la Teamo {{team}} en {{project}}.", "emails.invitation.footer": "Se vi ne interesiĝas, vi povas ignori ĉi tiun mesaĝon.", "emails.invitation.thanks": "Dankegon,", + "emails.invitation.buttonText": "Akcepti inviton al {{team}}", "emails.invitation.signature": "Teamo {{project}}", "locale.country.unknown": "Unknown", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/es.json b/app/config/locale/translations/es.json index ff98fd28c7..21a406b418 100644 --- a/app/config/locale/translations/es.json +++ b/app/config/locale/translations/es.json @@ -2,17 +2,16 @@ "settings.inspire": "\"El arte de ser sabio es el arte de saber qué pasar por alto\"", "settings.locale": "es", "settings.direction": "ltr", - "emails.sender": "El equipo de %s", + "emails.sender": "El equipo de {{project}}", "emails.verification.subject": "Verificación de cuenta", "emails.verification.hello": "Hola, {{name}}.,", "emails.verification.body": "Haz clic en este enlace para verificar tu correo:", "emails.verification.footer": "Si no has solicitado verificar este correo, puedes ignorar este mensaje.", "emails.verification.thanks": "Gracias.,", + "emails.verification.buttonText": "Confirmar dirección de correo", "emails.verification.signature": "El equipo de {{project}}.", "emails.magicSession.subject": "Inicio de sesión", "emails.magicSession.hello": "Hola,", - "emails.magicSession.body": "Haz clic en este enlace para iniciar sesión:", - "emails.magicSession.footer": "Si no has solicitado iniciar sesión usando este correo, puedes ignorar este mensaje.", "emails.magicSession.thanks": "Gracias.,", "emails.magicSession.signature": "El equipo de {{project}}", "emails.recovery.subject": "Restablecer contraseña", @@ -20,12 +19,14 @@ "emails.recovery.body": "Haz clic en este enlace para restablecer la contraseña de {{project}}:", "emails.recovery.footer": "Si no has solicitado restablecer la contraseña, puedes ignorar este mensaje.", "emails.recovery.thanks": "Gracias.,", + "emails.recovery.buttonText": "Restablecer contraseña", "emails.recovery.signature": "El equipo de {{project}}", - "emails.invitation.subject": "Invitación al equipo %s en %s", + "emails.invitation.subject": "Invitación al equipo {{team}} en {{project}}", "emails.invitation.hello": "Hola,", "emails.invitation.body": "Este correo ha sido enviado a petición de {{owner}} quién quiere invitarte a formar parte del equipo {{team}} en {{project}}.", "emails.invitation.footer": "Si no estás interesado, puedes ignorar este mensaje.", "emails.invitation.thanks": "Gracias.,", + "emails.invitation.buttonText": "Aceptar invitación a {{team}}", "emails.invitation.signature": "El equipo de {{project}}", "locale.country.unknown": "Desconocido", "countries.af": "Afganistán", diff --git a/app/config/locale/translations/fa.json b/app/config/locale/translations/fa.json index f826a75118..84cd154f4e 100644 --- a/app/config/locale/translations/fa.json +++ b/app/config/locale/translations/fa.json @@ -2,17 +2,16 @@ "settings.inspire": "\"هنر خردمند بودن این است که بدانید چه چیزی را نادیده بگیرید.\"", "settings.locale": "fa", "settings.direction": "rtl", - "emails.sender": "تیم %s", + "emails.sender": "تیم {{project}}", "emails.verification.subject": "تأیید حساب", "emails.verification.hello": "سلام {{user}}،", "emails.verification.body": "برای تأیید ایمیل‌تان پیوند زیر را دنبال کنید.", "emails.verification.footer": "اگر شما درخواست تأیید حساب نداده‌اید، می‌توانید این پیام را نادیده بگیرید.", "emails.verification.thanks": "سپاس فراوان،", + "emails.verification.buttonText": "آدرس ایمیل را تایید کنید", "emails.verification.signature": "تیم {{user}}", "emails.magicSession.subject": "ورود به حساب کاربری", "emails.magicSession.hello": "سلام،", - "emails.magicSession.body": "برای ورود به حساب‌تان پیوند زیر را دنبال کنید.", - "emails.magicSession.footer": "اگر شما درخواست ورود به حساب کاربری با استفاده از این ایمیل را نداد‌ه‌اید، می‌توانید این پیام را نادیده بگیرید.", "emails.magicSession.thanks": "سپاس فراوان،", "emails.magicSession.signature": "تیم {{user}}", "emails.recovery.subject": "بازیابی گذرواژه", @@ -20,12 +19,14 @@ "emails.recovery.body": "برای بازیابی گذرواژه‌تان پیوند زیر را دنبال کنید.", "emails.recovery.footer": "اگر شما درخواست بازیابی گذرواژه نداده‌اید، می‌توانید این پیام را نادیده بگیرید.", "emails.recovery.thanks": "سپاس فراوان،", + "emails.recovery.buttonText": "بازنشانی رمز عبور", "emails.recovery.signature": "تیم {{user}}", - "emails.invitation.subject": "دعوت به تیم %s در %s", + "emails.invitation.subject": "دعوت به تیم {{team}} در {{project}}", "emails.invitation.hello": "سلام،", "emails.invitation.body": "این ایمیل برای شما فرستاده شده‌است زیرا {{owner}} می‌خواهد شما را به تیم {{team}} در پروژه‌ی {{project}} بیفزاید.", "emails.invitation.footer": "اگر علاقه ندارید، می‌توانید این پیام را نادیده بگیرید.", "emails.invitation.thanks": "سپاس فراوان،", + "emails.invitation.buttonText": "دعوت را به {{team}} بپذیرید", "emails.invitation.signature": "تیم {{user}}", "locale.country.unknown": "ناشناخته", "countries.af": "افغانستان", diff --git a/app/config/locale/translations/fi.json b/app/config/locale/translations/fi.json index ca61a95653..2a5ff54078 100644 --- a/app/config/locale/translations/fi.json +++ b/app/config/locale/translations/fi.json @@ -2,7 +2,7 @@ "settings.inspire": "\"The art of being wise is the art of knowing what to overlook.\"", "settings.locale": "fi", "settings.direction": "ltr", - "emails.sender": "%s Tiimi", + "emails.sender": "{{project}} Tiimi", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", @@ -11,8 +11,6 @@ "emails.verification.signature": "", "emails.magicSession.subject": "", "emails.magicSession.hello": ",", - "emails.magicSession.body": "", - "emails.magicSession.footer": "", "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", diff --git a/app/config/locale/translations/fo.json b/app/config/locale/translations/fo.json index a982fd0590..e301d158fa 100644 --- a/app/config/locale/translations/fo.json +++ b/app/config/locale/translations/fo.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Kunstin om at vera vís er at vita hvat man skal misrøkja.\"", "settings.locale": "fo", "settings.direction": "ltr", - "emails.sender": "%s Lið", + "emails.sender": "{{project}} Lið", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", @@ -11,8 +11,6 @@ "emails.verification.signature": "", "emails.magicSession.subject": "", "emails.magicSession.hello": ",", - "emails.magicSession.body": "", - "emails.magicSession.footer": "", "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", diff --git a/app/config/locale/translations/fr.json b/app/config/locale/translations/fr.json index 1b60cb1910..95abe15787 100644 --- a/app/config/locale/translations/fr.json +++ b/app/config/locale/translations/fr.json @@ -2,17 +2,16 @@ "settings.inspire": "\"L'art d'être sage est l'art de savoir quoi négliger.\"", "settings.locale": "fr", "settings.direction": "ltr", - "emails.sender": "Équipe %s", + "emails.sender": "Équipe {{project}}", "emails.verification.subject": "Vérification du compte", "emails.verification.hello": "Bonjour {{user}},", "emails.verification.body": "Suivez ce lien pour vérifier votre adresse e-mail.", "emails.verification.footer": "Si vous n'avez pas demandé à vérifier cette adresse, vous pouvez ignorer ce message.", "emails.verification.thanks": "Merci,", + "emails.verification.buttonText": "Confirmez l'adresse e-mail", "emails.verification.signature": "Équipe {{project}}", "emails.magicSession.subject": "Connexion", "emails.magicSession.hello": "Bonjour,", - "emails.magicSession.body": "Suivez ce lien pour vous connecter.", - "emails.magicSession.footer": "Si vous n'avez pas demandé à vous connecter en utilisant cet e-mail, vous pouvez ignorer ce message.", "emails.magicSession.thanks": "Merci,", "emails.magicSession.signature": "L'équipe {{project}}", "emails.recovery.subject": "Réinitialisation du mot de passe", @@ -20,12 +19,14 @@ "emails.recovery.body": "Suivez ce lien pour réinitialiser votre mot de passe pour {{project}}.", "emails.recovery.footer": "Si vous n'avez pas demandé à réinitialiser votre mot de passe, vous pouvez ignorer ce message.", "emails.recovery.thanks": "Merci,", + "emails.recovery.buttonText": "Réinitialisation du mot de passe", "emails.recovery.signature": "L'équipe {{project}}", - "emails.invitation.subject": "Invitation à l'équipe %s de %s", + "emails.invitation.subject": "Invitation à l'équipe {{team}} de {{project}}", "emails.invitation.hello": "Bonjour,", "emails.invitation.body": "Cet e-mail vous a été envoyé parce que {{owner}} souhaite vous inviter à devenir membre de l'équipe {{team}} pour {{project}}.", "emails.invitation.footer": "Si vous n'êtes pas intéressé, vous pouvez ignorer ce message.", "emails.invitation.thanks": "Merci,", + "emails.invitation.buttonText": "Accepter l'invitation à {{team}}", "emails.invitation.signature": "L'équipe {{project}}", "locale.country.unknown": "Inconnu", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ga.json b/app/config/locale/translations/ga.json index 3ed68ad8c3..b3e480c22c 100644 --- a/app/config/locale/translations/ga.json +++ b/app/config/locale/translations/ga.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Is í ealaín na críonnachta ná rudaí a aithint chun cluas bhodhar a thabhairt dóibh.\"", "settings.locale": "ga", "settings.direction": "ltr", - "emails.sender": "%s Foireann", + "emails.sender": "{{project}} Foireann", "emails.verification.subject": "Fíoraithe cuntais", "emails.verification.hello": "Haigh {{user}},", "emails.verification.body": "Lean an nasc seo chun do ríomhphost a fhíorú.", "emails.verification.footer": "Mura ndearna tú iarratas an seoladh seo a fhíoru, déan neamhaird den teachtaireacht seo.", "emails.verification.thanks": "Go raibh maith agat,", + "emails.verification.buttonText": "Deimhnigh seoladh ríomhphoist", "emails.verification.signature": "{{project}} foireann", "emails.magicSession.subject": "Logáil isteach", "emails.magicSession.hello": "Haigh,", - "emails.magicSession.body": "Lean an nasc seo chun logáil isteach.", - "emails.magicSession.footer": "Mura ndearna tú iarratas logáil isteach leis an ríomhphost seo, déan neamhaird den teachtaireacht seo.", "emails.magicSession.thanks": "Go raibh maith agat,", "emails.magicSession.signature": "{{project}} foireann", "emails.recovery.subject": "Athshocrú pasfhocail", @@ -20,12 +19,14 @@ "emails.recovery.body": "Lean an nasc seo chun do pasfhocal {{project}} a athshocrú.", "emails.recovery.footer": "Mura ndearna tú iarratas do pasfhocal a athshocrú, déan neamhaird den teachtaireacht seo.", "emails.recovery.thanks": "Go raibh maith agat,", + "emails.recovery.buttonText": "Athshocraigh focal faire", "emails.recovery.signature": "{{project}} foireann", - "emails.invitation.subject": "Cuireadh do %s foireann ag %s", + "emails.invitation.subject": "Cuireadh do {{team}} foireann ag {{project}}", "emails.invitation.hello": "Haigh,", "emails.invitation.body": "Seoladh an ríomhphost seo chugat mar ba mhaith le {{owner}} cuireadh a thabhairt duit bheith mar bhall den fhoireann {{team}} ag obair ar {{project}}.", "emails.invitation.footer": "Is cuma leat? Déan neamhaird den teachtaireacht seo.", "emails.invitation.thanks": "Go raibh maith agat,", + "emails.invitation.buttonText": "Glac le cuireadh chuig {{team}}", "emails.invitation.signature": "{{project}} foireann", "locale.country.unknown": "Neamhaithnid", "countries.af": "An Afganastáin", diff --git a/app/config/locale/translations/gu.json b/app/config/locale/translations/gu.json index 54378caa9e..97d73b8d5c 100644 --- a/app/config/locale/translations/gu.json +++ b/app/config/locale/translations/gu.json @@ -2,17 +2,16 @@ "settings.inspire": "\"સ્માર્ટ બનવાની કળા એ છે કે શું અવગણવું તે જાણવાની કળા છે.\"", "settings.locale": "gu", "settings.direction": "ltr", - "emails.sender": "%s ટીમ", + "emails.sender": "{{project}} ટીમ", "emails.verification.subject": "ખાતાની ચકાસણી", "emails.verification.hello": "નમસ્કાર {{user}},", "emails.verification.body": "તમારું ઇમેઇલ સરનામું ચકાસવા માટે આ લિંકને અનુસરો.", "emails.verification.footer": "જો તમે આ સરનામાંની ચકાસણી કરવાનું ન કહ્યું હોય, તો તમે આ સંદેશને અવગણી શકો છો.", "emails.verification.thanks": "આભાર,", + "emails.verification.buttonText": "ઇમેઇલ સરનામું ખાતરી કરો", "emails.verification.signature": "{{project}} ટીમ", "emails.magicSession.subject": "પ્રવેશ કરો", "emails.magicSession.hello": "નમસ્કાર,", - "emails.magicSession.body": "પ્રવેશ કરવા માટે આ લિંકને અનુસરો.", - "emails.magicSession.footer": "જો તમે આ ઇમેઇલનો ઉપયોગ કરીને પ્રવેશ કરવાનું ન કહ્યું હોય, તો તમે આ સંદેશને અવગણી શકો છો.", "emails.magicSession.thanks": "આભાર,", "emails.magicSession.signature": "{{project}} ટીમ", "emails.recovery.subject": "પાસવર્ડ ફરીથી સેટ કરો", @@ -20,12 +19,14 @@ "emails.recovery.body": "તમારો {{project}} પાસવર્ડ ફરીથી સેટ કરવા માટે આ લિંકને અનુસરો.", "emails.recovery.footer": "જો તમે તમારો પાસવર્ડ ફરીથી સેટ કરવાનું ન કહ્યું હોય, તો તમે આ સંદેશને અવગણી શકો છો.", "emails.recovery.thanks": "આભાર,", + "emails.recovery.buttonText": "પાસવર્ડ રીસેટ કરો", "emails.recovery.signature": "{{project}} ટીમ", - "emails.invitation.subject": "%s ટીમને %s પર આમંત્રણ", + "emails.invitation.subject": "{{team}} ટીમને {{project}} પર આમંત્રણ", "emails.invitation.hello": "નમસ્કાર,", "emails.invitation.body": "આ મેઇલ તમને મોકલવામાં આવ્યો હતો કારણ કે {{owner}} તમને {{project}} માં {{team}} ટીમના સભ્ય બનવા માટે આમંત્રિત કરવા માંગતા હતો.", "emails.invitation.footer": "જો તમને રસ નથી, તો તમે આ સંદેશને અવગણી શકો છો.", "emails.invitation.thanks": "આભાર,", + "emails.invitation.buttonText": "{{team}} નું આમંત્રણ સ્વીકારો", "emails.invitation.signature": "{{project}} ટીમ", "locale.country.unknown": "અજાણ", "countries.af": "અફઘાનિસ્તાન", diff --git a/app/config/locale/translations/he.json b/app/config/locale/translations/he.json index b3d4dea2a8..96c9eb3d50 100644 --- a/app/config/locale/translations/he.json +++ b/app/config/locale/translations/he.json @@ -2,17 +2,16 @@ "settings.inspire": "\"להיות חכם זה לדעת ממה להתעלם.\"", "settings.locale": "he", "settings.direction": "rtl", - "emails.sender": "צוות %s", + "emails.sender": "צוות {{project}}", "emails.verification.subject": "אימות חשבון", "emails.verification.hello": "שלום {{user}},", "emails.verification.body": "לחץ על קישור זה כדי לאמת את כתובת הדוא\"ל שלך.", "emails.verification.footer": "אם לא ביקשת לאמת כתובת זו, תוכל להתעלם מהודעה זו.", "emails.verification.thanks": "תודה,", + "emails.verification.buttonText": "אשר כתובת דוא\"ל", "emails.verification.signature": "צוות {{project}}", "emails.magicSession.subject": "כניסה למערכת", "emails.magicSession.hello": "שלום,", - "emails.magicSession.body": "לחץ על קישור זה כדי להיכנס.", - "emails.magicSession.footer": "אם לא ביקשת להיכנס באמצעות דוא\"ל זה, תוכל להתעלם מהודעה זו.", "emails.magicSession.thanks": "תודה,", "emails.magicSession.signature": "צוות {{project}}", "emails.recovery.subject": "איפוס סיסמא", @@ -20,12 +19,14 @@ "emails.recovery.body": "עקוב אחר קישור זה כדי לאפס את סיסמתך ב-{{project}}.", "emails.recovery.footer": "אם לא ביקשת לאפס את הסיסמה, תוכל להתעלם מהודעה זו.", "emails.recovery.thanks": "תודה,", + "emails.recovery.buttonText": "סיסמא איפוס", "emails.recovery.signature": "צוות {{project}}", - "emails.invitation.subject": "הזמנה לצוות %s ב- %s", + "emails.invitation.subject": "הזמנה לצוות {{team}} ב- {{project}}", "emails.invitation.hello": "שלום,", "emails.invitation.body": "דואר זה נשלח אליך מכיוון ש {{owner}} רצה להזמין אותך להיות חבר בצוות {{team}} ב-{{project}}.", "emails.invitation.footer": "אם אינך מעוניין, תוכל להתעלם מהודעה זו.", "emails.invitation.thanks": "תודה,", + "emails.invitation.buttonText": "אשר הזמנה ל-{{team}}", "emails.invitation.signature": "צוות {{project}}", "locale.country.unknown": "לא ידוע", "countries.af": "אפגניסטן", diff --git a/app/config/locale/translations/hi.json b/app/config/locale/translations/hi.json index 1c4d531d60..51f404260e 100644 --- a/app/config/locale/translations/hi.json +++ b/app/config/locale/translations/hi.json @@ -2,17 +2,16 @@ "settings.inspire": "\"बुद्धिमान होने की कला यह जानने की कला है कि क्या अनदेखा किया जाए |\"", "settings.locale": "hi", "settings.direction": "ltr", - "emails.sender": "%s टीम", + "emails.sender": "{{project}} टीम", "emails.verification.subject": "अकाउंट वेरिफिकेशन ", "emails.verification.hello": "नमस्ते {{user}},", "emails.verification.body": "इस लिंक के माध्यम से अपने ईमेल को सत्यापित कीजिये।", "emails.verification.footer": "यदि आप इस पते को सत्यापित नहीं करना चाहते हैं, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", "emails.verification.thanks": "धन्यवाद,", + "emails.verification.buttonText": "ईमेल पता सत्यापित करें", "emails.verification.signature": "{{project}} टीम", "emails.magicSession.subject": "लॉग इन", "emails.magicSession.hello": "नमस्ते,", - "emails.magicSession.body": "इस लिंक के माध्यम से लॉग-इन करें।", - "emails.magicSession.footer": "यदि आप इस ईमेल द्वारा लॉगिन नहीं करना चाहते हैं, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", "emails.magicSession.thanks": "धन्यवाद,", "emails.magicSession.signature": "{{project}} टीम", "emails.recovery.subject": "पासवर्ड रीसेट", @@ -20,12 +19,14 @@ "emails.recovery.body": "इस लिंक के माध्यम से अपना {{project}} पासवर्ड रीसेट करें।", "emails.recovery.footer": "यदि आप अपना पासवर्ड रीसेट नहीं करना चाहते हैं, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", "emails.recovery.thanks": "धन्यवाद,", + "emails.recovery.buttonText": "पासवर्ड रीसेट करें", "emails.recovery.signature": "{{project}} टीम", - "emails.invitation.subject": "%s टीम का यहाँ %s पर आमंत्रण", + "emails.invitation.subject": "{{team}} टीम का यहाँ {{project}} पर आमंत्रण", "emails.invitation.hello": "नमस्ते,", "emails.invitation.body": "यह मेल आपको इसलिए भेजा गया है क्योंकि {{owner}} आपको {{team}} टीम का सदस्य बनाना चाहते है, जो {{project}} से जुड़ा हुआ है।", "emails.invitation.footer": "यदि आप इसमें रूचि नहीं रखते, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", "emails.invitation.thanks": "धन्यवाद,", + "emails.invitation.buttonText": "{{team}} का निमंत्रण स्वीकार करें", "emails.invitation.signature": "{{project}} टीम", "locale.country.unknown": "अज्ञात", "countries.af": "अफ़ग़ानिस्तान", diff --git a/app/config/locale/translations/hr.json b/app/config/locale/translations/hr.json index e5bf4719a9..e956a530c1 100644 --- a/app/config/locale/translations/hr.json +++ b/app/config/locale/translations/hr.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Umjetnost mudrosti je umjetnost znanja o tome što zanemariti.\"", "settings.locale": "hr", "settings.direction": "ltr", - "emails.sender": "%s Tim", + "emails.sender": "{{project}} Tim", "emails.verification.subject": "Verifikacija računa", "emails.verification.hello": "Pozdrav {{user}},", "emails.verification.body": "Slijedite ovu poveznicu da biste potvrdili svoju adresu e-pošte.", "emails.verification.footer": "Ukoliko niste zatražili potvrdu ove adrese, možete zanemariti ovu poruku.", "emails.verification.thanks": "Hvala,", + "emails.verification.buttonText": "Potvrdi adresu e-pošte", "emails.verification.signature": "{{project}} tim", "emails.magicSession.subject": "Prijavite se", "emails.magicSession.hello": "Pozdrav,", - "emails.magicSession.body": "Slijedite ovu poveznicu za prijavu.", - "emails.magicSession.footer": "Ako niste zatražili prijavu putem ove e-pošte, možete zanemariti ovu poruku.", "emails.magicSession.thanks": "Hvala,", "emails.magicSession.signature": "{{project}} tim", "emails.recovery.subject": "Ponovno postavljanje lozinke", @@ -20,12 +19,14 @@ "emails.recovery.body": "Slijedite ovu poveznicu za ponovno postavljanje {{project}} lozinke.", "emails.recovery.footer": "Ako niste zatražili ponovno postavljanje Vaše lozinke, možete zanemariti ovu poruku.", "emails.recovery.thanks": "Hvala,", + "emails.recovery.buttonText": "Resetiraj lozinku", "emails.recovery.signature": "{{project}} tim", - "emails.invitation.subject": "Pozivnica za %s tim na %s", + "emails.invitation.subject": "Pozivnica za {{team}} tim na {{project}}", "emails.invitation.hello": "Pozdrav,", "emails.invitation.body": "Ova poruka Vam je poslana jer Vas je {{owner}} htio pozvati da postanete član {{team}} tima na {{project}}.", "emails.invitation.footer": "Ukoliko niste zainteresirani, možete zanemariti ovu poruku.", "emails.invitation.thanks": "Hvala,", + "emails.invitation.buttonText": "Prihvati pozivnicu za {{team}}", "emails.invitation.signature": "{{project}} tim", "locale.country.unknown": "Nepoznato", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/hu.json b/app/config/locale/translations/hu.json index 589cb61859..2593099c52 100644 --- a/app/config/locale/translations/hu.json +++ b/app/config/locale/translations/hu.json @@ -2,17 +2,16 @@ "settings.inspire": "\"The art of being wise is the art of knowing what to overlook.\"", "settings.locale": "hu", "settings.direction": "ltr", - "emails.sender": "%s Csapat", + "emails.sender": "{{project}} Csapat", "emails.verification.subject": "Fiók Megerősítése", "emails.verification.hello": "Szia {{user}},", "emails.verification.body": "Kattints a linkre, hogy megerősítsd az email címedet.", "emails.verification.footer": "Ha nem te kérted a címed megerősítését, akkor nyugodtan hagyd figyelmen kívül ezt az üzenetet.", "emails.verification.thanks": "Köszönettel,", + "emails.verification.buttonText": "E-mail-cím megerősítése", "emails.verification.signature": "a {{project}} csapat", "emails.magicSession.subject": "Bejelentkezés", "emails.magicSession.hello": "Szia,", - "emails.magicSession.body": "Kattints a linkre a bejelentkezéshez.", - "emails.magicSession.footer": "Ha nem te szerettél volna bejelentkezni ezzel az email címmel, akkor nyugodtan hagyd figyelmen kívül ezt az üzenetet.", "emails.magicSession.thanks": "Köszönettel,", "emails.magicSession.signature": "a {{project}} csapat", "emails.recovery.subject": "Jelszó Visszaállítása", @@ -20,12 +19,14 @@ "emails.recovery.body": "Kattints a linkre a {{project}} jelszavad visszaállításához.", "emails.recovery.footer": "Ha nem te kezdeményezted a jelszavad visszaállítását, akkor nyugodtan hagyd figyelmen kívül ezt az üzenetet.", "emails.recovery.thanks": "Köszönettel,", + "emails.recovery.buttonText": "Jelszó visszaállítása", "emails.recovery.signature": "a {{project}} csapat", - "emails.invitation.subject": "Meghívó a(z) %s csapatba, a(z) %s projektbe", + "emails.invitation.subject": "Meghívó a(z) {{team}} csapatba, a(z) {{project}} projektbe", "emails.invitation.hello": "Szia,", "emails.invitation.body": "Ezt a levelet azért kaptad, mert {{owner}} meghívott, hogy légy a {{team}} csapat tagja a {{project}} projektben.", "emails.invitation.footer": "Ha nem érdekel a lehetőség, nyugodtan hagyd figyelmen kívül ezt az üzenetet.", "emails.invitation.thanks": "Köszönettel,", + "emails.invitation.buttonText": "Elfogadni meghívást a {{team}-re", "emails.invitation.signature": "a {{project}} csapat", "locale.country.unknown": "Ismeretlen", "countries.af": "Afganisztán", diff --git a/app/config/locale/translations/hy.json b/app/config/locale/translations/hy.json index c845526607..b0c264d87c 100644 --- a/app/config/locale/translations/hy.json +++ b/app/config/locale/translations/hy.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Искусство быть мудрым — это искусство знать, чем можно пренебречь.\"", "settings.locale": "ru", "settings.direction": "ltr", - "emails.sender": "Թիմ %s", + "emails.sender": "Թիմ {{project}}", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", @@ -11,8 +11,6 @@ "emails.verification.signature": "", "emails.magicSession.subject": "", "emails.magicSession.hello": ",", - "emails.magicSession.body": "", - "emails.magicSession.footer": "", "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", diff --git a/app/config/locale/translations/id.json b/app/config/locale/translations/id.json index c28b15f15d..0e716f1e80 100644 --- a/app/config/locale/translations/id.json +++ b/app/config/locale/translations/id.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Seni menjadi bijak adalah seni mengetahui apa yang harus diabaikan.\"", "settings.locale": "id", "settings.direction": "ltr", - "emails.sender": "Tim %s", + "emails.sender": "Tim {{project}}", "emails.verification.subject": "Verifikasi Akun", "emails.verification.hello": "Hai {{user}},", "emails.verification.body": "Ikuti tautan ini untuk memverifikasi alamat email Anda.", "emails.verification.footer": "Jika Anda tidak meminta untuk memverifikasi alamat email ini, Anda dapat mengabaikan pesan ini.", "emails.verification.thanks": "Terima kasih,", + "emails.verification.buttonText": "Konfirmasi alamat email", "emails.verification.signature": "Tim {{project}}", "emails.magicSession.subject": "Masuk", "emails.magicSession.hello": "Hai,", - "emails.magicSession.body": "Ikuti tautan ini untuk masuk.", - "emails.magicSession.footer": "Jika Anda tidak meminta untuk masuk menggunakan email ini, Anda dapat mengabaikan pesan ini.", "emails.magicSession.thanks": "Terima kasih,", "emails.magicSession.signature": "Tim {{project}}", "emails.recovery.subject": "Atur Ulang Kata Sandi", @@ -20,12 +19,14 @@ "emails.recovery.body": "Ikuti tautan ini untuk menyetel ulang kata sandi {{project}} Anda.", "emails.recovery.footer": "Jika Anda tidak meminta untuk menyetel ulang kata sandi, Anda dapat mengabaikan pesan ini.", "emails.recovery.thanks": "Terima kasih,", + "emails.recovery.buttonText": "Atur ulang kata sandi", "emails.recovery.signature": "Tim {{project}}", - "emails.invitation.subject": "Undangan ke Tim %s di %s", + "emails.invitation.subject": "Undangan ke Tim {{team}} di {{project}}", "emails.invitation.hello": "Halo,", "emails.invitation.body": "Email ini dikirimkan kepada Anda karena {{owner}} ingin mengundang Anda untuk menjadi anggota tim {{team}} di {{project}}.", "emails.invitation.footer": "Jika Anda tidak tertarik, Anda dapat mengabaikan pesan ini.", "emails.invitation.thanks": "Terima kasih,", + "emails.invitation.buttonText": "Terima undangan ke {{team}}", "emails.invitation.signature": "Tim {{project}}", "locale.country.unknown": "Tidak diketahui", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/is.json b/app/config/locale/translations/is.json index 5fede4dda0..e387058d17 100644 --- a/app/config/locale/translations/is.json +++ b/app/config/locale/translations/is.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Listin að vera vitur er listin að vita hvað á að líta framhjá.\"", "settings.locale": "is", "settings.direction": "ltr", - "emails.sender": "%s Teymi", + "emails.sender": "{{project}} Teymi", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", @@ -11,8 +11,6 @@ "emails.verification.signature": "", "emails.magicSession.subject": "", "emails.magicSession.hello": ",", - "emails.magicSession.body": "", - "emails.magicSession.footer": "", "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", diff --git a/app/config/locale/translations/it.json b/app/config/locale/translations/it.json index 8d45de9903..1b07f7e95c 100644 --- a/app/config/locale/translations/it.json +++ b/app/config/locale/translations/it.json @@ -2,17 +2,16 @@ "settings.inspire": "\"L'arte di essere saggi è l'arte di saper cosa trascurare.\"", "settings.locale": "it", "settings.direction": "ltr", - "emails.sender": "Team %s", + "emails.sender": "Team {{project}}", "emails.verification.subject": "Verifica account", "emails.verification.hello": "Ciao {{user}},", "emails.verification.body": "Clicca questo link per verificare il tuo indirizzo email.", "emails.verification.footer": "Se non hai richiesto la verifica dell’indirizzo email, puoi ignorare questo messaggio.", "emails.verification.thanks": "Grazie,", + "emails.verification.buttonText": "Confermare l'indirizzo email", "emails.verification.signature": "Il team {{project}}", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Ciao,", - "emails.magicSession.body": "Clicca questo link per accedere.", - "emails.magicSession.footer": "Se non hai richiesto di effettuare l’accesso, puoi ignorare questo messaggio.", "emails.magicSession.thanks": "Grazie,", "emails.magicSession.signature": "Il team {{project}}", "emails.recovery.subject": "Reimpostazione password", @@ -20,12 +19,14 @@ "emails.recovery.body": "Clicca questo link per reimpostare la tua password di {{project}}.", "emails.recovery.footer": "Se non hai richiesto la reimpostazione della password, puoi ignorare questo messaggio.", "emails.recovery.thanks": "Grazie,", + "emails.recovery.buttonText": "Reimposta password", "emails.recovery.signature": "Il team {{project}}", - "emails.invitation.subject": "Invito al Team %s per %s", + "emails.invitation.subject": "Invito al Team {{team}} per {{project}}", "emails.invitation.hello": "Ciao,", "emails.invitation.body": "Hai ricevuto questa email perché {{owner}} ti ha invitato a diventare un membro del team {{team}} di {{project}}.", "emails.invitation.footer": "Ignora questo messaggio se non sei interessatə.", "emails.invitation.thanks": "Grazie,", + "emails.invitation.buttonText": "Accetta invito a {{team}}", "emails.invitation.signature": "Il team {{project}}", "locale.country.unknown": "Sconosciuto", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ja.json b/app/config/locale/translations/ja.json index 76d9a0cb1f..40c84e4a80 100644 --- a/app/config/locale/translations/ja.json +++ b/app/config/locale/translations/ja.json @@ -2,17 +2,16 @@ "settings.inspire": "\"賢明になる術は何を捨てるべきかを心得る術である。\"", "settings.locale": "ja", "settings.direction": "ltr", - "emails.sender": "%s チーム", + "emails.sender": "{{project}} チーム", "emails.verification.subject": "アカウント認証", "emails.verification.hello": "こんにちは{{user}}さん、", "emails.verification.body": "メールアドレスを有効化するためには下記リンクをクリックして下さい。", "emails.verification.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", "emails.verification.thanks": "ご利用いただきありがとうございます。、", + "emails.verification.buttonText": "メールアドレスを確認する", "emails.verification.signature": "{{project}}チーム", "emails.magicSession.subject": "ログイン", "emails.magicSession.hello": "こんにちは、", - "emails.magicSession.body": "ログインするためには下記リンクをクリックしてください。", - "emails.magicSession.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", "emails.magicSession.thanks": "ご利用いただきありがとうございます。、", "emails.magicSession.signature": "{{project}}チーム", "emails.recovery.subject": "パスワードリセット", @@ -20,12 +19,14 @@ "emails.recovery.body": "パスワードをリセットするためには下記リンクをクリックしてください。", "emails.recovery.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", "emails.recovery.thanks": "ご利用いただきありがとうございます。、", + "emails.recovery.buttonText": "パスワードをリセット", "emails.recovery.signature": "{{project}}チーム", - "emails.invitation.subject": "%sチームへの招待が%sから来ました。", + "emails.invitation.subject": "{{team}}チームへの招待が{{project}}から来ました。", "emails.invitation.hello": "こんにちは、", "emails.invitation.body": "{{owner}}さんが{{project}}の{{team}}チームにあなたを招待しています。", "emails.invitation.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", "emails.invitation.thanks": "ご利用いただきありがとうございます。、", + "emails.invitation.buttonText": "{{team}}への招待を承諾する", "emails.invitation.signature": "{{project}}チーム", "locale.country.unknown": "不明", "countries.af": "アフガニスタン", diff --git a/app/config/locale/translations/jv.json b/app/config/locale/translations/jv.json index 889e968b4d..962ded4fdc 100644 --- a/app/config/locale/translations/jv.json +++ b/app/config/locale/translations/jv.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Kesenian sing wicaksana yaiku seni sing ngerti apa sing kudu dilalekake.\"", "settings.locale": "jv", "settings.direction": "ltr", - "emails.sender": "Tim %s", + "emails.sender": "Tim {{project}}", "emails.verification.subject": "Verifikasi Akun", "emails.verification.hello": "Hai {{user}},", "emails.verification.body": "Klik link iki kanggo verifikasi alamat email sampeyan.", "emails.verification.footer": "Yen sampeyan ora njaluk verifikasi alamat iki, sampeyan iso nglirwakake pesen iki.", "emails.verification.thanks": "Matur nuwun,", + "emails.verification.buttonText": "Konfirmasi alamat email", "emails.verification.signature": "Tim {{project}}", "emails.magicSession.subject": "Masuk", "emails.magicSession.hello": "Hai,", - "emails.magicSession.body": "Klik link iki kanggo masuk.", - "emails.magicSession.footer": "Yen sampeyan ora njaluk masuk nggunakake alamat email iki, sampeyan iso nglirwakake pesen iki.", "emails.magicSession.thanks": "Matur nuwun,", "emails.magicSession.signature": "Tim {{project}}", "emails.recovery.subject": "Setel ulang sandi", @@ -20,12 +19,14 @@ "emails.recovery.body": "Klik link iki kanggo setel ulang sandi {{project}}.", "emails.recovery.footer": "Yen sampeyan ora njaluk setel ulang sandi, sampeyan iso nglirwakake pesen iki.", "emails.recovery.thanks": "Matur nuwun,", + "emails.recovery.buttonText": "Reset sandhi", "emails.recovery.signature": "Tim {{project}}", - "emails.invitation.subject": "Undangan ke Tim %s di %s", + "emails.invitation.subject": "Undangan ke Tim {{team}} di {{project}}", "emails.invitation.hello": "Halo,", "emails.invitation.body": "Email iki dikirim menyang sampeyan amarga {{owner}} pengin ngajak sampeyan dadi anggota tim {{team}} di {{project}}.", "emails.invitation.footer": "Yen sampeyan ora tertarik, sampeyan iso nglirwakake pesen iki.", "emails.invitation.thanks": "Matur nuwun,", + "emails.invitation.buttonText": "Tampa undhangan menyang {{team}}", "emails.invitation.signature": "Tim {{project}}", "locale.country.unknown": "Ora dingerteni", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/km.json b/app/config/locale/translations/km.json index 12ac05e8da..e673a7916f 100644 --- a/app/config/locale/translations/km.json +++ b/app/config/locale/translations/km.json @@ -2,7 +2,7 @@ "settings.inspire": "\"សិល្បៈនៃប្រាជ្ញាគឺជាសិល្បៈនៃការស្គាល់ពីអ្វីដែលត្រូវមើលរំលង។\"", "settings.locale": "km", "settings.direction": "ltr", - "emails.sender": "ក្រុម %s", + "emails.sender": "ក្រុម {{project}}", "emails.verification.subject": "", "emails.verification.hello": "", "emails.verification.body": "", @@ -11,8 +11,6 @@ "emails.verification.signature": "", "emails.magicSession.subject": "", "emails.magicSession.hello": "", - "emails.magicSession.body": "", - "emails.magicSession.footer": "", "emails.magicSession.thanks": "", "emails.magicSession.signature": "", "emails.recovery.subject": "", diff --git a/app/config/locale/translations/kn.json b/app/config/locale/translations/kn.json index ba57c21155..ede9d020b8 100644 --- a/app/config/locale/translations/kn.json +++ b/app/config/locale/translations/kn.json @@ -1,18 +1,17 @@ { "settings.inspire": "\"ಬುದ್ಧಿವಂತಿಕೆಯ ಕಲೆ ಏನು ಕಡೆಗಣಿಸಬೇಕೆಂದು ತಿಳಿಯುವ ಕಲೆ.\"", - "settings.locale": "ka", + "settings.locale": "kn", "settings.direction": "ltr", - "emails.sender": "%s ತಂಡ", + "emails.sender": "{{project}} ತಂಡ", "emails.verification.subject": "ಖಾತೆ ಪರಿಶೀಲನೆ", "emails.verification.hello": "ನಮಸ್ಕಾರ {{user}},", "emails.verification.body": "ನಿಮ್ಮ ಇಮೇಲ್ ವಿಳಾಸ ಪರಿಶೀಲನೆಗೆ ಈ ಲಿಂಕನ್ನು ಅನುಸರಿಸಿ", "emails.verification.footer": "ನೀವು ಇಮೇಲ್ ವಿಳಾಸ ಪರಿಶೀಲನೆಗೆ ಕೇಳದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", "emails.verification.thanks": "ಧನ್ಯವಾದಗಳು,", + "emails.verification.buttonText": "ಇಮೇಲ್ ವಿಳಾಸವನ್ನು ದೃಢೀಕರಿಸಿ", "emails.verification.signature": "{{project}} ತಂಡ", "emails.magicSession.subject": "ಲಾಗಿನ್", "emails.magicSession.hello": "ನಮಸ್ಕಾರ,", - "emails.magicSession.body": "ಲಾಗಿನ್ ಮಾಡಲಿಕ್ಕೆ ಈ ಲಿಂಕನ್ನು ಅನುಸರಿಸಿ", - "emails.magicSession.footer": "ನೀವು ಈ ಇಮೇಲನಿಂದ ಲಾಗಿನ್ ಮಾಡಲು ಕೇಳದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", "emails.magicSession.thanks": "ಧನ್ಯವಾದಗಳು,", "emails.magicSession.signature": "{{project}} ತಂಡ", "emails.recovery.subject": "ಗುಪ್ತಪದ ಮರುಹೊಂದಿಸಿ", @@ -20,12 +19,14 @@ "emails.recovery.body": "ನಿಮ್ಮ {{project}} ಗುಪ್ತಪದವನ್ನು ಮರುಹೊಂದಿಸಲು ಈ ಲಿಂಕನ್ನು ಅನುಸರಿಸಿ", "emails.recovery.footer": "ನೀವು ಗುಪ್ತಪದವನ್ನು ಮರುಹೊಂದಿಸಲು ಕೇಳದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", "emails.recovery.thanks": "ಧನ್ಯವಾದಗಳು,", + "emails.recovery.buttonText": "ಗುಪ್ತಪದವನ್ನು ಮರುಸೆಟ್ ಮಾಡಿ", "emails.recovery.signature": "{{project}} ತಂಡ", - "emails.invitation.subject": "%s ತಂಡಕ್ಕೆ %s ರಲ್ಲಿ ಆಹ್ವಾನ", + "emails.invitation.subject": "{{team}} ತಂಡಕ್ಕೆ {{project}} ರಲ್ಲಿ ಆಹ್ವಾನ", "emails.invitation.hello": "ನಮಸ್ಕಾರ,", "emails.invitation.body": "ಈ ಇಮೇಲ್ ನಿಮಗೆ ಬಂದಿದೆ ಏಕೆಂದರೆ {{owner}} ನಿಮ್ಮನ್ನು {{team}} ತಂಡದ {{project}}ರಲ್ಲಿ ಸದಸ್ಯ ಆಗಲಿಕ್ಕೆ ಆಹ್ವಾನಿಸಿದ್ದಾರೆ", "emails.invitation.footer": "ನಿಮಗೆ ಆಸಕ್ತಿಯಿಲ್ಲದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", "emails.invitation.thanks": "ಧನ್ಯವಾದಗಳು,", + "emails.invitation.buttonText": "{{team}} ಗೆ ಆಹ್ವಾನವನ್ನು ಸ್ವೀಕರಿಸಿ", "emails.invitation.signature": "{{project}} ತಂಡ", "locale.country.unknown": "Unknown", "countries.af": "ಅಫ್ಘಾನಿಸ್ತಾನ", diff --git a/app/config/locale/translations/ko.json b/app/config/locale/translations/ko.json index c33c961130..192af7ab93 100644 --- a/app/config/locale/translations/ko.json +++ b/app/config/locale/translations/ko.json @@ -2,17 +2,16 @@ "settings.inspire": "\"지혜롭게 되는 묘책은 그동안 간과했던 것을 알아내는 것에 있다\"", "settings.locale": "ko", "settings.direction": "ltr", - "emails.sender": "%s 팀", + "emails.sender": "{{project}} 팀", "emails.verification.subject": "계정 인증", "emails.verification.hello": "안녕하세요 {{user}}님、", "emails.verification.body": "이메일 인증을 위해 링크를 클릭하여주세요.", "emails.verification.footer": "이메일 인증을 부탁하지 않으셨다면 이 메시지를 무시하여주세요.", "emails.verification.thanks": "감사합니다、", + "emails.verification.buttonText": "이메일 주소를 확인합니다", "emails.verification.signature": "{{project}} 팀", "emails.magicSession.subject": "로그인", "emails.magicSession.hello": "안녕하세요、", - "emails.magicSession.body": "로그인 하시려면 링크를 클릭하여주세요.", - "emails.magicSession.footer": "이 이메일 계정으로 로그인 신청을 하지 않으셨다면 이 메세지를 무시하여주세요.", "emails.magicSession.thanks": "감사합니다、", "emails.magicSession.signature": "{{project}} 팀", "emails.recovery.subject": "비밀번호 재설정", @@ -20,12 +19,14 @@ "emails.recovery.body": "{{project}}의 비밀번호 재설정을 위해 링크를 클릭하여주세요.", "emails.recovery.footer": "비밀번호 재설정 신청을 하지 않으셨다면 이 메세지를 무시하여주세요.", "emails.recovery.thanks": "감사합니다、", + "emails.recovery.buttonText": "비밀번호 재설정", "emails.recovery.signature": "{{project}} 팀", - "emails.invitation.subject": "초대장 %s 팀 - %s", + "emails.invitation.subject": "초대장 {{team}} 팀 - {{project}}", "emails.invitation.hello": "안녕하세요、", "emails.invitation.body": "{{owner}}님이 귀하를 {{project}}의 {{team}} 팀으로 초대합니다.", "emails.invitation.footer": "팀에 합류할 의사가 없으시면 이 메세지를 무시하여주세요.", "emails.invitation.thanks": "감사합니다、", + "emails.invitation.buttonText": "{{team}} 초대를 수락하기", "emails.invitation.signature": "{{project}} 팀", "locale.country.unknown": "알려지지 않은", "countries.af": "아프가니스탄", diff --git a/app/config/locale/translations/la.json b/app/config/locale/translations/la.json index bebef26854..242e563c8c 100644 --- a/app/config/locale/translations/la.json +++ b/app/config/locale/translations/la.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Ars sapiendi est ars sciendi quid negligat.\"", "settings.locale": "la", "settings.direction": "ltr*", - "emails.sender": "%s team", + "emails.sender": "{{project}} team", "emails.verification.subject": "Ratio comprobatio", "emails.verification.hello": "Salve ibi {{user}},", "emails.verification.body": "Sequere hanc nexum ut quin inscriptionem tuum.", "emails.verification.footer": "Si verificationem huius inscriptionis non postulasti, nuntium hunc ignorare potes.", "emails.verification.thanks": "Gratias,", + "emails.verification.buttonText": "Confirma inscriptionem electronicam", "emails.verification.signature": "{{project}} Team", "emails.magicSession.subject": "Log in", "emails.magicSession.hello": "Salve ibi,", - "emails.magicSession.body": "Hanc nexum cum login", - "emails.magicSession.footer": "Si verificationem huius inscriptionis non postulasti, nuntium hunc ignorare potes.", "emails.magicSession.thanks": "Gratias,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Recuperet password", @@ -20,12 +19,14 @@ "emails.recovery.body": "Sequere hanc conjunctionem ut recipias project password {{project}}", "emails.recovery.footer": "Si tesseram tuam recuperare non petis, nuntium hunc ignorare potes", "emails.recovery.thanks": "Gratias,", + "emails.recovery.buttonText": "Reset password", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Invitatio pro %s in quadrigis %s", + "emails.invitation.subject": "Invitatio pro {{team}} in quadrigis {{project}}", "emails.invitation.hello": "Salve ibi,", "emails.invitation.body": "Haec inscriptio ad te missa est quia dominus incepto {{owner}} te invitare vult ut membrum {{team}} quadrigis fias ad {{project}}", "emails.invitation.footer": "Si non quaero, potes hunc nuntium ignorare", "emails.invitation.thanks": "Gratias,", + "emails.invitation.buttonText": "Accipe invitare ad {{team}}", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ignotum", "countries.af": "Afghanistan", @@ -244,7 +245,7 @@ "emails.otpSession.securityPhrase": "Sententia securitatis huius epistulae est {{phrase}}. Epistulae confidere potes si haec sententia cum ea quae ostensa est in signo ingressus convenit.", "emails.otpSession.thanks": "Gratias,", "emails.otpSession.signature": "{{project}} team -> {{project}} grex", - "emails.certificate.subject": "Defectio testimonii pro %s", + "emails.certificate.subject": "Defectio testimonii pro {{domain}}", "emails.certificate.hello": "Salve,", "emails.certificate.body": "Certificatum pro dominio tuo '{{domain}}' generari non potuit. Hoc conatus num. {{attempt}} est, et defectus causatus est ab: {{error}}", "emails.certificate.footer": "Praeclarum tuum testificationem valet ad XXX dies a primo defectu. Magnopere suademus ut hoc casum investiges, alioquin dominium tuum sine valida SSL communicatione erit.", diff --git a/app/config/locale/translations/lb.json b/app/config/locale/translations/lb.json index 91b52e4a18..075c29ef11 100644 --- a/app/config/locale/translations/lb.json +++ b/app/config/locale/translations/lb.json @@ -2,17 +2,16 @@ "settings.inspire": "\"The art of being wise is the art of knowing what to overlook.\"", "settings.locale": "lb", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Kont Verifikatioun", "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Follegt dëse Link fir Är E -Mail Adress z'iwwerpréiwen.", "emails.verification.footer": "Wann Dir net gefrot hutt dës Adress z'iwwerpréiwen, kënnt Dir dëse Message ignoréieren.", "emails.verification.thanks": "Merci,", + "emails.verification.buttonText": "E-Mail-Adress bestätegen", "emails.verification.signature": "{{project}} équipe", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Hey,", - "emails.magicSession.body": "Follegt dëse Link fir umellen.", - "emails.magicSession.footer": "Wann Dir net gefrot hutt Iech mat dëser E -Mail anzemelden, kënnt Dir dëse Message ignoréieren.", "emails.magicSession.thanks": "Merci,", "emails.magicSession.signature": "{{project}} équipe", "emails.recovery.subject": "Password Reset", @@ -20,12 +19,14 @@ "emails.recovery.body": "Follegt dëse Link fir Äert {{project}} Passwuert zréckzesetzen.", "emails.recovery.footer": "Wann Dir net gefrot hutt Äert Passwuert zréckzesetzen, kënnt Dir dëse Message ignoréieren.", "emails.recovery.thanks": "Merci,", + "emails.recovery.buttonText": "Passwuert zrécksetzen", "emails.recovery.signature": "{{project}} équipe", - "emails.invitation.subject": "Invitatioun un %s équipe bei %s", + "emails.invitation.subject": "Invitatioun un {{team}} équipe bei {{project}}", "emails.invitation.hello": "Hallo,", "emails.invitation.body": "Dës E -Mail gouf un Iech geschéckt well {{owner}} Iech invitéiere wëllt fir Member vum {{team}} Team bei {{project}} ze ginn.", "emails.invitation.footer": "Wann Dir net interesséiert sidd, kënnt Dir dëse Message ignoréieren.", "emails.invitation.thanks": "Merci,", + "emails.invitation.buttonText": "Invitatioun bei {{team}} akzeptéieren", "emails.invitation.signature": "{{project}} équipe", "locale.country.unknown": "Onbekannt", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/lt.json b/app/config/locale/translations/lt.json index 94c874ce82..3e32658947 100644 --- a/app/config/locale/translations/lt.json +++ b/app/config/locale/translations/lt.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Menas būti išmintingu — tai menas žinoti, ko galima nepamatyti.\"", "settings.locale": "lt", "settings.direction": "ltr", - "emails.sender": "%s komanda", + "emails.sender": "{{project}} komanda", "emails.verification.subject": "Paskyros Patvirtinimas", "emails.verification.hello": "Labas {{user}},", "emails.verification.body": "Spauskite šią nuorodą, kad patvirtintumėte savo el. paštą.", "emails.verification.footer": "Jei neprašėte patvirtinti šio el. pašto, galite ignoruoti šį pranešimą.", "emails.verification.thanks": "Ačiū,", + "emails.verification.buttonText": "Patvirtinti el. pašto adresą", "emails.verification.signature": "{{project}} komanda", "emails.magicSession.subject": "Prisijungti", "emails.magicSession.hello": "Labas,", - "emails.magicSession.body": "Spauskite šią nuorodą, kad prisijungtumėte.", - "emails.magicSession.footer": "Jei neprašėte prisijungti naudojantis šiuo el. paštu, galite ignoruoti šį pranešimą.", "emails.magicSession.thanks": "Ačiū,", "emails.magicSession.signature": "{{project}} komanda", "emails.recovery.subject": "Slaptažodžio Atkūrimas", @@ -20,12 +19,14 @@ "emails.recovery.body": "Spauskite šią nuorodą, kad atkurtumėte projekto {{project}} slaptažodį.", "emails.recovery.footer": "Jei neprašėte atkurti savo slaptažodzio, galite ignoruoti šį pranešimą.", "emails.recovery.thanks": "Ačiū,", + "emails.recovery.buttonText": "Atstatyti slaptažodį", "emails.recovery.signature": "{{project}} komanda", - "emails.invitation.subject": "Pakvietimas į %s komandą %s projekte", + "emails.invitation.subject": "Pakvietimas į {{team}} komandą {{project}} projekte", "emails.invitation.hello": "Labas,", "emails.invitation.body": "Šis el. laiškas buvo atsiųstas jums, nes {{owner}} norėjo jus pakviesti tapti projekto {{project}} dalimi {{team}} komandoje.", "emails.invitation.footer": "Jei jūsų tai nedomina, galite ignoruoti šį pranešimą.", "emails.invitation.thanks": "Ačiū,", + "emails.invitation.buttonText": "Priimti kvietimą į {{team}}", "emails.invitation.signature": "{{project}} komanda", "locale.country.unknown": "Nežinoma", "countries.af": "Afganistanas", diff --git a/app/config/locale/translations/lv.json b/app/config/locale/translations/lv.json index b4a396367c..9083fd3fc4 100644 --- a/app/config/locale/translations/lv.json +++ b/app/config/locale/translations/lv.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Māksla būt gudram ir māksla zināt, ko aizmirst.\"", "settings.locale": "lv", "settings.direction": "ltr", - "emails.sender": "%s komanda", + "emails.sender": "{{project}} komanda", "emails.verification.subject": "Konta verifikācija", "emails.verification.hello": "Sveicināti, {{user}},", "emails.verification.body": "Sekojiet saitei, lai apstiprinātu savu e-pasta adresi.", "emails.verification.footer": "Ja Jūs nepieprasījāt šīs adreses apstiprinājumu, lūdzu, ignorējiet šo ziņu.", "emails.verification.thanks": "Paldies,", + "emails.verification.buttonText": "Apstiprināt e-pasta adresi", "emails.verification.signature": "{{project}} komanda", "emails.magicSession.subject": "Ieiet", "emails.magicSession.hello": "Sveicināti,", - "emails.magicSession.body": "Sekojiet saitei, lai ieietu.", - "emails.magicSession.footer": "Ja Jūs nepieprasījāt ieiet ar šo e-pasta adresi, lūdzu, ignorējiet šo ziņu.", "emails.magicSession.thanks": "Paldies,", "emails.magicSession.signature": "{{project}} komanda", "emails.recovery.subject": "Paroles atjaunināšana", @@ -20,12 +19,14 @@ "emails.recovery.body": "Sekojiet saitei, lai atjauninātu {{project}} paroli.", "emails.recovery.footer": "Ja Jūs nepieprasījāt paroles atjaunināšanu, lūdzu, ignorējiet šo ziņu.", "emails.recovery.thanks": "Paldies,", + "emails.recovery.buttonText": "Atiestatīt paroli", "emails.recovery.signature": "{{project}} komanda", - "emails.invitation.subject": "Ielūgums piebiedroties %s komandai %s projektā.", + "emails.invitation.subject": "Ielūgums piebiedroties {{team}} komandai {{project}} projektā.", "emails.invitation.hello": "Labdien,", "emails.invitation.body": "Šis e-pasts tika nosūtīts Jums, jo {{owner}} vēlējās Jūs ielūgt kļūt par {{team}} komandas biedru {{project}} projektā.", "emails.invitation.footer": "Ja Jūs neesat ieinteresēts, lūdzu, ignorējiet šo ziņu.", "emails.invitation.thanks": "Paldies,", + "emails.invitation.buttonText": "Pieņemt ielūgumu uz {{team}}", "emails.invitation.signature": "{{project}} komanda", "locale.country.unknown": "Nav zināms", "countries.af": "Afganistāna", diff --git a/app/config/locale/translations/ml.json b/app/config/locale/translations/ml.json index 1b57d87865..064df28413 100644 --- a/app/config/locale/translations/ml.json +++ b/app/config/locale/translations/ml.json @@ -2,17 +2,16 @@ "settings.inspire": "\"എന്താണ് അവഗണിക്കേണ്ടതെന്ന് അറിയാനുള്ള കലയാണ് ബുദ്ധിമാനായിരിക്കുക എന്നത്.\"", "settings.locale": "ml", "settings.direction": "ltr", - "emails.sender": "%s ടീം", + "emails.sender": "{{project}} ടീം", "emails.verification.subject": "അക്കൗണ്ട് സ്ഥിരീകരണം", "emails.verification.hello": "നമസ്കാരം {{user}},", "emails.verification.body": "നിങ്ങളുടെ ഇമെയിൽ വിലാസം സ്ഥിരീകരിക്കുന്നതിനായി ഈ ലിങ്ക് പിന്തുടരുക.", "emails.verification.footer": "ഈ വിലാസം സ്ഥിരീകരിക്കാന്‍ നിങ്ങൾ ആവശ്യപ്പെട്ടില്ലെങ്കിൽ, നിങ്ങൾക്ക് ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", "emails.verification.thanks": "നന്ദി,", + "emails.verification.buttonText": "ഇമെയിൽ വിലാസം സ്ഥിരീകരിക്കുക", "emails.verification.signature": "{{project}} ടീം", "emails.magicSession.subject": "ലോഗിൻ", "emails.magicSession.hello": "നമസ്കാരം,", - "emails.magicSession.body": "ലോഗിൻ ചെയ്യുന്നതിനായി ഈ ലിങ്ക് പിന്തുടരുക.", - "emails.magicSession.footer": "ഈ ഇമെയിൽ ഉപയോഗിച്ച് ലോഗിൻ ചെയ്യാൻ നിങ്ങൾ ആവശ്യപ്പെട്ടില്ലെങ്കിൽ, ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", "emails.magicSession.thanks": "നന്ദി,", "emails.magicSession.signature": "{{project}} ടീം", "emails.recovery.subject": "രഹസ്യവാക്ക് പുനക്രമീകരണം", @@ -20,12 +19,14 @@ "emails.recovery.body": "നിങ്ങളുടെ {{Project}} രഹസ്യവാക്ക് പുനക്രമീകരിക്കുന്നതിന് ഈ ലിങ്ക് പിന്തുടരുക.", "emails.recovery.footer": "നിങ്ങളുടെ രഹസ്യവാക്ക് പുനക്രമീകരിക്കാന്‍ നിങ്ങൾ ആവശ്യപ്പെട്ടില്ലെങ്കിൽ, ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", "emails.recovery.thanks": "നന്ദി,", + "emails.recovery.buttonText": "പാസ്‌വേഡ് റീസെറ്റ് ചെയ്യുക", "emails.recovery.signature": "{{project}} ടീം", - "emails.invitation.subject": "%s -ലെ %s ടീമിലേക്കുള്ള ക്ഷണം", + "emails.invitation.subject": "{{project}} -ലെ {{team}} ടീമിലേക്കുള്ള ക്ഷണം", "emails.invitation.hello": "നമസ്കാരം,", "emails.invitation.body": "നിങ്ങളെ {{project}} -ലെ {{team}} ടീമിലെ അംഗമാകുവാന്‍ ക്ഷണിക്കാൻ {{owner}} ആഗ്രഹിക്കുന്നതിനാലാണ് ഈ മെയിൽ നിങ്ങൾക്ക് അയക്കുന്നത്.", "emails.invitation.footer": "നിങ്ങൾക്ക് താൽപ്പര്യമില്ലെങ്കിൽ, ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", "emails.invitation.thanks": "നന്ദി,", + "emails.invitation.buttonText": "{{team}} ലേക്കുള്ള ക്ഷണം സ്വീകരിക്കുക", "emails.invitation.signature": "{{project}} ടീം", "locale.country.unknown": "Unknown", "countries.af": "അഫ്ഗാനിസ്ഥാൻ", @@ -244,7 +245,7 @@ "emails.otpSession.securityPhrase": "ഈ ഇമെയിലിന്റെ സുരക്ഷാ വാചകം {{phrase}} ആണ്. സൈൻ ഇൻ ചെയ്യുമ്പോൾ കാണിച്ച വാചകവുമായി ഈ വാചകം പൊരുത്തപ്പെടുന്നുണ്ടെങ്കിൽ ഈ ഇമെയിലിന് വിശ്വസിക്കാം.", "emails.otpSession.thanks": "നന്ദി,", "emails.otpSession.signature": "പ്രോജക്ട് ടീം", - "emails.certificate.subject": "%s ന് സർട്ടിഫിക്കറ്റ് പരാജയപ്പെട്ടു", + "emails.certificate.subject": "{{domain}} ന് സർട്ടിഫിക്കറ്റ് പരാജയപ്പെട്ടു", "emails.certificate.hello": "ഹലോ,", "emails.certificate.body": "നിങ്ങളുടെ ഡൊമൈൻ '{{domain}}'നു വേണ്ടിയുള്ള സർട്ടിഫിക്കറ്റ് ഉണ്ടാക്കാനായില്ല. ഇത് ശ്രമം നമ്പർ {{attempt}} ആണ്, പരാജയപ്പെട്ടത് ഇതു മൂലമാണ്: {{error}}", "emails.certificate.footer": "നിങ്ങളുടെ മുൻപത്തെ സർട്ടിഫിക്കറ്റ് ആദ്യ പരാജയത്തിനു ശേഷം 30 ദിവസം വരെ സാധുവായിരിക്കും. ഈ കേസ് അന്വേഷിച്ചു നോക്കുന്നത് ഞങ്ങൾ ശക്തമായി ശുപാർശ ചെയ്യുന്നു, അല്ലെങ്കിൽ നിങ്ങളുടെ ഡൊമെയ്‌ൻ സാധുവായ SSL കമ്മ്യൂണിക്കേഷനില്ലാത്ത ഒരു അവസ്ഥയിലാകും.", diff --git a/app/config/locale/translations/mr.json b/app/config/locale/translations/mr.json index 6550d1c1ba..533d0ec92c 100644 --- a/app/config/locale/translations/mr.json +++ b/app/config/locale/translations/mr.json @@ -2,17 +2,16 @@ "settings.inspire": "\"हुशार असण्याची कला म्हणजे कोणत्या गोष्टीकडे दुर्लक्ष करावे हे जाणून घेण्याची कला.\"", "settings.locale": "mr", "settings.direction": "ltr", - "emails.sender": "%s टीम", + "emails.sender": "{{project}} टीम", "emails.verification.subject": "खाते सत्यापन", "emails.verification.hello": "नमस्कार {{user}},", "emails.verification.body": "आपला ईमेल पत्ता सत्यापित करण्यासाठी या दुव्याचे अनुसरण करा.", "emails.verification.footer": "आपण या पत्त्याची पडताळणी करण्यास सांगितले नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", "emails.verification.thanks": "धन्यवाद,", + "emails.verification.buttonText": "ईमेल पत्ता सत्यापित करा", "emails.verification.signature": "{{project}} संघ", "emails.magicSession.subject": "लॉगिन करा", "emails.magicSession.hello": "नमस्कार ,", - "emails.magicSession.body": "लॉगिन करण्यासाठी या लिंकचे अनुसरण करा.", - "emails.magicSession.footer": "आपण या ईमेलचा वापर करून लॉगिन करण्यास सांगितले नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", "emails.magicSession.thanks": "धन्यवाद,", "emails.magicSession.signature": "{{project}} संघ", "emails.recovery.subject": "पासवर्ड रीसेट", @@ -20,12 +19,14 @@ "emails.recovery.body": "आपला {{project}}चे पासवर्ड रीसेट करण्यासाठी या लिंकचे अनुसरण करा", "emails.recovery.footer": "आपण आपला पासवर्ड रीसेट करण्यास सांगितले नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", "emails.recovery.thanks": "धन्यवाद,", + "emails.recovery.buttonText": "पासवर्ड रीसेट करा", "emails.recovery.signature": "{{project}} संघ", - "emails.invitation.subject": "%s संघ %s येथे सामील होण्यासाठी आमंत्रण", + "emails.invitation.subject": "{{team}} संघ {{project}} येथे सामील होण्यासाठी आमंत्रण", "emails.invitation.hello": "नमस्कार,", "emails.invitation.body": "हा मेल तुम्हाला पाठवला होता कारण {{owner}} तुम्हाला {{project}} येथे {{team}} टीमचे सदस्य होण्यासाठी आमंत्रित करू इच्छित होते.", "emails.invitation.footer": "आपल्याला स्वारस्य नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", "emails.invitation.thanks": "धन्यवाद,", + "emails.invitation.buttonText": "{{team}} साठी आमंत्रण स्वीकारा", "emails.invitation.signature": "{{project}} संघ", "locale.country.unknown": "अज्ञात", "countries.af": "अफगानिस्तान", diff --git a/app/config/locale/translations/ms.json b/app/config/locale/translations/ms.json index a02c36b075..c19fa48f52 100644 --- a/app/config/locale/translations/ms.json +++ b/app/config/locale/translations/ms.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Seni menjadi pandai adalah seni mengetahui apa yang dilihatnya.\"", "settings.locale": "ms", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Pengesahan Akaun", "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Tekan pautan ini untuk mengesahkan alamat email anda.", "emails.verification.footer": "Sekiranya anda tidak membuat permintaan untuk mengesahkan email ini, sila abaikan mesej ini.", "emails.verification.thanks": "Terima kasih,", + "emails.verification.buttonText": "Sahkan alamat email", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Log masuk", "emails.magicSession.hello": "Hey,", - "emails.magicSession.body": "Tekan pautan ini untuk log masuk.", - "emails.magicSession.footer": "Sekiranya anda tidak membuat permintaan untuk log masuk menggunakan email ini, sila abaikan mesej ini.", "emails.magicSession.thanks": "Terima kasih,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Menetap semula Kata Laluan", @@ -20,12 +19,14 @@ "emails.recovery.body": "Tekan pautan ini untuk menetapkan semula kata laluan {{project}}.", "emails.recovery.footer": "Sekiranya anda tidak membuat permintaan menetap semula kata laluan, sila abaikan mesej ini.", "emails.recovery.thanks": "Terima kasih,", + "emails.recovery.buttonText": "Tetapkan semula kata laluan", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Jemputan ke pasukan %s di %s", + "emails.invitation.subject": "Jemputan ke pasukan {{team}} di {{project}}", "emails.invitation.hello": "Hello,", "emails.invitation.body": "Anda menerima mel ini kerana {{owner}} ingin menjemput anda untuk menjadi ahli pasukan {{team}} di {{project}}.", "emails.invitation.footer": "Sekiranya anda tidak berminat, sila abaikan mesej ini.", "emails.invitation.thanks": "Terima kasih,", + "emails.invitation.buttonText": "Terima jemputan ke {{team}}", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Tidak Diketahui", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/nb.json b/app/config/locale/translations/nb.json index daf18abc1c..3236f267b8 100644 --- a/app/config/locale/translations/nb.json +++ b/app/config/locale/translations/nb.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Kunsten å være klok er kunsten å vite hva man skal overse.\"", "settings.locale": "nb", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Kontobekreftelse", "emails.verification.hello": "Hei {{user}},", "emails.verification.body": "Følg denne lenken for å bekrefte din e-postadresse.", "emails.verification.footer": "Dersom du ikke ba om å bekrefte e-postadressen, kan du se bort fra denne meldingen.", "emails.verification.thanks": "Takk,", + "emails.verification.buttonText": "Bekreft e-postadresse", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Pålogging", "emails.magicSession.hello": "Hei,", - "emails.magicSession.body": "Følg denne lenken for å logge på.", - "emails.magicSession.footer": "Dersom du ikke ba om å logge på med denne e-postadressen, kan du se bort fra denne meldingen.", "emails.magicSession.thanks": "Takk,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Nullstille passord", @@ -20,12 +19,14 @@ "emails.recovery.body": "Følg denne lenken for å nullstille ditt {{project}} passord.", "emails.recovery.footer": "Dersom du ikke ba om å nullstille passordet ditt, kan du se bort fra denne meldingen.", "emails.recovery.thanks": "Takk,", + "emails.recovery.buttonText": "Tilbakestill passord", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Invitasjon til %s Team ved %s", + "emails.invitation.subject": "Invitasjon til {{team}} Team ved {{project}}", "emails.invitation.hello": "Hei,", "emails.invitation.body": "Denne meldingen ble sendt til deg fordi {{owner}} ønsket å invitere deg til å bli medlem av {{team}} team ved {{project}}.", "emails.invitation.footer": "Dersom du ikke er interessert, kan du se bort fra denne meldingen.", "emails.invitation.thanks": "Takk,", + "emails.invitation.buttonText": "Godta invitasjon til {{team}}", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ukjent", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ne.json b/app/config/locale/translations/ne.json index 4f05a9b5ba..b8dd495814 100644 --- a/app/config/locale/translations/ne.json +++ b/app/config/locale/translations/ne.json @@ -2,17 +2,16 @@ "settings.inspire": "\"के लाई बेवास्ता गर्ने भन्ने जान्नुनै बुद्धिमान हुनुको कला हो ।\"", "settings.locale": "ne", "settings.direction": "ltr", - "emails.sender": "%s समूह", + "emails.sender": "{{project}} समूह", "emails.verification.subject": "खाता प्रमाणिकरण", "emails.verification.hello": "नमस्ते {{user}},", "emails.verification.body": "इमेल ठेगाना प्रमाणित गर्नको लागी यो लिंकमा जानुहोस।", "emails.verification.footer": "यदि तपाइँले आफ्नो खाता प्रमाणित गर्न सोध्नु भएको छैन भने तपाइँले यो सन्देश लाई बेवास्ता गर्न सक्नुहुन्छ।", "emails.verification.thanks": "धन्यवाद,", + "emails.verification.buttonText": "इमेल ठेगाना पुष्टि गर्नुहोस्", "emails.verification.signature": "{{project}} समूह", "emails.magicSession.subject": "लगइन", "emails.magicSession.hello": "नमस्ते,", - "emails.magicSession.body": "लगइन गर्नको लागी यो लिंकमा जानुहोस।", - "emails.magicSession.footer": "यदि तपाइँले यो इमेल प्रयोग गरेर लगइन गर्न सोध्नु भएको छैन भने तपाइँले यो सन्देश लाई बेवास्ता गर्न सक्नुहुन्छ।", "emails.magicSession.thanks": "धन्यवाद,", "emails.magicSession.signature": "{{project}} समूह", "emails.recovery.subject": "पासवर्ड रिसेट", @@ -20,12 +19,14 @@ "emails.recovery.body": "{{project}}को पासवर्ड रिसेट गर्नको लागी यो लिंकमा जानुहोस।", "emails.recovery.footer": "यदि तपाइँले आफ्नो पासवर्ड रिसेट गर्न सोध्नु भएको छैन भने तपाइँले यो सन्देश लाई बेवास्ता गर्न सक्नुहुन्छ।", "emails.recovery.thanks": "धन्यवाद,", + "emails.recovery.buttonText": "रिसेट पासवर्ड", "emails.recovery.signature": "{{project}} समूह", - "emails.invitation.subject": "%s समूहको लागि %s मा निमन्त्रणा", + "emails.invitation.subject": "{{team}} समूहको लागि {{project}} मा निमन्त्रणा", "emails.invitation.hello": "नमस्ते,", "emails.invitation.body": "{{owner}}ले तपाइँलाई {{project}}मा {{team}}को सदस्य बन्न आमन्त्रित गर्न चाहनु भएको छ। त्येसैले तपाइँलाई यो सन्देश पठाइएको हो।", "emails.invitation.footer": "यदि तपाइँ इच्छुक हुनुहुन्न भने, तपाइँले यो सन्देशलाई बेवास्ता गर्न सक्नुहुन्छ।", "emails.invitation.thanks": "धन्यवाद,", + "emails.invitation.buttonText": "{{team}} मा निमन्त्रणा स्वीकार गर्नुहोस्", "emails.invitation.signature": "{{project}} समूह", "locale.country.unknown": "अज्ञात", "countries.af": "अफगानिस्तान", diff --git a/app/config/locale/translations/nl.json b/app/config/locale/translations/nl.json index cae82a9a37..9b051b6dc6 100644 --- a/app/config/locale/translations/nl.json +++ b/app/config/locale/translations/nl.json @@ -2,17 +2,16 @@ "settings.inspire": "\"De kunst om wijs te zijn is de kunst om te weten wat over het hoofd gezien moet worden.\"", "settings.locale": "nl", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Account Verificatie", "emails.verification.hello": "Hoi {{user}},", "emails.verification.body": "Volg deze link om uw e-mail te verifieren", "emails.verification.footer": "Als u geen aanvraag voor verificatie heeft gemaakt, kan u deze mail negeren", "emails.verification.thanks": "Bedankt,", + "emails.verification.buttonText": "Bevestig e-mailadres", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Hoi,", - "emails.magicSession.body": "Volg deze link om in te loggen", - "emails.magicSession.footer": "Als u geen aanvraag heeft gemaakt om met deze mail in te loggen, kan u deze mail negeren", "emails.magicSession.thanks": "Bedankt,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Wachtwoord Herinstellen", @@ -20,12 +19,14 @@ "emails.recovery.body": "Volg deze link om het wachtwoord van uw project {{project}} te wijzigen", "emails.recovery.footer": "Als u geen aanvraag heeft gemaakt om uw wachtwoord te wijzigen, kan u deze mail negeren", "emails.recovery.thanks": "Bedankt,", + "emails.recovery.buttonText": "Wachtwoord opnieuw instellen", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Uitnodiging van %s Team uit %s", + "emails.invitation.subject": "Uitnodiging van {{team}} Team uit {{project}}", "emails.invitation.hello": "Hallo,", "emails.invitation.body": "U ontvangt deze mail want u was uitgenodig door {{owner}} om lid van het {{team}} team te worden in {{project}} ", "emails.invitation.footer": "Als u niet geintereseerd bent, kan u deze mail negeren.", "emails.invitation.thanks": "Bedankt,", + "emails.invitation.buttonText": "Uitnodiging voor {{team}} accepteren", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Onbekend", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/nn.json b/app/config/locale/translations/nn.json index 44be0f9845..9fc77a7faa 100644 --- a/app/config/locale/translations/nn.json +++ b/app/config/locale/translations/nn.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Kunsten å væra klok er kunsten å vita kva man skal oversjå.\"", "settings.locale": "nn", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Kontostadfesting", "emails.verification.hello": "Hallo {{user}},", "emails.verification.body": "Følg denne lenkja for å bekrefta din e-postadresse.", "emails.verification.footer": "Om du ikkje bad om å bekrefta e-postadressa, kan du ignorera denne meldinga.", "emails.verification.thanks": "Takk,", + "emails.verification.buttonText": "Stadfest e-postadresse", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Pålogging", "emails.magicSession.hello": "Hei,", - "emails.magicSession.body": "Følg denne lenkja for å logge på.", - "emails.magicSession.footer": "Om du ikkje ba om å logge på med denne e-postadressa, kan du ignorera denne meldinga.", "emails.magicSession.thanks": "Takk,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Nullstilla passord", @@ -20,12 +19,14 @@ "emails.recovery.body": "Følg denne lenkja for å nullstilla ditt {{project}} passord.", "emails.recovery.footer": "Om du ikkje ba om å nullstilla passordet ditt, kan du ignorera denne meldinga.", "emails.recovery.thanks": "Takk,", + "emails.recovery.buttonText": "Nullstill passord", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Innbyding til %s Team ved %s", + "emails.invitation.subject": "Innbyding til {{team}} Team ved {{project}}", "emails.invitation.hello": "Hallo,", "emails.invitation.body": "Denne meldinga ble sendt til deg fordi {{owner}} ynskja å invitera deg til å bli medlem av {{team}} team i {{project}}.", "emails.invitation.footer": "Om du ikkje er interessert, kan du ignorera denne meldinga.", "emails.invitation.thanks": "Takk,", + "emails.invitation.buttonText": "Godta invitasjon til {{team}}", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ukjend", "countries.af": "Afghanistan", @@ -244,7 +245,7 @@ "emails.otpSession.securityPhrase": "Tryggingsfrasen for denne e-posten er {{phrase}}. Du kan stole på denne e-posten om frasen stemmer med frasen vist under pålogging.", "emails.otpSession.thanks": "Takk,", "emails.otpSession.signature": "{{project}}-laget", - "emails.certificate.subject": "Sertifikatfeil for %s", + "emails.certificate.subject": "Sertifikatfeil for {{domain}}", "emails.certificate.hello": "Hei,", "emails.certificate.body": "Sertifikatet for domenet ditt '{{domain}}' kunne ikkje opprettast. Dette er forsøk nr. {{attempt}}, og feilen blei forårsaka av: {{error}}", "emails.certificate.footer": "Førre sertifikatet ditt vil vere gyldig i 30 dagar sidan den første feilen. Vi rår sterkt til at du undersøkjer denne saka, elles vil domenet ditt ende opp utan gyldig SSL-kommunikasjon.", diff --git a/app/config/locale/translations/or.json b/app/config/locale/translations/or.json index efd516f23a..73f47881c0 100644 --- a/app/config/locale/translations/or.json +++ b/app/config/locale/translations/or.json @@ -2,17 +2,16 @@ "settings.inspire": "\"ବୁଦ୍ଧିମାନ ହେବାର କଳା ହେଉଛି କ’ଣ ଅଣଦେଖା କରାଯିବ ଜାଣିବାର କଳା |\"", "settings.locale": "or", "settings.direction": "ltr", - "emails.sender": "%s ଦଳ", + "emails.sender": "{{project}} ଦଳ", "emails.verification.subject": "ଖାତା ଯାଞ୍ଚ", "emails.verification.hello": "ନମସ୍କାର {{user}},", "emails.verification.body": "ଆପଣଙ୍କର ଇମେଲ୍ ଠିକଣା ଯାଞ୍ଚ କରିବାକୁ ଏହି ଲିଙ୍କ୍ ଅନୁସରଣ କରନ୍ତୁ |", "emails.verification.footer": "ଯଦି ଆପଣ ଏହି ଠିକଣା ଯାଞ୍ଚ କରିବାକୁ କହି ନାହାଁନ୍ତି, ତେବେ ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଉପେକ୍ଷା କରିପାରିବେ |", "emails.verification.thanks": "ଧନ୍ୟବାଦ,", + "emails.verification.buttonText": "ଇମେଲ ଠିକଣା ନିଶ୍ଚିତ କରନ୍ତୁ", "emails.verification.signature": "{{project}} ଦଳ", "emails.magicSession.subject": "ଲଗଇନ୍ କରନ୍ତୁ", "emails.magicSession.hello": "ନମସ୍କାର,", - "emails.magicSession.body": "ଲଗଇନ୍ କରିବାକୁ ଏହି ଲିଙ୍କ୍ ଅନୁସରଣ କରନ୍ତୁ |", - "emails.magicSession.footer": "ଯଦି ଆପଣ ଏହି ଇମେଲ୍ ବ୍ୟବହାର କରି ଲଗଇନ୍ କରିବାକୁ କହି ନାହାଁନ୍ତି, ତେବେ ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଉପେକ୍ଷା କରିପାରିବେ |", "emails.magicSession.thanks": "ଧନ୍ୟବାଦ,", "emails.magicSession.signature": "{{project}} ଦଳ", "emails.recovery.subject": "ପାସୱାର୍ଡ ପୁନଃ ସେଟ୍ କରନ୍ତୁ |", @@ -20,12 +19,14 @@ "emails.recovery.body": "ଆପଣଙ୍କର {{project}} ପାସୱାର୍ଡ ପୁନଃ ସେଟ୍ କରିବାକୁ ଏହି ଲିଙ୍କକୁ ଅନୁସରଣ କରନ୍ତୁ |", "emails.recovery.footer": "ଯଦି ଆପଣ ଆପଣଙ୍କର ପାସୱାର୍ଡ ପୁନଃ ସେଟ୍ କରିବାକୁ କହି ନାହାଁନ୍ତି, ତେବେ ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଉପେକ୍ଷା କରିପାରିବେ |", "emails.recovery.thanks": "ଧନ୍ୟବାଦ,", + "emails.recovery.buttonText": "ପାସୱାର୍ଡ ପୁନଃସେଟ୍ କରନ୍ତୁ", "emails.recovery.signature": "{{project}} ଦଳ", - "emails.invitation.subject": "%s ରେ %s ଦଳକୁ ନିମନ୍ତ୍ରଣ |", + "emails.invitation.subject": "{{team}} ରେ {{project}} ଦଳକୁ ନିମନ୍ତ୍ରଣ |", "emails.invitation.hello": "ନମସ୍କାର,", - "emails.invitation.body": "ଏହି ମେଲ୍ ଆପଣଙ୍କୁ ପଠାଯାଇଥିଲା କାରଣ {{owner}} ଆପଣଙ୍କୁ {{project} ରେ {{team}} ଦଳର ସଦସ୍ୟ ହେବାକୁ ଆମନ୍ତ୍ରଣ କରିବାକୁ ଚାହୁଁଥିଲେ |", + "emails.invitation.body": "ଏହି ମେଲ୍ ଆପଣଙ୍କୁ ପଠାଯାଇଥିଲା କାରଣ {{owner}} ଆପଣଙ୍କୁ {{project}} ରେ {{team}} ଦଳର ସଦସ୍ୟ ହେବାକୁ ଆମନ୍ତ୍ରଣ କରିବାକୁ ଚାହୁଁଥିଲେ |", "emails.invitation.footer": "ଯଦି ଆପଣ ଆଗ୍ରହୀ ନୁହଁନ୍ତି, ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଅଣଦେଖା କରିପାରିବେ |", "emails.invitation.thanks": "ଧନ୍ୟବାଦ,", + "emails.invitation.buttonText": "{{team}} ପାଇଁ ଆମନ୍ତ୍ରଣ ଗ୍ରହଣ କରନ୍ତୁ", "emails.invitation.signature": "{{project}} ଦଳ", "locale.country.unknown": "ଅଜ୍ଞାତ", "countries.af": "ଆଫଗାନିସ୍ତାନ", diff --git a/app/config/locale/translations/pa.json b/app/config/locale/translations/pa.json index de71be9f49..48ff17c174 100644 --- a/app/config/locale/translations/pa.json +++ b/app/config/locale/translations/pa.json @@ -2,7 +2,7 @@ "settings.inspire": "\"ਬੁੱਧੀਮਾਨ ਬਣਨ ਦੀ ਕਲਾ ਇਹ ਜਾਣਨ ਦੀ ਕਲਾ ਹੈ ਕਿ ਕਿਸ ਨੂੰ ਨਜ਼ਰਅੰਦਾਜ਼ ਕਰਨਾ ਹੈ.\"", "settings.locale": "pa", "settings.direction": "ltr", - "emails.sender": "%s ਟੀਮ", + "emails.sender": "{{project}} ਟੀਮ", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", @@ -11,8 +11,6 @@ "emails.verification.signature": "", "emails.magicSession.subject": "", "emails.magicSession.hello": ",", - "emails.magicSession.body": "", - "emails.magicSession.footer": "", "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", diff --git a/app/config/locale/translations/pl.json b/app/config/locale/translations/pl.json index ee5811fb59..4ca95614a1 100644 --- a/app/config/locale/translations/pl.json +++ b/app/config/locale/translations/pl.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Sztuka bycia mądrym to sztuka wiedzieć, co przeoczyć.\"", "settings.locale": "pl", "settings.direction": "ltr", - "emails.sender": "Zespół %s", + "emails.sender": "Zespół {{project}}", "emails.verification.subject": "Weryfikacja konta", "emails.verification.hello": "Cześć {{user}},", "emails.verification.body": "Przejdź do tego linku, aby zweryfikować swój adres e-mail.", "emails.verification.footer": "Jeśli to nie Ty prosiłeś o zweryfikowanie tego adresu, zignoruj tę wiadomość.", "emails.verification.thanks": "Dziękujemy,", + "emails.verification.buttonText": "Potwierdź adres e-mail", "emails.verification.signature": "Zespół {{project}}", "emails.magicSession.subject": "Logowanie", "emails.magicSession.hello": "Cześć,", - "emails.magicSession.body": "Kliknij w ten link, aby zalogować się.", - "emails.magicSession.footer": "Jeśli to nie Ty prosiłeś o logowanie przy użyciu tego adresu e-mail, zignoruj tę wiadomość.", "emails.magicSession.thanks": "Dziękujemy,", "emails.magicSession.signature": "Zespół {{project}}", "emails.recovery.subject": "Resetowanie hasła", @@ -20,12 +19,14 @@ "emails.recovery.body": "Przejdź do tego linku, aby zresetować hasło dla {{project}}.", "emails.recovery.footer": "Jeśli to nie Ty prosiłeś o zresetowanie swojego hasła, zignoruj tę wiadomość.", "emails.recovery.thanks": "Dziękujemy,", + "emails.recovery.buttonText": "Zresetuj hasło", "emails.recovery.signature": "Zespół {{project}}", - "emails.invitation.subject": "Zaproszenie do zespołu %s w %s", + "emails.invitation.subject": "Zaproszenie do zespołu {{team}} w {{project}}", "emails.invitation.hello": "Cześć,", "emails.invitation.body": "Otrzymujesz tę wiadomość, ponieważ {{owner}} zaprasza Cię do grona członków zespołu {{team}} w projekcie {{project}}.", "emails.invitation.footer": "Jeśli nie jesteś zainteresowany, zignoruj tę wiadomość.", "emails.invitation.thanks": "Dziękujemy,", + "emails.invitation.buttonText": "Zaakceptuj zaproszenie do {{team}}", "emails.invitation.signature": "Zespół {{project}}", "locale.country.unknown": "Nieznany", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/pt-br.json b/app/config/locale/translations/pt-br.json index a53ca79813..617db1f857 100644 --- a/app/config/locale/translations/pt-br.json +++ b/app/config/locale/translations/pt-br.json @@ -2,17 +2,16 @@ "settings.inspire": "\"A arte de ser sábio é a arte de saber o que deixar passar.\"", "settings.locale": "pt-br", "settings.direction": "ltr", - "emails.sender": "Time %s", + "emails.sender": "Time {{project}}", "emails.verification.subject": "Verificação da Conta", "emails.verification.hello": "Olá {{user}},", "emails.verification.body": "Clique neste link para verificar o seu endereço de e-mail.", "emails.verification.footer": "Se você não solicitou a verificação deste e-mail, ignore essa mensagem.", "emails.verification.thanks": "Muito obrigado,", + "emails.verification.buttonText": "Confirmar endereço de e-mail", "emails.verification.signature": "Time {{project}}", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Olá,", - "emails.magicSession.body": "Clique neste link para entrar.", - "emails.magicSession.footer": "Se você não solicitou conectar-se com este e-mail, ignore essa mensagem.", "emails.magicSession.thanks": "Muito obrigado,", "emails.magicSession.signature": "Time {{project}}", "emails.recovery.subject": "Redefinição de senha", @@ -20,12 +19,14 @@ "emails.recovery.body": "Clique neste link para redefinir sua senha do {{project}}.", "emails.recovery.footer": "Se você não solicitou a redefinição da sua senha, você pode ignorar essa mensagem.", "emails.recovery.thanks": "Muito obrigado,", + "emails.recovery.buttonText": "Redefinir senha", "emails.recovery.signature": "Time {{project}}", - "emails.invitation.subject": "Convite para o Time %s em %s", + "emails.invitation.subject": "Convite para o Time {{team}} em {{project}}", "emails.invitation.hello": "Olá,", "emails.invitation.body": "Este e-mail foi enviado porque {{owner}} deseja convidar você a se tornar membro do Time {{team}} em {{project}}.", "emails.invitation.footer": "Caso não tenha interesse, ignore essa mensagem.", "emails.invitation.thanks": "Muito obrigado,", + "emails.invitation.buttonText": "Aceitar convite para {{team}}", "emails.invitation.signature": "Time {{project}}", "locale.country.unknown": "Desconhecido", "countries.af": "Afeganistão", diff --git a/app/config/locale/translations/pt-pt.json b/app/config/locale/translations/pt-pt.json index d85dca9300..66a58ed7ce 100644 --- a/app/config/locale/translations/pt-pt.json +++ b/app/config/locale/translations/pt-pt.json @@ -2,17 +2,16 @@ "settings.inspire": "\"A arte de ser sábio é a arte de saber o que ultrapassar.\"", "settings.locale": "pt-pt", "settings.direction": "ltr", - "emails.sender": "Equipa %s", + "emails.sender": "Equipa {{project}}", "emails.verification.subject": "Verificação de contas", "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Siga esta ligação para verificar o seu endereço de correio electrónico.", "emails.verification.footer": "Se não pediu para verificar este endereço, pode ignorar esta mensagem.", "emails.verification.thanks": "Obrigado,", + "emails.verification.buttonText": "Confirmar endereço de email", "emails.verification.signature": "Equipa {{project}}", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Olá ,", - "emails.magicSession.body": "Siga esta ligação para iniciar sessão.", - "emails.magicSession.footer": "Se não pediu para entrar usando este e-mail, pode ignorar esta mensagem.", "emails.magicSession.thanks": "Obrigado,", "emails.magicSession.signature": "Equipa {{project}}", "emails.recovery.subject": "Redefinição de senha", @@ -20,12 +19,14 @@ "emails.recovery.body": "Utilize este link para redefinir a palavra-passe do seu projecto {{project}}", "emails.recovery.footer": "Se não pediu para redefinir a sua palavra-passe, pode ignorar esta mensagem.", "emails.recovery.thanks": "Obrigado,", + "emails.recovery.buttonText": "Repor palavra-passe", "emails.recovery.signature": "Equipa {{project}}", - "emails.invitation.subject": "Convite à equipa de %s às %s", + "emails.invitation.subject": "Convite à equipa de {{team}} às {{project}}", "emails.invitation.hello": "Olá,", "emails.invitation.body": "Este correio foi-lhe enviado porque {{owner}} queria convidá-lo a tornar-se membro da equipa {{team}} da {{project}}.", "emails.invitation.footer": "Se não estiver interessado, pode ignorar esta mensagem.", "emails.invitation.thanks": "Obrigado,", + "emails.invitation.buttonText": "Aceitar convite para o {{team}}", "emails.invitation.signature": "Equipa {{project}}", "locale.country.unknown": "Desconhecido", "countries.af": "Afeganistão", diff --git a/app/config/locale/translations/ro.json b/app/config/locale/translations/ro.json index 04cb22dd6b..6af6be8e38 100644 --- a/app/config/locale/translations/ro.json +++ b/app/config/locale/translations/ro.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Arta de a fi înţelept este arta de a intui ce trebuie trecut cu vederea.\"", "settings.locale": "ro", "settings.direction": "ltr", - "emails.sender": "%s Echipa", + "emails.sender": "{{project}} Echipa", "emails.verification.subject": "Verificare cont", "emails.verification.hello": "Bună ziua, {{user}},", "emails.verification.body": "Click pe acest link pentru a valida adresa de email.", "emails.verification.footer": "Dacă nu ai cerut validarea adresei de email, poți ignora acest mesaj.", "emails.verification.thanks": "Mulțumim,", + "emails.verification.buttonText": "Confirmă adresa de email", "emails.verification.signature": "Echipa {{project}}", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Bună ziua,", - "emails.magicSession.body": "Urmează acest link pentru logare.", - "emails.magicSession.footer": "Dacă nu ai incercat să te loghezi folosing această adresa de email, poți ignora acest mesaj.", "emails.magicSession.thanks": "Mulțumim,", "emails.magicSession.signature": "Echipa {{project}}", "emails.recovery.subject": "Resetare parolă", @@ -20,12 +19,14 @@ "emails.recovery.body": "Click aici pentru a reseta parola pentru {{project}}", "emails.recovery.footer": "Dacă nu ai cerut să îți schimbi parola, ignoră acest mesaj.", "emails.recovery.thanks": "Mulțumim,", + "emails.recovery.buttonText": "Resetează parola", "emails.recovery.signature": "Echipa {{project}}", - "emails.invitation.subject": "Invitatie catre %s Echipa la %s", + "emails.invitation.subject": "Invitatie catre {{team}} Echipa la {{project}}", "emails.invitation.hello": "Bună ziua,", "emails.invitation.body": "Acest email a fost trimis pentru că {{owner}} a vrut ca tu să devii membru al echipei {{team}} la {{project}}.", "emails.invitation.footer": "Dacă nu esti interesat, poți ignora acest email.", "emails.invitation.thanks": "Mulțumim,", + "emails.invitation.buttonText": "Acceptă invitația la {{team}}", "emails.invitation.signature": "Echipa {{project}}", "locale.country.unknown": "Necunoscut", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ru.json b/app/config/locale/translations/ru.json index 029aa06ee7..61ff4f94b3 100644 --- a/app/config/locale/translations/ru.json +++ b/app/config/locale/translations/ru.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Искусство быть мудрым — это искусство знать, чем можно пренебречь.\"", "settings.locale": "ru", "settings.direction": "ltr", - "emails.sender": "Команда %s", + "emails.sender": "Команда {{project}}", "emails.verification.subject": "Верификация аккаунта", "emails.verification.hello": "Здравствуйте, {{user}},", "emails.verification.body": "Перейдите по ссылке, чтобы подтвердить свой адрес электронной почты.", "emails.verification.footer": "Если вы не запрашивали подтверждение этого адреса, проигнорируйте это сообщение.", "emails.verification.thanks": "Спасибо,", + "emails.verification.buttonText": "Подтвердить адрес электронной почты", "emails.verification.signature": "команда {{project}}", "emails.magicSession.subject": "Логин", "emails.magicSession.hello": "Здравствуйте,", - "emails.magicSession.body": "Перейдите по ссылке, чтобы войти.", - "emails.magicSession.footer": "Если вы не просили войти, используя этот адрес электронной почты, проигнорируйте это сообщение.", "emails.magicSession.thanks": "Спасибо,", "emails.magicSession.signature": "команда {{project}}", "emails.recovery.subject": "Сброс пароля", @@ -20,12 +19,14 @@ "emails.recovery.body": "Перейдите по этой ссылке для того чтобы сбросить свой пароль для проекта {{project}}", "emails.recovery.footer": "Если вы не запрашивали сброс пароля, проигнорируйте это сообщение.", "emails.recovery.thanks": "Спасибо,", + "emails.recovery.buttonText": "Сбросить пароль", "emails.recovery.signature": "команда {{project}}", - "emails.invitation.subject": "Приглашение в команду %s по проекту %s", + "emails.invitation.subject": "Приглашение в команду {{team}} по проекту {{project}}", "emails.invitation.hello": "Здравствуйте,", "emails.invitation.body": "Это письмо отправлено вам, потому что {{owner}} приглашает стать членом команды {{team}} в проекте {{project}}.", "emails.invitation.footer": "Если вы не заинтересованы, проигнорируйте это сообщение.", "emails.invitation.thanks": "Спасибо,", + "emails.invitation.buttonText": "Принять приглашение в {{team}}", "emails.invitation.signature": "команда {{project}}", "locale.country.unknown": "Неизвестно", "countries.af": "Афганистан", diff --git a/app/config/locale/translations/sa.json b/app/config/locale/translations/sa.json index 7aa8c90d77..6bd7c903d3 100644 --- a/app/config/locale/translations/sa.json +++ b/app/config/locale/translations/sa.json @@ -2,17 +2,16 @@ "settings.inspire": "\"किं हेयमित्यस्य ज्ञानमेव ज्ञानिलक्षणम्‌।\"", "settings.locale": "sa", "settings.direction": "ltr", - "emails.sender": "%s गणः", + "emails.sender": "{{project}} गणः", "emails.verification.subject": "पञ्जिकानिर्णायनम्‌", "emails.verification.hello": "अयि {{user}},", "emails.verification.body": "ई-पत्रनिर्णायनार्थमिदं संयोगसूत्रमनुसरतु।", "emails.verification.footer": "यदि अस्य संकेतस्य निर्णायनं नेष्यते तर्हि वात्र्तामिमामुपेक्षताम्‌।", "emails.verification.thanks": "धन्यवादः,", + "emails.verification.buttonText": "ईमेल-पत्त्रं सुनिश्चित करें", "emails.verification.signature": "{{project}} गणः", "emails.magicSession.subject": "संप्रवेशः", "emails.magicSession.hello": "अयि,", - "emails.magicSession.body": "संप्रवेशार्थमिदं संयोगसूत्रमनुसरतु।", - "emails.magicSession.footer": "अनेन ई-पत्रण यदि संप्रवेशो नेष्यते तर्हि वात्र्तामिमामुपेक्षताम्‌।", "emails.magicSession.thanks": "धन्यवादः,", "emails.magicSession.signature": "{{project}} गणः", "emails.recovery.subject": "कूटशब्दपुनयाेजनम्‌", @@ -20,12 +19,14 @@ "emails.recovery.body": "{{project}} कूटशब्दपुनयाेजनाय संयोगमेनमनुसरतु।", "emails.recovery.footer": "यदि कूटशब्दस्य पुनयाेजनं नेष्यते तर्हि वात्र्तामिमामुपेक्षताम्‌।", "emails.recovery.thanks": "धन्यवादः,", + "emails.recovery.buttonText": "गुप्तशब्दं पुनः स्थापित करें", "emails.recovery.signature": "{{project}} गणः", - "emails.invitation.subject": "गणस्य आमन्त्रणम्‌ %s इति %s", + "emails.invitation.subject": "गणस्य आमन्त्रणम्‌ {{team}} इति {{project}}", "emails.invitation.hello": "अयि भो,", "emails.invitation.body": "{{owner}} {{team}} गणे {{project}} मध्ये भवद्योगदानमच्छितीति हेतोः पत्रमदिं भवत्सकाशं प्रेषतिम्।", "emails.invitation.footer": "यदि भवदनिच्छा तर्हि वात्र्तामिमामुपेक्षताम्‌।", "emails.invitation.thanks": "धन्यवादः,", + "emails.invitation.buttonText": "{{team}} निमन्त्रणं स्वीकुरुत", "emails.invitation.signature": "{{project}} गणः", "locale.country.unknown": "अज्ञातम्‌ ", "countries.af": "आफगानिस्थानम्‌", diff --git a/app/config/locale/translations/sd.json b/app/config/locale/translations/sd.json index 3f1f7678db..d862a7d29c 100644 --- a/app/config/locale/translations/sd.json +++ b/app/config/locale/translations/sd.json @@ -2,17 +2,16 @@ "settings.inspire": "\"سمجھدار ھجڻ جو فن آھي اھو .اڻڻاڻڻ جو فن جيڪو نظر انداز ڪجي.\"", "settings.locale": "sd", "settings.direction": "ltr", - "emails.sender": "%s ٽيم", + "emails.sender": "{{project}} ٽيم", "emails.verification.subject": " اڪائونٽ جي تصديق", "emails.verification.hello": "سلام {{user}},", "emails.verification.body": "پنھنجي اي ميل ايڊريس جي تصديق ڪرڻ لاءِ ھن لنڪ تي عمل ڪريو.", "emails.verification.footer": "جيڪڏھن توھان نه پ askيا ھئا ھن ايڊريس جي تصديق ڪرڻ لاءِ ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", "emails.verification.thanks": "مهرباني,", + "emails.verification.buttonText": "اي ميل پتو تصديق ڪريو", "emails.verification.signature": "{{project}} ٽيم", "emails.magicSession.subject": "لاگ ان", "emails.magicSession.hello": "هي ,", - "emails.magicSession.body": "لاگ ان ٿيڻ لاءِ ھن لنڪ تي عمل ڪريو.", - "emails.magicSession.footer": "جيڪڏھن توھان نه پ پيا ھي لاگ ان استعمال ڪندي اي ميل ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", "emails.magicSession.thanks": "مهرباني,", "emails.magicSession.signature": "{{project}} ٽيم", "emails.recovery.subject": "پاسورڊ ري سيٽ", @@ -20,12 +19,14 @@ "emails.recovery.body": "ھن لنڪ تي عمل ڪريو پنھنجو {{project}} پاسورڊ ري سيٽ ڪرڻ لاءِ.", "emails.recovery.footer": "جيڪڏھن توھان نه پ پيو ھو پنھنجي پاسورڊ کي ري سيٽ ڪرڻ لاءِ ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", "emails.recovery.thanks": "مهرباني,", + "emails.recovery.buttonText": "پاسورڊ ري سيٽ ڪريو", "emails.recovery.signature": "{{project}} ٽيم", - "emails.invitation.subject": "%s ٽيم %s تيجي دعوت", + "emails.invitation.subject": "{{team}} ٽيم {{project}} تيجي دعوت", "emails.invitation.hello": "هيلو,", "emails.invitation.body": "ھي اي ميل توھان ڏانھن موڪليو ويو آھي {اڪاڻ ته {{owner}} توھان کي دعوت ڏيڻ چاھي ٿو ته توھان {{team}} ٽيم جو ميمبر بڻجي {{project}} تي.", "emails.invitation.footer": "جيڪڏھن توھان دلچسپي نٿا رکو ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", "emails.invitation.thanks": "مهرباني,", + "emails.invitation.buttonText": "{{team}} جي دعوت قبول ڪريو", "emails.invitation.signature": "{{project}} ٽيم", "locale.country.unknown": "نامعلوم", "countries.af": "افغانستان", @@ -244,7 +245,7 @@ "emails.otpSession.securityPhrase": "هن ای میل لاءِ سیکيورٽي جملو {{phrase}} آھي. توهان هن ای میل تي اعتماد ڪري سگهو ٿا جيڪڏهن هن جملو لاڳو ٿيندڙ جملي سان ميل کاندي.", "emails.otpSession.thanks": "مهرباني,", "emails.otpSession.signature": "پروجيڪٽ جي ٽيم", - "emails.certificate.subject": "%s لاءِ سند جو ناکامی", + "emails.certificate.subject": "{{domain}} لاءِ سند جو ناکامی", "emails.certificate.hello": "هيلو,", "emails.certificate.body": "توهان جي ڊومين '{{domain}}' لاءِ سرٽيفڪيٽ ٺاهڻ جو نه ٿي سگهيو. هي ڪوشش نمبر {{attempt}} آهي، ۽ ناڪامي جو سبب ٿيو: {{error}}", "emails.certificate.footer": "توهان جو اڳيون سرٽيفڪيٽ اولهو فئيلر جي ݙينهن کان ٣٠ ݙينهن لاءِ ماني ويندو. اسان ان جي چھان بني جي بھرپور خواهش ڪنداسين، نہ ته توهان جو ݙومين بغير ڪوري SSL ڪميونڪيشن آڻي ويندي.", diff --git a/app/config/locale/translations/si.json b/app/config/locale/translations/si.json index 536e8d3604..7461376428 100644 --- a/app/config/locale/translations/si.json +++ b/app/config/locale/translations/si.json @@ -2,17 +2,16 @@ "settings.inspire": "\"ප්‍රඥාවන්ත වීමේ කලාව යනු නොසලකා හැරිය යුතු දේ දැන ගැනීමේ කලාවයි.\"", "settings.locale": "si", "settings.direction": "ltr", - "emails.sender": "%s කණ්ඩායම", + "emails.sender": "{{project}} කණ්ඩායම", "emails.verification.subject": "ගිණුම් සත්‍යාපනය", "emails.verification.hello": "හේයි {{user}},", "emails.verification.body": "ඔබගේ විද්‍යුත් තැපැල් ලිපිනය සත්‍යාපනය කිරීමට මෙම සම්බන්ධකය අනුගමනය කරන්න.", "emails.verification.footer": "මෙම ලිපිනය සත්‍යාපනය කරන ලෙස ඔබ ඉල්ලුවේ නැත්නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", "emails.verification.thanks": "ස්තුතියි,", + "emails.verification.buttonText": "ඊමේල් ලිපිනය තහවුරු කරන්න", "emails.verification.signature": "{{project}} කණ්ඩායම", "emails.magicSession.subject": "ප්‍රවේශ වන්න", "emails.magicSession.hello": "හේයි,", - "emails.magicSession.body": "ප්‍රවේශ වීමට මෙම සම්බන්ධකය අනුගමනය කරන්න.", - "emails.magicSession.footer": "මෙම විද්‍යුත් තැපෑල භාවිතයෙන් ප්‍රවේශ වීමට ඔබ ඉල්ලුවේ නැත්නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", "emails.magicSession.thanks": "ස්තුතියි,", "emails.magicSession.signature": "{{project}} කණ්ඩායම", "emails.recovery.subject": "මුරපද යළි පිහිටුවීම", @@ -20,12 +19,14 @@ "emails.recovery.body": "ඔබගේ {{project}} මුරපදය නැවත සැකසීමට මෙම සම්බන්ධකය අනුගමනය කරන්න.", "emails.recovery.footer": "ඔබගේ මුරපදය නැවත සකසන ලෙස ඔබ ඉල්ලුවේ නැත්නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", "emails.recovery.thanks": "ස්තුතියි,", + "emails.recovery.buttonText": "මුරපදය යළි පිහිටුවන්න", "emails.recovery.signature": "{{project}} කණ්ඩායම", - "emails.invitation.subject": "%s කණ්ඩායමට ආරාධනා %s හි", + "emails.invitation.subject": "{{team}} කණ්ඩායමට ආරාධනා {{project}} හි", "emails.invitation.hello": "ආයුබෝවන්,", "emails.invitation.body": "මෙම තැපැල් ඔබට එව්වේ, {{owner}} හට {{project}} හි {{team}} කණ්ඩායමේ සාමාජිකයෙකු වීමට ඔබට ආරාධනා කිරීමට අවශ්‍ය වූ බැවිනි.", "emails.invitation.footer": "ඔබ උනන්දුවක් නොදක්වන්නේ නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", "emails.invitation.thanks": "ස්තුතියි,", + "emails.invitation.buttonText": "{{team}} සඳහා ආරාධනය පිළිගෙනින්න", "emails.invitation.signature": "{{project}} කණ්ඩායම", "locale.country.unknown": "නොදන්නා", "countries.af": "ඇෆ්ගනිස්ථානය", diff --git a/app/config/locale/translations/sk.json b/app/config/locale/translations/sk.json index 93c12c0881..ee14066aef 100644 --- a/app/config/locale/translations/sk.json +++ b/app/config/locale/translations/sk.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Umenie múdrosti je umenie vedieť, čo prehliadnuť.\"", "settings.locale": "sk", "settings.direction": "ltr", - "emails.sender": "%s Tím", + "emails.sender": "{{project}} Tím", "emails.verification.subject": "Overenie účtu", "emails.verification.hello": "Ahoj {{user}},", "emails.verification.body": "Použi tento link pre overenie svojej emailovej adresy.", "emails.verification.footer": "Ak si nepožiadal o overenie tejto adresy, môžeš túto správu ignorovať.", "emails.verification.thanks": "Ďakujeme.,", + "emails.verification.buttonText": "Potvrďte e-mailovú adresu", "emails.verification.signature": "{{project}} tím", "emails.magicSession.subject": "Prihlásenie", "emails.magicSession.hello": "Ahoj,", - "emails.magicSession.body": "Použi tento link pre prihlásenie.", - "emails.magicSession.footer": "Ak si nepožiadal o prihlásenie cez email, túto správu môžeš ignorovať.", "emails.magicSession.thanks": "Ďakujeme,", "emails.magicSession.signature": "{{project}} tím", "emails.recovery.subject": "Obnovenie hesla", @@ -20,12 +19,14 @@ "emails.recovery.body": "Použi tento link pre obnovenie svojho {{project}} hesla.", "emails.recovery.footer": "Ak si nepožiadal o obnovu svojho hesla, túto správu môžeš ignorovať.", "emails.recovery.thanks": "Ďakujeme,", + "emails.recovery.buttonText": "Obnoviť heslo", "emails.recovery.signature": "{{project}} tím", - "emails.invitation.subject": "Pozvánka do %s Tímu v %s", + "emails.invitation.subject": "Pozvánka do {{team}} Tímu v {{project}}", "emails.invitation.hello": "Ahoj,", "emails.invitation.body": "Tento email ti bol zaslaný, pretože {{owner}} ťa pozval, aby si sa stal členom {{team}} tímu v projekte {{project}}.", "emails.invitation.footer": "Ak nemáš záujem, môžeš túto správu ignorovať.", "emails.invitation.thanks": "Ďakujeme,", + "emails.invitation.buttonText": "Prijať pozvánku do {{team}}", "emails.invitation.signature": "{{project}} tím", "locale.country.unknown": "Neznámy", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/sl.json b/app/config/locale/translations/sl.json index f7c4f41255..9d441ba6c9 100644 --- a/app/config/locale/translations/sl.json +++ b/app/config/locale/translations/sl.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Srčika modrosti je umetnost védenja, kaj spregledati.\"", "settings.locale": "sl", "settings.direction": "ltr", - "emails.sender": "%s Ekipa", + "emails.sender": "{{project}} Ekipa", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", @@ -11,8 +11,6 @@ "emails.verification.signature": "", "emails.magicSession.subject": "", "emails.magicSession.hello": ",", - "emails.magicSession.body": "", - "emails.magicSession.footer": "", "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", diff --git a/app/config/locale/translations/sn.json b/app/config/locale/translations/sn.json index d17a98ff42..7c088f8b38 100644 --- a/app/config/locale/translations/sn.json +++ b/app/config/locale/translations/sn.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Unyanzvi hwekuchenjera kuziva zvekufuratira.\"", "settings.locale": "sn", "settings.direction": "ltr", - "emails.sender": "Chikwata che%s", + "emails.sender": "Chikwata che{{project}}", "emails.verification.subject": "Kuratidzi kuti ndiwe muridzi weakaundi", "emails.verification.hello": "Hesi {{user}},", "emails.verification.body": "Tevedza chinongedzo ichi kuti uratidze kuti kero iyi ndeyako.", "emails.verification.footer": "Kana usina kukumbira kuti uratidze kuti kero iyi ndeyako, unogona kufuratira meseji iyi.", "emails.verification.thanks": "Ndatenda,", + "emails.verification.buttonText": "Simbisa kero yeemail", "emails.verification.signature": "Chikwata che{{project}}", "emails.magicSession.subject": "Pinda", "emails.magicSession.hello": "Hesi,", - "emails.magicSession.body": "Baya chinongedzo ichi kuti upinde muakaundi yako.", - "emails.magicSession.footer": "Kana usina kukumbira kupinda muakaundi yako uchishandisa email iyi, unogona kufuratira meseji iyi.", "emails.magicSession.thanks": "Ndatenda,", "emails.magicSession.signature": "Chikwata che{{project}}", "emails.recovery.subject": "Kuchinja pasiwedhi", @@ -20,12 +19,14 @@ "emails.recovery.body": "Baya chinongedzo ichi kuti uchinje pasiwedhi yako ye{{project}}.", "emails.recovery.footer": "Kana usina kukumbira kuchinja pasiwedhi yako, unogona kufuratira meseji iyi.", "emails.recovery.thanks": "Ndatenda,", + "emails.recovery.buttonText": "Gadzirisa password", "emails.recovery.signature": "Chikwata che{{project}}", - "emails.invitation.subject": "Kukokwa kuchikwata che%s ku%s", + "emails.invitation.subject": "Kukokwa kuchikwata che{{team}} ku{{project}}", "emails.invitation.hello": "Mhoro,", "emails.invitation.body": "Tsamba iyi yatumirwa kwauri nekuti {{owner}} anga achida kuti uve nhengo yechikwata che{{team}} pachirongwa che{{project}}.", "emails.invitation.footer": "Kana usiri kufarira kuve nhengo yechikwata ichi, unogona kufuratira meseji iyi.", "emails.invitation.thanks": "Ndatenda,", + "emails.invitation.buttonText": "Gamuchira kukokwa ku {{team}}", "emails.invitation.signature": "Chikwata che{{project}}", "locale.country.unknown": "Haizivikanwe", "countries.af": "Afuganisitani", diff --git a/app/config/locale/translations/sq.json b/app/config/locale/translations/sq.json index 85aa6637f6..1e8eede0f5 100644 --- a/app/config/locale/translations/sq.json +++ b/app/config/locale/translations/sq.json @@ -2,7 +2,7 @@ "settings.inspire": "\"The art of being wise is the art of knowing what to overlook.\"", "settings.locale": "sq", "settings.direction": "ltr", - "emails.sender": "Grup %s", + "emails.sender": "Grup {{project}}", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", @@ -11,8 +11,6 @@ "emails.verification.signature": "", "emails.magicSession.subject": "", "emails.magicSession.hello": ",", - "emails.magicSession.body": "", - "emails.magicSession.footer": "", "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", diff --git a/app/config/locale/translations/sv.json b/app/config/locale/translations/sv.json index 8997fd53f8..4751e2ad65 100644 --- a/app/config/locale/translations/sv.json +++ b/app/config/locale/translations/sv.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Vishet är konsten att förstå vad man ska förbise.\"", "settings.locale": "sv", "settings.direction": "ltr", - "emails.sender": "%s-teamet", + "emails.sender": "{{project}}-teamet", "emails.verification.subject": "Verifiera konto", "emails.verification.hello": "Hej {{user}},", "emails.verification.body": "Klicka på denna länk för att verifiera din email", "emails.verification.footer": "Om du inte bad om att verifiera den här e-postadressen kan du ignorera detta mail.", "emails.verification.thanks": "Tack,", + "emails.verification.buttonText": "Bekräfta e-postadress", "emails.verification.signature": "{{project}} teamet", "emails.magicSession.subject": "Logga in", "emails.magicSession.hello": "Hej,", - "emails.magicSession.body": "Klicka på denna länk för att logga in.", - "emails.magicSession.footer": "Om du inte bad om att logga in med denna e-postadress kan du ignorera detta mail.", "emails.magicSession.thanks": "Tack,", "emails.magicSession.signature": "{{project}} teamet", "emails.recovery.subject": "Återställ lösenord", @@ -20,12 +19,14 @@ "emails.recovery.body": "Klicka på denna länk för att återställa lösenordet på {{project}}", "emails.recovery.footer": "Om du inte bad om att återställa ditt lösenord kan du ignorera detta mail.", "emails.recovery.thanks": "Tack,", + "emails.recovery.buttonText": "Återställ lösenord", "emails.recovery.signature": "{{project}} teamet", - "emails.invitation.subject": "Inbjudan till %s teamet på %s", + "emails.invitation.subject": "Inbjudan till {{team}} teamet på {{project}}", "emails.invitation.hello": "Hej,", "emails.invitation.body": "Detta mail skickades till dig eftersom {{owner}} ville bjuda in dig att bli medlem i teamet {{team}} på {{project}}.", "emails.invitation.footer": "Om du inte är intresserad kan du ignorera detta mail.", "emails.invitation.thanks": "Tack,", + "emails.invitation.buttonText": "Acceptera inbjudan till {{team}}", "emails.invitation.signature": "{{project}} teamet", "locale.country.unknown": "Okänt", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ta.json b/app/config/locale/translations/ta.json index f0695867a9..54ecc2436d 100644 --- a/app/config/locale/translations/ta.json +++ b/app/config/locale/translations/ta.json @@ -2,17 +2,16 @@ "settings.inspire": "\"புத்திசாலித்தனம் என்னும் கலை என்பது எதனை புறக்கணிக்க வேண்டும் என அறியும் கலையாகும்.\"", "settings.locale": "ta", "settings.direction": "ltr", - "emails.sender": "%s குழு", + "emails.sender": "{{project}} குழு", "emails.verification.subject": "கணக்கு சரிபார்ப்பு", "emails.verification.hello": "ஏய் {{user}},", "emails.verification.body": "உங்கள் மின்னஞ்சல் முகவரியைச் சரிபார்க்க இந்த இணைப்பைப் பின்தொடரவும்.", "emails.verification.footer": "இந்த முகவரியைச் சரிபார்க்கும்படி உங்களிடம் கேட்கப்படவில்லை என்றால், இந்தச் செய்தியை நீங்கள் புறக்கணிக்கலாம்.", "emails.verification.thanks": "நன்றி,", + "emails.verification.buttonText": "மின்னஞ்சல் முகவரியை உறுதிப்படுத்தவும்", "emails.verification.signature": "{{project}} குழு ", "emails.magicSession.subject": "உள்நுழைய", "emails.magicSession.hello": "ஏய்,", - "emails.magicSession.body": "இந்த இணைப்பைப் பின்தொடரவும் உள்நுழைய", - "emails.magicSession.footer": "இந்த மின்னஞ்சலைப் பயன்படுத்தி உள்நுழையுமாறு உங்களிடம் கேட்கப்படாவிட்டால், இந்தச் செய்தியைப் புறக்கணிக்கலாம்.", "emails.magicSession.thanks": "நன்றி,", "emails.magicSession.signature": "{{project}} குழு", "emails.recovery.subject": "கடவுச்சொல் மீட்டமைப்பு", @@ -20,12 +19,14 @@ "emails.recovery.body": "மீட்டமைக்க இந்த இணைப்பைப் பின்தொடரவும் {{project}} கடவுச்சொல்.", "emails.recovery.footer": "உங்கள் கடவுச்சொல்லை மீட்டமைக்கும்படி உங்களிடம் கேட்கப்படவில்லை என்றால், இந்தச் செய்தியை நீங்கள் புறக்கணிக்கலாம்.", "emails.recovery.thanks": "நன்றி,", + "emails.recovery.buttonText": "கடவுச்சொல்லை மீட்டமைக்கவும்", "emails.recovery.signature": "{{project}} குழு", - "emails.invitation.subject": "அழைப்பிதழ் %s குழு %s ", + "emails.invitation.subject": "அழைப்பிதழ் {{team}} குழு {{project}} ", "emails.invitation.hello": "வணக்கம்,", "emails.invitation.body": "{{project}} இல் {{team}} குழுவில் உறுப்பினராக உங்களை {{owner}} அழைக்க விரும்புவதால், இந்த அஞ்சல் உங்களுக்கு அனுப்பப்பட்டது.", "emails.invitation.footer": "உங்களுக்கு ஆர்வம் இல்லை என்றால், இந்த செய்தியை நீங்கள் புறக்கணிக்கலாம்.", "emails.invitation.thanks": "நன்றி,", + "emails.invitation.buttonText": "{{team}} அழைப்பை ஏற்கவும்", "emails.invitation.signature": "{{project}} குழு", "locale.country.unknown": "அறியவில்லை", "countries.af": "ஆப்கானித்தான்", diff --git a/app/config/locale/translations/te.json b/app/config/locale/translations/te.json index 870b0b82a2..74713ef47e 100644 --- a/app/config/locale/translations/te.json +++ b/app/config/locale/translations/te.json @@ -2,17 +2,16 @@ "settings.inspire": "\"ఏది విస్మరించాలో తెలుసుకోవడమే తెలివైన వ్యక్తి యొక్క కళ.\"", "settings.locale": "te", "settings.direction": "ltr", - "emails.sender": "%s జట్టు", + "emails.sender": "{{project}} జట్టు", "emails.verification.subject": "ఖాతా ధృవీకరణ", "emails.verification.hello": "నమస్కారము {{user}},", "emails.verification.body": "ఈ లింక్ ద్వారా ఇమెయిల్ ని ధృవీకరించండి", "emails.verification.footer": "మీరు ఈ చిరునామాను ధృవీకరించమని అడగనట్లయితే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు", "emails.verification.thanks": "ధన్యవాదాలు,", + "emails.verification.buttonText": "ఇమెయిల్ చిరునామాను నిర్ధారించండి", "emails.verification.signature": "{{project}} జట్", "emails.magicSession.subject": "లాగిన్", "emails.magicSession.hello": "నమస్కారము,", - "emails.magicSession.body": "లాగిన్ చేయడానికి ఈ లింక్ ని అనుసరించండి", - "emails.magicSession.footer": "మీరు ఈ ఇమెయిల్ ని ఉపయోగించి లాగిన్ చేయమని అడగకపోతే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు", "emails.magicSession.thanks": "ధన్యవాదాలు,", "emails.magicSession.signature": "{{project}} జట్", "emails.recovery.subject": "పాస్వర్డ్ రీసెట్", @@ -20,12 +19,14 @@ "emails.recovery.body": "మీ {{project}} పాస్వర్డ్ ని రీసెట్ చేయడానికి ఈ లింక్ ని అనుసరించండి", "emails.recovery.footer": "మీరు మీ పాస్వర్డ్ ని రీసెట్ చేయమని అడగనట్లయితే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు", "emails.recovery.thanks": "ధన్యవాదాల,", + "emails.recovery.buttonText": "పాస్‌వర్డ్‌ను రీసెట్ చేయండి", "emails.recovery.signature": "{{project}} జట్", - "emails.invitation.subject": "%s వద్ద %s బృందానికి ఆహ్వానం", + "emails.invitation.subject": "{{team}} వద్ద {{project}} బృందానికి ఆహ్వానం", "emails.invitation.hello": "నమస్కారమ,", "emails.invitation.body": "{{owner}} మిమ్మల్ని {{project}} లో {{team}} బృందంలో సభ్యునిగా ఉండమని ఆహ్వానించాలనుకుంటున్నందున ఈ మెయిల్ మీకు పంపబడింది.", "emails.invitation.footer": "మీకు ఆసక్తి లేకుంటే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు.", "emails.invitation.thanks": "ధన్యవాదాల,", + "emails.invitation.buttonText": "{{team}} కు ఆహ్వానాన్ని ఆమోదించండి", "emails.invitation.signature": "{{project}} జట్", "locale.country.unknown": "తెలియని", "countries.af": "ఆఫ్ఘనిస్తాన్", diff --git a/app/config/locale/translations/th.json b/app/config/locale/translations/th.json index 5a53b16055..2d27a9eb4d 100644 --- a/app/config/locale/translations/th.json +++ b/app/config/locale/translations/th.json @@ -2,17 +2,16 @@ "settings.inspire": "\"ศิลปะของการมีปัญญา คือการตระหนักได้ว่าควรจะมองข้ามเรื่องอะไร\"", "settings.locale": "th", "settings.direction": "ltr", - "emails.sender": "ทีม %s", + "emails.sender": "ทีม {{project}}", "emails.verification.subject": "การยืนยันบัญชีผู้ใช้", "emails.verification.hello": "เรียนคุณ {{user}}", "emails.verification.body": "กดเข้าไปที่ลิงก์นี้เพื่อยืนยันอีเมลของท่าน", "emails.verification.footer": "หากท่านไม่ได้ต้องการที่จะยืนยันอีเมลนี้ ท่านสามารถเพิกเฉยข้อความนี้ได้", "emails.verification.thanks": "ขอบคุณ", + "emails.verification.buttonText": "ยืนยันที่อยู่อีเมล", "emails.verification.signature": "ทีม {{project}}", "emails.magicSession.subject": "เข้าสู่ระบบ", "emails.magicSession.hello": "เรียนผู้ใช้งาน", - "emails.magicSession.body": "กดเข้าไปที่ลิงก์นี้เพื่อเข้าสู่ระบบ", - "emails.magicSession.footer": "หากท่านไม่ได้ต้องการที่จะเข้าสู่ระบบด้วยอีเมลนี้ ท่านสามารถเพิกเฉยข้อความนี้ได้", "emails.magicSession.thanks": "ขอบคุณ", "emails.magicSession.signature": "ทีม {{project}}", "emails.recovery.subject": "รีเซ็ตรหัสผ่าน", @@ -20,12 +19,14 @@ "emails.recovery.body": "กดเข้าไปที่ลิงก์นี้เพื่อรีเซ็ตรหัสผ่านสำหรับโปรเจกต์ {{project}} ของท่าน", "emails.recovery.footer": "หากท่านไม่ได้ต้องการที่จะรีเซ็ตรหัสผ่านของท่าน ท่านสามารถเพิกเฉยข้อความนี้ได้", "emails.recovery.thanks": "ขอบคุณ", + "emails.recovery.buttonText": "รีเซ็ตรหัสผ่าน", "emails.recovery.signature": "ทีม {{project}}", - "emails.invitation.subject": "เรียนเชิญเข้าร่วม ทีม %s จากโปรเจกต์ %s", + "emails.invitation.subject": "เรียนเชิญเข้าร่วม ทีม {{team}} จากโปรเจกต์ {{project}}", "emails.invitation.hello": "สวัสดี", "emails.invitation.body": "ท่านได้รับอีเมลฉบับนี้เนื่องจาก {{owner}} ต้องการที่จะเชิญชวนคุณเข้าร่วมเป็นส่วนหนึ่งของ ทีม {{team}} จากโปรเจกต์ {{project}}", "emails.invitation.footer": "หากท่านไม่ได้สนใจที่จะเข้าร่วม ท่านสามารถเพิกเฉยข้อความนี้ได้", "emails.invitation.thanks": "ขอบคุณ", + "emails.invitation.buttonText": "ยอมรับคำเชิญเข้าร่วม {{team}}", "emails.invitation.signature": "ทีม {{project}}", "locale.country.unknown": "ไม่ทราบ", "countries.af": "อัฟกานิสถาน", diff --git a/app/config/locale/translations/tl.json b/app/config/locale/translations/tl.json index 6d0be01095..51190a6d32 100644 --- a/app/config/locale/translations/tl.json +++ b/app/config/locale/translations/tl.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Ang sining ng pagiging matalino ay ang sining ng pag-alam kung ano ang dapat kaligtaan.\"", "settings.locale": "tl", "settings.direction": "ltr", - "emails.sender": "Pangkat ng %s", + "emails.sender": "Pangkat ng {{project}}", "emails.verification.subject": "Pagpapatunay ng account", "emails.verification.hello": "Kamusta {{user}},", "emails.verification.body": "Sundin ang link na ito upang ma-verify ang iyong email address.", "emails.verification.footer": "Kung hindi mo hiningi na i-verify ang address na ito, maaari mong balewalain ang mensahe na ito.", "emails.verification.thanks": "Salamat,", + "emails.verification.buttonText": "Kumpirmahin ang email address", "emails.verification.signature": "Pangkat ng {{project}}", "emails.magicSession.subject": "Mag log in", "emails.magicSession.hello": "Kamusta ,", - "emails.magicSession.body": "Sundin ang link na ito upang mag-login.", - "emails.magicSession.footer": "Kung hindi mo hiningi na mag-login gamit ang email na ito, maaari mong balewalain ang mensahe na ito.", "emails.magicSession.thanks": "Salamat,", "emails.magicSession.signature": "Pangkat ng {{project}}", "emails.recovery.subject": "I-reset ang password", @@ -20,12 +19,14 @@ "emails.recovery.body": "Sundin ang link na ito upang i-reset ang password ng iyong {{project}}.", "emails.recovery.footer": "Kung hindi mo hiningi na i-reset ang iyong password, maaari mong balewalain ang mensahe na ito.", "emails.recovery.thanks": "Salamat,", + "emails.recovery.buttonText": "I-reset ang password", "emails.recovery.signature": "Pangkat ng {{project}}", - "emails.invitation.subject": "Imbitasyon para sa Pangkat %s sa %s", + "emails.invitation.subject": "Imbitasyon para sa Pangkat {{team}} sa {{project}}", "emails.invitation.hello": "Kamusta,", "emails.invitation.body": "Ipinadala sa iyo ang mail na ito dahil gusto kang imbitahan ni {{owner}} na maging miyembro ng Pangkat {{team}} sa ilalim ng proyektong {{project}}.", "emails.invitation.footer": "Kung ikaw ay hindi interesado, maaari mong balewalain ang mensaheng ito.", "emails.invitation.thanks": "Salamat,", + "emails.invitation.buttonText": "Tanggapin ang paanyaya sa {{team}}", "emails.invitation.signature": "Pangkat ng {{project}}", "locale.country.unknown": "Hindi kilala", "countries.af": "Apganistan", diff --git a/app/config/locale/translations/tr.json b/app/config/locale/translations/tr.json index 115050c2e2..f6cd6d8687 100644 --- a/app/config/locale/translations/tr.json +++ b/app/config/locale/translations/tr.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Bilge olma sanatı, neyi ihmal edeceğini bilme sanatıdır.\"", "settings.locale": "tr", "settings.direction": "ltr", - "emails.sender": "%s Takımı", + "emails.sender": "{{project}} Takımı", "emails.verification.subject": "Hesabını Doğrula", "emails.verification.hello": "Merhaba {{user}},", "emails.verification.body": "Eposta adresini doğrulamak için bu bağlantıyı kullanın.", "emails.verification.footer": "Eğer bu eposta adresini doğrulamak isteyen siz değilseniz devam etmeyin.", "emails.verification.thanks": "Teşekkürler,", + "emails.verification.buttonText": "E-posta adresini doğrula", "emails.verification.signature": "{{project}} takımı", "emails.magicSession.subject": "Giriş", "emails.magicSession.hello": "Merhaba,", - "emails.magicSession.body": "Giriş yapmak için tıklayın.", - "emails.magicSession.footer": "Eğer bu eposta adresini kullanarak giriş yapmak istemediyseniz devam etmeyin.", "emails.magicSession.thanks": "Teşekkürler,", "emails.magicSession.signature": "{{project}} takımı", "emails.recovery.subject": "Şifremi Sıfırla", @@ -20,12 +19,14 @@ "emails.recovery.body": "{{project}} şifrenizi sıfırlamak için bu bağlantıyı kullanın.", "emails.recovery.footer": "Eğer şifre sıfırlama talebinde bulunmadıysanız devam etmeyin.", "emails.recovery.thanks": "Teşekkürler,", + "emails.recovery.buttonText": "Şifreyi sıfırla", "emails.recovery.signature": "{{project}} takımı", - "emails.invitation.subject": "%s üzerinde %s Takımına Davet", + "emails.invitation.subject": "{{team}} üzerinde {{project}} Takımına Davet", "emails.invitation.hello": "Merhaba,", "emails.invitation.body": "Bu epostayı aldınız, çünkü {{owner}} sizi {{project}} üzerinde {{team}} takımının üyesi olmaya davet etti.", "emails.invitation.footer": "Eğer ilgilenmiyorsanız devam etmeyin.", "emails.invitation.thanks": "Teşekkürler,", + "emails.invitation.buttonText": "{{team}}'e daveti kabul et", "emails.invitation.signature": "{{project}} takımı", "locale.country.unknown": "Bilinmeyen", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/uk.json b/app/config/locale/translations/uk.json index 3f66bd1c58..057c1dc5f4 100644 --- a/app/config/locale/translations/uk.json +++ b/app/config/locale/translations/uk.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Мистецтво бути мудрим - це мистецтво знати, чим можна знехтувати\"", "settings.locale": "uk", "settings.direction": "ltr", - "emails.sender": "Команда %s", + "emails.sender": "Команда {{project}}", "emails.verification.subject": "Верифікація акаунта", "emails.verification.hello": "Вітаємо, {{user}},", "emails.verification.body": "Перейдіть за цим посиланням, щоб підтвердити свою електронну адресу.", "emails.verification.footer": "Якщо ви не запитували підтвердження цієї адреси, ви можете ігнорувати це повідомлення.", "emails.verification.thanks": "Дякуємо,", + "emails.verification.buttonText": "Підтвердити адресу електронної пошти", "emails.verification.signature": "команда {{project}}", "emails.magicSession.subject": "Логін", "emails.magicSession.hello": "Вітаємо,", - "emails.magicSession.body": "Перейдіть за цим посиланням, щоб увійти.", - "emails.magicSession.footer": "Якщо ви не просили увійти за допомогою цієї електронної пошти, ви можете ігнорувати це повідомлення.", "emails.magicSession.thanks": "Дякуємо,", "emails.magicSession.signature": "команда {{project}}", "emails.recovery.subject": "Скидання пароля", @@ -20,12 +19,14 @@ "emails.recovery.body": "Перейдіть за цим посиланням для того щоб скинути свій пароль для проекту {{project}}", "emails.recovery.footer": "Якщо ви не запитували скидання паролю, проігноруйте це повідомлення.", "emails.recovery.thanks": "Дякуємо,", + "emails.recovery.buttonText": "Скинути пароль", "emails.recovery.signature": "команда {{project}}", - "emails.invitation.subject": "Запрошення до %s Команди у %s", + "emails.invitation.subject": "Запрошення до {{team}} Команди у {{project}}", "emails.invitation.hello": "Вітаємо,", "emails.invitation.body": "Цей лист був надісланий вам тому що {{owner}} запрошує вас стати членом команди {{team}} у проекті {{project}}.", "emails.invitation.footer": "Якщо ви не зацікавлені, проігноруйте це повідомлення.", "emails.invitation.thanks": "Дякуємо,", + "emails.invitation.buttonText": "Прийняти запрошення до {{team}}", "emails.invitation.signature": "команда {{project}}", "locale.country.unknown": "Невідомо", "countries.af": "Афганістан", diff --git a/app/config/locale/translations/ur.json b/app/config/locale/translations/ur.json index 9d6aa47762..0c2283d1e4 100644 --- a/app/config/locale/translations/ur.json +++ b/app/config/locale/translations/ur.json @@ -2,17 +2,16 @@ "settings.inspire": "\"عقلمند ہونے کا فن یہ جاننے کا فن ہے کہ کیا نظرانداز کیا جائے۔\"", "settings.locale": "ur", "settings.direction": "rtl", - "emails.sender": "%s ٹیم", + "emails.sender": "{{project}} ٹیم", "emails.verification.subject": "اکاؤنٹ کی تصدیق", "emails.verification.hello": "خوش آمدید {{user}}،", "emails.verification.body": "براہ کرم اپنے ای میل کی تصدیق کے لیے درج ذیل لنک پر عمل کریں۔", "emails.verification.footer": "اگر آپ نے اس پتے کی تصدیق کے لیے نہیں کہا تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", "emails.verification.thanks": "شکریہ،", + "emails.verification.buttonText": "ای میل پتہ کی تصدیق کریں", "emails.verification.signature": "ٹیم۔ {{project}}", "emails.magicSession.subject": "اگ ان کریں", "emails.magicSession.hello": "خوش آمدید،", - "emails.magicSession.body": "لاگ ان کرنے کے لیے اس لنک پر عمل کریں۔", - "emails.magicSession.footer": "اگر آپ نے اس ای میل کا استعمال کرتے ہوئے لاگ ان کرنے کے لیے نہیں کہا تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", "emails.magicSession.thanks": "شکریہ،", "emails.magicSession.signature": "ٹیم۔ {{project}}", "emails.recovery.subject": "پاس ورڈ ری سیٹ۔", @@ -20,13 +19,15 @@ "emails.recovery.body": "{{project}} کا پاس ورڈ تبدیل کرنے کے لیے درج ذیل لنک پر عمل کریں", "emails.recovery.footer": "اگر آپ نے اپنا پاس ورڈ دوبارہ ترتیب دینے کے لیے نہیں کہا تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", "emails.recovery.thanks": "شکریہ،", + "emails.recovery.buttonText": "پاس ورڈ ری سیٹ کریں", "emails.recovery.signature": "ٹیم۔ {{project}}", - "emails.invitation.subject": "%s پر %s ٹیم کو دعوت", + "emails.invitation.subject": "{{team}} پر {{project}} ٹیم کو دعوت", "emails.invitation.hello": "خوش آمدید،", "emails.invitation.body": "یہ پیغام آپ کو اس لیے بھیجا گیا تھا کہ {{owner}} نے آپ کو {{project}} میں {{team}} ٹیم کا رکن بننے کی دعوت بھیجی", "emails.invitation.footer": "اگر آپ دلچسپی نہیں رکھتے تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", "emails.invitation.thanks": "شکریہ،", - "emails.invitation.signature": "ٹیم۔ {{project}", + "emails.invitation.buttonText": "{{team}} کی دعوت قبول کریں", + "emails.invitation.signature": "ٹیم۔ {{project}}", "locale.country.unknown": "نامعلوم", "countries.af": "افغانستان", "countries.ao": "انگولا", diff --git a/app/config/locale/translations/vi.json b/app/config/locale/translations/vi.json index 76a545a1d4..4a6172d479 100644 --- a/app/config/locale/translations/vi.json +++ b/app/config/locale/translations/vi.json @@ -2,17 +2,16 @@ "settings.inspire": "\"Nghệ thuật khôn ngoan là nghệ thuật biết những gì cần bỏ qua.\"", "settings.locale": "vi", "settings.direction": "ltr", - "emails.sender": "Nhóm %s", + "emails.sender": "Nhóm {{project}}", "emails.verification.subject": "Xác minh tài khoản", "emails.verification.hello": "Chào {{user}}", "emails.verification.body": "Nhấn vào đường dẫn sau để xác minh địa chỉ email của bạn.", "emails.verification.footer": "Nếu bạn không yêu cầu xác minh tài khoản, bạn có thể bỏ qua email này.", "emails.verification.thanks": "Cảm ơn", + "emails.verification.buttonText": "Xác nhận địa chỉ email", "emails.verification.signature": "Nhóm {{project}}", "emails.magicSession.subject": "Đăng nhập", "emails.magicSession.hello": "Chào", - "emails.magicSession.body": "Nhấn vào đường dẫn sau để đăng nhập.", - "emails.magicSession.footer": "Nếu bạn không yêu cầu đăng nhập bằng email, bạn có thể bỏ qua email này.", "emails.magicSession.thanks": "Cảm ơn", "emails.magicSession.signature": "Nhóm {{project}}", "emails.recovery.subject": "Thiết lập lại mật khẩu", @@ -20,12 +19,14 @@ "emails.recovery.body": "Nhấn vào đường dẫn sau để thiết lập lại mật khẩu {{project}} của bạn.", "emails.recovery.footer": "Nếu bạn không yêu cầu thiết lập lại mật khẩu, bạn có thể bỏ qua email này.", "emails.recovery.thanks": "Cảm ơn", + "emails.recovery.buttonText": "Đặt lại mật khẩu", "emails.recovery.signature": "Nhóm {{project}}", - "emails.invitation.subject": "Lời mời tham gia nhóm %s tại %s", + "emails.invitation.subject": "Lời mời tham gia nhóm {{team}} tại {{project}}", "emails.invitation.hello": "Xin chào", "emails.invitation.body": "Email này được gửi cho bạn vì {{owner}} muốn mời bạn trở thành một thành viên của nhóm {{team}} tại {{project}}.", "emails.invitation.footer": "Nếu bạn không quan tâm, bạn có thể bỏ qua email này.", "emails.invitation.thanks": "Cảm ơn", + "emails.invitation.buttonText": "Chấp nhận lời mời vào {{team}}", "emails.invitation.signature": "Nhóm {{project}}", "locale.country.unknown": "Không xác định", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/zh-cn.json b/app/config/locale/translations/zh-cn.json index 5e35a89bfe..5bda45728d 100644 --- a/app/config/locale/translations/zh-cn.json +++ b/app/config/locale/translations/zh-cn.json @@ -2,17 +2,16 @@ "settings.inspire": "\"懂得取舍,方显睿智。\"", "settings.locale": "zh", "settings.direction": "ltr", - "emails.sender": "%s 小组", + "emails.sender": "{{project}} 小组", "emails.verification.subject": "帐户验证", "emails.verification.hello": "你好 {{user}}、", "emails.verification.body": "点此链接验证您的电子邮件地址。", "emails.verification.footer": "如果您没有要求验证此地址,则可忽略此消息。", "emails.verification.thanks": "谢谢、", + "emails.verification.buttonText": "确认邮箱地址", "emails.verification.signature": "{{project}} 团队", "emails.magicSession.subject": "登录", "emails.magicSession.hello": "你好、", - "emails.magicSession.body": "点此链接登录。", - "emails.magicSession.footer": "如果您没有要求使用此电子邮件登录,则可忽略此消息。", "emails.magicSession.thanks": "谢谢、", "emails.magicSession.signature": "{{project}} 团队", "emails.recovery.subject": "重设密码", @@ -20,12 +19,14 @@ "emails.recovery.body": "点此链接重置您的 {{project}} 密码。", "emails.recovery.footer": "如果您没有要求重置密码,则可以忽略此消息。", "emails.recovery.thanks": "谢谢、", + "emails.recovery.buttonText": "重置密码", "emails.recovery.signature": "{{project}} 团队", - "emails.invitation.subject": "邀请 %s 团队在 %s", + "emails.invitation.subject": "邀请 {{team}} 团队在 {{project}}", "emails.invitation.hello": "你好、", "emails.invitation.body": "这封邮件发送给您是因为 {{owner}} 想邀请您成为 {{team}} 团队在 {{project}}.", "emails.invitation.footer": "如果您不感兴趣,可以忽略此消息。", "emails.invitation.thanks": "谢谢、", + "emails.invitation.buttonText": "接受加入 {{team}} 的邀请", "emails.invitation.signature": "{{project}} 团队", "locale.country.unknown": "未知", "countries.af": "阿富汗", diff --git a/app/config/locale/translations/zh-tw.json b/app/config/locale/translations/zh-tw.json index 146dd0a401..3c7df3e668 100644 --- a/app/config/locale/translations/zh-tw.json +++ b/app/config/locale/translations/zh-tw.json @@ -2,17 +2,16 @@ "settings.inspire": "\"懂得取捨,方顯睿智。\"", "settings.locale": "zh-tw", "settings.direction": "ltr", - "emails.sender": "%s 小組", + "emails.sender": "{{project}} 小組", "emails.verification.subject": "帳戶驗證", "emails.verification.hello": "嗨 {{user}}、", "emails.verification.body": "按照此連結驗證您的電子郵件地址。", "emails.verification.footer": "如果您沒有要求驗證此地址,則可以忽略此消息。", "emails.verification.thanks": "謝謝、", + "emails.verification.buttonText": "確認電子郵件地址", "emails.verification.signature": "{{project}} 團隊", "emails.magicSession.subject": "登入", "emails.magicSession.hello": "嗨、", - "emails.magicSession.body": "點此連結登入。", - "emails.magicSession.footer": "如果您沒有要求使用此電子郵件登入,則可以忽略此消息。", "emails.magicSession.thanks": "謝謝、", "emails.magicSession.signature": "{{project}} 團隊", "emails.recovery.subject": "重設密碼", @@ -20,12 +19,14 @@ "emails.recovery.body": "按照此連結重置您的 {{project}} 密碼。", "emails.recovery.footer": "如果您沒有要求重置密碼,則可以忽略此消息。", "emails.recovery.thanks": "謝謝、", + "emails.recovery.buttonText": "重設密碼", "emails.recovery.signature": "{{project}} 團隊", - "emails.invitation.subject": "邀請 %s 團隊在 %s", + "emails.invitation.subject": "邀請 {{team}} 團隊在 {{project}}", "emails.invitation.hello": "您好、", "emails.invitation.body": "發送這封郵件給您是因為 {{owner}} 想邀請您成為 {{team}} 團隊在 {{project}}。", "emails.invitation.footer": "如果您不感興趣,可以忽略此消息。", "emails.invitation.thanks": "謝謝、", + "emails.invitation.buttonText": "接受加入 {{team}} 的邀請", "emails.invitation.signature": "{{project}} 團隊", "locale.country.unknown": "未知", "countries.af": "阿富汗", diff --git a/app/config/platforms.php b/app/config/platforms.php index 358edd0cf8..8a33144b2f 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -11,7 +11,7 @@ return [ [ 'key' => 'web', 'name' => 'Web', - 'version' => '18.1.0', + 'version' => '20.1.0', 'url' => 'https://github.com/appwrite/sdk-for-web', 'package' => 'https://www.npmjs.com/package/appwrite', 'enabled' => true, @@ -25,6 +25,7 @@ return [ 'gitRepoName' => 'sdk-for-web', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/web/CHANGELOG.md'), 'demos' => [ [ 'icon' => 'react.svg', @@ -59,7 +60,7 @@ return [ [ 'key' => 'flutter', 'name' => 'Flutter', - 'version' => '16.1.0', + 'version' => '19.1.0', 'url' => 'https://github.com/appwrite/sdk-for-flutter', 'package' => 'https://pub.dev/packages/appwrite', 'enabled' => true, @@ -73,11 +74,12 @@ return [ 'gitRepoName' => 'sdk-for-flutter', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/flutter/CHANGELOG.md'), ], [ 'key' => 'apple', 'name' => 'Apple', - 'version' => '10.1.0', + 'version' => '12.1.0', 'url' => 'https://github.com/appwrite/sdk-for-apple', 'package' => 'https://github.com/appwrite/sdk-for-apple', 'enabled' => true, @@ -91,6 +93,7 @@ return [ 'gitRepoName' => 'sdk-for-apple', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/apple/CHANGELOG.md'), ], [ 'key' => 'objective-c', @@ -108,11 +111,12 @@ return [ 'gitRepoName' => 'sdk-for-objective-c', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/objective-c/CHANGELOG.md'), ], [ 'key' => 'android', 'name' => 'Android', - 'version' => '8.1.0', + 'version' => '10.1.0', 'url' => 'https://github.com/appwrite/sdk-for-android', 'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-android', 'enabled' => true, @@ -130,11 +134,12 @@ return [ 'Kotlin' => 'kotlin', 'Java' => 'java', ], + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/android/CHANGELOG.md'), ], [ 'key' => 'react-native', 'name' => 'React Native', - 'version' => '0.9.1', + 'version' => '0.14.0', 'url' => 'https://github.com/appwrite/sdk-for-react-native', 'package' => 'https://npmjs.com/package/react-native-appwrite', 'enabled' => true, @@ -148,6 +153,7 @@ return [ 'gitRepoName' => 'sdk-for-react-native', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/react-native/CHANGELOG.md'), ], [ 'key' => 'graphql', @@ -167,6 +173,7 @@ return [ 'gitUserName' => '', 'gitBranch' => '', 'isSDK' => false, + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/graphql/CHANGELOG.md'), ], [ 'key' => 'rest', @@ -186,6 +193,7 @@ return [ 'gitUserName' => '', 'gitBranch' => '', 'isSDK' => false, + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/rest/CHANGELOG.md'), ], ], ], @@ -199,8 +207,8 @@ return [ [ 'key' => 'web', 'name' => 'Console', - 'version' => '1.7.0', - 'url' => 'https://github.com/appwrite/sdk-for-console', + 'version' => '0.1.0', + 'url' => '', 'package' => '', 'enabled' => true, 'beta' => false, @@ -209,15 +217,16 @@ return [ 'family' => APP_PLATFORM_CONSOLE, 'prism' => 'javascript', 'source' => \realpath(__DIR__ . '/../sdks/console-web'), - 'gitUrl' => 'git@github.com:appwrite/sdk-for-console.git', + 'gitUrl' => '', 'gitBranch' => 'dev', - 'gitRepoName' => 'sdk-for-console', - 'gitUserName' => 'appwrite', + 'gitRepoName' => '', + 'gitUserName' => '', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/console/CHANGELOG.md'), ], [ 'key' => 'cli', 'name' => 'Command Line', - 'version' => '6.2.3', + 'version' => '10.0.0', 'url' => 'https://github.com/appwrite/sdk-for-cli', 'package' => 'https://www.npmjs.com/package/appwrite-cli', 'enabled' => true, @@ -231,6 +240,14 @@ return [ 'gitRepoName' => 'sdk-for-cli', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'repoBranch' => 'master', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/cli/CHANGELOG.md'), + 'exclude' => [ + 'services' => [ + ['name' => 'assistant'], + ['name' => 'avatars'], + ], + ], ], ], ], @@ -245,7 +262,7 @@ return [ [ 'key' => 'nodejs', 'name' => 'Node.js', - 'version' => '17.0.0', + 'version' => '19.1.0', 'url' => 'https://github.com/appwrite/sdk-for-node', 'package' => 'https://www.npmjs.com/package/node-appwrite', 'enabled' => true, @@ -259,29 +276,12 @@ return [ 'gitRepoName' => 'sdk-for-node', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', - ], - [ - 'key' => 'deno', - 'name' => 'Deno', - 'version' => '15.0.0', - 'url' => 'https://github.com/appwrite/sdk-for-deno', - 'package' => 'https://deno.land/x/appwrite', - 'enabled' => true, - 'beta' => false, - 'dev' => false, - 'hidden' => false, - 'family' => APP_PLATFORM_SERVER, - 'prism' => 'typescript', - 'source' => \realpath(__DIR__ . '/../sdks/server-deno'), - 'gitUrl' => 'git@github.com:appwrite/sdk-for-deno.git', - 'gitRepoName' => 'sdk-for-deno', - 'gitUserName' => 'appwrite', - 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/nodejs/CHANGELOG.md'), ], [ 'key' => 'php', 'name' => 'PHP', - 'version' => '15.0.0', + 'version' => '17.1.0', 'url' => 'https://github.com/appwrite/sdk-for-php', 'package' => 'https://packagist.org/packages/appwrite/appwrite', 'enabled' => true, @@ -295,11 +295,12 @@ return [ 'gitRepoName' => 'sdk-for-php', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/php/CHANGELOG.md'), ], [ 'key' => 'python', 'name' => 'Python', - 'version' => '11.0.0', + 'version' => '13.1.0', 'url' => 'https://github.com/appwrite/sdk-for-python', 'package' => 'https://pypi.org/project/appwrite/', 'enabled' => true, @@ -313,11 +314,12 @@ return [ 'gitRepoName' => 'sdk-for-python', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/python/CHANGELOG.md'), ], [ 'key' => 'ruby', 'name' => 'Ruby', - 'version' => '16.0.0', + 'version' => '18.1.0', 'url' => 'https://github.com/appwrite/sdk-for-ruby', 'package' => 'https://rubygems.org/gems/appwrite', 'enabled' => true, @@ -331,11 +333,12 @@ return [ 'gitRepoName' => 'sdk-for-ruby', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/ruby/CHANGELOG.md'), ], [ 'key' => 'go', 'name' => 'Go', - 'version' => '0.8.0', + 'version' => '0.12.0', 'url' => 'https://github.com/appwrite/sdk-for-go', 'package' => 'https://github.com/appwrite/sdk-for-go', 'enabled' => true, @@ -349,11 +352,12 @@ return [ 'gitRepoName' => 'sdk-for-go', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/go/CHANGELOG.md'), ], [ 'key' => 'dotnet', 'name' => '.NET', - 'version' => '0.13.0', + 'version' => '0.18.0', 'url' => 'https://github.com/appwrite/sdk-for-dotnet', 'package' => 'https://www.nuget.org/packages/Appwrite', 'enabled' => true, @@ -367,11 +371,12 @@ return [ 'gitRepoName' => 'sdk-for-dotnet', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/dotnet/CHANGELOG.md'), ], [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '16.0.0', + 'version' => '18.1.0', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'package' => 'https://pub.dev/packages/dart_appwrite', 'enabled' => true, @@ -385,11 +390,12 @@ return [ 'gitRepoName' => 'sdk-for-dart', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/dart/CHANGELOG.md'), ], [ 'key' => 'kotlin', 'name' => 'Kotlin', - 'version' => '9.0.0', + 'version' => '11.1.0', 'url' => 'https://github.com/appwrite/sdk-for-kotlin', 'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-kotlin', 'enabled' => true, @@ -407,11 +413,12 @@ return [ 'Kotlin' => 'kotlin', 'Java' => 'java', ], + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/kotlin/CHANGELOG.md'), ], [ 'key' => 'swift', 'name' => 'Swift', - 'version' => '10.0.0', + 'version' => '12.1.0', 'url' => 'https://github.com/appwrite/sdk-for-swift', 'package' => 'https://github.com/appwrite/sdk-for-swift', 'enabled' => true, @@ -425,6 +432,7 @@ return [ 'gitRepoName' => 'sdk-for-swift', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/swift/CHANGELOG.md'), ], [ 'key' => 'graphql', @@ -444,6 +452,7 @@ return [ 'gitUserName' => '', 'gitBranch' => '', 'isSDK' => false, + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/graphql/CHANGELOG.md'), ], [ 'key' => 'rest', @@ -463,6 +472,7 @@ return [ 'gitUserName' => '', 'gitBranch' => '', 'isSDK' => false, + 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/rest/CHANGELOG.md'), ], ], ], diff --git a/app/config/roles.php b/app/config/roles.php index bccc2837f5..4b06e0a6c1 100644 --- a/app/config/roles.php +++ b/app/config/roles.php @@ -14,6 +14,8 @@ $member = [ 'teams.write', 'documents.read', 'documents.write', + 'rows.read', + 'rows.write', 'files.read', 'files.write', 'projects.read', @@ -37,6 +39,8 @@ $admins = [ 'teams.write', 'documents.read', 'documents.write', + 'rows.read', + 'rows.write', 'files.read', 'files.write', 'buckets.read', @@ -47,6 +51,8 @@ $admins = [ 'databases.write', 'collections.read', 'collections.write', + 'tables.read', + 'tables.write', 'platforms.read', 'platforms.write', 'projects.write', @@ -97,6 +103,8 @@ return [ 'sessions.write', 'documents.read', 'documents.write', + 'rows.read', + 'rows.write', 'files.read', 'files.write', 'locale.read', diff --git a/app/config/scopes.php b/app/config/scopes.php index 7dea7b1cd5..d90ca2eabf 100644 --- a/app/config/scopes.php +++ b/app/config/scopes.php @@ -28,12 +28,24 @@ return [ // List of publicly visible scopes 'collections.write' => [ 'description' => 'Access to create, update, and delete your project\'s database collections', ], + 'tables.read' => [ + 'description' => 'Access to read your project\'s database tables', + ], + 'tables.write' => [ + 'description' => 'Access to create, update, and delete your project\'s database tables', + ], 'attributes.read' => [ 'description' => 'Access to read your project\'s database collection\'s attributes', ], 'attributes.write' => [ 'description' => 'Access to create, update, and delete your project\'s database collection\'s attributes', ], + 'columns.read' => [ + 'description' => 'Access to read your project\'s database table\'s columns', + ], + 'columns.write' => [ + 'description' => 'Access to create, update, and delete your project\'s database table\'s columns', + ], 'indexes.read' => [ 'description' => 'Access to read your project\'s database collection\'s indexes', ], @@ -46,6 +58,12 @@ return [ // List of publicly visible scopes 'documents.write' => [ 'description' => 'Access to create, update, and delete your project\'s database documents', ], + 'rows.read' => [ + 'description' => 'Access to read your project\'s database rows', + ], + 'rows.write' => [ + 'description' => 'Access to create, update, and delete your project\'s database rows', + ], 'files.read' => [ 'description' => 'Access to read your project\'s storage files and preview images', ], diff --git a/app/config/services.php b/app/config/services.php index 9fef123f36..5f8651e59f 100644 --- a/app/config/services.php +++ b/app/config/services.php @@ -55,10 +55,10 @@ return [ ], 'databases' => [ 'key' => 'databases', - 'name' => 'Databases', + 'name' => 'Databases (legacy)', 'subtitle' => 'The Databases service allows you to create structured collections of documents, query and filter lists of documents', 'description' => '/docs/services/databases.md', - 'controller' => 'api/databases.php', + 'controller' => '', // Uses modules 'sdk' => true, 'docs' => true, 'docsUrl' => 'https://appwrite.io/docs/client/databases', @@ -66,6 +66,19 @@ return [ 'optional' => true, 'icon' => '/images/services/databases.png', ], + 'tablesdb' => [ + 'key' => 'tablesdb', + 'name' => 'TablesDB', + 'subtitle' => 'The TablesDB service allows you to create structured tables of columns, query and filter lists of rows', + 'description' => '/docs/services/tablesdb.md', + 'controller' => '', // Uses modules + 'sdk' => true, + 'docs' => true, + 'docsUrl' => 'https://appwrite.io/docs/client/tablesdb', + 'tests' => false, + 'optional' => true, + 'icon' => '/images/services/databases.png', + ], 'locale' => [ 'key' => 'locale', 'name' => 'Locale', @@ -201,7 +214,7 @@ return [ 'name' => 'Proxy', 'subtitle' => 'The Proxy Service allows you to configure actions for your domains beyond DNS configuration.', 'description' => '/docs/services/proxy.md', - 'controller' => 'api/proxy.php', + 'controller' => '', // Uses modules 'sdk' => true, 'docs' => true, 'docsUrl' => 'https://appwrite.io/docs/proxy', diff --git a/app/config/specs/open-api3-1.7.x-client.json b/app/config/specs/open-api3-1.7.x-client.json index abeab8a56f..c7de6a31af 100644 --- a/app/config/specs/open-api3-1.7.x-client.json +++ b/app/config/specs/open-api3-1.7.x-client.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.7.0", + "version": "1.7.4", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -2622,7 +2622,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2673,7 +2673,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "" }, "email": { @@ -2755,7 +2755,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "" }, "email": { @@ -2977,7 +2977,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "x-example": "" }, "phone": { @@ -3440,7 +3440,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "schema": { "type": "string", @@ -3458,7 +3458,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3478,7 +3478,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -4457,6 +4457,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", "server", "server" @@ -4465,10 +4466,9 @@ "methods": [ { "name": "createDocument", + "desc": "Create document", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [] }, "parameters": [ "databaseId", @@ -4489,7 +4489,8 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md" } ], "auth": { @@ -4890,7 +4891,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -4951,6 +4952,236 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/functions\/{functionId}\/executions": { "get": { "summary": "List executions", @@ -4974,7 +5205,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -5049,7 +5280,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -5132,7 +5363,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "" } } } @@ -5164,7 +5395,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -5238,7 +5469,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 308, "cookies": false, "type": "graphql", "deprecated": false, @@ -5290,7 +5521,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -5342,7 +5573,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5394,7 +5625,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5446,7 +5677,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -5498,7 +5729,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -5550,7 +5781,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -5602,7 +5833,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -5654,7 +5885,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -5706,7 +5937,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -5758,7 +5989,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -5841,7 +6072,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -5916,7 +6147,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6002,7 +6233,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -6100,7 +6331,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6172,7 +6403,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6261,7 +6492,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6328,7 +6559,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -6406,7 +6637,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -6595,7 +6826,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -6633,7 +6865,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -6718,7 +6950,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -6794,7 +7026,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -6879,7 +7111,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -6941,7 +7173,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7015,7 +7247,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7079,7 +7311,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -7165,7 +7397,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7276,7 +7508,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -7348,7 +7580,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -7435,7 +7667,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -7509,7 +7741,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -7607,7 +7839,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7668,7 +7900,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7803,7 +8035,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -7835,7 +8068,13 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } }, "documentList": { "description": "Documents List", @@ -7859,7 +8098,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "sessionList": { "description": "Sessions List", @@ -7883,7 +8126,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -7907,7 +8154,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -7931,7 +8182,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -7955,7 +8210,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "teamList": { "description": "Teams List", @@ -7979,7 +8238,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -8003,7 +8266,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "executionList": { "description": "Executions List", @@ -8027,7 +8294,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -8051,7 +8322,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -8075,7 +8350,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -8099,7 +8378,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -8123,7 +8406,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -8147,7 +8434,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -8171,7 +8462,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "document": { "description": "Document", @@ -8182,15 +8477,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -8216,12 +8520,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -8355,7 +8676,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -8516,7 +8860,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -8530,7 +8900,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -8544,7 +8917,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -8558,7 +8934,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -8572,7 +8951,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -8614,7 +8996,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -8646,7 +9035,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -8681,12 +9076,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -8873,7 +9279,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -8941,7 +9380,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -8985,7 +9436,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -8999,7 +9458,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -9049,7 +9511,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -9069,7 +9540,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -9151,7 +9626,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "team": { "description": "Team", @@ -9202,7 +9692,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -9293,7 +9794,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "execution": { "description": "Execution", @@ -9329,6 +9847,11 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -9413,6 +9936,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -9424,7 +9948,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "country": { "description": "Country", @@ -9444,7 +9998,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -9464,7 +10022,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -9490,7 +10052,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -9542,7 +10109,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -9568,7 +10144,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "headers": { "description": "Headers", @@ -9588,7 +10169,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -9620,7 +10205,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -9640,7 +10231,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -9660,7 +10257,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -9692,7 +10293,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "subscriber": { "description": "Subscriber", @@ -9766,7 +10373,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -9828,7 +10455,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-1.7.x-console.json b/app/config/specs/open-api3-1.7.x-console.json index 19ce78915c..2554b7282c 100644 --- a/app/config/specs/open-api3-1.7.x-console.json +++ b/app/config/specs/open-api3-1.7.x-console.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.7.0", + "version": "1.7.4", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -2631,7 +2631,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2682,7 +2682,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "" }, "email": { @@ -2764,7 +2764,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "" }, "email": { @@ -2986,7 +2986,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "x-example": "" }, "phone": { @@ -3445,7 +3445,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "schema": { "type": "string", @@ -3463,7 +3463,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3483,7 +3483,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -4359,7 +4359,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 308, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -4419,7 +4419,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 432, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -4494,7 +4494,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 307, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -4694,7 +4694,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -8016,6 +8016,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", "server", "server" @@ -8024,10 +8025,9 @@ "methods": [ { "name": "createDocument", + "desc": "Create document", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [] }, "parameters": [ "databaseId", @@ -8048,7 +8048,33 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md" + }, + { + "name": "createDocuments", + "desc": "Create documents", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md" } ], "auth": { @@ -8123,7 +8149,7 @@ } }, "put": { - "summary": "Create or update documents", + "summary": "Upsert documents", "operationId": "databasesUpsertDocuments", "tags": [ "databases" @@ -8144,7 +8170,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -8155,6 +8181,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8204,7 +8231,10 @@ "type": "object" } } - } + }, + "required": [ + "documents" + ] } } } @@ -8232,7 +8262,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -8243,6 +8273,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8325,7 +8356,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -8336,6 +8367,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8718,7 +8750,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8872,6 +8904,236 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -9339,7 +9601,7 @@ "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -9504,7 +9766,7 @@ "x-appwrite": { "method": "getDatabaseUsage", "group": null, - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -9586,7 +9848,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -9659,7 +9921,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -9741,6 +10003,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9766,7 +10029,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9890,7 +10154,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -9939,7 +10203,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -9989,7 +10253,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 402, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -10089,7 +10353,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 401, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -10149,7 +10413,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 395, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -10221,7 +10485,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -10280,7 +10544,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -10369,6 +10633,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -10394,7 +10659,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -10508,7 +10774,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -10569,7 +10835,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -10649,7 +10915,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -10732,7 +10998,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 382, "cookies": false, "type": "upload", "deprecated": false, @@ -10828,7 +11094,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -10913,7 +11179,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -11016,7 +11282,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -11113,7 +11379,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -11175,7 +11441,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -11239,7 +11505,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 389, "cookies": false, "type": "location", "deprecated": false, @@ -11329,7 +11595,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -11400,7 +11666,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -11475,7 +11741,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -11558,7 +11824,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "" } } } @@ -11590,7 +11856,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -11655,7 +11921,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -11726,7 +11992,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 394, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -11808,7 +12074,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -11867,7 +12133,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -11958,7 +12224,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -12027,7 +12293,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -12118,7 +12384,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -12189,7 +12455,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 308, "cookies": false, "type": "graphql", "deprecated": false, @@ -12241,7 +12507,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -12293,7 +12559,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12342,7 +12608,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -12391,7 +12657,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12440,7 +12706,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12500,7 +12766,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12549,7 +12815,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12598,7 +12864,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12660,7 +12926,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12722,7 +12988,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12795,7 +13061,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12857,7 +13123,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -12945,7 +13211,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -13007,7 +13273,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -13069,7 +13335,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13131,7 +13397,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13193,7 +13459,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13255,7 +13521,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -13317,7 +13583,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -13379,7 +13645,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -13441,7 +13707,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -13490,7 +13756,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -13539,7 +13805,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -13588,7 +13854,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13640,7 +13906,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13692,7 +13958,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -13744,7 +14010,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -13796,7 +14062,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -13848,7 +14114,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -13900,7 +14166,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -13952,7 +14218,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -14004,7 +14270,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14080,7 +14346,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14224,7 +14490,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -14370,7 +14636,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14544,7 +14810,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14722,7 +14988,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14831,7 +15097,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -14943,7 +15209,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -14996,7 +15262,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -15058,7 +15324,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15133,7 +15399,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15208,7 +15474,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -15284,7 +15550,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -15389,7 +15655,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -15497,7 +15763,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -15582,7 +15848,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -15670,7 +15936,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -15785,7 +16051,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -15903,7 +16169,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -15998,7 +16264,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -16096,7 +16362,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -16201,7 +16467,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -16309,7 +16575,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -16452,7 +16718,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -16597,7 +16863,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -16692,7 +16958,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -16790,7 +17056,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -16885,7 +17151,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -16983,7 +17249,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -17078,7 +17344,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -17176,7 +17442,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -17271,7 +17537,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -17369,7 +17635,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -17422,7 +17688,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -17484,7 +17750,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -17559,7 +17825,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -17634,7 +17900,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -17708,7 +17974,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -17791,7 +18057,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -17851,7 +18117,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -17928,7 +18194,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -17990,7 +18256,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -18065,7 +18331,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -18149,7 +18415,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -18239,7 +18505,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -18302,7 +18568,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -18377,7 +18643,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 314, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -18451,7 +18717,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 309, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -18539,7 +18805,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 316, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -18632,7 +18898,7 @@ "x-appwrite": { "method": "createCsvMigration", "group": null, - "weight": 313, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -18711,7 +18977,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 310, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -18787,7 +19053,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 317, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -18859,7 +19125,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 312, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -18970,7 +19236,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 319, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -19103,7 +19369,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 311, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -19208,7 +19474,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 318, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -19332,7 +19598,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 315, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -19390,7 +19656,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 320, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -19441,7 +19707,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 321, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -19501,7 +19767,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19589,7 +19855,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -19635,7 +19901,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -19713,7 +19979,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -19771,7 +20037,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -19851,7 +20117,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 205, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -19911,7 +20177,7 @@ "x-appwrite": { "method": "list", "group": "projects", - "weight": 155, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -19983,7 +20249,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 154, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -20117,7 +20383,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 156, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20175,7 +20441,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 157, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20290,7 +20556,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 174, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -20350,7 +20616,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 161, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20442,7 +20708,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 162, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20521,7 +20787,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 167, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20600,7 +20866,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 166, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20679,7 +20945,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 172, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -20758,7 +21024,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 165, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20849,7 +21115,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 173, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -20931,7 +21197,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 170, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -21010,7 +21276,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 169, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -21089,7 +21355,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 171, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -21168,7 +21434,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 164, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -21247,7 +21513,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 168, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -21347,7 +21613,7 @@ "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 371, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -21415,7 +21681,7 @@ "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 368, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -21500,7 +21766,7 @@ "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 370, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -21568,7 +21834,7 @@ "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 369, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -21654,7 +21920,7 @@ "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 372, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -21724,7 +21990,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 186, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -21811,7 +22077,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 182, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -21869,7 +22135,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 181, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21962,7 +22228,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 183, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -22030,7 +22296,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 184, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -22124,7 +22390,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 185, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -22194,7 +22460,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 163, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -22332,7 +22598,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 188, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22390,7 +22656,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 187, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22509,7 +22775,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 189, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -22577,7 +22843,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 190, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -22672,7 +22938,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 191, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -22742,7 +23008,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 159, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -22843,7 +23109,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 160, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -22922,7 +23188,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 192, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23040,7 +23306,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 193, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23171,7 +23437,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 158, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -23250,7 +23516,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 195, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -23474,7 +23740,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 197, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -23738,7 +24004,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 199, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -23964,7 +24230,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 194, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -24185,7 +24451,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 196, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -24425,7 +24691,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 198, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -24648,7 +24914,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 176, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -24706,7 +24972,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 175, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -24821,7 +25087,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 177, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -24889,7 +25155,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 178, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -25005,7 +25271,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 180, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -25075,7 +25341,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 179, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -25145,7 +25411,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 292, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -25219,7 +25485,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 433, + "weight": 435, "cookies": false, "type": "", "deprecated": false, @@ -25286,7 +25552,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 435, + "weight": 437, "cookies": false, "type": "", "deprecated": false, @@ -25364,7 +25630,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 436, + "weight": 438, "cookies": false, "type": "", "deprecated": false, @@ -25420,12 +25686,33 @@ "Temporary Redirect 307", "Permanent Redirect 308" ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "x-example": "" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] } }, "required": [ "domain", "url", - "statusCode" + "statusCode", + "resourceId", + "resourceType" ] } } @@ -25456,7 +25743,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 434, + "weight": 436, "cookies": false, "type": "", "deprecated": false, @@ -25534,7 +25821,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -25585,7 +25872,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 294, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -25645,7 +25932,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -25705,7 +25992,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -25775,7 +26062,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -25910,6 +26197,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -25935,7 +26223,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26022,7 +26311,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -26071,7 +26360,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -26121,7 +26410,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 427, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -26221,7 +26510,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 428, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -26281,7 +26570,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 429, + "weight": 431, "cookies": false, "type": "", "deprecated": false, @@ -26353,7 +26642,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -26412,7 +26701,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -26554,6 +26843,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26579,7 +26869,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26655,7 +26946,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -26716,7 +27007,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -26796,7 +27087,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -26879,7 +27170,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 411, "cookies": false, "type": "upload", "deprecated": false, @@ -26980,7 +27271,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -27060,7 +27351,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -27163,7 +27454,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -27261,7 +27552,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -27323,7 +27614,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -27387,7 +27678,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 418, "cookies": false, "type": "location", "deprecated": false, @@ -27477,7 +27768,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -27548,7 +27839,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -27619,7 +27910,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -27681,7 +27972,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -27752,7 +28043,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 430, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -27834,7 +28125,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -27893,7 +28184,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -27984,7 +28275,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -28053,7 +28344,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -28144,7 +28435,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -28215,7 +28506,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -28288,7 +28579,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -28415,7 +28706,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -28474,7 +28765,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -28598,7 +28889,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -28659,7 +28950,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -28745,7 +29036,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -28843,7 +29134,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -28915,7 +29206,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -29004,7 +29295,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -29071,7 +29362,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -29149,7 +29440,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -29338,7 +29629,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -29376,7 +29668,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -29461,7 +29753,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -29533,7 +29825,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -29615,7 +29907,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -29691,7 +29983,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -29776,7 +30068,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -29838,7 +30130,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -29912,7 +30204,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -29976,7 +30268,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -30049,7 +30341,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -30135,7 +30427,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -30246,7 +30538,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -30318,7 +30610,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -30405,7 +30697,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -30479,7 +30771,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -30576,7 +30868,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -30636,7 +30928,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -30717,7 +31009,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -30797,7 +31089,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -30886,7 +31178,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -30946,7 +31238,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -31016,7 +31308,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 443, "cookies": false, "type": "", "deprecated": false, @@ -31078,7 +31370,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -31151,7 +31443,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -31239,7 +31531,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -31324,7 +31616,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -31409,7 +31701,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -31477,7 +31769,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -31538,7 +31830,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -31623,7 +31915,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -31708,7 +32000,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -31823,7 +32115,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -31926,7 +32218,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -32031,7 +32323,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 278, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -32103,7 +32395,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -32155,7 +32447,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -32216,7 +32508,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -32296,7 +32588,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -32378,7 +32670,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -32461,7 +32753,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -32535,7 +32827,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -32620,7 +32912,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -32693,7 +32985,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -32769,7 +33061,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -32830,7 +33122,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -32889,7 +33181,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -32948,7 +33240,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -33009,7 +33301,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -33089,7 +33381,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -33169,7 +33461,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -33249,7 +33541,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -33308,7 +33600,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -33388,7 +33680,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -33447,7 +33739,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -33499,7 +33791,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -33553,7 +33845,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -33624,7 +33916,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -33704,7 +33996,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -33742,7 +34034,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "schema": { "type": "array", @@ -33777,7 +34069,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -33887,7 +34179,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -33957,7 +34249,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -34046,7 +34338,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -34118,7 +34410,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -34200,7 +34492,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -34280,7 +34572,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -34360,7 +34652,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 282, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -34456,7 +34748,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 283, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -34541,7 +34833,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 284, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -34626,7 +34918,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 285, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -34696,7 +34988,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -34750,7 +35042,7 @@ "tags": [ "vcs" ], - "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "VCS Content List", @@ -34766,7 +35058,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 281, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -34820,6 +35112,17 @@ "default": "" }, "in": "query" + }, + { + "name": "providerReference", + "description": "Git reference (branch, tag, commit) to get contents from", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" } ] } @@ -34840,7 +35143,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 291, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -34929,7 +35232,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -35003,7 +35306,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -35054,7 +35357,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -35167,7 +35470,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -35199,7 +35503,13 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } }, "documentList": { "description": "Documents List", @@ -35223,7 +35533,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -35247,7 +35561,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -35271,7 +35589,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -35295,7 +35617,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -35319,7 +35645,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -35343,7 +35673,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -35367,7 +35701,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -35391,7 +35729,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -35415,7 +35757,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -35439,7 +35785,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -35463,7 +35813,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -35487,7 +35841,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -35511,7 +35869,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -35535,7 +35897,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "templateSiteList": { "description": "Site Templates List", @@ -35559,7 +35925,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "functionList": { "description": "Functions List", @@ -35583,7 +35953,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "templateFunctionList": { "description": "Function Templates List", @@ -35607,7 +35981,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "installationList": { "description": "Installations List", @@ -35631,7 +36009,11 @@ "required": [ "total", "installations" - ] + ], + "example": { + "total": 5, + "installations": "" + } }, "providerRepositoryFrameworkList": { "description": "Framework Provider Repositories List", @@ -35655,7 +36037,11 @@ "required": [ "total", "frameworkProviderRepositories" - ] + ], + "example": { + "total": 5, + "frameworkProviderRepositories": "" + } }, "providerRepositoryRuntimeList": { "description": "Runtime Provider Repositories List", @@ -35679,7 +36065,11 @@ "required": [ "total", "runtimeProviderRepositories" - ] + ], + "example": { + "total": 5, + "runtimeProviderRepositories": "" + } }, "branchList": { "description": "Branches List", @@ -35703,7 +36093,11 @@ "required": [ "total", "branches" - ] + ], + "example": { + "total": 5, + "branches": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -35727,7 +36121,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -35751,7 +36149,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -35775,7 +36177,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -35799,7 +36205,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "projectList": { "description": "Projects List", @@ -35823,7 +36233,11 @@ "required": [ "total", "projects" - ] + ], + "example": { + "total": 5, + "projects": "" + } }, "webhookList": { "description": "Webhooks List", @@ -35847,7 +36261,11 @@ "required": [ "total", "webhooks" - ] + ], + "example": { + "total": 5, + "webhooks": "" + } }, "keyList": { "description": "API Keys List", @@ -35871,7 +36289,11 @@ "required": [ "total", "keys" - ] + ], + "example": { + "total": 5, + "keys": "" + } }, "devKeyList": { "description": "Dev Keys List", @@ -35895,7 +36317,11 @@ "required": [ "total", "devKeys" - ] + ], + "example": { + "total": 5, + "devKeys": "" + } }, "platformList": { "description": "Platforms List", @@ -35919,7 +36345,11 @@ "required": [ "total", "platforms" - ] + ], + "example": { + "total": 5, + "platforms": "" + } }, "countryList": { "description": "Countries List", @@ -35943,7 +36373,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -35967,7 +36401,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -35991,7 +36429,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -36015,7 +36457,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -36039,7 +36485,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -36063,7 +36513,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "proxyRuleList": { "description": "Rule List", @@ -36087,7 +36541,11 @@ "required": [ "total", "rules" - ] + ], + "example": { + "total": 5, + "rules": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -36111,7 +36569,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -36135,7 +36597,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -36159,7 +36625,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -36183,7 +36653,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -36207,7 +36681,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -36231,7 +36709,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "migrationList": { "description": "Migrations List", @@ -36255,7 +36737,11 @@ "required": [ "total", "migrations" - ] + ], + "example": { + "total": 5, + "migrations": "" + } }, "specificationList": { "description": "Specifications List", @@ -36279,7 +36765,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "vcsContentList": { "description": "VCS Content List", @@ -36303,7 +36793,11 @@ "required": [ "total", "contents" - ] + ], + "example": { + "total": 5, + "contents": "" + } }, "database": { "description": "Database", @@ -36341,7 +36835,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -36451,7 +36952,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -36506,7 +37021,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -36564,6 +37083,12 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "default", "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "nullable": true } }, "required": [ @@ -36575,7 +37100,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -36652,7 +37190,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -36729,7 +37280,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -36791,7 +37355,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -36859,7 +37434,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -36936,7 +37523,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -37004,7 +37604,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -37072,7 +37684,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -37140,7 +37764,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -37232,7 +37868,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -37304,7 +37956,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -37315,15 +37978,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -37349,12 +38021,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -37488,7 +38177,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -37649,7 +38361,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -37663,7 +38401,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -37677,7 +38418,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -37691,7 +38435,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -37705,7 +38452,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -37747,7 +38497,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -37779,7 +38536,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -37814,12 +38577,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -38006,7 +38780,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -38074,7 +38881,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -38118,7 +38937,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -38132,7 +38959,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -38182,7 +39012,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -38202,7 +39041,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -38284,7 +39127,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -38376,7 +39234,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -38426,7 +39303,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -38477,7 +39363,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -38568,7 +39465,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -38754,7 +39668,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "templateSite": { "description": "Template Site", @@ -38849,7 +39794,22 @@ "providerOwner", "providerVersion", "variables" - ] + ], + "example": { + "key": "starter", + "name": "Starter site", + "tagline": "Minimal web app integrating with Appwrite.", + "demoUrl": "https:\/\/nextjs-starter.appwrite.network\/", + "screenshotDark": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png", + "screenshotLight": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png", + "useCases": "Starter", + "frameworks": [], + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [] + } }, "templateFramework": { "description": "Template Framework", @@ -38911,7 +39871,18 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/build", + "providerRootDirectory": ".\/svelte-kit\/starter", + "buildRuntime": "node-22", + "adapter": "ssr", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -39100,7 +40071,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "templateFunction": { "description": "Template Function", @@ -39229,7 +40230,26 @@ "providerVersion", "variables", "scopes" - ] + ], + "example": { + "icon": "icon-lightning-bolt", + "id": "starter", + "name": "Starter function", + "tagline": "A simple function to get started.", + "permissions": "any", + "events": "account.create", + "cron": "0 0 * * *", + "timeout": 300, + "useCases": "Starter", + "runtimes": [], + "instructions": "For documentation and instructions check out .", + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [], + "scopes": "users.read" + } }, "templateRuntime": { "description": "Template Runtime", @@ -39261,7 +40281,13 @@ "commands", "entrypoint", "providerRootDirectory" - ] + ], + "example": { + "name": "node-19.0", + "commands": "npm install", + "entrypoint": "index.js", + "providerRootDirectory": "node\/starter" + } }, "templateVariable": { "description": "Template Variable", @@ -39311,7 +40337,16 @@ "placeholder", "required", "type" - ] + ], + "example": { + "name": "APPWRITE_DATABASE_ID", + "description": "The ID of the Appwrite database that contains the collection to sync.", + "value": "512", + "secret": false, + "placeholder": "64a55...7b912", + "required": false, + "type": "password" + } }, "installation": { "description": "Installation", @@ -39355,7 +40390,15 @@ "provider", "organization", "providerInstallationId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "provider": "github", + "organization": "appwrite", + "providerInstallationId": "5322" + } }, "providerRepository": { "description": "ProviderRepository", @@ -39386,6 +40429,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39398,8 +40446,18 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime" + } }, "providerRepositoryFramework": { "description": "ProviderRepositoryFramework", @@ -39430,6 +40488,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39447,9 +40510,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "framework" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "framework": "nextjs" + } }, "providerRepositoryRuntime": { "description": "ProviderRepositoryRuntime", @@ -39480,6 +40554,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39497,9 +40576,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "runtime" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "runtime": "node-22" + } }, "detectionFramework": { "description": "DetectionFramework", @@ -39531,7 +40621,13 @@ "installCommand", "buildCommand", "outputDirectory" - ] + ], + "example": { + "framework": "nuxt", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" + } }, "detectionRuntime": { "description": "DetectionRuntime", @@ -39557,7 +40653,12 @@ "runtime", "entrypoint", "commands" - ] + ], + "example": { + "runtime": "node", + "entrypoint": "index.js", + "commands": "npm install && npm run build" + } }, "vcsContent": { "description": "VcsContents", @@ -39584,7 +40685,12 @@ }, "required": [ "name" - ] + ], + "example": { + "size": 1523, + "isDirectory": true, + "name": "Main.java" + } }, "branch": { "description": "Branch", @@ -39598,7 +40704,10 @@ }, "required": [ "name" - ] + ], + "example": { + "name": "main" + } }, "runtime": { "description": "Runtime", @@ -39657,7 +40766,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -39712,7 +40831,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -39750,7 +40887,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -39924,7 +41068,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -39960,6 +41133,11 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -40044,6 +41222,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -40055,7 +41234,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "project": { "description": "Project", @@ -40451,7 +41660,73 @@ "serviceStatusForFunctions", "serviceStatusForGraphql", "serviceStatusForMessaging" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "description": "This is a new project.", + "teamId": "1592981250", + "logo": "5f5c451b403cb", + "url": "5f5c451b403cb", + "legalName": "Company LTD.", + "legalCountry": "US", + "legalState": "New York", + "legalCity": "New York City.", + "legalAddress": "620 Eighth Avenue, New York, NY 10018", + "legalTaxId": "131102020", + "authDuration": 60, + "authLimit": 100, + "authSessionsLimit": 10, + "authPasswordHistory": 5, + "authPasswordDictionary": true, + "authPersonalDataCheck": true, + "authMockNumbers": [ + {} + ], + "authSessionAlerts": true, + "authMembershipsUserName": true, + "authMembershipsUserEmail": true, + "authMembershipsMfa": true, + "oAuthProviders": [ + {} + ], + "platforms": {}, + "webhooks": {}, + "keys": {}, + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyTo": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "securepassword", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "authEmailPassword": true, + "authUsersAuthMagicURL": true, + "authEmailOtp": true, + "authAnonymous": true, + "authInvites": true, + "authJWT": true, + "authPhone": true, + "serviceStatusForAccount": true, + "serviceStatusForAvatars": true, + "serviceStatusForDatabases": true, + "serviceStatusForLocale": true, + "serviceStatusForHealth": true, + "serviceStatusForStorage": true, + "serviceStatusForTeams": true, + "serviceStatusForUsers": true, + "serviceStatusForSites": true, + "serviceStatusForFunctions": true, + "serviceStatusForGraphql": true, + "serviceStatusForMessaging": true + } }, "webhook": { "description": "Webhook", @@ -40541,7 +41816,22 @@ "enabled", "logs", "attempts" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": "database.collections.update", + "security": true, + "httpUser": "username", + "httpPass": "password", + "signatureKey": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } }, "key": { "description": "Key", @@ -40609,7 +41899,18 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "devKey": { "description": "DevKey", @@ -40668,7 +41969,17 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "mockNumber": { "description": "Mock Number", @@ -40688,7 +41999,11 @@ "required": [ "phone", "otp" - ] + ], + "example": { + "phone": "+1612842323", + "otp": "123456" + } }, "authProvider": { "description": "AuthProvider", @@ -40726,7 +42041,14 @@ "appId", "secret", "enabled" - ] + ], + "example": { + "key": "github", + "name": "GitHub", + "appId": "259125845563242502", + "secret": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ", + "enabled": "" + } }, "platform": { "description": "Platform", @@ -40794,7 +42116,19 @@ "hostname", "httpUser", "httpPass" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "key": "com.company.appname", + "store": "", + "hostname": true, + "httpUser": "username", + "httpPass": "password" + } }, "variable": { "description": "Variable", @@ -40850,7 +42184,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -40870,7 +42214,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -40890,7 +42238,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -40916,7 +42268,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -40968,7 +42325,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -40994,7 +42360,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -41014,7 +42385,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -41029,7 +42404,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -41056,7 +42434,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -41100,7 +42483,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -41129,7 +42520,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "metric": { "description": "Metric", @@ -41150,7 +42546,11 @@ "required": [ "value", "date" - ] + ], + "example": { + "value": 1, + "date": "2020-10-15T06:38:00.000+00:00" + } }, "metricBreakdown": { "description": "Metric Breakdown", @@ -41184,7 +42584,13 @@ "required": [ "name", "value" - ] + ], + "example": { + "resourceId": "5e5ea5c16897e", + "name": "Documents", + "value": 1, + "estimate": 1 + } }, "usageDatabases": { "description": "UsageDatabases", @@ -41294,7 +42700,22 @@ "storage", "databasesReads", "databasesWrites" - ] + ], + "example": { + "range": "30d", + "databasesTotal": 0, + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "databases": [], + "collections": [], + "documents": [], + "storage": [], + "databasesReads": [], + "databasesWrites": [] + } }, "usageDatabase": { "description": "UsageDatabase", @@ -41388,7 +42809,20 @@ "storage", "databaseReads", "databaseWrites" - ] + ], + "example": { + "range": "30d", + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databaseReadsTotal": 0, + "databaseWritesTotal": 0, + "collections": [], + "documents": [], + "storage": [], + "databaseReads": [], + "databaseWrites": [] + } }, "usageCollection": { "description": "UsageCollection", @@ -41418,7 +42852,12 @@ "range", "documentsTotal", "documents" - ] + ], + "example": { + "range": "30d", + "documentsTotal": 0, + "documents": [] + } }, "usageUsers": { "description": "UsageUsers", @@ -41464,7 +42903,14 @@ "sessionsTotal", "users", "sessions" - ] + ], + "example": { + "range": "30d", + "usersTotal": 0, + "sessionsTotal": 0, + "users": [], + "sessions": [] + } }, "usageStorage": { "description": "StorageUsage", @@ -41526,7 +42972,16 @@ "buckets", "files", "storage" - ] + ], + "example": { + "range": "30d", + "bucketsTotal": 0, + "filesTotal": 0, + "filesStorageTotal": 0, + "buckets": [], + "files": [], + "storage": [] + } }, "usageBuckets": { "description": "UsageBuckets", @@ -41588,7 +43043,16 @@ "storage", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "range": "30d", + "filesTotal": 0, + "filesStorageTotal": 0, + "files": [], + "storage": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "usageFunctions": { "description": "UsageFunctions", @@ -41794,7 +43258,34 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "functionsTotal": 0, + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "functions": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageFunction": { "description": "UsageFunction", @@ -41991,7 +43482,33 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageSites": { "description": "UsageSites", @@ -42245,7 +43762,40 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "sitesTotal": 0, + "sites": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageSite": { "description": "UsageSite", @@ -42490,7 +44040,39 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageProject": { "description": "UsageProject", @@ -42743,7 +44325,40 @@ "databasesWrites", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "executionsTotal": 0, + "documentsTotal": 0, + "databasesTotal": 0, + "databasesStorageTotal": 0, + "usersTotal": 0, + "filesStorageTotal": 0, + "functionsStorageTotal": 0, + "buildsStorageTotal": 0, + "deploymentsStorageTotal": 0, + "bucketsTotal": 0, + "executionsMbSecondsTotal": 0, + "buildsMbSecondsTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "requests": [], + "network": [], + "users": [], + "executions": [], + "executionsBreakdown": [], + "bucketsBreakdown": [], + "databasesStorageBreakdown": [], + "executionsMbSecondsBreakdown": [], + "buildsMbSecondsBreakdown": [], + "functionsStorageBreakdown": [], + "authPhoneTotal": 0, + "authPhoneEstimate": 0, + "authPhoneCountryBreakdown": [], + "databasesReads": [], + "databasesWrites": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "headers": { "description": "Headers", @@ -42763,7 +44378,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -42797,7 +44416,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "proxyRule": { "description": "Rule", @@ -42896,7 +44521,24 @@ "status", "logs", "renewAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "function", + "status": "verified", + "logs": "HTTP challegne failed.", + "renewAt": "datetime" + } }, "smsTemplate": { "description": "SmsTemplate", @@ -42922,7 +44564,12 @@ "type", "locale", "message" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account." + } }, "emailTemplate": { "description": "EmailTemplate", @@ -42972,7 +44619,16 @@ "senderEmail", "replyTo", "subject" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyTo": "emails@appwrite.io", + "subject": "Please verify your email address" + } }, "consoleVariables": { "description": "Console Variables", @@ -42993,6 +44649,11 @@ "description": "AAAA target for your Appwrite custom domains.", "x-example": "::1" }, + "_APP_DOMAIN_TARGET_CAA": { + "type": "string", + "description": "CAA target for your Appwrite custom domains.", + "x-example": "digicert.com" + }, "_APP_STORAGE_LIMIT": { "type": "integer", "description": "Maximum file size allowed for file upload in bytes.", @@ -43050,6 +44711,7 @@ "_APP_DOMAIN_TARGET_CNAME", "_APP_DOMAIN_TARGET_A", "_APP_DOMAIN_TARGET_AAAA", + "_APP_DOMAIN_TARGET_CAA", "_APP_STORAGE_LIMIT", "_APP_COMPUTE_SIZE_LIMIT", "_APP_USAGE_STATS", @@ -43060,7 +44722,23 @@ "_APP_DOMAIN_FUNCTIONS", "_APP_OPTIONS_FORCE_HTTPS", "_APP_DOMAINS_NAMESERVERS" - ] + ], + "example": { + "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", + "_APP_DOMAIN_TARGET_A": "127.0.0.1", + "_APP_DOMAIN_TARGET_AAAA": "::1", + "_APP_DOMAIN_TARGET_CAA": "digicert.com", + "_APP_STORAGE_LIMIT": "30000000", + "_APP_COMPUTE_SIZE_LIMIT": "30000000", + "_APP_USAGE_STATS": "enabled", + "_APP_VCS_ENABLED": true, + "_APP_DOMAIN_ENABLED": true, + "_APP_ASSISTANT_ENABLED": true, + "_APP_DOMAIN_SITES": "sites.localhost", + "_APP_DOMAIN_FUNCTIONS": "functions.localhost", + "_APP_OPTIONS_FORCE_HTTPS": "enabled", + "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -43092,7 +44770,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -43112,7 +44796,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -43132,7 +44822,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -43164,7 +44858,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -43230,7 +44930,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -43340,7 +45055,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -43402,7 +45143,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -43476,7 +45227,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -43538,7 +45309,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } }, "migration": { "description": "Migration", @@ -43626,7 +45408,23 @@ "statusCounters", "resourceData", "errors" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "stage": "init", + "source": "Appwrite", + "destination": "Appwrite", + "resources": [ + "user" + ], + "resourceId": "databaseId:collectionId", + "statusCounters": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}", + "resourceData": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]", + "errors": [] + } }, "migrationReport": { "description": "Migration Report", @@ -43696,7 +45494,18 @@ "function", "size", "version" - ] + ], + "example": { + "user": 20, + "team": 20, + "database": 20, + "document": 20, + "file": 20, + "bucket": 20, + "function": 20, + "size": 30000, + "version": "1.4.0" + } } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-1.7.x-server.json b/app/config/specs/open-api3-1.7.x-server.json index db615d642c..65eb2b29d0 100644 --- a/app/config/specs/open-api3-1.7.x-server.json +++ b/app/config/specs/open-api3-1.7.x-server.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.7.0", + "version": "1.7.4", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -2303,7 +2303,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2354,7 +2354,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "" }, "email": { @@ -2436,7 +2436,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "" }, "email": { @@ -2658,7 +2658,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "x-example": "" }, "phone": { @@ -3129,7 +3129,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "schema": { "type": "string", @@ -3147,7 +3147,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3167,7 +3167,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -7497,6 +7497,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", "server", "server" @@ -7505,10 +7506,10 @@ "methods": [ { "name": "createDocument", + "desc": "Create document", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [], + "Session": [] }, "parameters": [ "databaseId", @@ -7529,7 +7530,34 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md" + }, + { + "name": "createDocuments", + "desc": "Create documents", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md" } ], "auth": { @@ -7606,7 +7634,7 @@ } }, "put": { - "summary": "Create or update documents", + "summary": "Upsert documents", "operationId": "databasesUpsertDocuments", "tags": [ "databases" @@ -7627,7 +7655,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -7638,6 +7666,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7688,7 +7717,10 @@ "type": "object" } } - } + }, + "required": [ + "documents" + ] } } } @@ -7716,7 +7748,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -7727,6 +7759,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7810,7 +7843,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -7821,6 +7854,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8210,7 +8244,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8273,6 +8307,240 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -8661,7 +8929,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -8735,7 +9003,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -8818,6 +9086,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -8843,7 +9112,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -8967,7 +9237,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -9017,7 +9287,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -9068,7 +9338,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -9128,7 +9398,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -9218,6 +9488,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9243,7 +9514,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9357,7 +9629,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -9419,7 +9691,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -9500,7 +9772,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -9584,7 +9856,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 382, "cookies": false, "type": "upload", "deprecated": false, @@ -9681,7 +9953,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -9767,7 +10039,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -9871,7 +10143,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -9969,7 +10241,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -10032,7 +10304,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -10097,7 +10369,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 389, "cookies": false, "type": "location", "deprecated": false, @@ -10188,7 +10460,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -10260,7 +10532,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -10337,7 +10609,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -10422,7 +10694,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "" } } } @@ -10454,7 +10726,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -10521,7 +10793,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -10593,7 +10865,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -10653,7 +10925,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -10745,7 +11017,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -10815,7 +11087,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -10907,7 +11179,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -10979,7 +11251,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 308, "cookies": false, "type": "graphql", "deprecated": false, @@ -11033,7 +11305,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -11087,7 +11359,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -11137,7 +11409,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -11187,7 +11459,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11237,7 +11509,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11298,7 +11570,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11348,7 +11620,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11398,7 +11670,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11461,7 +11733,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11524,7 +11796,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11598,7 +11870,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11661,7 +11933,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -11750,7 +12022,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11813,7 +12085,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11876,7 +12148,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -11939,7 +12211,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12002,7 +12274,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12065,7 +12337,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12128,7 +12400,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -12191,7 +12463,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12254,7 +12526,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -12304,7 +12576,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -12354,7 +12626,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12404,7 +12676,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12458,7 +12730,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12512,7 +12784,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -12566,7 +12838,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12620,7 +12892,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12674,7 +12946,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -12728,7 +13000,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12782,7 +13054,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12836,7 +13108,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -12913,7 +13185,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -13058,7 +13330,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -13205,7 +13477,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -13380,7 +13652,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -13559,7 +13831,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -13669,7 +13941,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -13782,7 +14054,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -13836,7 +14108,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -13899,7 +14171,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -13975,7 +14247,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -14051,7 +14323,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -14128,7 +14400,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -14234,7 +14506,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -14343,7 +14615,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -14429,7 +14701,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -14518,7 +14790,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -14634,7 +14906,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -14753,7 +15025,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -14849,7 +15121,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -14948,7 +15220,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -15054,7 +15326,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -15163,7 +15435,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -15307,7 +15579,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -15453,7 +15725,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -15549,7 +15821,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -15648,7 +15920,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -15744,7 +16016,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -15843,7 +16115,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -15939,7 +16211,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -16038,7 +16310,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -16134,7 +16406,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -16233,7 +16505,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -16287,7 +16559,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -16350,7 +16622,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -16426,7 +16698,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -16502,7 +16774,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -16577,7 +16849,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -16661,7 +16933,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16722,7 +16994,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16800,7 +17072,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16863,7 +17135,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -16939,7 +17211,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -17024,7 +17296,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -17116,7 +17388,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -17180,7 +17452,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -17257,7 +17529,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -17328,7 +17600,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -17464,6 +17736,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17489,7 +17762,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -17576,7 +17850,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -17626,7 +17900,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -17677,7 +17951,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -17737,7 +18011,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -17880,6 +18154,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17905,7 +18180,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -17981,7 +18257,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -18043,7 +18319,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -18124,7 +18400,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -18208,7 +18484,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 411, "cookies": false, "type": "upload", "deprecated": false, @@ -18310,7 +18586,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -18391,7 +18667,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -18495,7 +18771,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -18594,7 +18870,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -18657,7 +18933,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -18722,7 +18998,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 418, "cookies": false, "type": "location", "deprecated": false, @@ -18813,7 +19089,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -18885,7 +19161,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -18957,7 +19233,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -19020,7 +19296,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -19092,7 +19368,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -19152,7 +19428,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -19244,7 +19520,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -19314,7 +19590,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -19406,7 +19682,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -19478,7 +19754,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -19552,7 +19828,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -19680,7 +19956,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -19740,7 +20016,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -19865,7 +20141,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -19927,7 +20203,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -20015,7 +20291,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -20115,7 +20391,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -20189,7 +20465,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -20280,7 +20556,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -20349,7 +20625,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -20429,7 +20705,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -20620,7 +20896,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -20658,7 +20935,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -20745,7 +21022,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -20823,7 +21100,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -20910,7 +21187,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -20974,7 +21251,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -21050,7 +21327,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -21116,7 +21393,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -21204,7 +21481,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -21317,7 +21594,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -21391,7 +21668,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -21480,7 +21757,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -21556,7 +21833,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -21655,7 +21932,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -21717,7 +21994,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -21800,7 +22077,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -21881,7 +22158,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -21971,7 +22248,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -22032,7 +22309,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -22103,7 +22380,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 443, "cookies": false, "type": "", "deprecated": false, @@ -22166,7 +22443,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -22240,7 +22517,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -22329,7 +22606,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -22415,7 +22692,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -22501,7 +22778,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -22570,7 +22847,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -22632,7 +22909,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -22718,7 +22995,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -22804,7 +23081,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -22920,7 +23197,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -23024,7 +23301,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -23130,7 +23407,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -23183,7 +23460,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -23245,7 +23522,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -23326,7 +23603,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -23409,7 +23686,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -23493,7 +23770,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -23568,7 +23845,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -23654,7 +23931,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -23728,7 +24005,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -23805,7 +24082,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -23867,7 +24144,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -23927,7 +24204,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -23987,7 +24264,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -24049,7 +24326,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -24130,7 +24407,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -24211,7 +24488,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -24292,7 +24569,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -24352,7 +24629,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -24433,7 +24710,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -24493,7 +24770,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -24546,7 +24823,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -24601,7 +24878,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -24673,7 +24950,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -24754,7 +25031,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -24793,7 +25070,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "schema": { "type": "array", @@ -24828,7 +25105,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -24939,7 +25216,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -25010,7 +25287,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -25100,7 +25377,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -25173,7 +25450,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -25256,7 +25533,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -25337,7 +25614,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -25471,7 +25748,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -25503,7 +25781,13 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } }, "documentList": { "description": "Documents List", @@ -25527,7 +25811,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -25551,7 +25839,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -25575,7 +25867,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -25599,7 +25895,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -25623,7 +25923,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -25647,7 +25951,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -25671,7 +25979,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -25695,7 +26007,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -25719,7 +26035,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -25743,7 +26063,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -25767,7 +26091,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -25791,7 +26119,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -25815,7 +26147,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -25839,7 +26175,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "functionList": { "description": "Functions List", @@ -25863,7 +26203,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -25887,7 +26231,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -25911,7 +26259,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -25935,7 +26287,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -25959,7 +26315,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -25983,7 +26343,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -26007,7 +26371,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -26031,7 +26399,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -26055,7 +26427,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -26079,7 +26455,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -26103,7 +26483,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -26127,7 +26511,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -26151,7 +26539,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -26175,7 +26567,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -26199,7 +26595,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -26223,7 +26623,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -26247,7 +26651,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "specificationList": { "description": "Specifications List", @@ -26271,7 +26679,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "database": { "description": "Database", @@ -26309,7 +26721,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -26419,7 +26838,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -26474,7 +26907,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -26532,6 +26969,12 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "default", "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "nullable": true } }, "required": [ @@ -26543,7 +26986,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -26620,7 +27076,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -26697,7 +27166,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -26759,7 +27241,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -26827,7 +27320,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -26904,7 +27409,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -26972,7 +27490,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -27040,7 +27570,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -27108,7 +27650,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -27200,7 +27754,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -27272,7 +27842,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -27283,15 +27864,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -27317,12 +27907,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -27456,7 +28063,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -27617,7 +28247,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -27631,7 +28287,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -27645,7 +28304,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -27659,7 +28321,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -27673,7 +28338,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -27715,7 +28383,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -27747,7 +28422,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -27782,12 +28463,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -27974,7 +28666,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -28042,7 +28767,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -28086,7 +28823,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -28100,7 +28845,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -28150,7 +28898,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -28170,7 +28927,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -28252,7 +29013,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -28344,7 +29120,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -28394,7 +29189,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -28445,7 +29249,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -28536,7 +29351,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -28722,7 +29554,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -28911,7 +29774,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "runtime": { "description": "Runtime", @@ -28970,7 +29863,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -29025,7 +29928,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -29063,7 +29984,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -29237,7 +30165,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -29273,6 +30230,11 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -29357,6 +30319,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -29368,7 +30331,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "variable": { "description": "Variable", @@ -29424,7 +30417,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -29444,7 +30447,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -29464,7 +30471,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -29490,7 +30501,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -29542,7 +30558,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -29568,7 +30593,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -29588,7 +30618,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -29603,7 +30637,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -29630,7 +30667,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -29674,7 +30716,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -29703,7 +30753,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "headers": { "description": "Headers", @@ -29723,7 +30778,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -29757,7 +30816,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -29789,7 +30854,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -29809,7 +30880,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -29829,7 +30906,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -29861,7 +30942,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -29927,7 +31014,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -30037,7 +31139,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -30099,7 +31227,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -30173,7 +31311,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -30235,7 +31393,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-1.8.x-client.json b/app/config/specs/open-api3-1.8.x-client.json new file mode 100644 index 0000000000..d57b9f83b2 --- /dev/null +++ b/app/config/specs/open-api3-1.8.x-client.json @@ -0,0 +1,12064 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.8.0", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1" + }, + { + "url": "https:\/\/.cloud.appwrite.io\/v1" + } + ], + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "demo": "account\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "demo": "account\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "demo": "account\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "demo": "account\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "demo": "account\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaType" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaChallenge" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + } + } + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "x-example": "" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + } + } + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "demo": "account\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + } + } + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "demo": "account\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "demo": "account\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "tags": [ + "account" + ], + "description": "Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "demo": "account\/create-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "demo": "account\/update-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "x-example": "" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "demo": "account\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "demo": "account\/update-magic-url-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 session", + "operationId": "accountCreateOAuth2Session", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "301": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createOAuth2Session", + "group": "sessions", + "weight": 20, + "cookies": false, + "type": "webAuth", + "demo": "account\/create-o-auth-2-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "demo": "account\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "demo": "account\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/targets\/push": { + "post": { + "summary": "Create push target", + "operationId": "accountCreatePushTarget", + "tags": [ + "account" + ], + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPushTarget", + "group": "pushTargets", + "weight": 55, + "cookies": false, + "type": "", + "demo": "account\/create-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "" + } + }, + "required": [ + "targetId", + "identifier" + ] + } + } + } + } + } + }, + "\/account\/targets\/{targetId}\/push": { + "put": { + "summary": "Update push target", + "operationId": "accountUpdatePushTarget", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePushTarget", + "group": "pushTargets", + "weight": 56, + "cookies": false, + "type": "", + "demo": "account\/update-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "" + } + }, + "required": [ + "identifier" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete push target", + "operationId": "accountDeletePushTarget", + "tags": [ + "account" + ], + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deletePushTarget", + "group": "pushTargets", + "weight": 57, + "cookies": false, + "type": "", + "demo": "account\/delete-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "demo": "account\/create-magic-url-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "demo": "account\/create-o-auth-2-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", + "x-example": "" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + } + } + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "demo": "avatars\/get-browser.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "schema": { + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "tags": [ + "avatars" + ], + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "demo": "avatars\/get-credit-card.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", + "required": true, + "schema": { + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "unionpay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "demo": "avatars\/get-favicon.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "demo": "avatars\/get-flag.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "demo": "avatars\/get-image.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "demo": "avatars\/get-initials.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "background", + "description": "Changes background color. By default a random color will be picked and stay will persistent to the given name.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "tags": [ + "avatars" + ], + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "demo": "avatars\/get-qr.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 400 + }, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "download", + "description": "Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.", + "required": false, + "schema": { + "type": "boolean", + "x-example": false, + "default": false + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 335, + "cookies": false, + "type": "", + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 327, + "cookies": false, + "type": "", + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, + "methods": [ + { + "name": "createDocument", + "namespace": "databases", + "desc": "Create document", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 328, + "cookies": false, + "type": "", + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "databasesUpsertDocument", + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 331, + "cookies": false, + "type": "", + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 329, + "cookies": false, + "type": "", + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 333, + "cookies": false, + "type": "", + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 456, + "cookies": false, + "type": "", + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "content": { + "multipart\/form-data": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 454, + "cookies": false, + "type": "", + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "x-example": "" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "x-example": "" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is POST.", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS", + "HEAD" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "string", + "description": "HTTP headers of execution. Defaults to empty.", + "x-example": null + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "x-example": "" + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 455, + "cookies": false, + "type": "", + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 250, + "cookies": false, + "type": "graphql", + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 249, + "cookies": false, + "type": "graphql", + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "tags": [ + "locale" + ], + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "responses": { + "200": { + "description": "Locale", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/locale" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 70, + "cookies": false, + "type": "", + "demo": "locale\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/localeCodeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 71, + "cookies": false, + "type": "", + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/continentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 75, + "cookies": false, + "type": "", + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 72, + "cookies": false, + "type": "", + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "tags": [ + "locale" + ], + "description": "List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 73, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-eu.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/phoneList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 74, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "tags": [ + "locale" + ], + "description": "List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Currencies List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/currencyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 76, + "cookies": false, + "type": "", + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "tags": [ + "locale" + ], + "description": "List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.", + "responses": { + "200": { + "description": "Languages List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/languageList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 77, + "cookies": false, + "type": "", + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 296, + "cookies": false, + "type": "", + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "x-example": "" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "x-example": "" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 300, + "cookies": false, + "type": "", + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/fileList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 160, + "cookies": false, + "type": "", + "demo": "storage\/list-files.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 159, + "cookies": false, + "type": "upload", + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "fileId": { + "type": "string", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "", + "x-upload-id": true + }, + "file": { + "type": "string", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "x-example": null + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "fileId", + "file" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 161, + "cookies": false, + "type": "", + "demo": "storage\/get-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 166, + "cookies": false, + "type": "", + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "x-example": "" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 167, + "cookies": false, + "type": "", + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 163, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "tags": [ + "storage" + ], + "description": "Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 162, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-preview.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "schema": { + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center" + }, + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "x-example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0 + }, + "in": "query" + }, + { + "name": "background", + "description": "Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "x-example": "jpg", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "" + }, + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 164, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-view.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/teamList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 171, + "cookies": false, + "type": "", + "demo": "teams\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 170, + "cookies": false, + "type": "", + "demo": "teams\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "x-example": "" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 172, + "cookies": false, + "type": "", + "demo": "teams\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 174, + "cookies": false, + "type": "", + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 176, + "cookies": false, + "type": "", + "demo": "teams\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 178, + "cookies": false, + "type": "", + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 177, + "cookies": false, + "type": "", + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "x-example": "" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "roles" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 179, + "cookies": false, + "type": "", + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 180, + "cookies": false, + "type": "", + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "tags": [ + "teams" + ], + "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 182, + "cookies": false, + "type": "", + "demo": "teams\/delete-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 181, + "cookies": false, + "type": "", + "demo": "teams\/update-membership-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 173, + "cookies": false, + "type": "", + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 175, + "cookies": false, + "type": "", + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "components": { + "schemas": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true, + "example": [] + }, + "error": { + "description": "Error", + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Error message.", + "x-example": "Not found" + }, + "code": { + "type": "string", + "description": "Error code.", + "x-example": "404" + }, + "type": { + "type": "string", + "description": "Error type. You can learn more about all the error types at https:\/\/appwrite.io\/docs\/error-codes#errorTypes", + "x-example": "not_found" + }, + "version": { + "type": "string", + "description": "Server version number.", + "x-example": "1.0" + } + }, + "required": [ + "message", + "code", + "type", + "version" + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "$ref": "#\/components\/schemas\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "$ref": "#\/components\/schemas\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ], + "example": { + "total": 5, + "documents": "" + } + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "$ref": "#\/components\/schemas\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ], + "example": { + "total": 5, + "sessions": "" + } + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "$ref": "#\/components\/schemas\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ], + "example": { + "total": 5, + "identities": "" + } + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "$ref": "#\/components\/schemas\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ], + "example": { + "total": 5, + "logs": "" + } + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "$ref": "#\/components\/schemas\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ], + "example": { + "total": 5, + "files": "" + } + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "$ref": "#\/components\/schemas\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ], + "example": { + "total": 5, + "teams": "" + } + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "$ref": "#\/components\/schemas\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ], + "example": { + "total": 5, + "memberships": "" + } + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "$ref": "#\/components\/schemas\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ], + "example": { + "total": 5, + "executions": "" + } + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "$ref": "#\/components\/schemas\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ], + "example": { + "total": 5, + "countries": "" + } + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "$ref": "#\/components\/schemas\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ], + "example": { + "total": 5, + "continents": "" + } + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "$ref": "#\/components\/schemas\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ], + "example": { + "total": 5, + "languages": "" + } + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "$ref": "#\/components\/schemas\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ], + "example": { + "total": 5, + "currencies": "" + } + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "$ref": "#\/components\/schemas\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ], + "example": { + "total": 5, + "phones": "" + } + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "$ref": "#\/components\/schemas\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ], + "example": { + "total": 5, + "localeCodes": "" + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/algoArgon2" + }, + { + "$ref": "#\/components\/schemas\/algoScrypt" + }, + { + "$ref": "#\/components\/schemas\/algoScryptModified" + }, + { + "$ref": "#\/components\/schemas\/algoBcrypt" + }, + { + "$ref": "#\/components\/schemas\/algoPhpass" + }, + { + "$ref": "#\/components\/schemas\/algoSha" + }, + { + "$ref": "#\/components\/schemas\/algoMd5" + } + ] + }, + "nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ], + "example": { + "type": "md5" + } + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ], + "example": { + "type": "sha" + } + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ], + "example": { + "type": "phpass" + } + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ], + "example": { + "type": "bcrypt" + } + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "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.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "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.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ], + "example": { + "code": "en-us", + "name": "US" + } + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "deploymentId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "United States", + "code": "US" + } + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "Europe", + "code": "EU" + } + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ], + "example": { + "secret": true, + "uri": true + } + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "$ref": "#\/components\/schemas\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } + } + }, + "securitySchemes": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header" + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Session": { + "type": "apiKey", + "name": "X-Appwrite-Session", + "description": "The user session to authenticate with", + "in": "header" + }, + "DevKey": { + "type": "apiKey", + "name": "X-Appwrite-Dev-Key", + "description": "Your secret dev API key", + "in": "header" + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/open-api3-1.8.x-console.json b/app/config/specs/open-api3-1.8.x-console.json new file mode 100644 index 0000000000..ab36ae475c --- /dev/null +++ b/app/config/specs/open-api3-1.8.x-console.json @@ -0,0 +1,57075 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.8.0", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1" + }, + { + "url": "https:\/\/.cloud.appwrite.io\/v1" + } + ], + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "demo": "account\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "demo": "account\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete account", + "operationId": "accountDelete", + "tags": [ + "account" + ], + "description": "Delete the currently logged in user.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "account", + "weight": 11, + "cookies": false, + "type": "", + "demo": "account\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "demo": "account\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "demo": "account\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "demo": "account\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaType" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaChallenge" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + } + } + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "x-example": "" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + } + } + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "demo": "account\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + } + } + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "demo": "account\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "demo": "account\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "tags": [ + "account" + ], + "description": "Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "demo": "account\/create-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "demo": "account\/update-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "x-example": "" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "demo": "account\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "demo": "account\/update-magic-url-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 session", + "operationId": "accountCreateOAuth2Session", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "301": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createOAuth2Session", + "group": "sessions", + "weight": 20, + "cookies": false, + "type": "webAuth", + "demo": "account\/create-o-auth-2-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "demo": "account\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "demo": "account\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/targets\/push": { + "post": { + "summary": "Create push target", + "operationId": "accountCreatePushTarget", + "tags": [ + "account" + ], + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPushTarget", + "group": "pushTargets", + "weight": 55, + "cookies": false, + "type": "", + "demo": "account\/create-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "" + } + }, + "required": [ + "targetId", + "identifier" + ] + } + } + } + } + } + }, + "\/account\/targets\/{targetId}\/push": { + "put": { + "summary": "Update push target", + "operationId": "accountUpdatePushTarget", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePushTarget", + "group": "pushTargets", + "weight": 56, + "cookies": false, + "type": "", + "demo": "account\/update-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "" + } + }, + "required": [ + "identifier" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete push target", + "operationId": "accountDeletePushTarget", + "tags": [ + "account" + ], + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deletePushTarget", + "group": "pushTargets", + "weight": 57, + "cookies": false, + "type": "", + "demo": "account\/delete-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "demo": "account\/create-magic-url-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "demo": "account\/create-o-auth-2-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", + "x-example": "" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + } + } + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "demo": "avatars\/get-browser.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "schema": { + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "tags": [ + "avatars" + ], + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "demo": "avatars\/get-credit-card.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", + "required": true, + "schema": { + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "unionpay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "demo": "avatars\/get-favicon.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "demo": "avatars\/get-flag.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "demo": "avatars\/get-image.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "demo": "avatars\/get-initials.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "background", + "description": "Changes background color. By default a random color will be picked and stay will persistent to the given name.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "tags": [ + "avatars" + ], + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "demo": "avatars\/get-qr.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 400 + }, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "download", + "description": "Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.", + "required": false, + "schema": { + "type": "boolean", + "x-example": false, + "default": false + }, + "in": "query" + } + ] + } + }, + "\/console\/assistant": { + "post": { + "summary": "Create assistant query", + "operationId": "assistantChat", + "tags": [ + "assistant" + ], + "description": "Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream. ", + "responses": { + "200": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "chat", + "group": "console", + "weight": 252, + "cookies": false, + "type": "", + "demo": "assistant\/chat.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/assistant\/chat.md", + "rate-limit": 15, + "rate-time": 3600, + "rate-key": "userId:{userId}", + "scope": "assistant.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "description": "Prompt. A string containing questions asked to the AI assistant.", + "x-example": "" + } + }, + "required": [ + "prompt" + ] + } + } + } + } + } + }, + "\/console\/resources": { + "get": { + "summary": "Check resource ID availability", + "operationId": "consoleGetResource", + "tags": [ + "console" + ], + "description": "Check if a resource ID is available.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getResource", + "group": null, + "weight": 496, + "cookies": false, + "type": "", + "demo": "console\/get-resource.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCheck if a resource ID is available.", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "value", + "description": "Resource value.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "query" + }, + { + "name": "type", + "description": "Resource type.", + "required": true, + "schema": { + "type": "string", + "x-example": "rules", + "enum": [ + "rules" + ], + "x-enum-name": "ConsoleResourceType", + "x-enum-keys": [] + }, + "in": "query" + } + ] + } + }, + "\/console\/variables": { + "get": { + "summary": "Get variables", + "operationId": "consoleVariables", + "tags": [ + "console" + ], + "description": "Get all Environment Variables that are relevant for the console.", + "responses": { + "200": { + "description": "Console Variables", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/consoleVariables" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "variables", + "group": "console", + "weight": 251, + "cookies": false, + "type": "", + "demo": "console\/variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/console\/variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/databases": { + "get": { + "summary": "List databases", + "operationId": "databasesList", + "tags": [ + "databases" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "list", + "group": "databases", + "weight": 316, + "cookies": false, + "type": "", + "demo": "databases\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + }, + "methods": [ + { + "name": "list", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "queries", + "search" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/databaseList" + } + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "demo": "databases\/list.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "databasesCreate", + "tags": [ + "databases" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "create", + "group": "databases", + "weight": 312, + "cookies": false, + "type": "", + "demo": "databases\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + }, + "methods": [ + { + "name": "create", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Create a new Database.\n", + "demo": "databases\/create.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/usage": { + "get": { + "summary": "Get databases usage stats", + "operationId": "databasesListUsage", + "tags": [ + "databases" + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabases", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageDatabases" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 319, + "cookies": false, + "type": "", + "demo": "databases\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listUsage" + }, + "methods": [ + { + "name": "listUsage", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "range" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/usageDatabases" + } + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "databases\/list-usage.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listUsage" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "databasesGet", + "tags": [ + "databases" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "get", + "group": "databases", + "weight": 313, + "cookies": false, + "type": "", + "demo": "databases\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + }, + "methods": [ + { + "name": "get", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "demo": "databases\/get.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "databasesUpdate", + "tags": [ + "databases" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "update", + "group": "databases", + "weight": 314, + "cookies": false, + "type": "", + "demo": "databases\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + }, + "methods": [ + { + "name": "update", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Update a database by its unique ID.", + "demo": "databases\/update.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "databasesDelete", + "tags": [ + "databases" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "delete", + "group": "databases", + "weight": 315, + "cookies": false, + "type": "", + "demo": "databases\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + }, + "methods": [ + { + "name": "delete", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "demo": "databases\/delete.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "databasesListCollections", + "tags": [ + "databases" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collectionList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listCollections", + "group": "collections", + "weight": 324, + "cookies": false, + "type": "", + "demo": "databases\/list-collections.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTables" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create collections", + "operationId": "databasesCreateCollection", + "tags": [ + "databases" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createCollection", + "group": "collections", + "weight": 320, + "cookies": false, + "type": "", + "demo": "databases\/create-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "collectionId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "x-example": "" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "databasesGetCollection", + "tags": [ + "databases" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getCollection", + "group": "collections", + "weight": 321, + "cookies": false, + "type": "", + "demo": "databases\/get-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "databasesUpdateCollection", + "tags": [ + "databases" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateCollection", + "group": "collections", + "weight": 322, + "cookies": false, + "type": "", + "demo": "databases\/update-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "x-example": "" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete collection", + "operationId": "databasesDeleteCollection", + "tags": [ + "databases" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteCollection", + "group": "collections", + "weight": 323, + "cookies": false, + "type": "", + "demo": "databases\/delete-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes": { + "get": { + "summary": "List attributes", + "operationId": "databasesListAttributes", + "tags": [ + "databases" + ], + "description": "List attributes in the collection.", + "responses": { + "200": { + "description": "Attributes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listAttributes", + "group": "attributes", + "weight": 341, + "cookies": false, + "type": "", + "demo": "databases\/list-attributes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listColumns" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean": { + "post": { + "summary": "Create boolean attribute", + "operationId": "databasesCreateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Create a boolean attribute.\n", + "responses": { + "202": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createBooleanAttribute", + "group": "attributes", + "weight": 342, + "cookies": false, + "type": "", + "demo": "databases\/create-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBooleanColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean\/{key}": { + "patch": { + "summary": "Update boolean attribute", + "operationId": "databasesUpdateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Update a boolean attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateBooleanAttribute", + "group": "attributes", + "weight": 343, + "cookies": false, + "type": "", + "demo": "databases\/update-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBooleanColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime": { + "post": { + "summary": "Create datetime attribute", + "operationId": "databasesCreateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Create a date time attribute according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createDatetimeAttribute", + "group": "attributes", + "weight": 344, + "cookies": false, + "type": "", + "demo": "databases\/create-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createDatetimeColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { + "patch": { + "summary": "Update datetime attribute", + "operationId": "databasesUpdateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Update a date time attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDatetimeAttribute", + "group": "attributes", + "weight": 345, + "cookies": false, + "type": "", + "demo": "databases\/update-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateDatetimeColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email": { + "post": { + "summary": "Create email attribute", + "operationId": "databasesCreateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Create an email attribute.\n", + "responses": { + "202": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createEmailAttribute", + "group": "attributes", + "weight": 346, + "cookies": false, + "type": "", + "demo": "databases\/create-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEmailColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email\/{key}": { + "patch": { + "summary": "Update email attribute", + "operationId": "databasesUpdateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateEmailAttribute", + "group": "attributes", + "weight": 347, + "cookies": false, + "type": "", + "demo": "databases\/update-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEmailColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum": { + "post": { + "summary": "Create enum attribute", + "operationId": "databasesCreateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "responses": { + "202": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createEnumAttribute", + "group": "attributes", + "weight": 348, + "cookies": false, + "type": "", + "demo": "databases\/create-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEnumColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum\/{key}": { + "patch": { + "summary": "Update enum attribute", + "operationId": "databasesUpdateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateEnumAttribute", + "group": "attributes", + "weight": 349, + "cookies": false, + "type": "", + "demo": "databases\/update-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEnumColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float": { + "post": { + "summary": "Create float attribute", + "operationId": "databasesCreateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createFloatAttribute", + "group": "attributes", + "weight": 350, + "cookies": false, + "type": "", + "demo": "databases\/create-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createFloatColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value.", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float\/{key}": { + "patch": { + "summary": "Update float attribute", + "operationId": "databasesUpdateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateFloatAttribute", + "group": "attributes", + "weight": 351, + "cookies": false, + "type": "", + "demo": "databases\/update-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateFloatColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value.", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer": { + "post": { + "summary": "Create integer attribute", + "operationId": "databasesCreateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIntegerAttribute", + "group": "attributes", + "weight": 352, + "cookies": false, + "type": "", + "demo": "databases\/create-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIntegerColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer\/{key}": { + "patch": { + "summary": "Update integer attribute", + "operationId": "databasesUpdateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIntegerAttribute", + "group": "attributes", + "weight": 353, + "cookies": false, + "type": "", + "demo": "databases\/update-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIntegerColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip": { + "post": { + "summary": "Create IP address attribute", + "operationId": "databasesCreateIpAttribute", + "tags": [ + "databases" + ], + "description": "Create IP address attribute.\n", + "responses": { + "202": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIpAttribute", + "group": "attributes", + "weight": 354, + "cookies": false, + "type": "", + "demo": "databases\/create-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIpColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 355, + "cookies": false, + "type": "", + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIpColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 356, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 357, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 358, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 359, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 360, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createRelationshipAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/create-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRelationshipColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedCollectionId": { + "type": "string", + "description": "Related Collection ID.", + "x-example": "" + }, + "type": { + "type": "string", + "description": "Relation type", + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "x-example": false + }, + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Attribute Key.", + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedCollectionId", + "type" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string": { + "post": { + "summary": "Create string attribute", + "operationId": "databasesCreateStringAttribute", + "tags": [ + "databases" + ], + "description": "Create a string attribute.\n", + "responses": { + "202": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createStringAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/create-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createStringColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "size": { + "type": "integer", + "description": "Attribute size for text attributes, in number of characters.", + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string\/{key}": { + "patch": { + "summary": "Update string attribute", + "operationId": "databasesUpdateStringAttribute", + "tags": [ + "databases" + ], + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateStringAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/update-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateStringColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string attribute.", + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url": { + "post": { + "summary": "Create URL attribute", + "operationId": "databasesCreateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Create a URL attribute.\n", + "responses": { + "202": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createUrlAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/create-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createUrlColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url\/{key}": { + "patch": { + "summary": "Update URL attribute", + "operationId": "databasesUpdateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateUrlAttribute", + "group": "attributes", + "weight": 367, + "cookies": false, + "type": "", + "demo": "databases\/update-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateUrlColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}": { + "get": { + "summary": "Get attribute", + "operationId": "databasesGetAttribute", + "tags": [ + "databases" + ], + "description": "Get attribute by ID.", + "responses": { + "200": { + "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeRelationship, or AttributeString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getAttribute", + "group": "attributes", + "weight": 339, + "cookies": false, + "type": "", + "demo": "databases\/get-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete attribute", + "operationId": "databasesDeleteAttribute", + "tags": [ + "databases" + ], + "description": "Deletes an attribute.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteAttribute", + "group": "attributes", + "weight": 340, + "cookies": false, + "type": "", + "demo": "databases\/delete-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}\/relationship": { + "patch": { + "summary": "Update relationship attribute", + "operationId": "databasesUpdateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "200": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateRelationshipAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/update-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRelationshipColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 335, + "cookies": false, + "type": "", + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 327, + "cookies": false, + "type": "", + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, + "methods": [ + { + "name": "createDocument", + "namespace": "databases", + "desc": "Create document", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + }, + { + "name": "createDocuments", + "namespace": "databases", + "desc": "Create documents", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRows" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Upsert documents", + "operationId": "databasesUpsertDocuments", + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 332, + "cookies": false, + "type": "", + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + }, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "demo": "databases\/upsert-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { + "type": "array", + "description": "Array of document data as JSON objects. May contain partial documents.", + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "documents" + ] + } + } + } + } + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDocuments", + "group": "documents", + "weight": 330, + "cookies": false, + "type": "", + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteDocuments", + "group": "documents", + "weight": 334, + "cookies": false, + "type": "", + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 328, + "cookies": false, + "type": "", + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "databasesUpsertDocument", + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 331, + "cookies": false, + "type": "", + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 329, + "cookies": false, + "type": "", + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 333, + "cookies": false, + "type": "", + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/logs": { + "get": { + "summary": "List document logs", + "operationId": "databasesListDocumentLogs", + "tags": [ + "databases" + ], + "description": "Get the document activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listDocumentLogs", + "group": "logs", + "weight": 336, + "cookies": false, + "type": "", + "demo": "databases\/list-document-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRowLogs" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "databasesListIndexes", + "tags": [ + "databases" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/indexList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 371, + "cookies": false, + "type": "", + "demo": "databases\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listIndexes" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "databasesCreateIndex", + "tags": [ + "databases" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 368, + "cookies": false, + "type": "", + "demo": "databases\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIndex" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "attributes": { + "type": "array", + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "databasesGetIndex", + "tags": [ + "databases" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 369, + "cookies": false, + "type": "", + "demo": "databases\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getIndex" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "databasesDeleteIndex", + "tags": [ + "databases" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 370, + "cookies": false, + "type": "", + "demo": "databases\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteIndex" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/logs": { + "get": { + "summary": "List collection logs", + "operationId": "databasesListCollectionLogs", + "tags": [ + "databases" + ], + "description": "Get the collection activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listCollectionLogs", + "group": "collections", + "weight": 325, + "cookies": false, + "type": "", + "demo": "databases\/list-collection-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTableLogs" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/usage": { + "get": { + "summary": "Get collection usage stats", + "operationId": "databasesGetCollectionUsage", + "tags": [ + "databases" + ], + "description": "Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageCollection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageCollection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getCollectionUsage", + "group": null, + "weight": 326, + "cookies": false, + "type": "", + "demo": "databases\/get-collection-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTableUsage" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/logs": { + "get": { + "summary": "List database logs", + "operationId": "databasesListLogs", + "tags": [ + "databases" + ], + "description": "Get the database activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 317, + "cookies": false, + "type": "", + "demo": "databases\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listDatabaseLogs" + }, + "methods": [ + { + "name": "listLogs", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "queries" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/logList" + } + ], + "description": "Get the database activity logs list by its unique ID.", + "demo": "databases\/list-logs.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listDatabaseLogs" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/usage": { + "get": { + "summary": "Get database usage stats", + "operationId": "databasesGetUsage", + "tags": [ + "databases" + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabase", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageDatabase" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 318, + "cookies": false, + "type": "", + "demo": "databases\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getUsage" + }, + "methods": [ + { + "name": "getUsage", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "range" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/usageDatabase" + } + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "databases\/get-usage.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getUsage" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/functions": { + "get": { + "summary": "List functions", + "operationId": "functionsList", + "tags": [ + "functions" + ], + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Functions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/functionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "functions", + "weight": 440, + "cookies": false, + "type": "", + "demo": "functions\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create function", + "operationId": "functionsCreate", + "tags": [ + "functions" + ], + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "responses": { + "201": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "functions", + "weight": 437, + "cookies": false, + "type": "", + "demo": "functions\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "functionId": { + "type": "string", + "description": "Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "x-example": "" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Function maximum execution time in seconds.", + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "x-example": "" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function.", + "x-example": "" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function.", + "x-example": "" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "x-example": "" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "x-example": null + } + }, + "required": [ + "functionId", + "name", + "runtime" + ] + } + } + } + } + } + }, + "\/functions\/runtimes": { + "get": { + "summary": "List runtimes", + "operationId": "functionsListRuntimes", + "tags": [ + "functions" + ], + "description": "Get a list of all runtimes that are currently active on your instance.", + "responses": { + "200": { + "description": "Runtimes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/runtimeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRuntimes", + "group": "runtimes", + "weight": 442, + "cookies": false, + "type": "", + "demo": "functions\/list-runtimes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "functionsListSpecifications", + "tags": [ + "functions" + ], + "description": "List allowed function specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSpecifications", + "group": "runtimes", + "weight": 443, + "cookies": false, + "type": "", + "demo": "functions\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/templates": { + "get": { + "summary": "List templates", + "operationId": "functionsListTemplates", + "tags": [ + "functions" + ], + "description": "List available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "responses": { + "200": { + "description": "Function Templates List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateFunctionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTemplates", + "group": "templates", + "weight": 466, + "cookies": false, + "type": "", + "demo": "functions\/list-templates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "runtimes", + "description": "List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "useCases", + "description": "List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "limit", + "description": "Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 25 + }, + "in": "query" + }, + { + "name": "offset", + "description": "Offset the list of returned templates. Maximum offset is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + } + ] + } + }, + "\/functions\/templates\/{templateId}": { + "get": { + "summary": "Get function template", + "operationId": "functionsGetTemplate", + "tags": [ + "functions" + ], + "description": "Get a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "responses": { + "200": { + "description": "Template Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateFunction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTemplate", + "group": "templates", + "weight": 465, + "cookies": false, + "type": "", + "demo": "functions\/get-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Template ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/functions\/usage": { + "get": { + "summary": "Get functions usage", + "operationId": "functionsListUsage", + "tags": [ + "functions" + ], + "description": "Get usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageFunctions", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageFunctions" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 459, + "cookies": false, + "type": "", + "demo": "functions\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}": { + "get": { + "summary": "Get function", + "operationId": "functionsGet", + "tags": [ + "functions" + ], + "description": "Get a function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "functions", + "weight": 438, + "cookies": false, + "type": "", + "demo": "functions\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update function", + "operationId": "functionsUpdate", + "tags": [ + "functions" + ], + "description": "Update function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "functions", + "weight": 439, + "cookies": false, + "type": "", + "demo": "functions\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "x-example": "" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Maximum execution time in seconds.", + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "x-example": "" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Controle System) deployment.", + "x-example": "" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function", + "x-example": "", + "x-nullable": true + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function", + "x-example": "" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "x-example": "" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete function", + "operationId": "functionsDelete", + "tags": [ + "functions" + ], + "description": "Delete a function by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "functions", + "weight": 441, + "cookies": false, + "type": "", + "demo": "functions\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployment": { + "patch": { + "summary": "Update function's deployment", + "operationId": "functionsUpdateFunctionDeployment", + "tags": [ + "functions" + ], + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFunctionDeployment", + "group": "functions", + "weight": 446, + "cookies": false, + "type": "", + "demo": "functions\/update-function-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "functionsListDeployments", + "tags": [ + "functions" + ], + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 447, + "cookies": false, + "type": "", + "demo": "functions\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "functionsCreateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 444, + "cookies": false, + "type": "upload", + "demo": "functions\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "entrypoint": { + "type": "string", + "description": "Entrypoint File.", + "x-example": "" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "" + }, + "code": { + "type": "string", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "x-example": null + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "code", + "activate" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "functionsCreateDuplicateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 452, + "cookies": false, + "type": "", + "demo": "functions\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "" + }, + "buildId": { + "type": "string", + "description": "Build unique ID.", + "x-example": "" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "functionsCreateTemplateDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 449, + "cookies": false, + "type": "", + "demo": "functions\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "x-example": "" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "x-example": "" + }, + "rootDirectory": { + "type": "string", + "description": "Path to function code in the template repo.", + "x-example": "" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the function template.", + "x-example": "" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "functionsCreateVcsDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 450, + "cookies": false, + "type": "", + "demo": "functions\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "x-example": "branch", + "enum": [ + "branch", + "commit" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "x-example": "" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "functionsGetDeployment", + "tags": [ + "functions" + ], + "description": "Get a function deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 445, + "cookies": false, + "type": "", + "demo": "functions\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "functionsDeleteDeployment", + "tags": [ + "functions" + ], + "description": "Delete a code deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 448, + "cookies": false, + "type": "", + "demo": "functions\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "functionsGetDeploymentDownload", + "tags": [ + "functions" + ], + "description": "Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 451, + "cookies": false, + "type": "location", + "demo": "functions\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source" + }, + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "functionsUpdateDeploymentStatus", + "tags": [ + "functions" + ], + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 453, + "cookies": false, + "type": "", + "demo": "functions\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 456, + "cookies": false, + "type": "", + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "content": { + "multipart\/form-data": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 454, + "cookies": false, + "type": "", + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "x-example": "" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "x-example": "" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is POST.", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS", + "HEAD" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "string", + "description": "HTTP headers of execution. Defaults to empty.", + "x-example": null + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "x-example": "" + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 455, + "cookies": false, + "type": "", + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete execution", + "operationId": "functionsDeleteExecution", + "tags": [ + "functions" + ], + "description": "Delete a function execution by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteExecution", + "group": "executions", + "weight": 457, + "cookies": false, + "type": "", + "demo": "functions\/delete-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/usage": { + "get": { + "summary": "Get function usage", + "operationId": "functionsGetUsage", + "tags": [ + "functions" + ], + "description": "Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageFunction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageFunction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 458, + "cookies": false, + "type": "", + "demo": "functions\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "functionsListVariables", + "tags": [ + "functions" + ], + "description": "Get a list of all variables of a specific function.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 462, + "cookies": false, + "type": "", + "demo": "functions\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "functionsCreateVariable", + "tags": [ + "functions" + ], + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 460, + "cookies": false, + "type": "", + "demo": "functions\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "functionsGetVariable", + "tags": [ + "functions" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 461, + "cookies": false, + "type": "", + "demo": "functions\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "functionsUpdateVariable", + "tags": [ + "functions" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 463, + "cookies": false, + "type": "", + "demo": "functions\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "functionsDeleteVariable", + "tags": [ + "functions" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 464, + "cookies": false, + "type": "", + "demo": "functions\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 250, + "cookies": false, + "type": "graphql", + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 249, + "cookies": false, + "type": "graphql", + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/health": { + "get": { + "summary": "Get HTTP", + "operationId": "healthGet", + "tags": [ + "health" + ], + "description": "Check the Appwrite HTTP server is up and responsive.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "health", + "weight": 78, + "cookies": false, + "type": "", + "demo": "health\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/anti-virus": { + "get": { + "summary": "Get antivirus", + "operationId": "healthGetAntivirus", + "tags": [ + "health" + ], + "description": "Check the Appwrite Antivirus server is up and connection is successful.", + "responses": { + "200": { + "description": "Health Antivirus", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthAntivirus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getAntivirus", + "group": "health", + "weight": 99, + "cookies": false, + "type": "", + "demo": "health\/get-antivirus.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/cache": { + "get": { + "summary": "Get cache", + "operationId": "healthGetCache", + "tags": [ + "health" + ], + "description": "Check the Appwrite in-memory cache servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCache", + "group": "health", + "weight": 81, + "cookies": false, + "type": "", + "demo": "health\/get-cache.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/certificate": { + "get": { + "summary": "Get the SSL certificate for a domain", + "operationId": "healthGetCertificate", + "tags": [ + "health" + ], + "description": "Get the SSL certificate for a domain", + "responses": { + "200": { + "description": "Health Certificate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthCertificate" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCertificate", + "group": "health", + "weight": 86, + "cookies": false, + "type": "", + "demo": "health\/get-certificate.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "domain", + "description": "string", + "required": false, + "schema": { + "type": "string" + }, + "in": "query" + } + ] + } + }, + "\/health\/db": { + "get": { + "summary": "Get DB", + "operationId": "healthGetDB", + "tags": [ + "health" + ], + "description": "Check the Appwrite database servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDB", + "group": "health", + "weight": 80, + "cookies": false, + "type": "", + "demo": "health\/get-db.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/pubsub": { + "get": { + "summary": "Get pubsub", + "operationId": "healthGetPubSub", + "tags": [ + "health" + ], + "description": "Check the Appwrite pub-sub servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPubSub", + "group": "health", + "weight": 82, + "cookies": false, + "type": "", + "demo": "health\/get-pub-sub.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/queue\/builds": { + "get": { + "summary": "Get builds queue", + "operationId": "healthGetQueueBuilds", + "tags": [ + "health" + ], + "description": "Get the number of builds that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueBuilds", + "group": "queue", + "weight": 88, + "cookies": false, + "type": "", + "demo": "health\/get-queue-builds.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/certificates": { + "get": { + "summary": "Get certificates queue", + "operationId": "healthGetQueueCertificates", + "tags": [ + "health" + ], + "description": "Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueCertificates", + "group": "queue", + "weight": 87, + "cookies": false, + "type": "", + "demo": "health\/get-queue-certificates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/databases": { + "get": { + "summary": "Get databases queue", + "operationId": "healthGetQueueDatabases", + "tags": [ + "health" + ], + "description": "Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueDatabases", + "group": "queue", + "weight": 89, + "cookies": false, + "type": "", + "demo": "health\/get-queue-databases.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Queue name for which to check the queue size", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "database_db_main" + }, + "in": "query" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/deletes": { + "get": { + "summary": "Get deletes queue", + "operationId": "healthGetQueueDeletes", + "tags": [ + "health" + ], + "description": "Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueDeletes", + "group": "queue", + "weight": 90, + "cookies": false, + "type": "", + "demo": "health\/get-queue-deletes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/failed\/{name}": { + "get": { + "summary": "Get number of failed queue jobs", + "operationId": "healthGetFailedJobs", + "tags": [ + "health" + ], + "description": "Returns the amount of failed jobs in a given queue.\n", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFailedJobs", + "group": "queue", + "weight": 100, + "cookies": false, + "type": "", + "demo": "health\/get-failed-jobs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "The name of the queue", + "required": true, + "schema": { + "type": "string", + "x-example": "v1-database", + "enum": [ + "v1-database", + "v1-deletes", + "v1-audits", + "v1-mails", + "v1-functions", + "v1-stats-resources", + "v1-stats-usage", + "v1-webhooks", + "v1-certificates", + "v1-builds", + "v1-messaging", + "v1-migrations" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/functions": { + "get": { + "summary": "Get functions queue", + "operationId": "healthGetQueueFunctions", + "tags": [ + "health" + ], + "description": "Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueFunctions", + "group": "queue", + "weight": 94, + "cookies": false, + "type": "", + "demo": "health\/get-queue-functions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/logs": { + "get": { + "summary": "Get logs queue", + "operationId": "healthGetQueueLogs", + "tags": [ + "health" + ], + "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueLogs", + "group": "queue", + "weight": 85, + "cookies": false, + "type": "", + "demo": "health\/get-queue-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/mails": { + "get": { + "summary": "Get mails queue", + "operationId": "healthGetQueueMails", + "tags": [ + "health" + ], + "description": "Get the number of mails that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMails", + "group": "queue", + "weight": 91, + "cookies": false, + "type": "", + "demo": "health\/get-queue-mails.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/messaging": { + "get": { + "summary": "Get messaging queue", + "operationId": "healthGetQueueMessaging", + "tags": [ + "health" + ], + "description": "Get the number of messages that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMessaging", + "group": "queue", + "weight": 92, + "cookies": false, + "type": "", + "demo": "health\/get-queue-messaging.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/migrations": { + "get": { + "summary": "Get migrations queue", + "operationId": "healthGetQueueMigrations", + "tags": [ + "health" + ], + "description": "Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMigrations", + "group": "queue", + "weight": 93, + "cookies": false, + "type": "", + "demo": "health\/get-queue-migrations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-resources": { + "get": { + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueStatsResources", + "group": "queue", + "weight": 95, + "cookies": false, + "type": "", + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueUsage", + "group": "queue", + "weight": 96, + "cookies": false, + "type": "", + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/webhooks": { + "get": { + "summary": "Get webhooks queue", + "operationId": "healthGetQueueWebhooks", + "tags": [ + "health" + ], + "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueWebhooks", + "group": "queue", + "weight": 84, + "cookies": false, + "type": "", + "demo": "health\/get-queue-webhooks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/storage": { + "get": { + "summary": "Get storage", + "operationId": "healthGetStorage", + "tags": [ + "health" + ], + "description": "Check the Appwrite storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getStorage", + "group": "storage", + "weight": 98, + "cookies": false, + "type": "", + "demo": "health\/get-storage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/storage\/local": { + "get": { + "summary": "Get local storage", + "operationId": "healthGetStorageLocal", + "tags": [ + "health" + ], + "description": "Check the Appwrite local storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getStorageLocal", + "group": "storage", + "weight": 97, + "cookies": false, + "type": "", + "demo": "health\/get-storage-local.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/time": { + "get": { + "summary": "Get time", + "operationId": "healthGetTime", + "tags": [ + "health" + ], + "description": "Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.", + "responses": { + "200": { + "description": "Health Time", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthTime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTime", + "group": "health", + "weight": 83, + "cookies": false, + "type": "", + "demo": "health\/get-time.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "tags": [ + "locale" + ], + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "responses": { + "200": { + "description": "Locale", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/locale" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 70, + "cookies": false, + "type": "", + "demo": "locale\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/localeCodeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 71, + "cookies": false, + "type": "", + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/continentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 75, + "cookies": false, + "type": "", + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 72, + "cookies": false, + "type": "", + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "tags": [ + "locale" + ], + "description": "List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 73, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-eu.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/phoneList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 74, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "tags": [ + "locale" + ], + "description": "List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Currencies List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/currencyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 76, + "cookies": false, + "type": "", + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "tags": [ + "locale" + ], + "description": "List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.", + "responses": { + "200": { + "description": "Languages List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/languageList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 77, + "cookies": false, + "type": "", + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages": { + "get": { + "summary": "List messages", + "operationId": "messagingListMessages", + "tags": [ + "messaging" + ], + "description": "Get a list of all messages from the current Appwrite project.", + "responses": { + "200": { + "description": "Message list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/messageList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMessages", + "group": "messages", + "weight": 304, + "cookies": false, + "type": "", + "demo": "messaging\/list-messages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/email": { + "post": { + "summary": "Create email", + "operationId": "messagingCreateEmail", + "tags": [ + "messaging" + ], + "description": "Create a new email message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmail", + "group": "messages", + "weight": 301, + "cookies": false, + "type": "", + "demo": "messaging\/create-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "x-example": "" + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as :.", + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + }, + "required": [ + "messageId", + "subject", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/email\/{messageId}": { + "patch": { + "summary": "Update email", + "operationId": "messagingUpdateEmail", + "tags": [ + "messaging" + ], + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "messages", + "weight": 308, + "cookies": false, + "type": "", + "demo": "messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "x-example": "" + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "x-example": false + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as :.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/push": { + "post": { + "summary": "Create push notification", + "operationId": "messagingCreatePush", + "tags": [ + "messaging" + ], + "description": "Create a new push notification.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPush", + "group": "messages", + "weight": 303, + "cookies": false, + "type": "", + "demo": "messaging\/create-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "x-example": "" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "x-example": "<BODY>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "data": { + "type": "object", + "description": "Additional key-value pair data for push notification.", + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web Platform.", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS Platform.", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android Platform.", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android Platform.", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + }, + "required": [ + "messageId" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/push\/{messageId}": { + "patch": { + "summary": "Update push notification", + "operationId": "messagingUpdatePush", + "tags": [ + "messaging" + ], + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePush", + "group": "messages", + "weight": 310, + "cookies": false, + "type": "", + "demo": "messaging\/update-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "x-example": "<BODY>" + }, + "data": { + "type": "object", + "description": "Additional Data for push notification.", + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web platforms.", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS platforms.", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android platforms.", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android platforms.", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS platforms.", + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSms", + "group": "messages", + "weight": 302, + "cookies": false, + "type": "", + "demo": "messaging\/create-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + }, + "methods": [ + { + "name": "createSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + } + }, + { + "name": "createSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<MESSAGE_ID>" + }, + "content": { + "type": "string", + "description": "SMS Content.", + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + }, + "required": [ + "messageId", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSms", + "group": "messages", + "weight": 309, + "cookies": false, + "type": "", + "demo": "messaging\/update-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + }, + "methods": [ + { + "name": "updateSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + } + }, + { + "name": "updateSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/{messageId}": { + "get": { + "summary": "Get message", + "operationId": "messagingGetMessage", + "tags": [ + "messaging" + ], + "description": "Get a message by its unique ID.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getMessage", + "group": "messages", + "weight": 307, + "cookies": false, + "type": "", + "demo": "messaging\/get-message.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete message", + "operationId": "messagingDelete", + "tags": [ + "messaging" + ], + "description": "Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "messages", + "weight": 311, + "cookies": false, + "type": "", + "demo": "messaging\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/logs": { + "get": { + "summary": "List message logs", + "operationId": "messagingListMessageLogs", + "tags": [ + "messaging" + ], + "description": "Get the message activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMessageLogs", + "group": "logs", + "weight": 305, + "cookies": false, + "type": "", + "demo": "messaging\/list-message-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/targets": { + "get": { + "summary": "List message targets", + "operationId": "messagingListTargets", + "tags": [ + "messaging" + ], + "description": "Get a list of the targets associated with a message.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTargets", + "group": "messages", + "weight": 306, + "cookies": false, + "type": "", + "demo": "messaging\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers": { + "get": { + "summary": "List providers", + "operationId": "messagingListProviders", + "tags": [ + "messaging" + ], + "description": "Get a list of all providers from the current Appwrite project.", + "responses": { + "200": { + "description": "Provider list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listProviders", + "group": "providers", + "weight": 276, + "cookies": false, + "type": "", + "demo": "messaging\/list-providers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createApnsProvider", + "group": "providers", + "weight": 275, + "cookies": false, + "type": "", + "demo": "messaging\/create-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + }, + "methods": [ + { + "name": "createApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + } + }, + { + "name": "createAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateApnsProvider", + "group": "providers", + "weight": 288, + "cookies": false, + "type": "", + "demo": "messaging\/update-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + }, + "methods": [ + { + "name": "updateApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + } + }, + { + "name": "updateAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createFcmProvider", + "group": "providers", + "weight": 274, + "cookies": false, + "type": "", + "demo": "messaging\/create-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + }, + "methods": [ + { + "name": "createFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + } + }, + { + "name": "createFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateFcmProvider", + "group": "providers", + "weight": 287, + "cookies": false, + "type": "", + "demo": "messaging\/update-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + }, + "methods": [ + { + "name": "updateFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + } + }, + { + "name": "updateFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun": { + "post": { + "summary": "Create Mailgun provider", + "operationId": "messagingCreateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Mailgun provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMailgunProvider", + "group": "providers", + "weight": 266, + "cookies": false, + "type": "", + "demo": "messaging\/create-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun\/{providerId}": { + "patch": { + "summary": "Update Mailgun provider", + "operationId": "messagingUpdateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Update a Mailgun provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMailgunProvider", + "group": "providers", + "weight": 279, + "cookies": false, + "type": "", + "demo": "messaging\/update-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/msg91": { + "post": { + "summary": "Create Msg91 provider", + "operationId": "messagingCreateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Create a new MSG91 provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMsg91Provider", + "group": "providers", + "weight": 269, + "cookies": false, + "type": "", + "demo": "messaging\/create-msg-91-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "x-example": "<AUTH_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/msg91\/{providerId}": { + "patch": { + "summary": "Update Msg91 provider", + "operationId": "messagingUpdateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Update a MSG91 provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMsg91Provider", + "group": "providers", + "weight": 282, + "cookies": false, + "type": "", + "demo": "messaging\/update-msg-91-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID.", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "x-example": "<AUTH_KEY>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid": { + "post": { + "summary": "Create Sendgrid provider", + "operationId": "messagingCreateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Sendgrid provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSendgridProvider", + "group": "providers", + "weight": 267, + "cookies": false, + "type": "", + "demo": "messaging\/create-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid\/{providerId}": { + "patch": { + "summary": "Update Sendgrid provider", + "operationId": "messagingUpdateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Update a Sendgrid provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSendgridProvider", + "group": "providers", + "weight": 280, + "cookies": false, + "type": "", + "demo": "messaging\/update-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSmtpProvider", + "group": "providers", + "weight": 268, + "cookies": false, + "type": "", + "demo": "messaging\/create-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + }, + "methods": [ + { + "name": "createSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + } + }, + { + "name": "createSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "The default SMTP server port.", + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSmtpProvider", + "group": "providers", + "weight": 281, + "cookies": false, + "type": "", + "demo": "messaging\/update-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + }, + "methods": [ + { + "name": "updateSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + } + }, + { + "name": "updateSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "SMTP port.", + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be 'ssl' or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "x-example": "<REPLY_TO_EMAIL>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/telesign": { + "post": { + "summary": "Create Telesign provider", + "operationId": "messagingCreateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Telesign provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTelesignProvider", + "group": "providers", + "weight": 270, + "cookies": false, + "type": "", + "demo": "messaging\/create-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/telesign\/{providerId}": { + "patch": { + "summary": "Update Telesign provider", + "operationId": "messagingUpdateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Update a Telesign provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTelesignProvider", + "group": "providers", + "weight": 283, + "cookies": false, + "type": "", + "demo": "messaging\/update-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic": { + "post": { + "summary": "Create Textmagic provider", + "operationId": "messagingCreateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Textmagic provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTextmagicProvider", + "group": "providers", + "weight": 271, + "cookies": false, + "type": "", + "demo": "messaging\/create-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic\/{providerId}": { + "patch": { + "summary": "Update Textmagic provider", + "operationId": "messagingUpdateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Update a Textmagic provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTextmagicProvider", + "group": "providers", + "weight": 284, + "cookies": false, + "type": "", + "demo": "messaging\/update-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/twilio": { + "post": { + "summary": "Create Twilio provider", + "operationId": "messagingCreateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Twilio provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTwilioProvider", + "group": "providers", + "weight": 272, + "cookies": false, + "type": "", + "demo": "messaging\/create-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "x-example": "<AUTH_TOKEN>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/twilio\/{providerId}": { + "patch": { + "summary": "Update Twilio provider", + "operationId": "messagingUpdateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Update a Twilio provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTwilioProvider", + "group": "providers", + "weight": 285, + "cookies": false, + "type": "", + "demo": "messaging\/update-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "x-example": "<AUTH_TOKEN>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/vonage": { + "post": { + "summary": "Create Vonage provider", + "operationId": "messagingCreateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Vonage provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVonageProvider", + "group": "providers", + "weight": 273, + "cookies": false, + "type": "", + "demo": "messaging\/create-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "x-example": "<API_SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/vonage\/{providerId}": { + "patch": { + "summary": "Update Vonage provider", + "operationId": "messagingUpdateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Update a Vonage provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVonageProvider", + "group": "providers", + "weight": 286, + "cookies": false, + "type": "", + "demo": "messaging\/update-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "x-example": "<API_SECRET>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/{providerId}": { + "get": { + "summary": "Get provider", + "operationId": "messagingGetProvider", + "tags": [ + "messaging" + ], + "description": "Get a provider by its unique ID.\n", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getProvider", + "group": "providers", + "weight": 278, + "cookies": false, + "type": "", + "demo": "messaging\/get-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete provider", + "operationId": "messagingDeleteProvider", + "tags": [ + "messaging" + ], + "description": "Delete a provider by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteProvider", + "group": "providers", + "weight": 289, + "cookies": false, + "type": "", + "demo": "messaging\/delete-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/providers\/{providerId}\/logs": { + "get": { + "summary": "List provider logs", + "operationId": "messagingListProviderLogs", + "tags": [ + "messaging" + ], + "description": "Get the provider activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listProviderLogs", + "group": "providers", + "weight": 277, + "cookies": false, + "type": "", + "demo": "messaging\/list-provider-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/subscribers\/{subscriberId}\/logs": { + "get": { + "summary": "List subscriber logs", + "operationId": "messagingListSubscriberLogs", + "tags": [ + "messaging" + ], + "description": "Get the subscriber activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSubscriberLogs", + "group": "subscribers", + "weight": 298, + "cookies": false, + "type": "", + "demo": "messaging\/list-subscriber-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/topics": { + "get": { + "summary": "List topics", + "operationId": "messagingListTopics", + "tags": [ + "messaging" + ], + "description": "Get a list of all topics from the current Appwrite project.", + "responses": { + "200": { + "description": "Topic list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topicList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTopics", + "group": "topics", + "weight": 291, + "cookies": false, + "type": "", + "demo": "messaging\/list-topics.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create topic", + "operationId": "messagingCreateTopic", + "tags": [ + "messaging" + ], + "description": "Create a new topic.", + "responses": { + "201": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTopic", + "group": "topics", + "weight": 290, + "cookies": false, + "type": "", + "demo": "messaging\/create-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topicId": { + "type": "string", + "description": "Topic ID. Choose a custom Topic ID or a new Topic ID.", + "x-example": "<TOPIC_ID>" + }, + "name": { + "type": "string", + "description": "Topic Name.", + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "topicId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}": { + "get": { + "summary": "Get topic", + "operationId": "messagingGetTopic", + "tags": [ + "messaging" + ], + "description": "Get a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTopic", + "group": "topics", + "weight": 293, + "cookies": false, + "type": "", + "demo": "messaging\/get-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update topic", + "operationId": "messagingUpdateTopic", + "tags": [ + "messaging" + ], + "description": "Update a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTopic", + "group": "topics", + "weight": 294, + "cookies": false, + "type": "", + "demo": "messaging\/update-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Topic Name.", + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete topic", + "operationId": "messagingDeleteTopic", + "tags": [ + "messaging" + ], + "description": "Delete a topic by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTopic", + "group": "topics", + "weight": 295, + "cookies": false, + "type": "", + "demo": "messaging\/delete-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/logs": { + "get": { + "summary": "List topic logs", + "operationId": "messagingListTopicLogs", + "tags": [ + "messaging" + ], + "description": "Get the topic activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTopicLogs", + "group": "topics", + "weight": 292, + "cookies": false, + "type": "", + "demo": "messaging\/list-topic-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "get": { + "summary": "List subscribers", + "operationId": "messagingListSubscribers", + "tags": [ + "messaging" + ], + "description": "Get a list of all subscribers from the current Appwrite project.", + "responses": { + "200": { + "description": "Subscriber list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriberList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSubscribers", + "group": "subscribers", + "weight": 297, + "cookies": false, + "type": "", + "demo": "messaging\/list-subscribers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 296, + "cookies": false, + "type": "", + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "x-example": "<SUBSCRIBER_ID>" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "x-example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "get": { + "summary": "Get subscriber", + "operationId": "messagingGetSubscriber", + "tags": [ + "messaging" + ], + "description": "Get a subscriber by its unique ID.\n", + "responses": { + "200": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSubscriber", + "group": "subscribers", + "weight": 299, + "cookies": false, + "type": "", + "demo": "messaging\/get-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 300, + "cookies": false, + "type": "", + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/migrations": { + "get": { + "summary": "List migrations", + "operationId": "migrationsList", + "tags": [ + "migrations" + ], + "description": "List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.", + "responses": { + "200": { + "description": "Migrations List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": null, + "weight": 258, + "cookies": false, + "type": "", + "demo": "migrations\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/list-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/migrations\/appwrite": { + "post": { + "summary": "Create Appwrite migration", + "operationId": "migrationsCreateAppwriteMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createAppwriteMigration", + "group": null, + "weight": 253, + "cookies": false, + "type": "", + "demo": "migrations\/create-appwrite-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "x-example": null, + "items": { + "type": "string" + } + }, + "endpoint": { + "type": "string", + "description": "Source Appwrite endpoint", + "x-example": "https:\/\/example.com" + }, + "projectId": { + "type": "string", + "description": "Source Project ID", + "x-example": "<PROJECT_ID>" + }, + "apiKey": { + "type": "string", + "description": "Source API Key", + "x-example": "<API_KEY>" + } + }, + "required": [ + "resources", + "endpoint", + "projectId", + "apiKey" + ] + } + } + } + } + } + }, + "\/migrations\/appwrite\/report": { + "get": { + "summary": "Get Appwrite migration report", + "operationId": "migrationsGetAppwriteReport", + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getAppwriteReport", + "group": null, + "weight": 260, + "cookies": false, + "type": "", + "demo": "migrations\/get-appwrite-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "in": "query" + }, + { + "name": "endpoint", + "description": "Source's Appwrite Endpoint", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "projectID", + "description": "Source's Project ID", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "query" + }, + { + "name": "key", + "description": "Source's API Key", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY>" + }, + "in": "query" + } + ] + } + }, + "\/migrations\/csv": { + "post": { + "summary": "Import documents from a CSV", + "operationId": "migrationsCreateCsvMigration", + "tags": [ + "migrations" + ], + "description": "Import documents from a CSV file into your Appwrite database. This endpoint allows you to import documents from a CSV file uploaded to Appwrite Storage bucket.", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createCsvMigration", + "group": null, + "weight": 257, + "cookies": false, + "type": "", + "demo": "migrations\/create-csv-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-csv.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "x-example": "<BUCKET_ID>" + }, + "fileId": { + "type": "string", + "description": "File ID.", + "x-example": "<FILE_ID>" + }, + "resourceId": { + "type": "string", + "description": "Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.", + "x-example": "[ID1:ID2]" + }, + "internalFile": { + "type": "boolean", + "description": "Is the file stored in an internal bucket?", + "x-example": false + } + }, + "required": [ + "bucketId", + "fileId", + "resourceId" + ] + } + } + } + } + } + }, + "\/migrations\/firebase": { + "post": { + "summary": "Create Firebase migration", + "operationId": "migrationsCreateFirebaseMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFirebaseMigration", + "group": null, + "weight": 254, + "cookies": false, + "type": "", + "demo": "migrations\/create-firebase-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "x-example": null, + "items": { + "type": "string" + } + }, + "serviceAccount": { + "type": "string", + "description": "JSON of the Firebase service account credentials", + "x-example": "<SERVICE_ACCOUNT>" + } + }, + "required": [ + "resources", + "serviceAccount" + ] + } + } + } + } + } + }, + "\/migrations\/firebase\/report": { + "get": { + "summary": "Get Firebase migration report", + "operationId": "migrationsGetFirebaseReport", + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFirebaseReport", + "group": null, + "weight": 261, + "cookies": false, + "type": "", + "demo": "migrations\/get-firebase-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "in": "query" + }, + { + "name": "serviceAccount", + "description": "JSON of the Firebase service account credentials", + "required": true, + "schema": { + "type": "string", + "x-example": "<SERVICE_ACCOUNT>" + }, + "in": "query" + } + ] + } + }, + "\/migrations\/nhost": { + "post": { + "summary": "Create NHost migration", + "operationId": "migrationsCreateNHostMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createNHostMigration", + "group": null, + "weight": 256, + "cookies": false, + "type": "", + "demo": "migrations\/create-n-host-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "x-example": null, + "items": { + "type": "string" + } + }, + "subdomain": { + "type": "string", + "description": "Source's Subdomain", + "x-example": "<SUBDOMAIN>" + }, + "region": { + "type": "string", + "description": "Source's Region", + "x-example": "<REGION>" + }, + "adminSecret": { + "type": "string", + "description": "Source's Admin Secret", + "x-example": "<ADMIN_SECRET>" + }, + "database": { + "type": "string", + "description": "Source's Database Name", + "x-example": "<DATABASE>" + }, + "username": { + "type": "string", + "description": "Source's Database Username", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Source's Database Password", + "x-example": "<PASSWORD>" + }, + "port": { + "type": "integer", + "description": "Source's Database Port", + "x-example": null + } + }, + "required": [ + "resources", + "subdomain", + "region", + "adminSecret", + "database", + "username", + "password" + ] + } + } + } + } + } + }, + "\/migrations\/nhost\/report": { + "get": { + "summary": "Get NHost migration report", + "operationId": "migrationsGetNHostReport", + "tags": [ + "migrations" + ], + "description": "Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getNHostReport", + "group": null, + "weight": 263, + "cookies": false, + "type": "", + "demo": "migrations\/get-n-host-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "in": "query" + }, + { + "name": "subdomain", + "description": "Source's Subdomain.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBDOMAIN>" + }, + "in": "query" + }, + { + "name": "region", + "description": "Source's Region.", + "required": true, + "schema": { + "type": "string", + "x-example": "<REGION>" + }, + "in": "query" + }, + { + "name": "adminSecret", + "description": "Source's Admin Secret.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ADMIN_SECRET>" + }, + "in": "query" + }, + { + "name": "database", + "description": "Source's Database Name.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE>" + }, + "in": "query" + }, + { + "name": "username", + "description": "Source's Database Username.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USERNAME>" + }, + "in": "query" + }, + { + "name": "password", + "description": "Source's Database Password.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PASSWORD>" + }, + "in": "query" + }, + { + "name": "port", + "description": "Source's Database Port.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5432 + }, + "in": "query" + } + ] + } + }, + "\/migrations\/supabase": { + "post": { + "summary": "Create Supabase migration", + "operationId": "migrationsCreateSupabaseMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSupabaseMigration", + "group": null, + "weight": 255, + "cookies": false, + "type": "", + "demo": "migrations\/create-supabase-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "x-example": null, + "items": { + "type": "string" + } + }, + "endpoint": { + "type": "string", + "description": "Source's Supabase Endpoint", + "x-example": "https:\/\/example.com" + }, + "apiKey": { + "type": "string", + "description": "Source's API Key", + "x-example": "<API_KEY>" + }, + "databaseHost": { + "type": "string", + "description": "Source's Database Host", + "x-example": "<DATABASE_HOST>" + }, + "username": { + "type": "string", + "description": "Source's Database Username", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Source's Database Password", + "x-example": "<PASSWORD>" + }, + "port": { + "type": "integer", + "description": "Source's Database Port", + "x-example": null + } + }, + "required": [ + "resources", + "endpoint", + "apiKey", + "databaseHost", + "username", + "password" + ] + } + } + } + } + } + }, + "\/migrations\/supabase\/report": { + "get": { + "summary": "Get Supabase migration report", + "operationId": "migrationsGetSupabaseReport", + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSupabaseReport", + "group": null, + "weight": 262, + "cookies": false, + "type": "", + "demo": "migrations\/get-supabase-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "in": "query" + }, + { + "name": "endpoint", + "description": "Source's Supabase Endpoint.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "apiKey", + "description": "Source's API Key.", + "required": true, + "schema": { + "type": "string", + "x-example": "<API_KEY>" + }, + "in": "query" + }, + { + "name": "databaseHost", + "description": "Source's Database Host.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_HOST>" + }, + "in": "query" + }, + { + "name": "username", + "description": "Source's Database Username.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USERNAME>" + }, + "in": "query" + }, + { + "name": "password", + "description": "Source's Database Password.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PASSWORD>" + }, + "in": "query" + }, + { + "name": "port", + "description": "Source's Database Port.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5432 + }, + "in": "query" + } + ] + } + }, + "\/migrations\/{migrationId}": { + "get": { + "summary": "Get migration", + "operationId": "migrationsGet", + "tags": [ + "migrations" + ], + "description": "Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process. ", + "responses": { + "200": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 259, + "cookies": false, + "type": "", + "demo": "migrations\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/get-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MIGRATION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update retry migration", + "operationId": "migrationsRetry", + "tags": [ + "migrations" + ], + "description": "Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "retry", + "group": null, + "weight": 264, + "cookies": false, + "type": "", + "demo": "migrations\/retry.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/retry-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MIGRATION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete migration", + "operationId": "migrationsDelete", + "tags": [ + "migrations" + ], + "description": "Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": null, + "weight": 265, + "cookies": false, + "type": "", + "demo": "migrations\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/delete-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MIGRATION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/project\/usage": { + "get": { + "summary": "Get project usage stats", + "operationId": "projectGetUsage", + "tags": [ + "project" + ], + "description": "Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.", + "responses": { + "200": { + "description": "UsageProject", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageProject" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 148, + "cookies": false, + "type": "", + "demo": "project\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "startDate", + "description": "Starting date for the usage", + "required": true, + "schema": { + "type": "string" + }, + "in": "query" + }, + { + "name": "endDate", + "description": "End date for the usage", + "required": true, + "schema": { + "type": "string" + }, + "in": "query" + }, + { + "name": "period", + "description": "Period used", + "required": false, + "schema": { + "type": "string", + "x-example": "1h", + "enum": [ + "1h", + "1d" + ], + "x-enum-name": "ProjectUsageRange", + "x-enum-keys": [ + "One Hour", + "One Day" + ], + "default": "1d" + }, + "in": "query" + } + ] + } + }, + "\/project\/variables": { + "get": { + "summary": "List variables", + "operationId": "projectListVariables", + "tags": [ + "project" + ], + "description": "Get a list of all project variables. These variables will be accessible in all Appwrite Functions at runtime.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listVariables", + "group": null, + "weight": 150, + "cookies": false, + "type": "", + "demo": "project\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/list-variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "projectCreateVariable", + "tags": [ + "project" + ], + "description": "Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVariable", + "group": null, + "weight": 149, + "cookies": false, + "type": "", + "demo": "project\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/create-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + } + } + } + }, + "\/project\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "projectGetVariable", + "tags": [ + "project" + ], + "description": "Get a project variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getVariable", + "group": null, + "weight": 151, + "cookies": false, + "type": "", + "demo": "project\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "projectUpdateVariable", + "tags": [ + "project" + ], + "description": "Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVariable", + "group": null, + "weight": 152, + "cookies": false, + "type": "", + "demo": "project\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/update-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "projectDeleteVariable", + "tags": [ + "project" + ], + "description": "Delete a project variable by its unique ID. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteVariable", + "group": null, + "weight": 153, + "cookies": false, + "type": "", + "demo": "project\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/delete-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects": { + "get": { + "summary": "List projects", + "operationId": "projectsList", + "tags": [ + "projects" + ], + "description": "Get a list of all projects. You can use the query params to filter your results. ", + "responses": { + "200": { + "description": "Projects List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/projectList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "projects", + "weight": 436, + "cookies": false, + "type": "", + "demo": "projects\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all projects. You can use the query params to filter your results. ", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create project", + "operationId": "projectsCreate", + "tags": [ + "projects" + ], + "description": "Create a new project. You can create a maximum of 100 projects per account. ", + "responses": { + "201": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "projects", + "weight": 102, + "cookies": false, + "type": "", + "demo": "projects\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "projectId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "Project name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "teamId": { + "type": "string", + "description": "Team unique ID.", + "x-example": "<TEAM_ID>" + }, + "region": { + "type": "string", + "description": "Project Region.", + "x-example": "default", + "enum": [ + "default" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "description": { + "type": "string", + "description": "Project description. Max length: 256 chars.", + "x-example": "<DESCRIPTION>" + }, + "logo": { + "type": "string", + "description": "Project logo.", + "x-example": "<LOGO>" + }, + "url": { + "type": "string", + "description": "Project URL.", + "x-example": "https:\/\/example.com" + }, + "legalName": { + "type": "string", + "description": "Project legal Name. Max length: 256 chars.", + "x-example": "<LEGAL_NAME>" + }, + "legalCountry": { + "type": "string", + "description": "Project legal Country. Max length: 256 chars.", + "x-example": "<LEGAL_COUNTRY>" + }, + "legalState": { + "type": "string", + "description": "Project legal State. Max length: 256 chars.", + "x-example": "<LEGAL_STATE>" + }, + "legalCity": { + "type": "string", + "description": "Project legal City. Max length: 256 chars.", + "x-example": "<LEGAL_CITY>" + }, + "legalAddress": { + "type": "string", + "description": "Project legal Address. Max length: 256 chars.", + "x-example": "<LEGAL_ADDRESS>" + }, + "legalTaxId": { + "type": "string", + "description": "Project legal Tax ID. Max length: 256 chars.", + "x-example": "<LEGAL_TAX_ID>" + } + }, + "required": [ + "projectId", + "name", + "teamId" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}": { + "get": { + "summary": "Get project", + "operationId": "projectsGet", + "tags": [ + "projects" + ], + "description": "Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "projects", + "weight": 103, + "cookies": false, + "type": "", + "demo": "projects\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update project", + "operationId": "projectsUpdate", + "tags": [ + "projects" + ], + "description": "Update a project by its unique ID.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "projects", + "weight": 104, + "cookies": false, + "type": "", + "demo": "projects\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Project name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "description": { + "type": "string", + "description": "Project description. Max length: 256 chars.", + "x-example": "<DESCRIPTION>" + }, + "logo": { + "type": "string", + "description": "Project logo.", + "x-example": "<LOGO>" + }, + "url": { + "type": "string", + "description": "Project URL.", + "x-example": "https:\/\/example.com" + }, + "legalName": { + "type": "string", + "description": "Project legal name. Max length: 256 chars.", + "x-example": "<LEGAL_NAME>" + }, + "legalCountry": { + "type": "string", + "description": "Project legal country. Max length: 256 chars.", + "x-example": "<LEGAL_COUNTRY>" + }, + "legalState": { + "type": "string", + "description": "Project legal state. Max length: 256 chars.", + "x-example": "<LEGAL_STATE>" + }, + "legalCity": { + "type": "string", + "description": "Project legal city. Max length: 256 chars.", + "x-example": "<LEGAL_CITY>" + }, + "legalAddress": { + "type": "string", + "description": "Project legal address. Max length: 256 chars.", + "x-example": "<LEGAL_ADDRESS>" + }, + "legalTaxId": { + "type": "string", + "description": "Project legal tax ID. Max length: 256 chars.", + "x-example": "<LEGAL_TAX_ID>" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete project", + "operationId": "projectsDelete", + "tags": [ + "projects" + ], + "description": "Delete a project by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "projects", + "weight": 121, + "cookies": false, + "type": "", + "demo": "projects\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/api": { + "patch": { + "summary": "Update API status", + "operationId": "projectsUpdateApiStatus", + "tags": [ + "projects" + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateApiStatus", + "group": "projects", + "weight": 108, + "cookies": false, + "type": "", + "demo": "projects\/update-api-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatus" + }, + "methods": [ + { + "name": "updateApiStatus", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "api", + "status" + ], + "required": [ + "projectId", + "api", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "demo": "projects\/update-api-status.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatus" + } + }, + { + "name": "updateAPIStatus", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "api", + "status" + ], + "required": [ + "projectId", + "api", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "demo": "projects\/update-api-status.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "api": { + "type": "string", + "description": "API name.", + "x-example": "rest", + "enum": [ + "rest", + "graphql", + "realtime" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "status": { + "type": "boolean", + "description": "API status.", + "x-example": false + } + }, + "required": [ + "api", + "status" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/api\/all": { + "patch": { + "summary": "Update all API status", + "operationId": "projectsUpdateApiStatusAll", + "tags": [ + "projects" + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateApiStatusAll", + "group": "projects", + "weight": 109, + "cookies": false, + "type": "", + "demo": "projects\/update-api-status-all.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status-all.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatusAll" + }, + "methods": [ + { + "name": "updateApiStatusAll", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "status" + ], + "required": [ + "projectId", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "demo": "projects\/update-api-status-all.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatusAll" + } + }, + { + "name": "updateAPIStatusAll", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "status" + ], + "required": [ + "projectId", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "demo": "projects\/update-api-status-all.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "API status.", + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/duration": { + "patch": { + "summary": "Update project authentication duration", + "operationId": "projectsUpdateAuthDuration", + "tags": [ + "projects" + ], + "description": "Update how long sessions created within a project should stay active for.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthDuration", + "group": "auth", + "weight": 114, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-duration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-duration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "duration": { + "type": "integer", + "description": "Project session length in seconds. Max length: 31536000 seconds.", + "x-example": 0 + } + }, + "required": [ + "duration" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/limit": { + "patch": { + "summary": "Update project users limit", + "operationId": "projectsUpdateAuthLimit", + "tags": [ + "projects" + ], + "description": "Update the maximum number of users allowed in this project. Set to 0 for unlimited users. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthLimit", + "group": "auth", + "weight": 113, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-limit.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-limit.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of users allowed in this project. Use 0 for unlimited.", + "x-example": 0 + } + }, + "required": [ + "limit" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/max-sessions": { + "patch": { + "summary": "Update project user sessions limit", + "operationId": "projectsUpdateAuthSessionsLimit", + "tags": [ + "projects" + ], + "description": "Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthSessionsLimit", + "group": "auth", + "weight": 119, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-sessions-limit.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-sessions-limit.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10", + "x-example": 1 + } + }, + "required": [ + "limit" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/memberships-privacy": { + "patch": { + "summary": "Update project memberships privacy attributes", + "operationId": "projectsUpdateMembershipsPrivacy", + "tags": [ + "projects" + ], + "description": "Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembershipsPrivacy", + "group": "auth", + "weight": 112, + "cookies": false, + "type": "", + "demo": "projects\/update-memberships-privacy.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-memberships-privacy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "boolean", + "description": "Set to true to show userName to members of a team.", + "x-example": false + }, + "userEmail": { + "type": "boolean", + "description": "Set to true to show email to members of a team.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Set to true to show mfa to members of a team.", + "x-example": false + } + }, + "required": [ + "userName", + "userEmail", + "mfa" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/mock-numbers": { + "patch": { + "summary": "Update the mock numbers for the project", + "operationId": "projectsUpdateMockNumbers", + "tags": [ + "projects" + ], + "description": "Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMockNumbers", + "group": "auth", + "weight": 120, + "cookies": false, + "type": "", + "demo": "projects\/update-mock-numbers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-mock-numbers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "numbers": { + "type": "array", + "description": "An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.", + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "numbers" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/password-dictionary": { + "patch": { + "summary": "Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password", + "operationId": "projectsUpdateAuthPasswordDictionary", + "tags": [ + "projects" + ], + "description": "Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthPasswordDictionary", + "group": "auth", + "weight": 117, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-password-dictionary.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-dictionary.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Set whether or not to enable checking user's password against most commonly used passwords. Default is false.", + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/password-history": { + "patch": { + "summary": "Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.", + "operationId": "projectsUpdateAuthPasswordHistory", + "tags": [ + "projects" + ], + "description": "Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthPasswordHistory", + "group": "auth", + "weight": 116, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-password-history.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-history.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of passwords to store in user history. User can't choose a new password that is already stored in the password history list. Max number of passwords allowed in history is20. Default value is 0", + "x-example": 0 + } + }, + "required": [ + "limit" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/personal-data": { + "patch": { + "summary": "Update personal data check", + "operationId": "projectsUpdatePersonalDataCheck", + "tags": [ + "projects" + ], + "description": "Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePersonalDataCheck", + "group": "auth", + "weight": 118, + "cookies": false, + "type": "", + "demo": "projects\/update-personal-data-check.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-personal-data-check.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Set whether or not to check a password for similarity with personal data. Default is false.", + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/session-alerts": { + "patch": { + "summary": "Update project sessions emails", + "operationId": "projectsUpdateSessionAlerts", + "tags": [ + "projects" + ], + "description": "Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSessionAlerts", + "group": "auth", + "weight": 111, + "cookies": false, + "type": "", + "demo": "projects\/update-session-alerts.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-alerts.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "alerts": { + "type": "boolean", + "description": "Set to true to enable session emails.", + "x-example": false + } + }, + "required": [ + "alerts" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/session-invalidation": { + "patch": { + "summary": "Update invalidate session option of the project", + "operationId": "projectsUpdateSessionInvalidation", + "tags": [ + "projects" + ], + "description": "Invalidate all existing sessions. An optional auth security setting for projects, and enabled by default for console project.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSessionInvalidation", + "group": "auth", + "weight": 147, + "cookies": false, + "type": "", + "demo": "projects\/update-session-invalidation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-invalidation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Update authentication session invalidation status. Use this endpoint to enable or disable session invalidation on password change", + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/{method}": { + "patch": { + "summary": "Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.", + "operationId": "projectsUpdateAuthStatus", + "tags": [ + "projects" + ], + "description": "Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthStatus", + "group": "auth", + "weight": 115, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "method", + "description": "Auth Method. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone", + "required": true, + "schema": { + "type": "string", + "x-example": "email-password", + "enum": [ + "email-password", + "magic-url", + "email-otp", + "anonymous", + "invites", + "jwt", + "phone" + ], + "x-enum-name": "AuthMethod", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "Set the status of this auth method.", + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/dev-keys": { + "get": { + "summary": "List dev keys", + "operationId": "projectsListDevKeys", + "tags": [ + "projects" + ], + "description": "List all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "responses": { + "200": { + "description": "Dev Keys List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKeyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listDevKeys", + "group": "devKeys", + "weight": 434, + "cookies": false, + "type": "", + "demo": "projects\/list-dev-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: accessedAt, expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create dev key", + "operationId": "projectsCreateDevKey", + "tags": [ + "projects" + ], + "description": "Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "responses": { + "201": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDevKey", + "group": "devKeys", + "weight": 431, + "cookies": false, + "type": "", + "demo": "projects\/create-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/dev-keys\/{keyId}": { + "get": { + "summary": "Get dev key", + "operationId": "projectsGetDevKey", + "tags": [ + "projects" + ], + "description": "Get a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "responses": { + "200": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDevKey", + "group": "devKeys", + "weight": 433, + "cookies": false, + "type": "", + "demo": "projects\/get-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update dev key", + "operationId": "projectsUpdateDevKey", + "tags": [ + "projects" + ], + "description": "Update a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "responses": { + "200": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDevKey", + "group": "devKeys", + "weight": 432, + "cookies": false, + "type": "", + "demo": "projects\/update-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete dev key", + "operationId": "projectsDeleteDevKey", + "tags": [ + "projects" + ], + "description": "Delete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteDevKey", + "group": "devKeys", + "weight": 435, + "cookies": false, + "type": "", + "demo": "projects\/delete-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "projectsCreateJWT", + "tags": [ + "projects" + ], + "description": "Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. ", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "auth", + "weight": 133, + "cookies": false, + "type": "", + "demo": "projects\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "scopes": { + "type": "array", + "description": "List of scopes allowed for JWT key. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "x-example": 0 + } + }, + "required": [ + "scopes" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/keys": { + "get": { + "summary": "List keys", + "operationId": "projectsListKeys", + "tags": [ + "projects" + ], + "description": "Get a list of all API keys from the current project. ", + "responses": { + "200": { + "description": "API Keys List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/keyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listKeys", + "group": "keys", + "weight": 129, + "cookies": false, + "type": "", + "demo": "projects\/list-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-keys.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create key", + "operationId": "projectsCreateKey", + "tags": [ + "projects" + ], + "description": "Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.", + "responses": { + "201": { + "description": "Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/key" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createKey", + "group": "keys", + "weight": 128, + "cookies": false, + "type": "", + "demo": "projects\/create-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "scopes": { + "type": "array", + "description": "Key scopes list. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.", + "x-example": null + } + }, + "required": [ + "name", + "scopes" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/keys\/{keyId}": { + "get": { + "summary": "Get key", + "operationId": "projectsGetKey", + "tags": [ + "projects" + ], + "description": "Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.", + "responses": { + "200": { + "description": "Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/key" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getKey", + "group": "keys", + "weight": 130, + "cookies": false, + "type": "", + "demo": "projects\/get-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update key", + "operationId": "projectsUpdateKey", + "tags": [ + "projects" + ], + "description": "Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. ", + "responses": { + "200": { + "description": "Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/key" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateKey", + "group": "keys", + "weight": 131, + "cookies": false, + "type": "", + "demo": "projects\/update-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "scopes": { + "type": "array", + "description": "Key scopes list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.", + "x-example": null + } + }, + "required": [ + "name", + "scopes" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete key", + "operationId": "projectsDeleteKey", + "tags": [ + "projects" + ], + "description": "Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteKey", + "group": "keys", + "weight": 132, + "cookies": false, + "type": "", + "demo": "projects\/delete-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/oauth2": { + "patch": { + "summary": "Update project OAuth2", + "operationId": "projectsUpdateOAuth2", + "tags": [ + "projects" + ], + "description": "Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable\/disable providers. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateOAuth2", + "group": "auth", + "weight": 110, + "cookies": false, + "type": "", + "demo": "projects\/update-o-auth-2.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-oauth2.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "Provider Name", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "appId": { + "type": "string", + "description": "Provider app ID. Max length: 256 chars.", + "x-example": "<APP_ID>" + }, + "secret": { + "type": "string", + "description": "Provider secret key. Max length: 512 chars.", + "x-example": "<SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Provider status. Set to 'false' to disable new session creation.", + "x-example": false + } + }, + "required": [ + "provider" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/platforms": { + "get": { + "summary": "List platforms", + "operationId": "projectsListPlatforms", + "tags": [ + "projects" + ], + "description": "Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. ", + "responses": { + "200": { + "description": "Platforms List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listPlatforms", + "group": "platforms", + "weight": 135, + "cookies": false, + "type": "", + "demo": "projects\/list-platforms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-platforms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create platform", + "operationId": "projectsCreatePlatform", + "tags": [ + "projects" + ], + "description": "Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platform" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPlatform", + "group": "platforms", + "weight": 134, + "cookies": false, + "type": "", + "demo": "projects\/create-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Platform type.", + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "flutter-linux", + "flutter-macos", + "flutter-windows", + "apple-ios", + "apple-macos", + "apple-watchos", + "apple-tvos", + "android", + "unity", + "react-native-ios", + "react-native-android" + ], + "x-enum-name": "PlatformType", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "Platform name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "key": { + "type": "string", + "description": "Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.", + "x-example": "<KEY>" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID. Max length: 256 chars.", + "x-example": "<STORE>" + }, + "hostname": { + "type": "string", + "description": "Platform client hostname. Max length: 256 chars.", + "x-example": null + } + }, + "required": [ + "type", + "name" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/platforms\/{platformId}": { + "get": { + "summary": "Get platform", + "operationId": "projectsGetPlatform", + "tags": [ + "projects" + ], + "description": "Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ", + "responses": { + "200": { + "description": "Platform", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platform" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPlatform", + "group": "platforms", + "weight": 136, + "cookies": false, + "type": "", + "demo": "projects\/get-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "platformId", + "description": "Platform unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PLATFORM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update platform", + "operationId": "projectsUpdatePlatform", + "tags": [ + "projects" + ], + "description": "Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. ", + "responses": { + "200": { + "description": "Platform", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platform" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePlatform", + "group": "platforms", + "weight": 137, + "cookies": false, + "type": "", + "demo": "projects\/update-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "platformId", + "description": "Platform unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Platform name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "key": { + "type": "string", + "description": "Package name for android or bundle ID for iOS. Max length: 256 chars.", + "x-example": "<KEY>" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID. Max length: 256 chars.", + "x-example": "<STORE>" + }, + "hostname": { + "type": "string", + "description": "Platform client URL. Max length: 256 chars.", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete platform", + "operationId": "projectsDeletePlatform", + "tags": [ + "projects" + ], + "description": "Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deletePlatform", + "group": "platforms", + "weight": 138, + "cookies": false, + "type": "", + "demo": "projects\/delete-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "platformId", + "description": "Platform unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PLATFORM_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/service": { + "patch": { + "summary": "Update service status", + "operationId": "projectsUpdateServiceStatus", + "tags": [ + "projects" + ], + "description": "Update the status of a specific service. Use this endpoint to enable or disable a service in your project. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateServiceStatus", + "group": "projects", + "weight": 106, + "cookies": false, + "type": "", + "demo": "projects\/update-service-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "service": { + "type": "string", + "description": "Service name.", + "x-example": "account", + "enum": [ + "account", + "avatars", + "databases", + "tablesdb", + "locale", + "health", + "storage", + "teams", + "users", + "sites", + "functions", + "graphql", + "messaging" + ], + "x-enum-name": "ApiService", + "x-enum-keys": [] + }, + "status": { + "type": "boolean", + "description": "Service status.", + "x-example": false + } + }, + "required": [ + "service", + "status" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/service\/all": { + "patch": { + "summary": "Update all service status", + "operationId": "projectsUpdateServiceStatusAll", + "tags": [ + "projects" + ], + "description": "Update the status of all services. Use this endpoint to enable or disable all optional services at once. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateServiceStatusAll", + "group": "projects", + "weight": 107, + "cookies": false, + "type": "", + "demo": "projects\/update-service-status-all.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status-all.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "Service status.", + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/smtp": { + "patch": { + "summary": "Update SMTP", + "operationId": "projectsUpdateSmtp", + "tags": [ + "projects" + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSmtp", + "group": "templates", + "weight": 139, + "cookies": false, + "type": "", + "demo": "projects\/update-smtp.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-smtp.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMTP" + }, + "methods": [ + { + "name": "updateSmtp", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "enabled", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "enabled" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "demo": "projects\/update-smtp.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMTP" + } + }, + { + "name": "updateSMTP", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "enabled", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "enabled" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "demo": "projects\/update-smtp.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable custom SMTP service", + "x-example": false + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "x-example": "email@example.com" + }, + "host": { + "type": "string", + "description": "SMTP server host name", + "x-example": null + }, + "port": { + "type": "integer", + "description": "SMTP server port", + "x-example": null + }, + "username": { + "type": "string", + "description": "SMTP server username", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "SMTP server password", + "x-example": "<PASSWORD>" + }, + "secure": { + "type": "string", + "description": "Does SMTP server use secure connection", + "x-example": "tls", + "enum": [ + "tls", + "ssl" + ], + "x-enum-name": "SMTPSecure", + "x-enum-keys": [] + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/smtp\/tests": { + "post": { + "summary": "Create SMTP test", + "operationId": "projectsCreateSmtpTest", + "tags": [ + "projects" + ], + "description": "Send a test email to verify SMTP configuration. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSmtpTest", + "group": "templates", + "weight": 140, + "cookies": false, + "type": "", + "demo": "projects\/create-smtp-test.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-smtp-test.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.createSMTPTest" + }, + "methods": [ + { + "name": "createSmtpTest", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "host" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Send a test email to verify SMTP configuration. ", + "demo": "projects\/create-smtp-test.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.createSMTPTest" + } + }, + { + "name": "createSMTPTest", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "host" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Send a test email to verify SMTP configuration. ", + "demo": "projects\/create-smtp-test.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "emails": { + "type": "array", + "description": "Array of emails to send test email to. Maximum of 10 emails are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "x-example": "email@example.com" + }, + "host": { + "type": "string", + "description": "SMTP server host name", + "x-example": null + }, + "port": { + "type": "integer", + "description": "SMTP server port", + "x-example": null + }, + "username": { + "type": "string", + "description": "SMTP server username", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "SMTP server password", + "x-example": "<PASSWORD>" + }, + "secure": { + "type": "string", + "description": "Does SMTP server use secure connection", + "x-example": "tls", + "enum": [ + "tls", + "ssl" + ], + "x-enum-name": "SMTPSecure", + "x-enum-keys": [] + } + }, + "required": [ + "emails", + "senderName", + "senderEmail", + "host" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/team": { + "patch": { + "summary": "Update project team", + "operationId": "projectsUpdateTeam", + "tags": [ + "projects" + ], + "description": "Update the team ID of a project allowing for it to be transferred to another team.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTeam", + "group": "projects", + "weight": 105, + "cookies": false, + "type": "", + "demo": "projects\/update-team.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID of the team to transfer project to.", + "x-example": "<TEAM_ID>" + } + }, + "required": [ + "teamId" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/templates\/email\/{type}\/{locale}": { + "get": { + "summary": "Get custom email template", + "operationId": "projectsGetEmailTemplate", + "tags": [ + "projects" + ], + "description": "Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. ", + "responses": { + "200": { + "description": "EmailTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplate" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getEmailTemplate", + "group": "templates", + "weight": 142, + "cookies": false, + "type": "", + "demo": "projects\/get-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update custom email templates", + "operationId": "projectsUpdateEmailTemplate", + "tags": [ + "projects" + ], + "description": "Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.", + "responses": { + "200": { + "description": "EmailTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplate" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailTemplate", + "group": "templates", + "weight": 144, + "cookies": false, + "type": "", + "demo": "projects\/update-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Email Subject", + "x-example": "<SUBJECT>" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "<MESSAGE>" + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "x-example": "email@example.com" + } + }, + "required": [ + "subject", + "message" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete custom email template", + "operationId": "projectsDeleteEmailTemplate", + "tags": [ + "projects" + ], + "description": "Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. ", + "responses": { + "200": { + "description": "EmailTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplate" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteEmailTemplate", + "group": "templates", + "weight": 146, + "cookies": false, + "type": "", + "demo": "projects\/delete-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/templates\/sms\/{type}\/{locale}": { + "get": { + "summary": "Get custom SMS template", + "operationId": "projectsGetSmsTemplate", + "tags": [ + "projects" + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "responses": { + "200": { + "description": "SmsTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/smsTemplate" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getSmsTemplate", + "group": "templates", + "weight": 141, + "cookies": false, + "type": "", + "demo": "projects\/get-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.getSMSTemplate" + }, + "methods": [ + { + "name": "getSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "demo": "projects\/get-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.getSMSTemplate" + } + }, + { + "name": "getSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "demo": "projects\/get-sms-template.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update custom SMS template", + "operationId": "projectsUpdateSmsTemplate", + "tags": [ + "projects" + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "responses": { + "200": { + "description": "SmsTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/smsTemplate" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSmsTemplate", + "group": "templates", + "weight": 143, + "cookies": false, + "type": "", + "demo": "projects\/update-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMSTemplate" + }, + "methods": [ + { + "name": "updateSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale", + "message" + ], + "required": [ + "projectId", + "type", + "locale", + "message" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "demo": "projects\/update-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMSTemplate" + } + }, + { + "name": "updateSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale", + "message" + ], + "required": [ + "projectId", + "type", + "locale", + "message" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "demo": "projects\/update-sms-template.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Template message", + "x-example": "<MESSAGE>" + } + }, + "required": [ + "message" + ] + } + } + } + } + }, + "delete": { + "summary": "Reset custom SMS template", + "operationId": "projectsDeleteSmsTemplate", + "tags": [ + "projects" + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "responses": { + "200": { + "description": "SmsTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/smsTemplate" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteSmsTemplate", + "group": "templates", + "weight": 145, + "cookies": false, + "type": "", + "demo": "projects\/delete-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.deleteSMSTemplate" + }, + "methods": [ + { + "name": "deleteSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "demo": "projects\/delete-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.deleteSMSTemplate" + } + }, + { + "name": "deleteSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "demo": "projects\/delete-sms-template.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/webhooks": { + "get": { + "summary": "List webhooks", + "operationId": "projectsListWebhooks", + "tags": [ + "projects" + ], + "description": "Get a list of all webhooks belonging to the project. You can use the query params to filter your results. ", + "responses": { + "200": { + "description": "Webhooks List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhookList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listWebhooks", + "group": "webhooks", + "weight": 123, + "cookies": false, + "type": "", + "demo": "projects\/list-webhooks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-webhooks.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create webhook", + "operationId": "projectsCreateWebhook", + "tags": [ + "projects" + ], + "description": "Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. ", + "responses": { + "201": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createWebhook", + "group": "webhooks", + "weight": 122, + "cookies": false, + "type": "", + "demo": "projects\/create-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Webhook name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Enable or disable a webhook.", + "x-example": false + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "Webhook URL.", + "x-example": null + }, + "security": { + "type": "boolean", + "description": "Certificate verification, false for disabled or true for enabled.", + "x-example": false + }, + "httpUser": { + "type": "string", + "description": "Webhook HTTP user. Max length: 256 chars.", + "x-example": "<HTTP_USER>" + }, + "httpPass": { + "type": "string", + "description": "Webhook HTTP password. Max length: 256 chars.", + "x-example": "<HTTP_PASS>" + } + }, + "required": [ + "name", + "events", + "url", + "security" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/webhooks\/{webhookId}": { + "get": { + "summary": "Get webhook", + "operationId": "projectsGetWebhook", + "tags": [ + "projects" + ], + "description": "Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. ", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getWebhook", + "group": "webhooks", + "weight": 124, + "cookies": false, + "type": "", + "demo": "projects\/get-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update webhook", + "operationId": "projectsUpdateWebhook", + "tags": [ + "projects" + ], + "description": "Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. ", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateWebhook", + "group": "webhooks", + "weight": 125, + "cookies": false, + "type": "", + "demo": "projects\/update-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Webhook name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Enable or disable a webhook.", + "x-example": false + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "Webhook URL.", + "x-example": null + }, + "security": { + "type": "boolean", + "description": "Certificate verification, false for disabled or true for enabled.", + "x-example": false + }, + "httpUser": { + "type": "string", + "description": "Webhook HTTP user. Max length: 256 chars.", + "x-example": "<HTTP_USER>" + }, + "httpPass": { + "type": "string", + "description": "Webhook HTTP password. Max length: 256 chars.", + "x-example": "<HTTP_PASS>" + } + }, + "required": [ + "name", + "events", + "url", + "security" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete webhook", + "operationId": "projectsDeleteWebhook", + "tags": [ + "projects" + ], + "description": "Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteWebhook", + "group": "webhooks", + "weight": 127, + "cookies": false, + "type": "", + "demo": "projects\/delete-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/webhooks\/{webhookId}\/signature": { + "patch": { + "summary": "Update webhook signature key", + "operationId": "projectsUpdateWebhookSignature", + "tags": [ + "projects" + ], + "description": "Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. ", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateWebhookSignature", + "group": "webhooks", + "weight": 126, + "cookies": false, + "type": "", + "demo": "projects\/update-webhook-signature.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook-signature.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ] + } + }, + "\/proxy\/rules": { + "get": { + "summary": "List rules", + "operationId": "proxyListRules", + "tags": [ + "proxy" + ], + "description": "Get a list of all the proxy rules. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rule List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRuleList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRules", + "group": null, + "weight": 502, + "cookies": false, + "type": "", + "demo": "proxy\/list-rules.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the proxy rules. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/proxy\/rules\/api": { + "post": { + "summary": "Create API rule", + "operationId": "proxyCreateAPIRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite's API on custom domain.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createAPIRule", + "group": null, + "weight": 497, + "cookies": false, + "type": "", + "demo": "proxy\/create-api-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite's API on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": null + } + }, + "required": [ + "domain" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/function": { + "post": { + "summary": "Create function rule", + "operationId": "proxyCreateFunctionRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for executing Appwrite Function on custom domain.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFunctionRule", + "group": null, + "weight": 499, + "cookies": false, + "type": "", + "demo": "proxy\/create-function-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for executing Appwrite Function on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": null + }, + "functionId": { + "type": "string", + "description": "ID of function to be executed.", + "x-example": "<FUNCTION_ID>" + }, + "branch": { + "type": "string", + "description": "Name of VCS branch to deploy changes automatically", + "x-example": "<BRANCH>" + } + }, + "required": [ + "domain", + "functionId" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/redirect": { + "post": { + "summary": "Create Redirect rule", + "operationId": "proxyCreateRedirectRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for to redirect from custom domain to another domain.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRedirectRule", + "group": null, + "weight": 500, + "cookies": false, + "type": "", + "demo": "proxy\/create-redirect-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for to redirect from custom domain to another domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": null + }, + "url": { + "type": "string", + "description": "Target URL of redirection", + "x-example": "https:\/\/example.com" + }, + "statusCode": { + "type": "string", + "description": "Status code of redirection", + "x-example": "301", + "enum": [ + "301", + "302", + "307", + "308" + ], + "x-enum-name": null, + "x-enum-keys": [ + "Moved Permanently 301", + "Found 302", + "Temporary Redirect 307", + "Permanent Redirect 308" + ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "x-example": "<RESOURCE_ID>" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] + } + }, + "required": [ + "domain", + "url", + "statusCode", + "resourceId", + "resourceType" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/site": { + "post": { + "summary": "Create site rule", + "operationId": "proxyCreateSiteRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite Site on custom domain.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSiteRule", + "group": null, + "weight": 498, + "cookies": false, + "type": "", + "demo": "proxy\/create-site-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite Site on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": null + }, + "siteId": { + "type": "string", + "description": "ID of site to be executed.", + "x-example": "<SITE_ID>" + }, + "branch": { + "type": "string", + "description": "Name of VCS branch to deploy changes automatically", + "x-example": "<BRANCH>" + } + }, + "required": [ + "domain", + "siteId" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/{ruleId}": { + "get": { + "summary": "Get rule", + "operationId": "proxyGetRule", + "tags": [ + "proxy" + ], + "description": "Get a proxy rule by its unique ID.", + "responses": { + "200": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRule", + "group": null, + "weight": 501, + "cookies": false, + "type": "", + "demo": "proxy\/get-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a proxy rule by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<RULE_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete rule", + "operationId": "proxyDeleteRule", + "tags": [ + "proxy" + ], + "description": "Delete a proxy rule by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRule", + "group": null, + "weight": 503, + "cookies": false, + "type": "", + "demo": "proxy\/delete-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a proxy rule by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<RULE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/proxy\/rules\/{ruleId}\/verification": { + "patch": { + "summary": "Update rule verification status", + "operationId": "proxyUpdateRuleVerification", + "tags": [ + "proxy" + ], + "description": "Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", + "responses": { + "200": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRuleVerification", + "group": null, + "weight": 504, + "cookies": false, + "type": "", + "demo": "proxy\/update-rule-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterRetry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<RULE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites": { + "get": { + "summary": "List sites", + "operationId": "sitesList", + "tags": [ + "sites" + ], + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Sites List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/siteList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "sites", + "weight": 469, + "cookies": false, + "type": "", + "demo": "sites\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create site", + "operationId": "sitesCreate", + "tags": [ + "sites" + ], + "description": "Create a new site.", + "responses": { + "201": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "sites", + "weight": 467, + "cookies": false, + "type": "", + "demo": "sites\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "siteId": { + "type": "string", + "description": "Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<SITE_ID>" + }, + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "x-example": "<FALLBACK_FILE>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "x-example": null + } + }, + "required": [ + "siteId", + "name", + "framework", + "buildRuntime" + ] + } + } + } + } + } + }, + "\/sites\/frameworks": { + "get": { + "summary": "List frameworks", + "operationId": "sitesListFrameworks", + "tags": [ + "sites" + ], + "description": "Get a list of all frameworks that are currently available on the server instance.", + "responses": { + "200": { + "description": "Frameworks List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/frameworkList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listFrameworks", + "group": "frameworks", + "weight": 472, + "cookies": false, + "type": "", + "demo": "sites\/list-frameworks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "sitesListSpecifications", + "tags": [ + "sites" + ], + "description": "List allowed site specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSpecifications", + "group": "frameworks", + "weight": 495, + "cookies": false, + "type": "", + "demo": "sites\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/templates": { + "get": { + "summary": "List templates", + "operationId": "sitesListTemplates", + "tags": [ + "sites" + ], + "description": "List available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "responses": { + "200": { + "description": "Site Templates List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateSiteList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTemplates", + "group": "templates", + "weight": 491, + "cookies": false, + "type": "", + "demo": "sites\/list-templates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "frameworks", + "description": "List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "useCases", + "description": "List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "limit", + "description": "Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 25 + }, + "in": "query" + }, + { + "name": "offset", + "description": "Offset the list of returned templates. Maximum offset is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + } + ] + } + }, + "\/sites\/templates\/{templateId}": { + "get": { + "summary": "Get site template", + "operationId": "sitesGetTemplate", + "tags": [ + "sites" + ], + "description": "Get a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "responses": { + "200": { + "description": "Template Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateSite" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTemplate", + "group": "templates", + "weight": 492, + "cookies": false, + "type": "", + "demo": "sites\/get-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Template ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEMPLATE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/usage": { + "get": { + "summary": "Get sites usage", + "operationId": "sitesListUsage", + "tags": [ + "sites" + ], + "description": "Get usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageSites", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageSites" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 493, + "cookies": false, + "type": "", + "demo": "sites\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}": { + "get": { + "summary": "Get site", + "operationId": "sitesGet", + "tags": [ + "sites" + ], + "description": "Get a site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "sites", + "weight": 468, + "cookies": false, + "type": "", + "demo": "sites\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update site", + "operationId": "sitesUpdate", + "tags": [ + "sites" + ], + "description": "Update site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "sites", + "weight": 470, + "cookies": false, + "type": "", + "demo": "sites\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "x-example": "<FALLBACK_FILE>" + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "x-example": null + } + }, + "required": [ + "name", + "framework" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete site", + "operationId": "sitesDelete", + "tags": [ + "sites" + ], + "description": "Delete a site by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "sites", + "weight": 471, + "cookies": false, + "type": "", + "demo": "sites\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployment": { + "patch": { + "summary": "Update site's deployment", + "operationId": "sitesUpdateSiteDeployment", + "tags": [ + "sites" + ], + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSiteDeployment", + "group": "sites", + "weight": 478, + "cookies": false, + "type": "", + "demo": "sites\/update-site-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "sitesListDeployments", + "tags": [ + "sites" + ], + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 477, + "cookies": false, + "type": "", + "demo": "sites\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "sitesCreateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 473, + "cookies": false, + "type": "upload", + "demo": "sites\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "installCommand": { + "type": "string", + "description": "Install Commands.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Commands.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "code": { + "type": "string", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "x-example": null + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "code", + "activate" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "sitesCreateDuplicateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 481, + "cookies": false, + "type": "", + "demo": "sites\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "sitesCreateTemplateDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 474, + "cookies": false, + "type": "", + "demo": "sites\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to site code in the template repo.", + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the site template.", + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "sitesCreateVcsDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 475, + "cookies": false, + "type": "", + "demo": "sites\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "x-example": "branch", + "enum": [ + "branch", + "commit", + "tag" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "sitesGetDeployment", + "tags": [ + "sites" + ], + "description": "Get a site deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 476, + "cookies": false, + "type": "", + "demo": "sites\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "sitesDeleteDeployment", + "tags": [ + "sites" + ], + "description": "Delete a site deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 479, + "cookies": false, + "type": "", + "demo": "sites\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "sitesGetDeploymentDownload", + "tags": [ + "sites" + ], + "description": "Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 480, + "cookies": false, + "type": "location", + "demo": "sites\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "sitesUpdateDeploymentStatus", + "tags": [ + "sites" + ], + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 482, + "cookies": false, + "type": "", + "demo": "sites\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "tags": [ + "sites" + ], + "description": "Get a list of all site logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 484, + "cookies": false, + "type": "", + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "tags": [ + "sites" + ], + "description": "Get a site request log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getLog", + "group": "logs", + "weight": 483, + "cookies": false, + "type": "", + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<LOG_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "tags": [ + "sites" + ], + "description": "Delete a site log by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteLog", + "group": "logs", + "weight": 485, + "cookies": false, + "type": "", + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<LOG_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/usage": { + "get": { + "summary": "Get site usage", + "operationId": "sitesGetUsage", + "tags": [ + "sites" + ], + "description": "Get usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageSite", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageSite" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 494, + "cookies": false, + "type": "", + "demo": "sites\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "sitesListVariables", + "tags": [ + "sites" + ], + "description": "Get a list of all variables of a specific site.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 488, + "cookies": false, + "type": "", + "demo": "sites\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "sitesCreateVariable", + "tags": [ + "sites" + ], + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 486, + "cookies": false, + "type": "", + "demo": "sites\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "sitesGetVariable", + "tags": [ + "sites" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 487, + "cookies": false, + "type": "", + "demo": "sites\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "sitesUpdateVariable", + "tags": [ + "sites" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 489, + "cookies": false, + "type": "", + "demo": "sites\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "sitesDeleteVariable", + "tags": [ + "sites" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 490, + "cookies": false, + "type": "", + "demo": "sites\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets": { + "get": { + "summary": "List buckets", + "operationId": "storageListBuckets", + "tags": [ + "storage" + ], + "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Buckets List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucketList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listBuckets", + "group": "buckets", + "weight": 155, + "cookies": false, + "type": "", + "demo": "storage\/list-buckets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create bucket", + "operationId": "storageCreateBucket", + "tags": [ + "storage" + ], + "description": "Create a new storage bucket.", + "responses": { + "201": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBucket", + "group": "buckets", + "weight": 154, + "cookies": false, + "type": "", + "demo": "storage\/create-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<BUCKET_ID>" + }, + "name": { + "type": "string", + "description": "Bucket name", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "x-example": false + } + }, + "required": [ + "bucketId", + "name" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}": { + "get": { + "summary": "Get bucket", + "operationId": "storageGetBucket", + "tags": [ + "storage" + ], + "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBucket", + "group": "buckets", + "weight": 156, + "cookies": false, + "type": "", + "demo": "storage\/get-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update bucket", + "operationId": "storageUpdateBucket", + "tags": [ + "storage" + ], + "description": "Update a storage bucket by its unique ID.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBucket", + "group": "buckets", + "weight": 157, + "cookies": false, + "type": "", + "demo": "storage\/update-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Bucket name", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete bucket", + "operationId": "storageDeleteBucket", + "tags": [ + "storage" + ], + "description": "Delete a storage bucket by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteBucket", + "group": "buckets", + "weight": 158, + "cookies": false, + "type": "", + "demo": "storage\/delete-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/fileList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 160, + "cookies": false, + "type": "", + "demo": "storage\/list-files.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 159, + "cookies": false, + "type": "upload", + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "fileId": { + "type": "string", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<FILE_ID>", + "x-upload-id": true + }, + "file": { + "type": "string", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "x-example": null + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "fileId", + "file" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 161, + "cookies": false, + "type": "", + "demo": "storage\/get-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 166, + "cookies": false, + "type": "", + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 167, + "cookies": false, + "type": "", + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 163, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "tags": [ + "storage" + ], + "description": "Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 162, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-preview.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "schema": { + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center" + }, + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "x-example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0 + }, + "in": "query" + }, + { + "name": "background", + "description": "Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "x-example": "jpg", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "" + }, + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 164, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-view.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/usage": { + "get": { + "summary": "Get storage usage stats", + "operationId": "storageGetUsage", + "tags": [ + "storage" + ], + "description": "Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "StorageUsage", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageStorage" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 168, + "cookies": false, + "type": "", + "demo": "storage\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/storage\/{bucketId}\/usage": { + "get": { + "summary": "Get bucket usage stats", + "operationId": "storageGetBucketUsage", + "tags": [ + "storage" + ], + "description": "Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "UsageBuckets", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageBuckets" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBucketUsage", + "group": null, + "weight": 169, + "cookies": false, + "type": "", + "demo": "storage\/get-bucket-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb": { + "get": { + "summary": "List databases", + "operationId": "tablesDBList", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "tablesdb", + "weight": 376, + "cookies": false, + "type": "", + "demo": "tablesdb\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "tablesDBCreate", + "tags": [ + "tablesDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "tablesdb", + "weight": 372, + "cookies": false, + "type": "", + "demo": "tablesdb\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/usage": { + "get": { + "summary": "Get TablesDB usage stats", + "operationId": "tablesDBListUsage", + "tags": [ + "tablesDB" + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabases", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageDatabases" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 378, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "methods": [ + { + "name": "listUsage", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "range" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/usageDatabases" + } + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "tablesdb\/list-usage.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "tablesDBGet", + "tags": [ + "tablesDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tablesdb", + "weight": 373, + "cookies": false, + "type": "", + "demo": "tablesdb\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "tablesDBUpdate", + "tags": [ + "tablesDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tablesdb", + "weight": 374, + "cookies": false, + "type": "", + "demo": "tablesdb\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "tablesDBDelete", + "tags": [ + "tablesDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tablesdb", + "weight": 375, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables": { + "get": { + "summary": "List tables", + "operationId": "tablesDBListTables", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Tables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/tableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTables", + "group": "tables", + "weight": 383, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-tables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-tables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create table", + "operationId": "tablesDBCreateTable", + "tags": [ + "tablesDB" + ], + "description": "Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTable", + "group": "tables", + "weight": 379, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "tableId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TABLE_ID>" + }, + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "tableId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}": { + "get": { + "summary": "Get table", + "operationId": "tablesDBGetTable", + "tags": [ + "tablesDB" + ], + "description": "Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTable", + "group": "tables", + "weight": 380, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update table", + "operationId": "tablesDBUpdateTable", + "tags": [ + "tablesDB" + ], + "description": "Update a table by its unique ID.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTable", + "group": "tables", + "weight": 381, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete table", + "operationId": "tablesDBDeleteTable", + "tags": [ + "tablesDB" + ], + "description": "Delete a table by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTable", + "group": "tables", + "weight": 382, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns": { + "get": { + "summary": "List columns", + "operationId": "tablesDBListColumns", + "tags": [ + "tablesDB" + ], + "description": "List columns in the table.", + "responses": { + "200": { + "description": "Columns List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listColumns", + "group": "columns", + "weight": 388, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-columns.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-columns.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean": { + "post": { + "summary": "Create boolean column", + "operationId": "tablesDBCreateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a boolean column.\n", + "responses": { + "202": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBooleanColumn", + "group": "columns", + "weight": 389, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean\/{key}": { + "patch": { + "summary": "Update boolean column", + "operationId": "tablesDBUpdateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a boolean column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBooleanColumn", + "group": "columns", + "weight": 390, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime": { + "post": { + "summary": "Create datetime column", + "operationId": "tablesDBCreateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a date time column according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDatetimeColumn", + "group": "columns", + "weight": 391, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime column", + "operationId": "tablesDBUpdateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a date time column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDatetimeColumn", + "group": "columns", + "weight": 392, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email": { + "post": { + "summary": "Create email column", + "operationId": "tablesDBCreateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an email column.\n", + "responses": { + "202": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailColumn", + "group": "columns", + "weight": 393, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email\/{key}": { + "patch": { + "summary": "Update email column", + "operationId": "tablesDBUpdateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an email column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailColumn", + "group": "columns", + "weight": 394, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum": { + "post": { + "summary": "Create enum column", + "operationId": "tablesDBCreateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column.", + "responses": { + "202": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEnumColumn", + "group": "columns", + "weight": 395, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum\/{key}": { + "patch": { + "summary": "Update enum column", + "operationId": "tablesDBUpdateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an enum column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEnumColumn", + "group": "columns", + "weight": 396, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float": { + "post": { + "summary": "Create float column", + "operationId": "tablesDBCreateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a float column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFloatColumn", + "group": "columns", + "weight": 397, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float\/{key}": { + "patch": { + "summary": "Update float column", + "operationId": "tablesDBUpdateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a float column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFloatColumn", + "group": "columns", + "weight": 398, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer": { + "post": { + "summary": "Create integer column", + "operationId": "tablesDBCreateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an integer column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIntegerColumn", + "group": "columns", + "weight": 399, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer\/{key}": { + "patch": { + "summary": "Update integer column", + "operationId": "tablesDBUpdateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an integer column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIntegerColumn", + "group": "columns", + "weight": 400, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip": { + "post": { + "summary": "Create IP address column", + "operationId": "tablesDBCreateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Create IP address column.\n", + "responses": { + "202": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIpColumn", + "group": "columns", + "weight": 401, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip\/{key}": { + "patch": { + "summary": "Update IP address column", + "operationId": "tablesDBUpdateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an ip column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIpColumn", + "group": "columns", + "weight": 402, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line column.", + "responses": { + "202": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 403, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 404, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point column.", + "responses": { + "202": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 405, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 406, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon column.", + "responses": { + "202": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 407, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { + "post": { + "summary": "Create relationship column", + "operationId": "tablesDBCreateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Create relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "202": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRelationshipColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedTableId": { + "type": "string", + "description": "Related Table ID.", + "x-example": "<RELATED_TABLE_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "x-example": false + }, + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Column Key.", + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedTableId", + "type" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string": { + "post": { + "summary": "Create string column", + "operationId": "tablesDBCreateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a string column.\n", + "responses": { + "202": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createStringColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "size": { + "type": "integer", + "description": "Column size for text columns, in number of characters.", + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string\/{key}": { + "patch": { + "summary": "Update string column", + "operationId": "tablesDBUpdateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a string column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStringColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string column.", + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url": { + "post": { + "summary": "Create URL column", + "operationId": "tablesDBCreateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a URL column.\n", + "responses": { + "202": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createUrlColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url\/{key}": { + "patch": { + "summary": "Update URL column", + "operationId": "tablesDBUpdateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an url column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateUrlColumn", + "group": "columns", + "weight": 414, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}": { + "get": { + "summary": "Get column", + "operationId": "tablesDBGetColumn", + "tags": [ + "tablesDB" + ], + "description": "Get column by ID.", + "responses": { + "200": { + "description": "ColumnBoolean, or ColumnInteger, or ColumnFloat, or ColumnEmail, or ColumnEnum, or ColumnURL, or ColumnIP, or ColumnDatetime, or ColumnRelationship, or ColumnString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getColumn", + "group": "columns", + "weight": 386, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete column", + "operationId": "tablesDBDeleteColumn", + "tags": [ + "tablesDB" + ], + "description": "Deletes a column.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteColumn", + "group": "columns", + "weight": 387, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}\/relationship": { + "patch": { + "summary": "Update relationship column", + "operationId": "tablesDBUpdateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Update relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "200": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRelationshipColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "tablesDBListIndexes", + "tags": [ + "tablesDB" + ], + "description": "List indexes on the table.", + "responses": { + "200": { + "description": "Column Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndexList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 418, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "tablesDBCreateIndex", + "tags": [ + "tablesDB" + ], + "description": "Creates an index on the columns listed. Your index should include all the columns you will query in a single request.\nType can be `key`, `fulltext`, or `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 415, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "columns": { + "type": "array", + "description": "Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "columns" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "tablesDBGetIndex", + "tags": [ + "tablesDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 416, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "tablesDBDeleteIndex", + "tags": [ + "tablesDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 417, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/logs": { + "get": { + "summary": "List table logs", + "operationId": "tablesDBListTableLogs", + "tags": [ + "tablesDB" + ], + "description": "Get the table activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTableLogs", + "group": "tables", + "weight": 384, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-table-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + }, + { + "name": "createRows", + "namespace": "tablesDB", + "desc": "Create rows", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-rows.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<ROW_ID>" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Upsert rows", + "operationId": "tablesDBUpsertRows", + "tags": [ + "tablesDB" + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRows", + "group": "rows", + "weight": 424, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRows", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "demo": "tablesdb\/upsert-rows.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "description": "Array of row data as JSON objects. May contain partial rows.", + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "rows" + ] + } + } + } + } + }, + "patch": { + "summary": "Update rows", + "operationId": "tablesDBUpdateRows", + "tags": [ + "tablesDB" + ], + "description": "Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRows", + "group": "rows", + "weight": 422, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only column and value pairs to be updated.", + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete rows", + "operationId": "tablesDBDeleteRows", + "tags": [ + "tablesDB" + ], + "description": "Bulk delete rows using queries, if no queries are passed then all rows are deleted.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRows", + "group": "rows", + "weight": 426, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-rows.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/logs": { + "get": { + "summary": "List row logs", + "operationId": "tablesDBListRowLogs", + "tags": [ + "tablesDB" + ], + "description": "Get the row activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRowLogs", + "group": "logs", + "weight": 428, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-row-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/usage": { + "get": { + "summary": "Get table usage stats", + "operationId": "tablesDBGetTableUsage", + "tags": [ + "tablesDB" + ], + "description": "Get usage metrics and statistics for a table. Returning the total number of rows. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageTable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageTable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTableUsage", + "group": null, + "weight": 385, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/usage": { + "get": { + "summary": "Get TablesDB usage stats", + "operationId": "tablesDBGetUsage", + "tags": [ + "tablesDB" + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabase", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageDatabase" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 377, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-database-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "methods": [ + { + "name": "getUsage", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "range" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/usageDatabase" + } + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "tablesdb\/get-usage.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/teamList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 171, + "cookies": false, + "type": "", + "demo": "teams\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 170, + "cookies": false, + "type": "", + "demo": "teams\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TEAM_ID>" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 172, + "cookies": false, + "type": "", + "demo": "teams\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 174, + "cookies": false, + "type": "", + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 176, + "cookies": false, + "type": "", + "demo": "teams\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/logs": { + "get": { + "summary": "List team logs", + "operationId": "teamsListLogs", + "tags": [ + "teams" + ], + "description": "Get the team activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 183, + "cookies": false, + "type": "", + "demo": "teams\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 178, + "cookies": false, + "type": "", + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 177, + "cookies": false, + "type": "", + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 179, + "cookies": false, + "type": "", + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 180, + "cookies": false, + "type": "", + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "tags": [ + "teams" + ], + "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 182, + "cookies": false, + "type": "", + "demo": "teams\/delete-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 181, + "cookies": false, + "type": "", + "demo": "teams\/update-membership-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 173, + "cookies": false, + "type": "", + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 175, + "cookies": false, + "type": "", + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "files", + "weight": 507, + "cookies": false, + "type": "", + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFileToken", + "group": "files", + "weight": 505, + "cookies": false, + "type": "", + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "x-example": null, + "x-nullable": true + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tokens", + "weight": 506, + "cookies": false, + "type": "", + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tokens", + "weight": 508, + "cookies": false, + "type": "", + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "x-example": null, + "x-nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tokens", + "weight": 509, + "cookies": false, + "type": "", + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users": { + "get": { + "summary": "List users", + "operationId": "usersList", + "tags": [ + "users" + ], + "description": "Get a list of all the project's users. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Users List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/userList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "users", + "weight": 193, + "cookies": false, + "type": "", + "demo": "users\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user", + "operationId": "usersCreate", + "tags": [ + "users" + ], + "description": "Create a new user.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "users", + "weight": 184, + "cookies": false, + "type": "", + "demo": "users\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "Plain text user password. Must be at least 8 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId" + ] + } + } + } + } + } + }, + "\/users\/argon2": { + "post": { + "summary": "Create user with Argon2 password", + "operationId": "usersCreateArgon2User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createArgon2User", + "group": "users", + "weight": 187, + "cookies": false, + "type": "", + "demo": "users\/create-argon-2-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Argon2.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/bcrypt": { + "post": { + "summary": "Create user with bcrypt password", + "operationId": "usersCreateBcryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBcryptUser", + "group": "users", + "weight": 185, + "cookies": false, + "type": "", + "demo": "users\/create-bcrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Bcrypt.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/identities": { + "get": { + "summary": "List identities", + "operationId": "usersListIdentities", + "tags": [ + "users" + ], + "description": "Get identities for all users.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 201, + "cookies": false, + "type": "", + "demo": "users\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/users\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "usersDeleteIdentity", + "tags": [ + "users" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 224, + "cookies": false, + "type": "", + "demo": "users\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<IDENTITY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/md5": { + "post": { + "summary": "Create user with MD5 password", + "operationId": "usersCreateMD5User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMD5User", + "group": "users", + "weight": 186, + "cookies": false, + "type": "", + "demo": "users\/create-md-5-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using MD5.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/phpass": { + "post": { + "summary": "Create user with PHPass password", + "operationId": "usersCreatePHPassUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPHPassUser", + "group": "users", + "weight": 189, + "cookies": false, + "type": "", + "demo": "users\/create-ph-pass-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using PHPass.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/scrypt": { + "post": { + "summary": "Create user with Scrypt password", + "operationId": "usersCreateScryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createScryptUser", + "group": "users", + "weight": 190, + "cookies": false, + "type": "", + "demo": "users\/create-scrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt.", + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Optional salt used to hash password.", + "x-example": "<PASSWORD_SALT>" + }, + "passwordCpu": { + "type": "integer", + "description": "Optional CPU cost used to hash password.", + "x-example": null + }, + "passwordMemory": { + "type": "integer", + "description": "Optional memory cost used to hash password.", + "x-example": null + }, + "passwordParallel": { + "type": "integer", + "description": "Optional parallelization cost used to hash password.", + "x-example": null + }, + "passwordLength": { + "type": "integer", + "description": "Optional hash length used to hash password.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordCpu", + "passwordMemory", + "passwordParallel", + "passwordLength" + ] + } + } + } + } + } + }, + "\/users\/scrypt-modified": { + "post": { + "summary": "Create user with Scrypt modified password", + "operationId": "usersCreateScryptModifiedUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createScryptModifiedUser", + "group": "users", + "weight": 191, + "cookies": false, + "type": "", + "demo": "users\/create-scrypt-modified-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt Modified.", + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Salt used to hash password.", + "x-example": "<PASSWORD_SALT>" + }, + "passwordSaltSeparator": { + "type": "string", + "description": "Salt separator used to hash password.", + "x-example": "<PASSWORD_SALT_SEPARATOR>" + }, + "passwordSignerKey": { + "type": "string", + "description": "Signer key used to hash password.", + "x-example": "<PASSWORD_SIGNER_KEY>" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordSaltSeparator", + "passwordSignerKey" + ] + } + } + } + } + } + }, + "\/users\/sha": { + "post": { + "summary": "Create user with SHA password", + "operationId": "usersCreateSHAUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSHAUser", + "group": "users", + "weight": 188, + "cookies": false, + "type": "", + "demo": "users\/create-sha-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using SHA.", + "x-example": "password" + }, + "passwordVersion": { + "type": "string", + "description": "Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'", + "x-example": "sha1", + "enum": [ + "sha1", + "sha224", + "sha256", + "sha384", + "sha512\/224", + "sha512\/256", + "sha512", + "sha3-224", + "sha3-256", + "sha3-384", + "sha3-512" + ], + "x-enum-name": "PasswordHash", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/usage": { + "get": { + "summary": "Get users usage stats", + "operationId": "usersGetUsage", + "tags": [ + "users" + ], + "description": "Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "UsageUsers", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageUsers" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 226, + "cookies": false, + "type": "", + "demo": "users\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}": { + "get": { + "summary": "Get user", + "operationId": "usersGet", + "tags": [ + "users" + ], + "description": "Get a user by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "users", + "weight": 194, + "cookies": false, + "type": "", + "demo": "users\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user", + "operationId": "usersDelete", + "tags": [ + "users" + ], + "description": "Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https:\/\/appwrite.io\/docs\/server\/users#usersUpdateStatus) endpoint instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "users", + "weight": 222, + "cookies": false, + "type": "", + "demo": "users\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/email": { + "patch": { + "summary": "Update email", + "operationId": "usersUpdateEmail", + "tags": [ + "users" + ], + "description": "Update the user email by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "users", + "weight": 207, + "cookies": false, + "type": "", + "demo": "users\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + } + }, + "required": [ + "email" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/jwts": { + "post": { + "summary": "Create user JWT", + "operationId": "usersCreateJWT", + "tags": [ + "users" + ], + "description": "Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "sessions", + "weight": 225, + "cookies": false, + "type": "", + "demo": "users\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "sessionId": { + "type": "string", + "description": "Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.", + "x-example": "<SESSION_ID>" + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "x-example": 0 + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/labels": { + "put": { + "summary": "Update user labels", + "operationId": "usersUpdateLabels", + "tags": [ + "users" + ], + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLabels", + "group": "users", + "weight": 203, + "cookies": false, + "type": "", + "demo": "users\/update-labels.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "labels": { + "type": "array", + "description": "Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/logs": { + "get": { + "summary": "List user logs", + "operationId": "usersListLogs", + "tags": [ + "users" + ], + "description": "Get the user activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 199, + "cookies": false, + "type": "", + "demo": "users\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/memberships": { + "get": { + "summary": "List user memberships", + "operationId": "usersListMemberships", + "tags": [ + "users" + ], + "description": "Get the user membership list by its unique ID.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 198, + "cookies": false, + "type": "", + "demo": "users\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfa", + "group": "users", + "weight": 212, + "cookies": false, + "type": "", + "demo": "users\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + }, + "methods": [ + { + "name": "updateMfa", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + } + }, + { + "name": "updateMFA", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 217, + "cookies": false, + "type": "", + "demo": "users\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 213, + "cookies": false, + "type": "", + "demo": "users\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 214, + "cookies": false, + "type": "", + "demo": "users\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 216, + "cookies": false, + "type": "", + "demo": "users\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 215, + "cookies": false, + "type": "", + "demo": "users\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/name": { + "patch": { + "summary": "Update name", + "operationId": "usersUpdateName", + "tags": [ + "users" + ], + "description": "Update the user name by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "users", + "weight": 205, + "cookies": false, + "type": "", + "demo": "users\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/password": { + "patch": { + "summary": "Update password", + "operationId": "usersUpdatePassword", + "tags": [ + "users" + ], + "description": "Update the user password by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePassword", + "group": "users", + "weight": 206, + "cookies": false, + "type": "", + "demo": "users\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "x-example": null + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "usersUpdatePhone", + "tags": [ + "users" + ], + "description": "Update the user phone by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhone", + "group": "users", + "weight": 208, + "cookies": false, + "type": "", + "demo": "users\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "User phone number.", + "x-example": "+12065550100" + } + }, + "required": [ + "number" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/prefs": { + "get": { + "summary": "Get user preferences", + "operationId": "usersGetPrefs", + "tags": [ + "users" + ], + "description": "Get the user preferences by its unique ID.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "users", + "weight": 195, + "cookies": false, + "type": "", + "demo": "users\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user preferences", + "operationId": "usersUpdatePrefs", + "tags": [ + "users" + ], + "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "users", + "weight": 210, + "cookies": false, + "type": "", + "demo": "users\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/sessions": { + "get": { + "summary": "List user sessions", + "operationId": "usersListSessions", + "tags": [ + "users" + ], + "description": "Get the user sessions list by its unique ID.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 197, + "cookies": false, + "type": "", + "demo": "users\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create session", + "operationId": "usersCreateSession", + "tags": [ + "users" + ], + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 218, + "cookies": false, + "type": "", + "demo": "users\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user sessions", + "operationId": "usersDeleteSessions", + "tags": [ + "users" + ], + "description": "Delete all user's sessions by using the user's unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 221, + "cookies": false, + "type": "", + "demo": "users\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/sessions\/{sessionId}": { + "delete": { + "summary": "Delete user session", + "operationId": "usersDeleteSession", + "tags": [ + "users" + ], + "description": "Delete a user sessions by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 220, + "cookies": false, + "type": "", + "demo": "users\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "sessionId", + "description": "Session ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SESSION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/status": { + "patch": { + "summary": "Update user status", + "operationId": "usersUpdateStatus", + "tags": [ + "users" + ], + "description": "Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStatus", + "group": "users", + "weight": 202, + "cookies": false, + "type": "", + "demo": "users\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets": { + "get": { + "summary": "List user targets", + "operationId": "usersListTargets", + "tags": [ + "users" + ], + "description": "List the messaging targets that are associated with a user.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTargets", + "group": "targets", + "weight": 200, + "cookies": false, + "type": "", + "demo": "users\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user target", + "operationId": "usersCreateTarget", + "tags": [ + "users" + ], + "description": "Create a messaging target.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTarget", + "group": "targets", + "weight": 192, + "cookies": false, + "type": "", + "demo": "users\/create-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TARGET_ID>" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email", + "enum": [ + "email", + "sms", + "push" + ], + "x-enum-name": "MessagingProviderType", + "x-enum-keys": [] + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "x-example": "<NAME>" + } + }, + "required": [ + "targetId", + "providerType", + "identifier" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets\/{targetId}": { + "get": { + "summary": "Get user target", + "operationId": "usersGetTarget", + "tags": [ + "users" + ], + "description": "Get a user's push notification target by ID.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTarget", + "group": "targets", + "weight": 196, + "cookies": false, + "type": "", + "demo": "users\/get-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user target", + "operationId": "usersUpdateTarget", + "tags": [ + "users" + ], + "description": "Update a messaging target.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTarget", + "group": "targets", + "weight": 211, + "cookies": false, + "type": "", + "demo": "users\/update-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "x-example": "<NAME>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete user target", + "operationId": "usersDeleteTarget", + "tags": [ + "users" + ], + "description": "Delete a messaging target.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTarget", + "group": "targets", + "weight": 223, + "cookies": false, + "type": "", + "demo": "users\/delete-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/tokens": { + "post": { + "summary": "Create token", + "operationId": "usersCreateToken", + "tags": [ + "users" + ], + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createToken", + "group": "sessions", + "weight": 219, + "cookies": false, + "type": "", + "demo": "users\/create-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "length": { + "type": "integer", + "description": "Token length in characters. The default length is 6 characters", + "x-example": 4 + }, + "expire": { + "type": "integer", + "description": "Token expiration period in seconds. The default expiration is 15 minutes.", + "x-example": 60 + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/verification": { + "patch": { + "summary": "Update email verification", + "operationId": "usersUpdateEmailVerification", + "tags": [ + "users" + ], + "description": "Update the user email verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailVerification", + "group": "users", + "weight": 209, + "cookies": false, + "type": "", + "demo": "users\/update-email-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "emailVerification": { + "type": "boolean", + "description": "User email verification status.", + "x-example": false + } + }, + "required": [ + "emailVerification" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/verification\/phone": { + "patch": { + "summary": "Update phone verification", + "operationId": "usersUpdatePhoneVerification", + "tags": [ + "users" + ], + "description": "Update the user phone verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "users", + "weight": 204, + "cookies": false, + "type": "", + "demo": "users\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phoneVerification": { + "type": "boolean", + "description": "User phone verification status.", + "x-example": false + } + }, + "required": [ + "phoneVerification" + ] + } + } + } + } + } + }, + "\/vcs\/github\/installations\/{installationId}\/detections": { + "post": { + "summary": "Create repository detection", + "operationId": "vcsCreateRepositoryDetection", + "tags": [ + "vcs" + ], + "description": "Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", + "responses": { + "200": { + "description": "DetectionFramework", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/detectionFramework" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRepositoryDetection", + "group": "repositories", + "weight": 230, + "cookies": false, + "type": "", + "demo": "vcs\/create-repository-detection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository-detection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerRepositoryId": { + "type": "string", + "description": "Repository Id", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "type": { + "type": "string", + "description": "Detector type. Must be one of the following: runtime, framework", + "x-example": "runtime", + "enum": [ + "runtime", + "framework" + ], + "x-enum-name": "VCSDetectionType", + "x-enum-keys": [] + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to Root Directory", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + } + }, + "required": [ + "providerRepositoryId", + "type" + ] + } + } + } + } + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories": { + "get": { + "summary": "List repositories", + "operationId": "vcsListRepositories", + "tags": [ + "vcs" + ], + "description": "Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.", + "responses": { + "200": { + "description": "Framework Provider Repositories List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerRepositoryFrameworkList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRepositories", + "group": "repositories", + "weight": 231, + "cookies": false, + "type": "", + "demo": "vcs\/list-repositories.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repositories.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Detector type. Must be one of the following: runtime, framework", + "required": true, + "schema": { + "type": "string", + "x-example": "runtime", + "enum": [ + "runtime", + "framework" + ], + "x-enum-name": "VCSDetectionType", + "x-enum-keys": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create repository", + "operationId": "vcsCreateRepository", + "tags": [ + "vcs" + ], + "description": "Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation.", + "responses": { + "200": { + "description": "ProviderRepository", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerRepository" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRepository", + "group": "repositories", + "weight": 232, + "cookies": false, + "type": "", + "demo": "vcs\/create-repository.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name (slug)", + "x-example": "<NAME>" + }, + "private": { + "type": "boolean", + "description": "Mark repository public or private", + "x-example": false + } + }, + "required": [ + "name", + "private" + ] + } + } + } + } + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}": { + "get": { + "summary": "Get repository", + "operationId": "vcsGetRepository", + "tags": [ + "vcs" + ], + "description": "Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.", + "responses": { + "200": { + "description": "ProviderRepository", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerRepository" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRepository", + "group": "repositories", + "weight": 233, + "cookies": false, + "type": "", + "demo": "vcs\/get-repository.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}\/branches": { + "get": { + "summary": "List repository branches", + "operationId": "vcsListRepositoryBranches", + "tags": [ + "vcs" + ], + "description": "Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.\n", + "responses": { + "200": { + "description": "Branches List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/branchList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRepositoryBranches", + "group": "repositories", + "weight": 234, + "cookies": false, + "type": "", + "demo": "vcs\/list-repository-branches.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repository-branches.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}\/contents": { + "get": { + "summary": "Get files and directories of a VCS repository", + "operationId": "vcsGetRepositoryContents", + "tags": [ + "vcs" + ], + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", + "responses": { + "200": { + "description": "VCS Content List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vcsContentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRepositoryContents", + "group": "repositories", + "weight": 229, + "cookies": false, + "type": "", + "demo": "vcs\/get-repository-contents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository-contents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "in": "path" + }, + { + "name": "providerRootDirectory", + "description": "Path to get contents of nested directory", + "required": false, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ROOT_DIRECTORY>", + "default": "" + }, + "in": "query" + }, + { + "name": "providerReference", + "description": "Git reference (branch, tag, commit) to get contents from", + "required": false, + "schema": { + "type": "string", + "x-example": "<PROVIDER_REFERENCE>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/repositories\/{repositoryId}": { + "patch": { + "summary": "Update external deployment (authorize)", + "operationId": "vcsUpdateExternalDeployments", + "tags": [ + "vcs" + ], + "description": "Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateExternalDeployments", + "group": "repositories", + "weight": 239, + "cookies": false, + "type": "", + "demo": "vcs\/update-external-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/update-external-deployments.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "repositoryId", + "description": "VCS Repository Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<REPOSITORY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerPullRequestId": { + "type": "string", + "description": "GitHub Pull Request Id", + "x-example": "<PROVIDER_PULL_REQUEST_ID>" + } + }, + "required": [ + "providerPullRequestId" + ] + } + } + } + } + } + }, + "\/vcs\/installations": { + "get": { + "summary": "List installations", + "operationId": "vcsListInstallations", + "tags": [ + "vcs" + ], + "description": "List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details.\n", + "responses": { + "200": { + "description": "Installations List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/installationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listInstallations", + "group": "installations", + "weight": 236, + "cookies": false, + "type": "", + "demo": "vcs\/list-installations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-installations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: provider, organization", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/vcs\/installations\/{installationId}": { + "get": { + "summary": "Get installation", + "operationId": "vcsGetInstallation", + "tags": [ + "vcs" + ], + "description": "Get a VCS installation by its unique ID. This endpoint returns the installation's details including its provider, organization, and configuration. ", + "responses": { + "200": { + "description": "Installation", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/installation" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getInstallation", + "group": "installations", + "weight": 237, + "cookies": false, + "type": "", + "demo": "vcs\/get-installation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-installation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete installation", + "operationId": "vcsDeleteInstallation", + "tags": [ + "vcs" + ], + "description": "Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteInstallation", + "group": "installations", + "weight": 238, + "cookies": false, + "type": "", + "demo": "vcs\/delete-installation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/delete-installation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ] + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "components": { + "schemas": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true, + "example": [] + }, + "error": { + "description": "Error", + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Error message.", + "x-example": "Not found" + }, + "code": { + "type": "string", + "description": "Error code.", + "x-example": "404" + }, + "type": { + "type": "string", + "description": "Error type. You can learn more about all the error types at https:\/\/appwrite.io\/docs\/error-codes#errorTypes", + "x-example": "not_found" + }, + "version": { + "type": "string", + "description": "Server version number.", + "x-example": "1.0" + } + }, + "required": [ + "message", + "code", + "type", + "version" + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "$ref": "#\/components\/schemas\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "$ref": "#\/components\/schemas\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ], + "example": { + "total": 5, + "documents": "" + } + }, + "tableList": { + "description": "Tables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tables": { + "type": "array", + "description": "List of tables.", + "items": { + "$ref": "#\/components\/schemas\/table" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tables" + ], + "example": { + "total": 5, + "tables": "" + } + }, + "collectionList": { + "description": "Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections that matched your query.", + "x-example": 5, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "$ref": "#\/components\/schemas\/collection" + }, + "x-example": "" + } + }, + "required": [ + "total", + "collections" + ], + "example": { + "total": 5, + "collections": "" + } + }, + "databaseList": { + "description": "Databases List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of databases that matched your query.", + "x-example": 5, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "List of databases.", + "items": { + "$ref": "#\/components\/schemas\/database" + }, + "x-example": "" + } + }, + "required": [ + "total", + "databases" + ], + "example": { + "total": 5, + "databases": "" + } + }, + "indexList": { + "description": "Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "columnIndexList": { + "description": "Column Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "userList": { + "description": "Users List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of users that matched your query.", + "x-example": 5, + "format": "int32" + }, + "users": { + "type": "array", + "description": "List of users.", + "items": { + "$ref": "#\/components\/schemas\/user" + }, + "x-example": "" + } + }, + "required": [ + "total", + "users" + ], + "example": { + "total": 5, + "users": "" + } + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "$ref": "#\/components\/schemas\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ], + "example": { + "total": 5, + "sessions": "" + } + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "$ref": "#\/components\/schemas\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ], + "example": { + "total": 5, + "identities": "" + } + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "$ref": "#\/components\/schemas\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ], + "example": { + "total": 5, + "logs": "" + } + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "$ref": "#\/components\/schemas\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ], + "example": { + "total": 5, + "files": "" + } + }, + "bucketList": { + "description": "Buckets List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of buckets that matched your query.", + "x-example": 5, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "List of buckets.", + "items": { + "$ref": "#\/components\/schemas\/bucket" + }, + "x-example": "" + } + }, + "required": [ + "total", + "buckets" + ], + "example": { + "total": 5, + "buckets": "" + } + }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ], + "example": { + "total": 5, + "tokens": "" + } + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "$ref": "#\/components\/schemas\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ], + "example": { + "total": 5, + "teams": "" + } + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "$ref": "#\/components\/schemas\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ], + "example": { + "total": 5, + "memberships": "" + } + }, + "siteList": { + "description": "Sites List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sites that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "List of sites.", + "items": { + "$ref": "#\/components\/schemas\/site" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sites" + ], + "example": { + "total": 5, + "sites": "" + } + }, + "templateSiteList": { + "description": "Site Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates that matched your query.", + "x-example": 5, + "format": "int32" + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "$ref": "#\/components\/schemas\/templateSite" + }, + "x-example": "" + } + }, + "required": [ + "total", + "templates" + ], + "example": { + "total": 5, + "templates": "" + } + }, + "functionList": { + "description": "Functions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of functions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "List of functions.", + "items": { + "$ref": "#\/components\/schemas\/function" + }, + "x-example": "" + } + }, + "required": [ + "total", + "functions" + ], + "example": { + "total": 5, + "functions": "" + } + }, + "templateFunctionList": { + "description": "Function Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates that matched your query.", + "x-example": 5, + "format": "int32" + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "$ref": "#\/components\/schemas\/templateFunction" + }, + "x-example": "" + } + }, + "required": [ + "total", + "templates" + ], + "example": { + "total": 5, + "templates": "" + } + }, + "installationList": { + "description": "Installations List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of installations that matched your query.", + "x-example": 5, + "format": "int32" + }, + "installations": { + "type": "array", + "description": "List of installations.", + "items": { + "$ref": "#\/components\/schemas\/installation" + }, + "x-example": "" + } + }, + "required": [ + "total", + "installations" + ], + "example": { + "total": 5, + "installations": "" + } + }, + "providerRepositoryFrameworkList": { + "description": "Framework Provider Repositories List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworkProviderRepositories that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworkProviderRepositories": { + "type": "array", + "description": "List of frameworkProviderRepositories.", + "items": { + "$ref": "#\/components\/schemas\/providerRepositoryFramework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworkProviderRepositories" + ], + "example": { + "total": 5, + "frameworkProviderRepositories": "" + } + }, + "providerRepositoryRuntimeList": { + "description": "Runtime Provider Repositories List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimeProviderRepositories that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimeProviderRepositories": { + "type": "array", + "description": "List of runtimeProviderRepositories.", + "items": { + "$ref": "#\/components\/schemas\/providerRepositoryRuntime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimeProviderRepositories" + ], + "example": { + "total": 5, + "runtimeProviderRepositories": "" + } + }, + "branchList": { + "description": "Branches List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of branches that matched your query.", + "x-example": 5, + "format": "int32" + }, + "branches": { + "type": "array", + "description": "List of branches.", + "items": { + "$ref": "#\/components\/schemas\/branch" + }, + "x-example": "" + } + }, + "required": [ + "total", + "branches" + ], + "example": { + "total": 5, + "branches": "" + } + }, + "frameworkList": { + "description": "Frameworks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworks that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks.", + "items": { + "$ref": "#\/components\/schemas\/framework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworks" + ], + "example": { + "total": 5, + "frameworks": "" + } + }, + "runtimeList": { + "description": "Runtimes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes.", + "items": { + "$ref": "#\/components\/schemas\/runtime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimes" + ], + "example": { + "total": 5, + "runtimes": "" + } + }, + "deploymentList": { + "description": "Deployments List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of deployments that matched your query.", + "x-example": 5, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "List of deployments.", + "items": { + "$ref": "#\/components\/schemas\/deployment" + }, + "x-example": "" + } + }, + "required": [ + "total", + "deployments" + ], + "example": { + "total": 5, + "deployments": "" + } + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "$ref": "#\/components\/schemas\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ], + "example": { + "total": 5, + "executions": "" + } + }, + "projectList": { + "description": "Projects List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of projects that matched your query.", + "x-example": 5, + "format": "int32" + }, + "projects": { + "type": "array", + "description": "List of projects.", + "items": { + "$ref": "#\/components\/schemas\/project" + }, + "x-example": "" + } + }, + "required": [ + "total", + "projects" + ], + "example": { + "total": 5, + "projects": "" + } + }, + "webhookList": { + "description": "Webhooks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of webhooks that matched your query.", + "x-example": 5, + "format": "int32" + }, + "webhooks": { + "type": "array", + "description": "List of webhooks.", + "items": { + "$ref": "#\/components\/schemas\/webhook" + }, + "x-example": "" + } + }, + "required": [ + "total", + "webhooks" + ], + "example": { + "total": 5, + "webhooks": "" + } + }, + "keyList": { + "description": "API Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of keys that matched your query.", + "x-example": 5, + "format": "int32" + }, + "keys": { + "type": "array", + "description": "List of keys.", + "items": { + "$ref": "#\/components\/schemas\/key" + }, + "x-example": "" + } + }, + "required": [ + "total", + "keys" + ], + "example": { + "total": 5, + "keys": "" + } + }, + "devKeyList": { + "description": "Dev Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of devKeys that matched your query.", + "x-example": 5, + "format": "int32" + }, + "devKeys": { + "type": "array", + "description": "List of devKeys.", + "items": { + "$ref": "#\/components\/schemas\/devKey" + }, + "x-example": "" + } + }, + "required": [ + "total", + "devKeys" + ], + "example": { + "total": 5, + "devKeys": "" + } + }, + "platformList": { + "description": "Platforms List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of platforms that matched your query.", + "x-example": 5, + "format": "int32" + }, + "platforms": { + "type": "array", + "description": "List of platforms.", + "items": { + "$ref": "#\/components\/schemas\/platform" + }, + "x-example": "" + } + }, + "required": [ + "total", + "platforms" + ], + "example": { + "total": 5, + "platforms": "" + } + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "$ref": "#\/components\/schemas\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ], + "example": { + "total": 5, + "countries": "" + } + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "$ref": "#\/components\/schemas\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ], + "example": { + "total": 5, + "continents": "" + } + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "$ref": "#\/components\/schemas\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ], + "example": { + "total": 5, + "languages": "" + } + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "$ref": "#\/components\/schemas\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ], + "example": { + "total": 5, + "currencies": "" + } + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "$ref": "#\/components\/schemas\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ], + "example": { + "total": 5, + "phones": "" + } + }, + "variableList": { + "description": "Variables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of variables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "variables": { + "type": "array", + "description": "List of variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": "" + } + }, + "required": [ + "total", + "variables" + ], + "example": { + "total": 5, + "variables": "" + } + }, + "proxyRuleList": { + "description": "Rule List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rules that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rules": { + "type": "array", + "description": "List of rules.", + "items": { + "$ref": "#\/components\/schemas\/proxyRule" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rules" + ], + "example": { + "total": 5, + "rules": "" + } + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "$ref": "#\/components\/schemas\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ], + "example": { + "total": 5, + "localeCodes": "" + } + }, + "providerList": { + "description": "Provider list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of providers that matched your query.", + "x-example": 5, + "format": "int32" + }, + "providers": { + "type": "array", + "description": "List of providers.", + "items": { + "$ref": "#\/components\/schemas\/provider" + }, + "x-example": "" + } + }, + "required": [ + "total", + "providers" + ], + "example": { + "total": 5, + "providers": "" + } + }, + "messageList": { + "description": "Message list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of messages that matched your query.", + "x-example": 5, + "format": "int32" + }, + "messages": { + "type": "array", + "description": "List of messages.", + "items": { + "$ref": "#\/components\/schemas\/message" + }, + "x-example": "" + } + }, + "required": [ + "total", + "messages" + ], + "example": { + "total": 5, + "messages": "" + } + }, + "topicList": { + "description": "Topic list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of topics that matched your query.", + "x-example": 5, + "format": "int32" + }, + "topics": { + "type": "array", + "description": "List of topics.", + "items": { + "$ref": "#\/components\/schemas\/topic" + }, + "x-example": "" + } + }, + "required": [ + "total", + "topics" + ], + "example": { + "total": 5, + "topics": "" + } + }, + "subscriberList": { + "description": "Subscriber list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of subscribers that matched your query.", + "x-example": 5, + "format": "int32" + }, + "subscribers": { + "type": "array", + "description": "List of subscribers.", + "items": { + "$ref": "#\/components\/schemas\/subscriber" + }, + "x-example": "" + } + }, + "required": [ + "total", + "subscribers" + ], + "example": { + "total": 5, + "subscribers": "" + } + }, + "targetList": { + "description": "Target list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of targets that matched your query.", + "x-example": 5, + "format": "int32" + }, + "targets": { + "type": "array", + "description": "List of targets.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "x-example": "" + } + }, + "required": [ + "total", + "targets" + ], + "example": { + "total": 5, + "targets": "" + } + }, + "migrationList": { + "description": "Migrations List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of migrations that matched your query.", + "x-example": 5, + "format": "int32" + }, + "migrations": { + "type": "array", + "description": "List of migrations.", + "items": { + "$ref": "#\/components\/schemas\/migration" + }, + "x-example": "" + } + }, + "required": [ + "total", + "migrations" + ], + "example": { + "total": 5, + "migrations": "" + } + }, + "specificationList": { + "description": "Specifications List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of specifications that matched your query.", + "x-example": 5, + "format": "int32" + }, + "specifications": { + "type": "array", + "description": "List of specifications.", + "items": { + "$ref": "#\/components\/schemas\/specification" + }, + "x-example": "" + } + }, + "required": [ + "total", + "specifications" + ], + "example": { + "total": 5, + "specifications": "" + } + }, + "vcsContentList": { + "description": "VCS Content List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of contents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "contents": { + "type": "array", + "description": "List of contents.", + "items": { + "$ref": "#\/components\/schemas\/vcsContent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "contents" + ], + "example": { + "total": 5, + "contents": "" + } + }, + "database": { + "description": "Database", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Database name.", + "x-example": "My Database" + }, + "$createdAt": { + "type": "string", + "description": "Database creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Database update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "enabled": { + "type": "boolean", + "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "type": { + "type": "string", + "description": "Database type.", + "x-example": "legacy" + } + }, + "required": [ + "$id", + "name", + "$createdAt", + "$updatedAt", + "enabled", + "type" + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false, + "type": "legacy" + } + }, + "collection": { + "description": "Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "x-example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } + }, + "attributeList": { + "description": "Attributes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of attributes in the given collection.", + "x-example": 5, + "format": "int32" + }, + "attributes": { + "type": "array", + "description": "List of attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "attributes" + ], + "example": { + "total": 5, + "attributes": "" + } + }, + "attributeString": { + "description": "AttributeString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "attributeInteger": { + "description": "AttributeInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 10, + "format": "int32", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "attributeFloat": { + "description": "AttributeFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 2.5, + "format": "double", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "attributeBoolean": { + "description": "AttributeBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "attributeEmail": { + "description": "AttributeEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "attributeEnum": { + "description": "AttributeEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "attributeIp": { + "description": "AttributeIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "attributeUrl": { + "description": "AttributeURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "http:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } + }, + "attributeDatetime": { + "description": "AttributeDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "attributeRelationship": { + "description": "AttributeRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedCollection": { + "type": "string", + "description": "The ID of the related collection.", + "x-example": "collection" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedCollection", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + 0, + 0 + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "table": { + "description": "Table", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Table creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Table update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Table permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Table name.", + "x-example": "My Table" + }, + "enabled": { + "type": "boolean", + "description": "Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "rowSecurity": { + "type": "boolean", + "description": "Whether row-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "columns": { + "type": "array", + "description": "Table columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Table indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "rowSecurity", + "columns", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Table", + "enabled": false, + "rowSecurity": true, + "columns": {}, + "indexes": {} + } + }, + "columnList": { + "description": "Columns List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of columns in the given table.", + "x-example": 5, + "format": "int32" + }, + "columns": { + "type": "array", + "description": "List of columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "columns" + ], + "example": { + "total": 5, + "columns": "" + } + }, + "columnString": { + "description": "ColumnString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnInteger": { + "description": "ColumnInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 10, + "format": "int32", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnFloat": { + "description": "ColumnFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 2.5, + "format": "double", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "columnBoolean": { + "description": "ColumnBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "columnEmail": { + "description": "ColumnEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "columnEnum": { + "description": "ColumnEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "columnIp": { + "description": "ColumnIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "columnUrl": { + "description": "ColumnURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "https:\/\/example.com" + } + }, + "columnDatetime": { + "description": "ColumnDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "columnRelationship": { + "description": "ColumnRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedTable": { + "type": "string", + "description": "The ID of the related table.", + "x-example": "table" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedTable", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedTable": "table", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + 0, + 0 + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "index": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "attributes": { + "type": "array", + "description": "Index attributes.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index attributes length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "attributes", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [] + } + }, + "columnIndex": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "columns": { + "type": "array", + "description": "Index columns.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index columns length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "columns", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "columns": [], + "lengths": [], + "orders": [] + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/algoArgon2" + }, + { + "$ref": "#\/components\/schemas\/algoScrypt" + }, + { + "$ref": "#\/components\/schemas\/algoScryptModified" + }, + { + "$ref": "#\/components\/schemas\/algoBcrypt" + }, + { + "$ref": "#\/components\/schemas\/algoPhpass" + }, + { + "$ref": "#\/components\/schemas\/algoSha" + }, + { + "$ref": "#\/components\/schemas\/algoMd5" + } + ] + }, + "nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ], + "example": { + "type": "md5" + } + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ], + "example": { + "type": "sha" + } + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ], + "example": { + "type": "phpass" + } + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ], + "example": { + "type": "bcrypt" + } + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "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.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "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.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ], + "example": { + "code": "en-us", + "name": "US" + } + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } + }, + "bucket": { + "description": "Bucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Bucket creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Bucket update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Bucket permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "fileSecurity": { + "type": "boolean", + "description": "Whether file-level security is enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "name": { + "type": "string", + "description": "Bucket name.", + "x-example": "Documents" + }, + "enabled": { + "type": "boolean", + "description": "Bucket enabled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size supported.", + "x-example": 100, + "format": "int32" + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions.", + "items": { + "type": "string" + }, + "x-example": [ + "jpg", + "png" + ] + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" + }, + "encryption": { + "type": "boolean", + "description": "Bucket is encrypted.", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Virus scanning is enabled.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "fileSecurity", + "name", + "enabled", + "maximumFileSize", + "allowedFileExtensions", + "compression", + "encryption", + "antivirus" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } + }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "files" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceType", + "expire", + "secret", + "accessedAt" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } + }, + "site": { + "description": "Site", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Site ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Site creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Site update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Site name.", + "x-example": "My Site" + }, + "enabled": { + "type": "boolean", + "description": "Site enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "framework": { + "type": "string", + "description": "Site framework.", + "x-example": "react" + }, + "deploymentId": { + "type": "string", + "description": "Site's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "deploymentScreenshotLight": { + "type": "string", + "description": "Screenshot of active deployment with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentScreenshotDark": { + "type": "string", + "description": "Screenshot of active deployment with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentId": { + "type": "string", + "description": "Site's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "vars": { + "type": "array", + "description": "Site variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": [] + }, + "timeout": { + "type": "integer", + "description": "Site request timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the site dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the site.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The directory where the site build output is located.", + "x-example": "build" + }, + "installationId": { + "type": "string", + "description": "Site VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": "sites\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + }, + "buildRuntime": { + "type": "string", + "description": "Site build runtime.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework adapter.", + "x-example": "static" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "enabled", + "live", + "logging", + "framework", + "deploymentId", + "deploymentCreatedAt", + "deploymentScreenshotLight", + "deploymentScreenshotDark", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "vars", + "timeout", + "installCommand", + "buildCommand", + "outputDirectory", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification", + "buildRuntime", + "adapter", + "fallbackFile" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } + }, + "templateSite": { + "description": "Template Site", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Site Template ID.", + "x-example": "starter" + }, + "name": { + "type": "string", + "description": "Site Template Name.", + "x-example": "Starter site" + }, + "tagline": { + "type": "string", + "description": "Short description of template", + "x-example": "Minimal web app integrating with Appwrite." + }, + "demoUrl": { + "type": "string", + "description": "URL hosting a template demo.", + "x-example": "https:\/\/nextjs-starter.appwrite.network\/" + }, + "screenshotDark": { + "type": "string", + "description": "File URL with preview screenshot in dark theme preference.", + "x-example": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png" + }, + "screenshotLight": { + "type": "string", + "description": "File URL with preview screenshot in light theme preference.", + "x-example": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png" + }, + "useCases": { + "type": "array", + "description": "Site use cases.", + "items": { + "type": "string" + }, + "x-example": "Starter" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks that can be used with this template.", + "items": { + "$ref": "#\/components\/schemas\/templateFramework" + }, + "x-example": [] + }, + "vcsProvider": { + "type": "string", + "description": "VCS (Version Control System) Provider.", + "x-example": "github" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "templates" + }, + "providerOwner": { + "type": "string", + "description": "VCS (Version Control System) Owner.", + "x-example": "appwrite" + }, + "providerVersion": { + "type": "string", + "description": "VCS (Version Control System) branch version (tag).", + "x-example": "main" + }, + "variables": { + "type": "array", + "description": "Site variables.", + "items": { + "$ref": "#\/components\/schemas\/templateVariable" + }, + "x-example": [] + } + }, + "required": [ + "key", + "name", + "tagline", + "demoUrl", + "screenshotDark", + "screenshotLight", + "useCases", + "frameworks", + "vcsProvider", + "providerRepositoryId", + "providerOwner", + "providerVersion", + "variables" + ], + "example": { + "key": "starter", + "name": "Starter site", + "tagline": "Minimal web app integrating with Appwrite.", + "demoUrl": "https:\/\/nextjs-starter.appwrite.network\/", + "screenshotDark": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png", + "screenshotLight": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png", + "useCases": "Starter", + "frameworks": [], + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [] + } + }, + "templateFramework": { + "description": "Template Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Parent framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The output directory to store the build output.", + "x-example": ".\/build" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": ".\/svelte-kit\/starter" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime used during build step of template.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework runtime", + "x-example": "ssr" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for SPA. Only relevant for static serve runtime.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "name", + "installCommand", + "buildCommand", + "outputDirectory", + "providerRootDirectory", + "buildRuntime", + "adapter", + "fallbackFile" + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/build", + "providerRootDirectory": ".\/svelte-kit\/starter", + "buildRuntime": "node-22", + "adapter": "ssr", + "fallbackFile": "index.html" + } + }, + "function": { + "description": "Function", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "execute": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + }, + "name": { + "type": "string", + "description": "Function name.", + "x-example": "My Function" + }, + "enabled": { + "type": "boolean", + "description": "Function enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "runtime": { + "type": "string", + "description": "Function execution and build runtime.", + "x-example": "python-3.8" + }, + "deploymentId": { + "type": "string", + "description": "Function's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentId": { + "type": "string", + "description": "Function's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "vars": { + "type": "array", + "description": "Function variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": [] + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "schedule": { + "type": "string", + "description": "Function execution schedule in CRON format.", + "x-example": "5 4 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "version": { + "type": "string", + "description": "Version of Open Runtimes used for the function.", + "x-example": "v2" + }, + "installationId": { + "type": "string", + "description": "Function VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "functions\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "execute", + "name", + "enabled", + "live", + "logging", + "runtime", + "deploymentId", + "deploymentCreatedAt", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "events", + "schedule", + "timeout", + "entrypoint", + "commands", + "version", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } + }, + "templateFunction": { + "description": "Template Function", + "type": "object", + "properties": { + "icon": { + "type": "string", + "description": "Function Template Icon.", + "x-example": "icon-lightning-bolt" + }, + "id": { + "type": "string", + "description": "Function Template ID.", + "x-example": "starter" + }, + "name": { + "type": "string", + "description": "Function Template Name.", + "x-example": "Starter function" + }, + "tagline": { + "type": "string", + "description": "Function Template Tagline.", + "x-example": "A simple function to get started." + }, + "permissions": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "any" + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "cron": { + "type": "string", + "description": "Function execution schedult in CRON format.", + "x-example": "0 0 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "useCases": { + "type": "array", + "description": "Function use cases.", + "items": { + "type": "string" + }, + "x-example": "Starter" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes that can be used with this template.", + "items": { + "$ref": "#\/components\/schemas\/templateRuntime" + }, + "x-example": [] + }, + "instructions": { + "type": "string", + "description": "Function Template Instructions.", + "x-example": "For documentation and instructions check out <link>." + }, + "vcsProvider": { + "type": "string", + "description": "VCS (Version Control System) Provider.", + "x-example": "github" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "templates" + }, + "providerOwner": { + "type": "string", + "description": "VCS (Version Control System) Owner.", + "x-example": "appwrite" + }, + "providerVersion": { + "type": "string", + "description": "VCS (Version Control System) branch version (tag).", + "x-example": "main" + }, + "variables": { + "type": "array", + "description": "Function variables.", + "items": { + "$ref": "#\/components\/schemas\/templateVariable" + }, + "x-example": [] + }, + "scopes": { + "type": "array", + "description": "Function scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + } + }, + "required": [ + "icon", + "id", + "name", + "tagline", + "permissions", + "events", + "cron", + "timeout", + "useCases", + "runtimes", + "instructions", + "vcsProvider", + "providerRepositoryId", + "providerOwner", + "providerVersion", + "variables", + "scopes" + ], + "example": { + "icon": "icon-lightning-bolt", + "id": "starter", + "name": "Starter function", + "tagline": "A simple function to get started.", + "permissions": "any", + "events": "account.create", + "cron": "0 0 * * *", + "timeout": 300, + "useCases": "Starter", + "runtimes": [], + "instructions": "For documentation and instructions check out <link>.", + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [], + "scopes": "users.read" + } + }, + "templateRuntime": { + "description": "Template Runtime", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "node-19.0" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "node\/starter" + } + }, + "required": [ + "name", + "commands", + "entrypoint", + "providerRootDirectory" + ], + "example": { + "name": "node-19.0", + "commands": "npm install", + "entrypoint": "index.js", + "providerRootDirectory": "node\/starter" + } + }, + "templateVariable": { + "description": "Template Variable", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Variable Name.", + "x-example": "APPWRITE_DATABASE_ID" + }, + "description": { + "type": "string", + "description": "Variable Description.", + "x-example": "The ID of the Appwrite database that contains the collection to sync." + }, + "value": { + "type": "string", + "description": "Variable Value.", + "x-example": "512" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "placeholder": { + "type": "string", + "description": "Variable Placeholder.", + "x-example": "64a55...7b912" + }, + "required": { + "type": "boolean", + "description": "Is the variable required?", + "x-example": false + }, + "type": { + "type": "string", + "description": "Variable Type.", + "x-example": "password" + } + }, + "required": [ + "name", + "description", + "value", + "secret", + "placeholder", + "required", + "type" + ], + "example": { + "name": "APPWRITE_DATABASE_ID", + "description": "The ID of the Appwrite database that contains the collection to sync.", + "value": "512", + "secret": false, + "placeholder": "64a55...7b912", + "required": false, + "type": "password" + } + }, + "installation": { + "description": "Installation", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name.", + "x-example": "appwrite" + }, + "providerInstallationId": { + "type": "string", + "description": "VCS (Version Control System) installation ID.", + "x-example": "5322" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "provider", + "organization", + "providerInstallationId" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "provider": "github", + "organization": "appwrite", + "providerInstallationId": "5322" + } + }, + "providerRepository": { + "description": "ProviderRepository", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "defaultBranch", + "pushedAt" + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime" + } + }, + "providerRepositoryFramework": { + "description": "ProviderRepositoryFramework", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + }, + "framework": { + "type": "string", + "description": "Auto-detected framework. Empty if type is not \"framework\".", + "x-example": "nextjs" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "defaultBranch", + "pushedAt", + "framework" + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "framework": "nextjs" + } + }, + "providerRepositoryRuntime": { + "description": "ProviderRepositoryRuntime", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + }, + "runtime": { + "type": "string", + "description": "Auto-detected runtime. Empty if type is not \"runtime\".", + "x-example": "node-22" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "defaultBranch", + "pushedAt", + "runtime" + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "runtime": "node-22" + } + }, + "detectionFramework": { + "description": "DetectionFramework", + "type": "object", + "properties": { + "framework": { + "type": "string", + "description": "Framework", + "x-example": "nuxt" + }, + "installCommand": { + "type": "string", + "description": "Site Install Command", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Site Build Command", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Site Output Directory", + "x-example": "dist" + } + }, + "required": [ + "framework", + "installCommand", + "buildCommand", + "outputDirectory" + ], + "example": { + "framework": "nuxt", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" + } + }, + "detectionRuntime": { + "description": "DetectionRuntime", + "type": "object", + "properties": { + "runtime": { + "type": "string", + "description": "Runtime", + "x-example": "node" + }, + "entrypoint": { + "type": "string", + "description": "Function Entrypoint", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "Function install and build commands", + "x-example": "npm install && npm run build" + } + }, + "required": [ + "runtime", + "entrypoint", + "commands" + ], + "example": { + "runtime": "node", + "entrypoint": "index.js", + "commands": "npm install && npm run build" + } + }, + "vcsContent": { + "description": "VcsContents", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Content size in bytes. Only files have size, and for directories, 0 is returned.", + "x-example": 1523, + "format": "int32", + "nullable": true + }, + "isDirectory": { + "type": "boolean", + "description": "If a content is a directory. Directories can be used to check nested contents.", + "x-example": true, + "nullable": true + }, + "name": { + "type": "string", + "description": "Name of directory or file.", + "x-example": "Main.java" + } + }, + "required": [ + "name" + ], + "example": { + "size": 1523, + "isDirectory": true, + "name": "Main.java" + } + }, + "branch": { + "description": "Branch", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Branch Name.", + "x-example": "main" + } + }, + "required": [ + "name" + ], + "example": { + "name": "main" + } + }, + "runtime": { + "description": "Runtime", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Runtime ID.", + "x-example": "python-3.8" + }, + "key": { + "type": "string", + "description": "Parent runtime key.", + "x-example": "python" + }, + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "Python" + }, + "version": { + "type": "string", + "description": "Runtime version.", + "x-example": "3.8" + }, + "base": { + "type": "string", + "description": "Base Docker image used to build the runtime.", + "x-example": "python:3.8-alpine" + }, + "image": { + "type": "string", + "description": "Image name of Docker Hub.", + "x-example": "appwrite\\\/runtime-for-python:3.8" + }, + "logo": { + "type": "string", + "description": "Name of the logo image.", + "x-example": "python.png" + }, + "supports": { + "type": "array", + "description": "List of supported architectures.", + "items": { + "type": "string" + }, + "x-example": "amd64" + } + }, + "required": [ + "$id", + "key", + "name", + "version", + "base", + "image", + "logo", + "supports" + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } + }, + "framework": { + "description": "Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, + "runtimes": { + "type": "array", + "description": "List of supported runtime versions.", + "items": { + "type": "string" + }, + "x-example": [ + "static-1", + "node-22" + ] + }, + "adapters": { + "type": "array", + "description": "List of supported adapters.", + "items": { + "$ref": "#\/components\/schemas\/frameworkAdapter" + }, + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "buildRuntime", + "runtimes", + "adapters" + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Adapter key.", + "x-example": "static" + }, + "installCommand": { + "type": "string", + "description": "Default command to download dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Default command to build site into output directory.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Default output directory of build.", + "x-example": ".\/dist" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "installCommand", + "buildCommand", + "outputDirectory", + "fallbackFile" + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } + }, + "deployment": { + "description": "Deployment", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Deployment update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "type": { + "type": "string", + "description": "Type of deployment.", + "x-example": "vcs" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea6g16897e" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "functions" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file to use to execute the deployment code.", + "x-example": "index.js" + }, + "sourceSize": { + "type": "integer", + "description": "The code size in bytes.", + "x-example": 128, + "format": "int32" + }, + "buildSize": { + "type": "integer", + "description": "The build output size in bytes.", + "x-example": 128, + "format": "int32" + }, + "totalSize": { + "type": "integer", + "description": "The total size in bytes (source and build output).", + "x-example": 128, + "format": "int32" + }, + "buildId": { + "type": "string", + "description": "The current build ID.", + "x-example": "5e5ea5c16897e" + }, + "activate": { + "type": "boolean", + "description": "Whether the deployment should be automatically activated.", + "x-example": true + }, + "screenshotLight": { + "type": "string", + "description": "Screenshot with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "screenshotDark": { + "type": "string", + "description": "Screenshot with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "status": { + "type": "string", + "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] + }, + "buildLogs": { + "type": "string", + "description": "The build logs.", + "x-example": "Compiling source files..." + }, + "buildDuration": { + "type": "integer", + "description": "The current build time in seconds.", + "x-example": 128, + "format": "int32" + }, + "providerRepositoryName": { + "type": "string", + "description": "The name of the vcs provider repository", + "x-example": "database" + }, + "providerRepositoryOwner": { + "type": "string", + "description": "The name of the vcs provider repository owner", + "x-example": "utopia" + }, + "providerRepositoryUrl": { + "type": "string", + "description": "The url of the vcs provider repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" + }, + "providerCommitHash": { + "type": "string", + "description": "The commit hash of the vcs commit", + "x-example": "7c3f25d" + }, + "providerCommitAuthorUrl": { + "type": "string", + "description": "The url of vcs commit author", + "x-example": "https:\/\/github.com\/vermakhushboo" + }, + "providerCommitAuthor": { + "type": "string", + "description": "The name of vcs commit author", + "x-example": "Khushboo Verma" + }, + "providerCommitMessage": { + "type": "string", + "description": "The commit message", + "x-example": "Update index.js" + }, + "providerCommitUrl": { + "type": "string", + "description": "The url of the vcs commit", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" + }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, + "providerBranchUrl": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "type", + "resourceId", + "resourceType", + "entrypoint", + "sourceSize", + "buildSize", + "totalSize", + "buildId", + "activate", + "screenshotLight", + "screenshotDark", + "status", + "buildLogs", + "buildDuration", + "providerRepositoryName", + "providerRepositoryOwner", + "providerRepositoryUrl", + "providerCommitHash", + "providerCommitAuthorUrl", + "providerCommitAuthor", + "providerCommitMessage", + "providerCommitUrl", + "providerBranch", + "providerBranchUrl" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "deploymentId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "project": { + "description": "Project", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Project ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Project creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Project update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Project name.", + "x-example": "New Project" + }, + "description": { + "type": "string", + "description": "Project description.", + "x-example": "This is a new project." + }, + "teamId": { + "type": "string", + "description": "Project team ID.", + "x-example": "1592981250" + }, + "logo": { + "type": "string", + "description": "Project logo file ID.", + "x-example": "5f5c451b403cb" + }, + "url": { + "type": "string", + "description": "Project website URL.", + "x-example": "5f5c451b403cb" + }, + "legalName": { + "type": "string", + "description": "Company legal name.", + "x-example": "Company LTD." + }, + "legalCountry": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format.", + "x-example": "US" + }, + "legalState": { + "type": "string", + "description": "State name.", + "x-example": "New York" + }, + "legalCity": { + "type": "string", + "description": "City name.", + "x-example": "New York City." + }, + "legalAddress": { + "type": "string", + "description": "Company Address.", + "x-example": "620 Eighth Avenue, New York, NY 10018" + }, + "legalTaxId": { + "type": "string", + "description": "Company Tax ID.", + "x-example": "131102020" + }, + "authDuration": { + "type": "integer", + "description": "Session duration in seconds.", + "x-example": 60, + "format": "int32" + }, + "authLimit": { + "type": "integer", + "description": "Max users allowed. 0 is unlimited.", + "x-example": 100, + "format": "int32" + }, + "authSessionsLimit": { + "type": "integer", + "description": "Max sessions allowed per user. 100 maximum.", + "x-example": 10, + "format": "int32" + }, + "authPasswordHistory": { + "type": "integer", + "description": "Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history.", + "x-example": 5, + "format": "int32" + }, + "authPasswordDictionary": { + "type": "boolean", + "description": "Whether or not to check user's password against most commonly used passwords.", + "x-example": true + }, + "authPersonalDataCheck": { + "type": "boolean", + "description": "Whether or not to check the user password for similarity with their personal data.", + "x-example": true + }, + "authMockNumbers": { + "type": "array", + "description": "An array of mock numbers and their corresponding verification codes (OTPs).", + "items": { + "$ref": "#\/components\/schemas\/mockNumber" + }, + "x-example": [ + {} + ] + }, + "authSessionAlerts": { + "type": "boolean", + "description": "Whether or not to send session alert emails to users.", + "x-example": true + }, + "authMembershipsUserName": { + "type": "boolean", + "description": "Whether or not to show user names in the teams membership response.", + "x-example": true + }, + "authMembershipsUserEmail": { + "type": "boolean", + "description": "Whether or not to show user emails in the teams membership response.", + "x-example": true + }, + "authMembershipsMfa": { + "type": "boolean", + "description": "Whether or not to show user MFA status in the teams membership response.", + "x-example": true + }, + "authInvalidateSessions": { + "type": "boolean", + "description": "Whether or not all existing sessions should be invalidated on password change", + "x-example": true + }, + "oAuthProviders": { + "type": "array", + "description": "List of Auth Providers.", + "items": { + "$ref": "#\/components\/schemas\/authProvider" + }, + "x-example": [ + {} + ] + }, + "platforms": { + "type": "array", + "description": "List of Platforms.", + "items": { + "$ref": "#\/components\/schemas\/platform" + }, + "x-example": {} + }, + "webhooks": { + "type": "array", + "description": "List of Webhooks.", + "items": { + "$ref": "#\/components\/schemas\/webhook" + }, + "x-example": {} + }, + "keys": { + "type": "array", + "description": "List of API Keys.", + "items": { + "$ref": "#\/components\/schemas\/key" + }, + "x-example": {} + }, + "devKeys": { + "type": "array", + "description": "List of dev keys.", + "items": { + "$ref": "#\/components\/schemas\/devKey" + }, + "x-example": {} + }, + "smtpEnabled": { + "type": "boolean", + "description": "Status for custom SMTP", + "x-example": false + }, + "smtpSenderName": { + "type": "string", + "description": "SMTP sender name", + "x-example": "John Appwrite" + }, + "smtpSenderEmail": { + "type": "string", + "description": "SMTP sender email", + "x-example": "john@appwrite.io" + }, + "smtpReplyTo": { + "type": "string", + "description": "SMTP reply to email", + "x-example": "support@appwrite.io" + }, + "smtpHost": { + "type": "string", + "description": "SMTP server host name", + "x-example": "mail.appwrite.io" + }, + "smtpPort": { + "type": "integer", + "description": "SMTP server port", + "x-example": 25, + "format": "int32" + }, + "smtpUsername": { + "type": "string", + "description": "SMTP server username", + "x-example": "emailuser" + }, + "smtpPassword": { + "type": "string", + "description": "SMTP server password", + "x-example": "securepassword" + }, + "smtpSecure": { + "type": "string", + "description": "SMTP server secure protocol", + "x-example": "tls" + }, + "pingCount": { + "type": "integer", + "description": "Number of times the ping was received for this project.", + "x-example": 1, + "format": "int32" + }, + "pingedAt": { + "type": "string", + "description": "Last ping datetime in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "authEmailPassword": { + "type": "boolean", + "description": "Email\/Password auth method status", + "x-example": true + }, + "authUsersAuthMagicURL": { + "type": "boolean", + "description": "Magic URL auth method status", + "x-example": true + }, + "authEmailOtp": { + "type": "boolean", + "description": "Email (OTP) auth method status", + "x-example": true + }, + "authAnonymous": { + "type": "boolean", + "description": "Anonymous auth method status", + "x-example": true + }, + "authInvites": { + "type": "boolean", + "description": "Invites auth method status", + "x-example": true + }, + "authJWT": { + "type": "boolean", + "description": "JWT auth method status", + "x-example": true + }, + "authPhone": { + "type": "boolean", + "description": "Phone auth method status", + "x-example": true + }, + "serviceStatusForAccount": { + "type": "boolean", + "description": "Account service status", + "x-example": true + }, + "serviceStatusForAvatars": { + "type": "boolean", + "description": "Avatars service status", + "x-example": true + }, + "serviceStatusForDatabases": { + "type": "boolean", + "description": "Databases (legacy) service status", + "x-example": true + }, + "serviceStatusForTablesdb": { + "type": "boolean", + "description": "TablesDB service status", + "x-example": true + }, + "serviceStatusForLocale": { + "type": "boolean", + "description": "Locale service status", + "x-example": true + }, + "serviceStatusForHealth": { + "type": "boolean", + "description": "Health service status", + "x-example": true + }, + "serviceStatusForStorage": { + "type": "boolean", + "description": "Storage service status", + "x-example": true + }, + "serviceStatusForTeams": { + "type": "boolean", + "description": "Teams service status", + "x-example": true + }, + "serviceStatusForUsers": { + "type": "boolean", + "description": "Users service status", + "x-example": true + }, + "serviceStatusForSites": { + "type": "boolean", + "description": "Sites service status", + "x-example": true + }, + "serviceStatusForFunctions": { + "type": "boolean", + "description": "Functions service status", + "x-example": true + }, + "serviceStatusForGraphql": { + "type": "boolean", + "description": "GraphQL service status", + "x-example": true + }, + "serviceStatusForMessaging": { + "type": "boolean", + "description": "Messaging service status", + "x-example": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "description", + "teamId", + "logo", + "url", + "legalName", + "legalCountry", + "legalState", + "legalCity", + "legalAddress", + "legalTaxId", + "authDuration", + "authLimit", + "authSessionsLimit", + "authPasswordHistory", + "authPasswordDictionary", + "authPersonalDataCheck", + "authMockNumbers", + "authSessionAlerts", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", + "authInvalidateSessions", + "oAuthProviders", + "platforms", + "webhooks", + "keys", + "devKeys", + "smtpEnabled", + "smtpSenderName", + "smtpSenderEmail", + "smtpReplyTo", + "smtpHost", + "smtpPort", + "smtpUsername", + "smtpPassword", + "smtpSecure", + "pingCount", + "pingedAt", + "authEmailPassword", + "authUsersAuthMagicURL", + "authEmailOtp", + "authAnonymous", + "authInvites", + "authJWT", + "authPhone", + "serviceStatusForAccount", + "serviceStatusForAvatars", + "serviceStatusForDatabases", + "serviceStatusForTablesdb", + "serviceStatusForLocale", + "serviceStatusForHealth", + "serviceStatusForStorage", + "serviceStatusForTeams", + "serviceStatusForUsers", + "serviceStatusForSites", + "serviceStatusForFunctions", + "serviceStatusForGraphql", + "serviceStatusForMessaging" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "description": "This is a new project.", + "teamId": "1592981250", + "logo": "5f5c451b403cb", + "url": "5f5c451b403cb", + "legalName": "Company LTD.", + "legalCountry": "US", + "legalState": "New York", + "legalCity": "New York City.", + "legalAddress": "620 Eighth Avenue, New York, NY 10018", + "legalTaxId": "131102020", + "authDuration": 60, + "authLimit": 100, + "authSessionsLimit": 10, + "authPasswordHistory": 5, + "authPasswordDictionary": true, + "authPersonalDataCheck": true, + "authMockNumbers": [ + {} + ], + "authSessionAlerts": true, + "authMembershipsUserName": true, + "authMembershipsUserEmail": true, + "authMembershipsMfa": true, + "authInvalidateSessions": true, + "oAuthProviders": [ + {} + ], + "platforms": {}, + "webhooks": {}, + "keys": {}, + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyTo": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "securepassword", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "authEmailPassword": true, + "authUsersAuthMagicURL": true, + "authEmailOtp": true, + "authAnonymous": true, + "authInvites": true, + "authJWT": true, + "authPhone": true, + "serviceStatusForAccount": true, + "serviceStatusForAvatars": true, + "serviceStatusForDatabases": true, + "serviceStatusForTablesdb": true, + "serviceStatusForLocale": true, + "serviceStatusForHealth": true, + "serviceStatusForStorage": true, + "serviceStatusForTeams": true, + "serviceStatusForUsers": true, + "serviceStatusForSites": true, + "serviceStatusForFunctions": true, + "serviceStatusForGraphql": true, + "serviceStatusForMessaging": true + } + }, + "webhook": { + "description": "Webhook", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Webhook ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Webhook creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Webhook update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Webhook name.", + "x-example": "My Webhook" + }, + "url": { + "type": "string", + "description": "Webhook URL endpoint.", + "x-example": "https:\/\/example.com\/webhook" + }, + "events": { + "type": "array", + "description": "Webhook trigger events.", + "items": { + "type": "string" + }, + "x-example": [ + "databases.tables.update", + "databases.collections.update" + ] + }, + "security": { + "type": "boolean", + "description": "Indicated if SSL \/ TLS Certificate verification is enabled.", + "x-example": true + }, + "httpUser": { + "type": "string", + "description": "HTTP basic authentication username.", + "x-example": "username" + }, + "httpPass": { + "type": "string", + "description": "HTTP basic authentication password.", + "x-example": "password" + }, + "signatureKey": { + "type": "string", + "description": "Signature key which can be used to validated incoming", + "x-example": "ad3d581ca230e2b7059c545e5a" + }, + "enabled": { + "type": "boolean", + "description": "Indicates if this webhook is enabled.", + "x-example": true + }, + "logs": { + "type": "string", + "description": "Webhook error logs from the most recent failure.", + "x-example": "Failed to connect to remote server." + }, + "attempts": { + "type": "integer", + "description": "Number of consecutive failed webhook attempts.", + "x-example": 10, + "format": "int32" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "url", + "events", + "security", + "httpUser", + "httpPass", + "signatureKey", + "enabled", + "logs", + "attempts" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": [ + "databases.tables.update", + "databases.collections.update" + ], + "security": true, + "httpUser": "username", + "httpPass": "password", + "signatureKey": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } + }, + "key": { + "description": "Key", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "My API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "scopes", + "secret", + "accessedAt", + "sdks" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } + }, + "devKey": { + "description": "DevKey", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "Dev API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "secret", + "accessedAt", + "sdks" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } + }, + "mockNumber": { + "description": "Mock Number", + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS.", + "x-example": "+1612842323" + }, + "otp": { + "type": "string", + "description": "Mock OTP for the number. ", + "x-example": "123456" + } + }, + "required": [ + "phone", + "otp" + ], + "example": { + "phone": "+1612842323", + "otp": "123456" + } + }, + "authProvider": { + "description": "AuthProvider", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Auth Provider.", + "x-example": "github" + }, + "name": { + "type": "string", + "description": "Auth Provider name.", + "x-example": "GitHub" + }, + "appId": { + "type": "string", + "description": "OAuth 2.0 application ID.", + "x-example": "259125845563242502" + }, + "secret": { + "type": "string", + "description": "OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration.", + "x-example": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ" + }, + "enabled": { + "type": "boolean", + "description": "Auth Provider is active and can be used to create session.", + "x-example": "" + } + }, + "required": [ + "key", + "name", + "appId", + "secret", + "enabled" + ], + "example": { + "key": "github", + "name": "GitHub", + "appId": "259125845563242502", + "secret": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ", + "enabled": "" + } + }, + "platform": { + "description": "Platform", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "x-example": "My Web App" + }, + "type": { + "type": "string", + "description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.", + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "ios", + "android", + "unity" + ] + }, + "key": { + "type": "string", + "description": "Platform Key. iOS bundle ID or Android package name. Empty string for other platforms.", + "x-example": "com.company.appname" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID.", + "x-example": "" + }, + "hostname": { + "type": "string", + "description": "Web app hostname. Empty string for other platforms.", + "x-example": "app.example.com" + }, + "httpUser": { + "type": "string", + "description": "HTTP basic authentication username.", + "x-example": "username" + }, + "httpPass": { + "type": "string", + "description": "HTTP basic authentication password.", + "x-example": "password" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "key", + "store", + "hostname", + "httpUser", + "httpPass" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "key": "com.company.appname", + "store": "", + "hostname": "app.example.com", + "httpUser": "username", + "httpPass": "password" + } + }, + "variable": { + "description": "Variable", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Variable ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Variable key.", + "x-example": "API_KEY" + }, + "value": { + "type": "string", + "description": "Variable value.", + "x-example": "myPa$$word1" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "resourceType": { + "type": "string", + "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", + "x-example": "function" + }, + "resourceId": { + "type": "string", + "description": "ID of resource to which the variable belongs. If resourceType is \"project\", it is empty. If resourceType is \"function\", it is ID of the function.", + "x-example": "myAwesomeFunction" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "value", + "secret", + "resourceType", + "resourceId" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "United States", + "code": "US" + } + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "Europe", + "code": "EU" + } + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } + }, + "healthAntivirus": { + "description": "Health Antivirus", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Antivirus version.", + "x-example": "1.0.0" + }, + "status": { + "type": "string", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] + } + }, + "required": [ + "version", + "status" + ], + "example": { + "version": "1.0.0", + "status": "online" + } + }, + "healthQueue": { + "description": "Health Queue", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Amount of actions in the queue.", + "x-example": 8, + "format": "int32" + } + }, + "required": [ + "size" + ], + "example": { + "size": 8 + } + }, + "healthStatus": { + "description": "Health Status", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the service.", + "x-example": "database" + }, + "ping": { + "type": "integer", + "description": "Duration in milliseconds how long the health check took.", + "x-example": 128, + "format": "int32" + }, + "status": { + "type": "string", + "description": "Service status. Possible values are: `pass`, `fail`", + "x-example": "pass", + "enum": [ + "pass", + "fail" + ], + "x-enum-name": "HealthCheckStatus" + } + }, + "required": [ + "name", + "ping", + "status" + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } + }, + "healthCertificate": { + "description": "Health Certificate", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Certificate name", + "x-example": "\/CN=www.google.com" + }, + "subjectSN": { + "type": "string", + "description": "Subject SN", + "x-example": "" + }, + "issuerOrganisation": { + "type": "string", + "description": "Issuer organisation", + "x-example": "" + }, + "validFrom": { + "type": "string", + "description": "Valid from", + "x-example": "1704200998" + }, + "validTo": { + "type": "string", + "description": "Valid to", + "x-example": "1711458597" + }, + "signatureTypeSN": { + "type": "string", + "description": "Signature type SN", + "x-example": "RSA-SHA256" + } + }, + "required": [ + "name", + "subjectSN", + "issuerOrganisation", + "validFrom", + "validTo", + "signatureTypeSN" + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } + }, + "healthTime": { + "description": "Health Time", + "type": "object", + "properties": { + "remoteTime": { + "type": "integer", + "description": "Current unix timestamp on trustful remote server.", + "x-example": 1639490751, + "format": "int32" + }, + "localTime": { + "type": "integer", + "description": "Current unix timestamp of local server where Appwrite runs.", + "x-example": 1639490844, + "format": "int32" + }, + "diff": { + "type": "integer", + "description": "Difference of unix remote and local timestamps in milliseconds.", + "x-example": 93, + "format": "int32" + } + }, + "required": [ + "remoteTime", + "localTime", + "diff" + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } + }, + "metric": { + "description": "Metric", + "type": "object", + "properties": { + "value": { + "type": "integer", + "description": "The value of this metric at the timestamp.", + "x-example": 1, + "format": "int32" + }, + "date": { + "type": "string", + "description": "The date at which this metric was aggregated in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "value", + "date" + ], + "example": { + "value": 1, + "date": "2020-10-15T06:38:00.000+00:00" + } + }, + "metricBreakdown": { + "description": "Metric Breakdown", + "type": "object", + "properties": { + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c16897e", + "nullable": true + }, + "name": { + "type": "string", + "description": "Resource name.", + "x-example": "Documents" + }, + "value": { + "type": "integer", + "description": "The value of this metric at the timestamp.", + "x-example": 1, + "format": "int32" + }, + "estimate": { + "type": "number", + "description": "The estimated value of this metric at the end of the period.", + "x-example": 1, + "format": "double", + "nullable": true + } + }, + "required": [ + "name", + "value" + ], + "example": { + "resourceId": "5e5ea5c16897e", + "name": "Documents", + "value": 1, + "estimate": 1 + } + }, + "usageDatabases": { + "description": "UsageDatabases", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "databasesTotal": { + "type": "integer", + "description": "Total aggregated number of databases.", + "x-example": 0, + "format": "int32" + }, + "collectionsTotal": { + "type": "integer", + "description": "Total aggregated number of collections.", + "x-example": 0, + "format": "int32" + }, + "tablesTotal": { + "type": "integer", + "description": "Total aggregated number of tables.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, + "storageTotal": { + "type": "integer", + "description": "Total aggregated number of total databases storage in bytes.", + "x-example": 0, + "format": "int32" + }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "Aggregated number of databases per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "collections": { + "type": "array", + "description": "Aggregated number of collections per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "tables": { + "type": "array", + "description": "Aggregated number of tables per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "An array of the aggregated number of databases storage in bytes per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "databasesTotal", + "collectionsTotal", + "tablesTotal", + "documentsTotal", + "rowsTotal", + "storageTotal", + "databasesReadsTotal", + "databasesWritesTotal", + "databases", + "collections", + "tables", + "documents", + "rows", + "storage", + "databasesReads", + "databasesWrites" + ], + "example": { + "range": "30d", + "databasesTotal": 0, + "collectionsTotal": 0, + "tablesTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "storageTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "databases": [], + "collections": [], + "tables": [], + "documents": [], + "rows": [], + "storage": [], + "databasesReads": [], + "databasesWrites": [] + } + }, + "usageDatabase": { + "description": "UsageDatabase", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "collectionsTotal": { + "type": "integer", + "description": "Total aggregated number of collections.", + "x-example": 0, + "format": "int32" + }, + "tablesTotal": { + "type": "integer", + "description": "Total aggregated number of tables.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, + "storageTotal": { + "type": "integer", + "description": "Total aggregated number of total storage used in bytes.", + "x-example": 0, + "format": "int32" + }, + "databaseReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databaseWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "Aggregated number of collections per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "tables": { + "type": "array", + "description": "Aggregated number of tables per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated storage used in bytes per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databaseReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databaseWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "collectionsTotal", + "tablesTotal", + "documentsTotal", + "rowsTotal", + "storageTotal", + "databaseReadsTotal", + "databaseWritesTotal", + "collections", + "tables", + "documents", + "rows", + "storage", + "databaseReads", + "databaseWrites" + ], + "example": { + "range": "30d", + "collectionsTotal": 0, + "tablesTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "storageTotal": 0, + "databaseReadsTotal": 0, + "databaseWritesTotal": 0, + "collections": [], + "tables": [], + "documents": [], + "rows": [], + "storage": [], + "databaseReads": [], + "databaseWrites": [] + } + }, + "usageTable": { + "description": "UsageTable", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of of rows.", + "x-example": 0, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "rowsTotal", + "rows" + ], + "example": { + "range": "30d", + "rowsTotal": 0, + "rows": [] + } + }, + "usageCollection": { + "description": "UsageCollection", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of of documents.", + "x-example": 0, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "documentsTotal", + "documents" + ], + "example": { + "range": "30d", + "documentsTotal": 0, + "documents": [] + } + }, + "usageUsers": { + "description": "UsageUsers", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "usersTotal": { + "type": "integer", + "description": "Total aggregated number of statistics of users.", + "x-example": 0, + "format": "int32" + }, + "sessionsTotal": { + "type": "integer", + "description": "Total aggregated number of active sessions.", + "x-example": 0, + "format": "int32" + }, + "users": { + "type": "array", + "description": "Aggregated number of users per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "sessions": { + "type": "array", + "description": "Aggregated number of active sessions per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "usersTotal", + "sessionsTotal", + "users", + "sessions" + ], + "example": { + "range": "30d", + "usersTotal": 0, + "sessionsTotal": 0, + "users": [], + "sessions": [] + } + }, + "usageStorage": { + "description": "StorageUsage", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "bucketsTotal": { + "type": "integer", + "description": "Total aggregated number of buckets", + "x-example": 0, + "format": "int32" + }, + "filesTotal": { + "type": "integer", + "description": "Total aggregated number of files.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated number of files storage (in bytes).", + "x-example": 0, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "Aggregated number of buckets per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "files": { + "type": "array", + "description": "Aggregated number of files per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated number of files storage (in bytes) per period .", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "bucketsTotal", + "filesTotal", + "filesStorageTotal", + "buckets", + "files", + "storage" + ], + "example": { + "range": "30d", + "bucketsTotal": 0, + "filesTotal": 0, + "filesStorageTotal": 0, + "buckets": [], + "files": [], + "storage": [] + } + }, + "usageBuckets": { + "description": "UsageBuckets", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "filesTotal": { + "type": "integer", + "description": "Total aggregated number of bucket files.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated number of bucket files storage (in bytes).", + "x-example": 0, + "format": "int32" + }, + "files": { + "type": "array", + "description": "Aggregated number of bucket files per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated number of bucket storage files (in bytes) per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "imageTransformations": { + "type": "array", + "description": "Aggregated number of files transformations per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "imageTransformationsTotal": { + "type": "integer", + "description": "Total aggregated number of files transformations.", + "x-example": 0, + "format": "int32" + } + }, + "required": [ + "range", + "filesTotal", + "filesStorageTotal", + "files", + "storage", + "imageTransformations", + "imageTransformationsTotal" + ], + "example": { + "range": "30d", + "filesTotal": 0, + "filesStorageTotal": 0, + "files": [], + "storage": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } + }, + "usageFunctions": { + "description": "UsageFunctions", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "functionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions.", + "x-example": 0, + "format": "int32" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of functions deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions deployment storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of functions build.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of functions build storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions execution.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "Aggregated number of functions per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": 0 + }, + "deployments": { + "type": "array", + "description": "Aggregated number of functions deployment per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of functions deployment storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "builds": { + "type": "array", + "description": "Aggregated number of functions build per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of functions build storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of functions build compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated sum of functions build mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of functions execution per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of functions execution compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of functions mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "functionsTotal", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "functions", + "deployments", + "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" + ], + "example": { + "range": "30d", + "functionsTotal": 0, + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "functions": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } + }, + "usageFunction": { + "description": "UsageFunction", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of function deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of function deployments storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of function builds storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of function deployments per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of function deployments storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "builds": { + "type": "array", + "description": "Aggregated number of function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of function builds storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of function builds compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } + }, + "usageSites": { + "description": "UsageSites", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of functions deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions deployment storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of functions build.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of functions build storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions execution.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of functions deployment per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of functions deployment storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "builds": { + "type": "array", + "description": "Aggregated number of functions build per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of functions build storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of functions build compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated sum of functions build mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of functions execution per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of functions execution compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of functions mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "sitesTotal": { + "type": "integer", + "description": "Total aggregated number of sites.", + "x-example": 0, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "Aggregated number of sites per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "sitesTotal", + "sites", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "sitesTotal": 0, + "sites": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } + }, + "usageSite": { + "description": "UsageSite", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of function deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of function deployments storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of function builds storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of function deployments per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of function deployments storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "builds": { + "type": "array", + "description": "Aggregated number of function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of function builds storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of function builds compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } + }, + "usageProject": { + "description": "UsageProject", + "type": "object", + "properties": { + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, + "databasesTotal": { + "type": "integer", + "description": "Total aggregated number of databases.", + "x-example": 0, + "format": "int32" + }, + "databasesStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of databases storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "usersTotal": { + "type": "integer", + "description": "Total aggregated number of users.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of files storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "functionsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of builds storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of deployments storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "bucketsTotal": { + "type": "integer", + "description": "Total aggregated number of buckets.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "network": { + "type": "array", + "description": "Aggregated number of consumed bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "users": { + "type": "array", + "description": "Aggregated number of users per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of executions per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of executions by functions.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "bucketsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of usage by buckets.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "databasesStorageBreakdown": { + "type": "array", + "description": "An array of the aggregated breakdown of storage usage by databases.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "executionsMbSecondsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of execution mbSeconds by functions.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "buildsMbSecondsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of build mbSeconds by functions.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "functionsStorageBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of functions storage size (in bytes).", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "authPhoneTotal": { + "type": "integer", + "description": "Total aggregated number of phone auth.", + "x-example": 0, + "format": "int32" + }, + "authPhoneEstimate": { + "type": "number", + "description": "Estimated total aggregated cost of phone auth.", + "x-example": 0, + "format": "double" + }, + "authPhoneCountryBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of phone auth by country.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "imageTransformations": { + "type": "array", + "description": "An array of aggregated number of image transformations.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "imageTransformationsTotal": { + "type": "integer", + "description": "Total aggregated number of image transformations.", + "x-example": 0, + "format": "int32" + } + }, + "required": [ + "executionsTotal", + "documentsTotal", + "rowsTotal", + "databasesTotal", + "databasesStorageTotal", + "usersTotal", + "filesStorageTotal", + "functionsStorageTotal", + "buildsStorageTotal", + "deploymentsStorageTotal", + "bucketsTotal", + "executionsMbSecondsTotal", + "buildsMbSecondsTotal", + "databasesReadsTotal", + "databasesWritesTotal", + "requests", + "network", + "users", + "executions", + "executionsBreakdown", + "bucketsBreakdown", + "databasesStorageBreakdown", + "executionsMbSecondsBreakdown", + "buildsMbSecondsBreakdown", + "functionsStorageBreakdown", + "authPhoneTotal", + "authPhoneEstimate", + "authPhoneCountryBreakdown", + "databasesReads", + "databasesWrites", + "imageTransformations", + "imageTransformationsTotal" + ], + "example": { + "executionsTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "databasesTotal": 0, + "databasesStorageTotal": 0, + "usersTotal": 0, + "filesStorageTotal": 0, + "functionsStorageTotal": 0, + "buildsStorageTotal": 0, + "deploymentsStorageTotal": 0, + "bucketsTotal": 0, + "executionsMbSecondsTotal": 0, + "buildsMbSecondsTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "requests": [], + "network": [], + "users": [], + "executions": [], + "executionsBreakdown": [], + "bucketsBreakdown": [], + "databasesStorageBreakdown": [], + "executionsMbSecondsBreakdown": [], + "buildsMbSecondsBreakdown": [], + "functionsStorageBreakdown": [], + "authPhoneTotal": 0, + "authPhoneEstimate": 0, + "authPhoneCountryBreakdown": [], + "databasesReads": [], + "databasesWrites": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } + }, + "specification": { + "description": "Specification", + "type": "object", + "properties": { + "memory": { + "type": "integer", + "description": "Memory size in MB.", + "x-example": 512, + "format": "int32" + }, + "cpus": { + "type": "number", + "description": "Number of CPUs.", + "x-example": 1, + "format": "double" + }, + "enabled": { + "type": "boolean", + "description": "Is size enabled.", + "x-example": true + }, + "slug": { + "type": "string", + "description": "Size slug.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "memory", + "cpus", + "enabled", + "slug" + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } + }, + "proxyRule": { + "description": "Rule", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Rule ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Rule creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Rule update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": "appwrite.company.com" + }, + "type": { + "type": "string", + "description": "Action definition for the rule. Possible values are \"api\", \"deployment\", or \"redirect\"", + "x-example": "deployment" + }, + "trigger": { + "type": "string", + "description": "Defines how the rule was created. Possible values are \"manual\" or \"deployment\"", + "x-example": "manual" + }, + "redirectUrl": { + "type": "string", + "description": "URL to redirect to. Used if type is \"redirect\"", + "x-example": "https:\/\/appwrite.io\/docs" + }, + "redirectStatusCode": { + "type": "integer", + "description": "Status code to apply during redirect. Used if type is \"redirect\"", + "x-example": 301, + "format": "int32" + }, + "deploymentId": { + "type": "string", + "description": "ID of deployment. Used if type is \"deployment\"", + "x-example": "n3u9feiwmf" + }, + "deploymentResourceType": { + "type": "string", + "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", + "x-example": "function", + "enum": [ + "function", + "site" + ] + }, + "deploymentResourceId": { + "type": "string", + "description": "ID deployment's resource. Used if type is \"deployment\"", + "x-example": "n3u9feiwmf" + }, + "deploymentVcsProviderBranch": { + "type": "string", + "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", + "x-example": "main" + }, + "status": { + "type": "string", + "description": "Domain verification status. Possible values are \"created\", \"verifying\", \"verified\" and \"unverified\"", + "x-example": "verified", + "enum": [ + "created", + "verifying", + "verified", + "unverified" + ] + }, + "logs": { + "type": "string", + "description": "Certificate generation logs. This will return an empty string if generation did not run, or succeeded.", + "x-example": "HTTP challegne failed." + }, + "renewAt": { + "type": "string", + "description": "Certificate auto-renewal date in ISO 8601 format.", + "x-example": "datetime" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "domain", + "type", + "trigger", + "redirectUrl", + "redirectStatusCode", + "deploymentId", + "deploymentResourceType", + "deploymentResourceId", + "deploymentVcsProviderBranch", + "status", + "logs", + "renewAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "main", + "status": "verified", + "logs": "HTTP challegne failed.", + "renewAt": "datetime" + } + }, + "smsTemplate": { + "description": "SmsTemplate", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Template type", + "x-example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "x-example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "Click on the link to verify your account." + } + }, + "required": [ + "type", + "locale", + "message" + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account." + } + }, + "emailTemplate": { + "description": "EmailTemplate", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Template type", + "x-example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "x-example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "Click on the link to verify your account." + }, + "senderName": { + "type": "string", + "description": "Name of the sender", + "x-example": "My User" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "x-example": "mail@appwrite.io" + }, + "replyTo": { + "type": "string", + "description": "Reply to email address", + "x-example": "emails@appwrite.io" + }, + "subject": { + "type": "string", + "description": "Email subject", + "x-example": "Please verify your email address" + } + }, + "required": [ + "type", + "locale", + "message", + "senderName", + "senderEmail", + "replyTo", + "subject" + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyTo": "emails@appwrite.io", + "subject": "Please verify your email address" + } + }, + "consoleVariables": { + "description": "Console Variables", + "type": "object", + "properties": { + "_APP_DOMAIN_TARGET_CNAME": { + "type": "string", + "description": "CNAME target for your Appwrite custom domains.", + "x-example": "appwrite.io" + }, + "_APP_DOMAIN_TARGET_A": { + "type": "string", + "description": "A target for your Appwrite custom domains.", + "x-example": "127.0.0.1" + }, + "_APP_DOMAIN_TARGET_AAAA": { + "type": "string", + "description": "AAAA target for your Appwrite custom domains.", + "x-example": "::1" + }, + "_APP_DOMAIN_TARGET_CAA": { + "type": "string", + "description": "CAA target for your Appwrite custom domains.", + "x-example": "digicert.com" + }, + "_APP_STORAGE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for file upload in bytes.", + "x-example": "30000000", + "format": "int32" + }, + "_APP_COMPUTE_SIZE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for deployment in bytes.", + "x-example": "30000000", + "format": "int32" + }, + "_APP_USAGE_STATS": { + "type": "string", + "description": "Defines if usage stats are enabled. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'.", + "x-example": "enabled" + }, + "_APP_VCS_ENABLED": { + "type": "boolean", + "description": "Defines if VCS (Version Control System) is enabled.", + "x-example": true + }, + "_APP_DOMAIN_ENABLED": { + "type": "boolean", + "description": "Defines if main domain is configured. If so, custom domains can be created.", + "x-example": true + }, + "_APP_ASSISTANT_ENABLED": { + "type": "boolean", + "description": "Defines if AI assistant is enabled.", + "x-example": true + }, + "_APP_DOMAIN_SITES": { + "type": "string", + "description": "A domain to use for site URLs.", + "x-example": "sites.localhost" + }, + "_APP_DOMAIN_FUNCTIONS": { + "type": "string", + "description": "A domain to use for function URLs.", + "x-example": "functions.localhost" + }, + "_APP_OPTIONS_FORCE_HTTPS": { + "type": "string", + "description": "Defines if HTTPS is enforced for all requests.", + "x-example": "enabled" + }, + "_APP_DOMAINS_NAMESERVERS": { + "type": "string", + "description": "Comma-separated list of nameservers.", + "x-example": "ns1.example.com,ns2.example.com" + } + }, + "required": [ + "_APP_DOMAIN_TARGET_CNAME", + "_APP_DOMAIN_TARGET_A", + "_APP_DOMAIN_TARGET_AAAA", + "_APP_DOMAIN_TARGET_CAA", + "_APP_STORAGE_LIMIT", + "_APP_COMPUTE_SIZE_LIMIT", + "_APP_USAGE_STATS", + "_APP_VCS_ENABLED", + "_APP_DOMAIN_ENABLED", + "_APP_ASSISTANT_ENABLED", + "_APP_DOMAIN_SITES", + "_APP_DOMAIN_FUNCTIONS", + "_APP_OPTIONS_FORCE_HTTPS", + "_APP_DOMAINS_NAMESERVERS" + ], + "example": { + "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", + "_APP_DOMAIN_TARGET_A": "127.0.0.1", + "_APP_DOMAIN_TARGET_AAAA": "::1", + "_APP_DOMAIN_TARGET_CAA": "digicert.com", + "_APP_STORAGE_LIMIT": "30000000", + "_APP_COMPUTE_SIZE_LIMIT": "30000000", + "_APP_USAGE_STATS": "enabled", + "_APP_VCS_ENABLED": true, + "_APP_DOMAIN_ENABLED": true, + "_APP_ASSISTANT_ENABLED": true, + "_APP_DOMAIN_SITES": "sites.localhost", + "_APP_DOMAIN_FUNCTIONS": "functions.localhost", + "_APP_OPTIONS_FORCE_HTTPS": "enabled", + "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com" + } + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ], + "example": { + "secret": true, + "uri": true + } + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } + }, + "provider": { + "description": "Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Provider ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Provider creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Provider update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name for the provider instance.", + "x-example": "Mailgun" + }, + "provider": { + "type": "string", + "description": "The name of the provider service.", + "x-example": "mailgun" + }, + "enabled": { + "type": "boolean", + "description": "Is provider enabled?", + "x-example": true + }, + "type": { + "type": "string", + "description": "Type of provider.", + "x-example": "sms" + }, + "credentials": { + "type": "object", + "description": "Provider credentials.", + "x-example": { + "key": "123456789" + } + }, + "options": { + "type": "object", + "description": "Provider options.", + "x-example": { + "from": "sender-email@mydomain" + }, + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "provider", + "enabled", + "type", + "credentials" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } + }, + "message": { + "description": "Message", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Message ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Message creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Message update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerType": { + "type": "string", + "description": "Message provider type.", + "x-example": "email" + }, + "topics": { + "type": "array", + "description": "Topic IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "users": { + "type": "array", + "description": "User IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "targets": { + "type": "array", + "description": "Target IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for message.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveredAt": { + "type": "string", + "description": "The time when the message was delivered.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveryErrors": { + "type": "array", + "description": "Delivery errors if any.", + "items": { + "type": "string" + }, + "x-example": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "nullable": true + }, + "deliveredTotal": { + "type": "integer", + "description": "Number of recipients the message was delivered to.", + "x-example": 1, + "format": "int32" + }, + "data": { + "type": "object", + "description": "Data of the message.", + "x-example": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + } + }, + "status": { + "type": "string", + "description": "Status of delivery.", + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "providerType", + "topics", + "users", + "targets", + "deliveredTotal", + "data", + "status" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } + }, + "topic": { + "description": "Topic", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Topic creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Topic update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name of the topic.", + "x-example": "events" + }, + "emailTotal": { + "type": "integer", + "description": "Total count of email subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "smsTotal": { + "type": "integer", + "description": "Total count of SMS subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "pushTotal": { + "type": "integer", + "description": "Total count of push subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "subscribe": { + "type": "array", + "description": "Subscribe permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "emailTotal", + "smsTotal", + "pushTotal", + "subscribe" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "$ref": "#\/components\/schemas\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } + }, + "migration": { + "description": "Migration", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Migration ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Migration creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "string", + "description": "Migration status ( pending, processing, failed, completed ) ", + "x-example": "pending" + }, + "stage": { + "type": "string", + "description": "Migration stage ( init, processing, source-check, destination-check, migrating, finished )", + "x-example": "init" + }, + "source": { + "type": "string", + "description": "A string containing the type of source of the migration.", + "x-example": "Appwrite" + }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "x-example": "Appwrite" + }, + "resources": { + "type": "array", + "description": "Resources to migrate.", + "items": { + "type": "string" + }, + "x-example": [ + "user" + ] + }, + "resourceId": { + "type": "string", + "description": "Id of the resource to migrate.", + "x-example": "databaseId:collectionId" + }, + "statusCounters": { + "type": "object", + "description": "A group of counters that represent the total progress of the migration.", + "x-example": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}" + }, + "resourceData": { + "type": "object", + "description": "An array of objects containing the report data of the resources that were migrated.", + "x-example": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]" + }, + "errors": { + "type": "array", + "description": "All errors that occurred during the migration process.", + "items": { + "type": "string" + }, + "x-example": [] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "status", + "stage", + "source", + "destination", + "resources", + "resourceId", + "statusCounters", + "resourceData", + "errors" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "stage": "init", + "source": "Appwrite", + "destination": "Appwrite", + "resources": [ + "user" + ], + "resourceId": "databaseId:collectionId", + "statusCounters": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}", + "resourceData": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]", + "errors": [] + } + }, + "migrationReport": { + "description": "Migration Report", + "type": "object", + "properties": { + "user": { + "type": "integer", + "description": "Number of users to be migrated.", + "x-example": 20, + "format": "int32" + }, + "team": { + "type": "integer", + "description": "Number of teams to be migrated.", + "x-example": 20, + "format": "int32" + }, + "database": { + "type": "integer", + "description": "Number of databases to be migrated.", + "x-example": 20, + "format": "int32" + }, + "row": { + "type": "integer", + "description": "Number of rows to be migrated.", + "x-example": 20, + "format": "int32" + }, + "file": { + "type": "integer", + "description": "Number of files to be migrated.", + "x-example": 20, + "format": "int32" + }, + "bucket": { + "type": "integer", + "description": "Number of buckets to be migrated.", + "x-example": 20, + "format": "int32" + }, + "function": { + "type": "integer", + "description": "Number of functions to be migrated.", + "x-example": 20, + "format": "int32" + }, + "size": { + "type": "integer", + "description": "Size of files to be migrated in mb.", + "x-example": 30000, + "format": "int32" + }, + "version": { + "type": "string", + "description": "Version of the Appwrite instance to be migrated.", + "x-example": "1.4.0" + } + }, + "required": [ + "user", + "team", + "database", + "row", + "file", + "bucket", + "function", + "size", + "version" + ], + "example": { + "user": 20, + "team": 20, + "database": 20, + "row": 20, + "file": 20, + "bucket": 20, + "function": 20, + "size": 30000, + "version": "1.4.0" + } + } + }, + "securitySchemes": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "Key": { + "type": "apiKey", + "name": "X-Appwrite-Key", + "description": "Your secret API key", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_API_KEY>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header" + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Mode": { + "type": "apiKey", + "name": "X-Appwrite-Mode", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "" + } + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/open-api3-1.8.x-server.json b/app/config/specs/open-api3-1.8.x-server.json new file mode 100644 index 0000000000..93a0d9d46b --- /dev/null +++ b/app/config/specs/open-api3-1.8.x-server.json @@ -0,0 +1,41807 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.8.0", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1" + }, + { + "url": "https:\/\/<REGION>.cloud.appwrite.io\/v1" + } + ], + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "demo": "account\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "demo": "account\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "demo": "account\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<IDENTITY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "demo": "account\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "demo": "account\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaType" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaChallenge" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + } + } + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "x-example": "<CHALLENGE_ID>" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<OTP>" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + } + } + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "demo": "account\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + } + } + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "demo": "account\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "demo": "account\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "tags": [ + "account" + ], + "description": "Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "demo": "account\/create-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "demo": "account\/update-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "x-example": "<SECRET>" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "demo": "account\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "demo": "account\/update-magic-url-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "demo": "account\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SESSION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SESSION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "demo": "account\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SESSION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "demo": "account\/create-magic-url-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "demo": "account\/create-o-auth-2-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + } + } + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "demo": "avatars\/get-browser.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "schema": { + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "tags": [ + "avatars" + ], + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "demo": "avatars\/get-credit-card.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", + "required": true, + "schema": { + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "unionpay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "demo": "avatars\/get-favicon.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "demo": "avatars\/get-flag.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "demo": "avatars\/get-image.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "demo": "avatars\/get-initials.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<NAME>", + "default": "" + }, + "in": "query" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500 + }, + "in": "query" + }, + { + "name": "background", + "description": "Changes background color. By default a random color will be picked and stay will persistent to the given name.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "tags": [ + "avatars" + ], + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "demo": "avatars\/get-qr.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEXT>" + }, + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 400 + }, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "download", + "description": "Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.", + "required": false, + "schema": { + "type": "boolean", + "x-example": false, + "default": false + }, + "in": "query" + } + ] + } + }, + "\/databases": { + "get": { + "summary": "List databases", + "operationId": "databasesList", + "tags": [ + "databases" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "list", + "group": "databases", + "weight": 316, + "cookies": false, + "type": "", + "demo": "databases\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + }, + "methods": [ + { + "name": "list", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "queries", + "search" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/databaseList" + } + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "demo": "databases\/list.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "databasesCreate", + "tags": [ + "databases" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "create", + "group": "databases", + "weight": 312, + "cookies": false, + "type": "", + "demo": "databases\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + }, + "methods": [ + { + "name": "create", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Create a new Database.\n", + "demo": "databases\/create.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "databasesGet", + "tags": [ + "databases" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "get", + "group": "databases", + "weight": 313, + "cookies": false, + "type": "", + "demo": "databases\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + }, + "methods": [ + { + "name": "get", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "demo": "databases\/get.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "databasesUpdate", + "tags": [ + "databases" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "update", + "group": "databases", + "weight": 314, + "cookies": false, + "type": "", + "demo": "databases\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + }, + "methods": [ + { + "name": "update", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Update a database by its unique ID.", + "demo": "databases\/update.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "databasesDelete", + "tags": [ + "databases" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "delete", + "group": "databases", + "weight": 315, + "cookies": false, + "type": "", + "demo": "databases\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + }, + "methods": [ + { + "name": "delete", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "demo": "databases\/delete.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "databasesListCollections", + "tags": [ + "databases" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collectionList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listCollections", + "group": "collections", + "weight": 324, + "cookies": false, + "type": "", + "demo": "databases\/list-collections.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTables" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create collections", + "operationId": "databasesCreateCollection", + "tags": [ + "databases" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createCollection", + "group": "collections", + "weight": 320, + "cookies": false, + "type": "", + "demo": "databases\/create-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "collectionId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<COLLECTION_ID>" + }, + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "databasesGetCollection", + "tags": [ + "databases" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getCollection", + "group": "collections", + "weight": 321, + "cookies": false, + "type": "", + "demo": "databases\/get-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "databasesUpdateCollection", + "tags": [ + "databases" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateCollection", + "group": "collections", + "weight": 322, + "cookies": false, + "type": "", + "demo": "databases\/update-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete collection", + "operationId": "databasesDeleteCollection", + "tags": [ + "databases" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteCollection", + "group": "collections", + "weight": 323, + "cookies": false, + "type": "", + "demo": "databases\/delete-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes": { + "get": { + "summary": "List attributes", + "operationId": "databasesListAttributes", + "tags": [ + "databases" + ], + "description": "List attributes in the collection.", + "responses": { + "200": { + "description": "Attributes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listAttributes", + "group": "attributes", + "weight": 341, + "cookies": false, + "type": "", + "demo": "databases\/list-attributes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listColumns" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean": { + "post": { + "summary": "Create boolean attribute", + "operationId": "databasesCreateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Create a boolean attribute.\n", + "responses": { + "202": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createBooleanAttribute", + "group": "attributes", + "weight": 342, + "cookies": false, + "type": "", + "demo": "databases\/create-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBooleanColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean\/{key}": { + "patch": { + "summary": "Update boolean attribute", + "operationId": "databasesUpdateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Update a boolean attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateBooleanAttribute", + "group": "attributes", + "weight": 343, + "cookies": false, + "type": "", + "demo": "databases\/update-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBooleanColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime": { + "post": { + "summary": "Create datetime attribute", + "operationId": "databasesCreateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Create a date time attribute according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createDatetimeAttribute", + "group": "attributes", + "weight": 344, + "cookies": false, + "type": "", + "demo": "databases\/create-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createDatetimeColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { + "patch": { + "summary": "Update datetime attribute", + "operationId": "databasesUpdateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Update a date time attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDatetimeAttribute", + "group": "attributes", + "weight": 345, + "cookies": false, + "type": "", + "demo": "databases\/update-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateDatetimeColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email": { + "post": { + "summary": "Create email attribute", + "operationId": "databasesCreateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Create an email attribute.\n", + "responses": { + "202": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createEmailAttribute", + "group": "attributes", + "weight": 346, + "cookies": false, + "type": "", + "demo": "databases\/create-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEmailColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email\/{key}": { + "patch": { + "summary": "Update email attribute", + "operationId": "databasesUpdateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateEmailAttribute", + "group": "attributes", + "weight": 347, + "cookies": false, + "type": "", + "demo": "databases\/update-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEmailColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum": { + "post": { + "summary": "Create enum attribute", + "operationId": "databasesCreateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "responses": { + "202": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createEnumAttribute", + "group": "attributes", + "weight": 348, + "cookies": false, + "type": "", + "demo": "databases\/create-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEnumColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum\/{key}": { + "patch": { + "summary": "Update enum attribute", + "operationId": "databasesUpdateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateEnumAttribute", + "group": "attributes", + "weight": 349, + "cookies": false, + "type": "", + "demo": "databases\/update-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEnumColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float": { + "post": { + "summary": "Create float attribute", + "operationId": "databasesCreateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createFloatAttribute", + "group": "attributes", + "weight": 350, + "cookies": false, + "type": "", + "demo": "databases\/create-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createFloatColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value.", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float\/{key}": { + "patch": { + "summary": "Update float attribute", + "operationId": "databasesUpdateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateFloatAttribute", + "group": "attributes", + "weight": 351, + "cookies": false, + "type": "", + "demo": "databases\/update-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateFloatColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value.", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer": { + "post": { + "summary": "Create integer attribute", + "operationId": "databasesCreateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIntegerAttribute", + "group": "attributes", + "weight": 352, + "cookies": false, + "type": "", + "demo": "databases\/create-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIntegerColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer\/{key}": { + "patch": { + "summary": "Update integer attribute", + "operationId": "databasesUpdateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIntegerAttribute", + "group": "attributes", + "weight": 353, + "cookies": false, + "type": "", + "demo": "databases\/update-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIntegerColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip": { + "post": { + "summary": "Create IP address attribute", + "operationId": "databasesCreateIpAttribute", + "tags": [ + "databases" + ], + "description": "Create IP address attribute.\n", + "responses": { + "202": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIpAttribute", + "group": "attributes", + "weight": 354, + "cookies": false, + "type": "", + "demo": "databases\/create-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIpColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 355, + "cookies": false, + "type": "", + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIpColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 356, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 357, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 358, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 359, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 360, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createRelationshipAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/create-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRelationshipColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedCollectionId": { + "type": "string", + "description": "Related Collection ID.", + "x-example": "<RELATED_COLLECTION_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "x-example": false + }, + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Attribute Key.", + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedCollectionId", + "type" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string": { + "post": { + "summary": "Create string attribute", + "operationId": "databasesCreateStringAttribute", + "tags": [ + "databases" + ], + "description": "Create a string attribute.\n", + "responses": { + "202": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createStringAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/create-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createStringColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "size": { + "type": "integer", + "description": "Attribute size for text attributes, in number of characters.", + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string\/{key}": { + "patch": { + "summary": "Update string attribute", + "operationId": "databasesUpdateStringAttribute", + "tags": [ + "databases" + ], + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateStringAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/update-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateStringColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string attribute.", + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url": { + "post": { + "summary": "Create URL attribute", + "operationId": "databasesCreateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Create a URL attribute.\n", + "responses": { + "202": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createUrlAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/create-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createUrlColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url\/{key}": { + "patch": { + "summary": "Update URL attribute", + "operationId": "databasesUpdateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateUrlAttribute", + "group": "attributes", + "weight": 367, + "cookies": false, + "type": "", + "demo": "databases\/update-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateUrlColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}": { + "get": { + "summary": "Get attribute", + "operationId": "databasesGetAttribute", + "tags": [ + "databases" + ], + "description": "Get attribute by ID.", + "responses": { + "200": { + "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeRelationship, or AttributeString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getAttribute", + "group": "attributes", + "weight": 339, + "cookies": false, + "type": "", + "demo": "databases\/get-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete attribute", + "operationId": "databasesDeleteAttribute", + "tags": [ + "databases" + ], + "description": "Deletes an attribute.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteAttribute", + "group": "attributes", + "weight": 340, + "cookies": false, + "type": "", + "demo": "databases\/delete-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}\/relationship": { + "patch": { + "summary": "Update relationship attribute", + "operationId": "databasesUpdateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "200": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateRelationshipAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/update-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRelationshipColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 335, + "cookies": false, + "type": "", + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 327, + "cookies": false, + "type": "", + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, + "methods": [ + { + "name": "createDocument", + "namespace": "databases", + "desc": "Create document", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + }, + { + "name": "createDocuments", + "namespace": "databases", + "desc": "Create documents", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRows" + } + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<DOCUMENT_ID>" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Upsert documents", + "operationId": "databasesUpsertDocuments", + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 332, + "cookies": false, + "type": "", + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + }, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "demo": "databases\/upsert-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { + "type": "array", + "description": "Array of document data as JSON objects. May contain partial documents.", + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "documents" + ] + } + } + } + } + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDocuments", + "group": "documents", + "weight": 330, + "cookies": false, + "type": "", + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRows" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteDocuments", + "group": "documents", + "weight": 334, + "cookies": false, + "type": "", + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRows" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 328, + "cookies": false, + "type": "", + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "databasesUpsertDocument", + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 331, + "cookies": false, + "type": "", + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 329, + "cookies": false, + "type": "", + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 333, + "cookies": false, + "type": "", + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "databasesListIndexes", + "tags": [ + "databases" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/indexList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 371, + "cookies": false, + "type": "", + "demo": "databases\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listIndexes" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "databasesCreateIndex", + "tags": [ + "databases" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 368, + "cookies": false, + "type": "", + "demo": "databases\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIndex" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "attributes": { + "type": "array", + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "databasesGetIndex", + "tags": [ + "databases" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 369, + "cookies": false, + "type": "", + "demo": "databases\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getIndex" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "databasesDeleteIndex", + "tags": [ + "databases" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 370, + "cookies": false, + "type": "", + "demo": "databases\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteIndex" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/functions": { + "get": { + "summary": "List functions", + "operationId": "functionsList", + "tags": [ + "functions" + ], + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Functions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/functionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "functions", + "weight": 440, + "cookies": false, + "type": "", + "demo": "functions\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create function", + "operationId": "functionsCreate", + "tags": [ + "functions" + ], + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "responses": { + "201": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "functions", + "weight": 437, + "cookies": false, + "type": "", + "demo": "functions\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "functionId": { + "type": "string", + "description": "Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<FUNCTION_ID>" + }, + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Function maximum execution time in seconds.", + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function.", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function.", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "x-example": null + } + }, + "required": [ + "functionId", + "name", + "runtime" + ] + } + } + } + } + } + }, + "\/functions\/runtimes": { + "get": { + "summary": "List runtimes", + "operationId": "functionsListRuntimes", + "tags": [ + "functions" + ], + "description": "Get a list of all runtimes that are currently active on your instance.", + "responses": { + "200": { + "description": "Runtimes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/runtimeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRuntimes", + "group": "runtimes", + "weight": 442, + "cookies": false, + "type": "", + "demo": "functions\/list-runtimes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "functionsListSpecifications", + "tags": [ + "functions" + ], + "description": "List allowed function specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSpecifications", + "group": "runtimes", + "weight": 443, + "cookies": false, + "type": "", + "demo": "functions\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/{functionId}": { + "get": { + "summary": "Get function", + "operationId": "functionsGet", + "tags": [ + "functions" + ], + "description": "Get a function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "functions", + "weight": 438, + "cookies": false, + "type": "", + "demo": "functions\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update function", + "operationId": "functionsUpdate", + "tags": [ + "functions" + ], + "description": "Update function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "functions", + "weight": 439, + "cookies": false, + "type": "", + "demo": "functions\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Maximum execution time in seconds.", + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Controle System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function", + "x-example": "<PROVIDER_REPOSITORY_ID>", + "x-nullable": true + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete function", + "operationId": "functionsDelete", + "tags": [ + "functions" + ], + "description": "Delete a function by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "functions", + "weight": 441, + "cookies": false, + "type": "", + "demo": "functions\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployment": { + "patch": { + "summary": "Update function's deployment", + "operationId": "functionsUpdateFunctionDeployment", + "tags": [ + "functions" + ], + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFunctionDeployment", + "group": "functions", + "weight": 446, + "cookies": false, + "type": "", + "demo": "functions\/update-function-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "functionsListDeployments", + "tags": [ + "functions" + ], + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 447, + "cookies": false, + "type": "", + "demo": "functions\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "functionsCreateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 444, + "cookies": false, + "type": "upload", + "demo": "functions\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "entrypoint": { + "type": "string", + "description": "Entrypoint File.", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "<COMMANDS>" + }, + "code": { + "type": "string", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "x-example": null + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "code", + "activate" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "functionsCreateDuplicateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 452, + "cookies": false, + "type": "", + "demo": "functions\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + }, + "buildId": { + "type": "string", + "description": "Build unique ID.", + "x-example": "<BUILD_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "functionsCreateTemplateDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 449, + "cookies": false, + "type": "", + "demo": "functions\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to function code in the template repo.", + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the function template.", + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "functionsCreateVcsDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 450, + "cookies": false, + "type": "", + "demo": "functions\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "x-example": "branch", + "enum": [ + "branch", + "commit" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "functionsGetDeployment", + "tags": [ + "functions" + ], + "description": "Get a function deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 445, + "cookies": false, + "type": "", + "demo": "functions\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "functionsDeleteDeployment", + "tags": [ + "functions" + ], + "description": "Delete a code deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 448, + "cookies": false, + "type": "", + "demo": "functions\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "functionsGetDeploymentDownload", + "tags": [ + "functions" + ], + "description": "Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 451, + "cookies": false, + "type": "location", + "demo": "functions\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source" + }, + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "functionsUpdateDeploymentStatus", + "tags": [ + "functions" + ], + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 453, + "cookies": false, + "type": "", + "demo": "functions\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 456, + "cookies": false, + "type": "", + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "content": { + "multipart\/form-data": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 454, + "cookies": false, + "type": "", + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "x-example": "<BODY>" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "x-example": "<PATH>" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is POST.", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS", + "HEAD" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "string", + "description": "HTTP headers of execution. Defaults to empty.", + "x-example": null + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "x-example": "<SCHEDULED_AT>" + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 455, + "cookies": false, + "type": "", + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<EXECUTION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete execution", + "operationId": "functionsDeleteExecution", + "tags": [ + "functions" + ], + "description": "Delete a function execution by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteExecution", + "group": "executions", + "weight": 457, + "cookies": false, + "type": "", + "demo": "functions\/delete-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<EXECUTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "functionsListVariables", + "tags": [ + "functions" + ], + "description": "Get a list of all variables of a specific function.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 462, + "cookies": false, + "type": "", + "demo": "functions\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "functionsCreateVariable", + "tags": [ + "functions" + ], + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 460, + "cookies": false, + "type": "", + "demo": "functions\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "functionsGetVariable", + "tags": [ + "functions" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 461, + "cookies": false, + "type": "", + "demo": "functions\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "functionsUpdateVariable", + "tags": [ + "functions" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 463, + "cookies": false, + "type": "", + "demo": "functions\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "functionsDeleteVariable", + "tags": [ + "functions" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 464, + "cookies": false, + "type": "", + "demo": "functions\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 250, + "cookies": false, + "type": "graphql", + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 249, + "cookies": false, + "type": "graphql", + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/health": { + "get": { + "summary": "Get HTTP", + "operationId": "healthGet", + "tags": [ + "health" + ], + "description": "Check the Appwrite HTTP server is up and responsive.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "health", + "weight": 78, + "cookies": false, + "type": "", + "demo": "health\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/anti-virus": { + "get": { + "summary": "Get antivirus", + "operationId": "healthGetAntivirus", + "tags": [ + "health" + ], + "description": "Check the Appwrite Antivirus server is up and connection is successful.", + "responses": { + "200": { + "description": "Health Antivirus", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthAntivirus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getAntivirus", + "group": "health", + "weight": 99, + "cookies": false, + "type": "", + "demo": "health\/get-antivirus.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/cache": { + "get": { + "summary": "Get cache", + "operationId": "healthGetCache", + "tags": [ + "health" + ], + "description": "Check the Appwrite in-memory cache servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCache", + "group": "health", + "weight": 81, + "cookies": false, + "type": "", + "demo": "health\/get-cache.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/certificate": { + "get": { + "summary": "Get the SSL certificate for a domain", + "operationId": "healthGetCertificate", + "tags": [ + "health" + ], + "description": "Get the SSL certificate for a domain", + "responses": { + "200": { + "description": "Health Certificate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthCertificate" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCertificate", + "group": "health", + "weight": 86, + "cookies": false, + "type": "", + "demo": "health\/get-certificate.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "domain", + "description": "string", + "required": false, + "schema": { + "type": "string" + }, + "in": "query" + } + ] + } + }, + "\/health\/db": { + "get": { + "summary": "Get DB", + "operationId": "healthGetDB", + "tags": [ + "health" + ], + "description": "Check the Appwrite database servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDB", + "group": "health", + "weight": 80, + "cookies": false, + "type": "", + "demo": "health\/get-db.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/pubsub": { + "get": { + "summary": "Get pubsub", + "operationId": "healthGetPubSub", + "tags": [ + "health" + ], + "description": "Check the Appwrite pub-sub servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPubSub", + "group": "health", + "weight": 82, + "cookies": false, + "type": "", + "demo": "health\/get-pub-sub.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/queue\/builds": { + "get": { + "summary": "Get builds queue", + "operationId": "healthGetQueueBuilds", + "tags": [ + "health" + ], + "description": "Get the number of builds that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueBuilds", + "group": "queue", + "weight": 88, + "cookies": false, + "type": "", + "demo": "health\/get-queue-builds.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/certificates": { + "get": { + "summary": "Get certificates queue", + "operationId": "healthGetQueueCertificates", + "tags": [ + "health" + ], + "description": "Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueCertificates", + "group": "queue", + "weight": 87, + "cookies": false, + "type": "", + "demo": "health\/get-queue-certificates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/databases": { + "get": { + "summary": "Get databases queue", + "operationId": "healthGetQueueDatabases", + "tags": [ + "health" + ], + "description": "Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueDatabases", + "group": "queue", + "weight": 89, + "cookies": false, + "type": "", + "demo": "health\/get-queue-databases.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Queue name for which to check the queue size", + "required": false, + "schema": { + "type": "string", + "x-example": "<NAME>", + "default": "database_db_main" + }, + "in": "query" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/deletes": { + "get": { + "summary": "Get deletes queue", + "operationId": "healthGetQueueDeletes", + "tags": [ + "health" + ], + "description": "Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueDeletes", + "group": "queue", + "weight": 90, + "cookies": false, + "type": "", + "demo": "health\/get-queue-deletes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/failed\/{name}": { + "get": { + "summary": "Get number of failed queue jobs", + "operationId": "healthGetFailedJobs", + "tags": [ + "health" + ], + "description": "Returns the amount of failed jobs in a given queue.\n", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFailedJobs", + "group": "queue", + "weight": 100, + "cookies": false, + "type": "", + "demo": "health\/get-failed-jobs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "The name of the queue", + "required": true, + "schema": { + "type": "string", + "x-example": "v1-database", + "enum": [ + "v1-database", + "v1-deletes", + "v1-audits", + "v1-mails", + "v1-functions", + "v1-stats-resources", + "v1-stats-usage", + "v1-webhooks", + "v1-certificates", + "v1-builds", + "v1-messaging", + "v1-migrations" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/functions": { + "get": { + "summary": "Get functions queue", + "operationId": "healthGetQueueFunctions", + "tags": [ + "health" + ], + "description": "Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueFunctions", + "group": "queue", + "weight": 94, + "cookies": false, + "type": "", + "demo": "health\/get-queue-functions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/logs": { + "get": { + "summary": "Get logs queue", + "operationId": "healthGetQueueLogs", + "tags": [ + "health" + ], + "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueLogs", + "group": "queue", + "weight": 85, + "cookies": false, + "type": "", + "demo": "health\/get-queue-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/mails": { + "get": { + "summary": "Get mails queue", + "operationId": "healthGetQueueMails", + "tags": [ + "health" + ], + "description": "Get the number of mails that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMails", + "group": "queue", + "weight": 91, + "cookies": false, + "type": "", + "demo": "health\/get-queue-mails.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/messaging": { + "get": { + "summary": "Get messaging queue", + "operationId": "healthGetQueueMessaging", + "tags": [ + "health" + ], + "description": "Get the number of messages that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMessaging", + "group": "queue", + "weight": 92, + "cookies": false, + "type": "", + "demo": "health\/get-queue-messaging.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/migrations": { + "get": { + "summary": "Get migrations queue", + "operationId": "healthGetQueueMigrations", + "tags": [ + "health" + ], + "description": "Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMigrations", + "group": "queue", + "weight": 93, + "cookies": false, + "type": "", + "demo": "health\/get-queue-migrations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-resources": { + "get": { + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueStatsResources", + "group": "queue", + "weight": 95, + "cookies": false, + "type": "", + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueUsage", + "group": "queue", + "weight": 96, + "cookies": false, + "type": "", + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/webhooks": { + "get": { + "summary": "Get webhooks queue", + "operationId": "healthGetQueueWebhooks", + "tags": [ + "health" + ], + "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueWebhooks", + "group": "queue", + "weight": 84, + "cookies": false, + "type": "", + "demo": "health\/get-queue-webhooks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/storage": { + "get": { + "summary": "Get storage", + "operationId": "healthGetStorage", + "tags": [ + "health" + ], + "description": "Check the Appwrite storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getStorage", + "group": "storage", + "weight": 98, + "cookies": false, + "type": "", + "demo": "health\/get-storage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/storage\/local": { + "get": { + "summary": "Get local storage", + "operationId": "healthGetStorageLocal", + "tags": [ + "health" + ], + "description": "Check the Appwrite local storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getStorageLocal", + "group": "storage", + "weight": 97, + "cookies": false, + "type": "", + "demo": "health\/get-storage-local.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/time": { + "get": { + "summary": "Get time", + "operationId": "healthGetTime", + "tags": [ + "health" + ], + "description": "Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.", + "responses": { + "200": { + "description": "Health Time", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthTime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTime", + "group": "health", + "weight": 83, + "cookies": false, + "type": "", + "demo": "health\/get-time.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "tags": [ + "locale" + ], + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "responses": { + "200": { + "description": "Locale", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/locale" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 70, + "cookies": false, + "type": "", + "demo": "locale\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/localeCodeList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 71, + "cookies": false, + "type": "", + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/continentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 75, + "cookies": false, + "type": "", + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 72, + "cookies": false, + "type": "", + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "tags": [ + "locale" + ], + "description": "List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 73, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-eu.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/phoneList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 74, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "tags": [ + "locale" + ], + "description": "List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Currencies List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/currencyList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 76, + "cookies": false, + "type": "", + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "tags": [ + "locale" + ], + "description": "List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.", + "responses": { + "200": { + "description": "Languages List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/languageList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 77, + "cookies": false, + "type": "", + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages": { + "get": { + "summary": "List messages", + "operationId": "messagingListMessages", + "tags": [ + "messaging" + ], + "description": "Get a list of all messages from the current Appwrite project.", + "responses": { + "200": { + "description": "Message list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/messageList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMessages", + "group": "messages", + "weight": 304, + "cookies": false, + "type": "", + "demo": "messaging\/list-messages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/email": { + "post": { + "summary": "Create email", + "operationId": "messagingCreateEmail", + "tags": [ + "messaging" + ], + "description": "Create a new email message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmail", + "group": "messages", + "weight": 301, + "cookies": false, + "type": "", + "demo": "messaging\/create-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<MESSAGE_ID>" + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + }, + "required": [ + "messageId", + "subject", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/email\/{messageId}": { + "patch": { + "summary": "Update email", + "operationId": "messagingUpdateEmail", + "tags": [ + "messaging" + ], + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "messages", + "weight": 308, + "cookies": false, + "type": "", + "demo": "messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "x-example": false + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/push": { + "post": { + "summary": "Create push notification", + "operationId": "messagingCreatePush", + "tags": [ + "messaging" + ], + "description": "Create a new push notification.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPush", + "group": "messages", + "weight": 303, + "cookies": false, + "type": "", + "demo": "messaging\/create-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<MESSAGE_ID>" + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "x-example": "<BODY>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "data": { + "type": "object", + "description": "Additional key-value pair data for push notification.", + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web Platform.", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS Platform.", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android Platform.", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android Platform.", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + }, + "required": [ + "messageId" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/push\/{messageId}": { + "patch": { + "summary": "Update push notification", + "operationId": "messagingUpdatePush", + "tags": [ + "messaging" + ], + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePush", + "group": "messages", + "weight": 310, + "cookies": false, + "type": "", + "demo": "messaging\/update-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "x-example": "<BODY>" + }, + "data": { + "type": "object", + "description": "Additional Data for push notification.", + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web platforms.", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS platforms.", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android platforms.", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android platforms.", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS platforms.", + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSms", + "group": "messages", + "weight": 302, + "cookies": false, + "type": "", + "demo": "messaging\/create-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + }, + "methods": [ + { + "name": "createSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + } + }, + { + "name": "createSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<MESSAGE_ID>" + }, + "content": { + "type": "string", + "description": "SMS Content.", + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + }, + "required": [ + "messageId", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSms", + "group": "messages", + "weight": 309, + "cookies": false, + "type": "", + "demo": "messaging\/update-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + }, + "methods": [ + { + "name": "updateSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + } + }, + { + "name": "updateSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/{messageId}": { + "get": { + "summary": "Get message", + "operationId": "messagingGetMessage", + "tags": [ + "messaging" + ], + "description": "Get a message by its unique ID.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getMessage", + "group": "messages", + "weight": 307, + "cookies": false, + "type": "", + "demo": "messaging\/get-message.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete message", + "operationId": "messagingDelete", + "tags": [ + "messaging" + ], + "description": "Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "messages", + "weight": 311, + "cookies": false, + "type": "", + "demo": "messaging\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/logs": { + "get": { + "summary": "List message logs", + "operationId": "messagingListMessageLogs", + "tags": [ + "messaging" + ], + "description": "Get the message activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMessageLogs", + "group": "logs", + "weight": 305, + "cookies": false, + "type": "", + "demo": "messaging\/list-message-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/targets": { + "get": { + "summary": "List message targets", + "operationId": "messagingListTargets", + "tags": [ + "messaging" + ], + "description": "Get a list of the targets associated with a message.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTargets", + "group": "messages", + "weight": 306, + "cookies": false, + "type": "", + "demo": "messaging\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers": { + "get": { + "summary": "List providers", + "operationId": "messagingListProviders", + "tags": [ + "messaging" + ], + "description": "Get a list of all providers from the current Appwrite project.", + "responses": { + "200": { + "description": "Provider list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listProviders", + "group": "providers", + "weight": 276, + "cookies": false, + "type": "", + "demo": "messaging\/list-providers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createApnsProvider", + "group": "providers", + "weight": 275, + "cookies": false, + "type": "", + "demo": "messaging\/create-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + }, + "methods": [ + { + "name": "createApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + } + }, + { + "name": "createAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateApnsProvider", + "group": "providers", + "weight": 288, + "cookies": false, + "type": "", + "demo": "messaging\/update-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + }, + "methods": [ + { + "name": "updateApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + } + }, + { + "name": "updateAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createFcmProvider", + "group": "providers", + "weight": 274, + "cookies": false, + "type": "", + "demo": "messaging\/create-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + }, + "methods": [ + { + "name": "createFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + } + }, + { + "name": "createFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateFcmProvider", + "group": "providers", + "weight": 287, + "cookies": false, + "type": "", + "demo": "messaging\/update-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + }, + "methods": [ + { + "name": "updateFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + } + }, + { + "name": "updateFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun": { + "post": { + "summary": "Create Mailgun provider", + "operationId": "messagingCreateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Mailgun provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMailgunProvider", + "group": "providers", + "weight": 266, + "cookies": false, + "type": "", + "demo": "messaging\/create-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun\/{providerId}": { + "patch": { + "summary": "Update Mailgun provider", + "operationId": "messagingUpdateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Update a Mailgun provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMailgunProvider", + "group": "providers", + "weight": 279, + "cookies": false, + "type": "", + "demo": "messaging\/update-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/msg91": { + "post": { + "summary": "Create Msg91 provider", + "operationId": "messagingCreateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Create a new MSG91 provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMsg91Provider", + "group": "providers", + "weight": 269, + "cookies": false, + "type": "", + "demo": "messaging\/create-msg-91-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "x-example": "<AUTH_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/msg91\/{providerId}": { + "patch": { + "summary": "Update Msg91 provider", + "operationId": "messagingUpdateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Update a MSG91 provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMsg91Provider", + "group": "providers", + "weight": 282, + "cookies": false, + "type": "", + "demo": "messaging\/update-msg-91-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID.", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "x-example": "<AUTH_KEY>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid": { + "post": { + "summary": "Create Sendgrid provider", + "operationId": "messagingCreateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Sendgrid provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSendgridProvider", + "group": "providers", + "weight": 267, + "cookies": false, + "type": "", + "demo": "messaging\/create-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid\/{providerId}": { + "patch": { + "summary": "Update Sendgrid provider", + "operationId": "messagingUpdateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Update a Sendgrid provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSendgridProvider", + "group": "providers", + "weight": 280, + "cookies": false, + "type": "", + "demo": "messaging\/update-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSmtpProvider", + "group": "providers", + "weight": 268, + "cookies": false, + "type": "", + "demo": "messaging\/create-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + }, + "methods": [ + { + "name": "createSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + } + }, + { + "name": "createSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "The default SMTP server port.", + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSmtpProvider", + "group": "providers", + "weight": 281, + "cookies": false, + "type": "", + "demo": "messaging\/update-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + }, + "methods": [ + { + "name": "updateSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + } + }, + { + "name": "updateSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "SMTP port.", + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be 'ssl' or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "x-example": "<REPLY_TO_EMAIL>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/telesign": { + "post": { + "summary": "Create Telesign provider", + "operationId": "messagingCreateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Telesign provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTelesignProvider", + "group": "providers", + "weight": 270, + "cookies": false, + "type": "", + "demo": "messaging\/create-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/telesign\/{providerId}": { + "patch": { + "summary": "Update Telesign provider", + "operationId": "messagingUpdateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Update a Telesign provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTelesignProvider", + "group": "providers", + "weight": 283, + "cookies": false, + "type": "", + "demo": "messaging\/update-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic": { + "post": { + "summary": "Create Textmagic provider", + "operationId": "messagingCreateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Textmagic provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTextmagicProvider", + "group": "providers", + "weight": 271, + "cookies": false, + "type": "", + "demo": "messaging\/create-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic\/{providerId}": { + "patch": { + "summary": "Update Textmagic provider", + "operationId": "messagingUpdateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Update a Textmagic provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTextmagicProvider", + "group": "providers", + "weight": 284, + "cookies": false, + "type": "", + "demo": "messaging\/update-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/twilio": { + "post": { + "summary": "Create Twilio provider", + "operationId": "messagingCreateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Twilio provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTwilioProvider", + "group": "providers", + "weight": 272, + "cookies": false, + "type": "", + "demo": "messaging\/create-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "x-example": "<AUTH_TOKEN>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/twilio\/{providerId}": { + "patch": { + "summary": "Update Twilio provider", + "operationId": "messagingUpdateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Update a Twilio provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTwilioProvider", + "group": "providers", + "weight": 285, + "cookies": false, + "type": "", + "demo": "messaging\/update-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "x-example": "<AUTH_TOKEN>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/vonage": { + "post": { + "summary": "Create Vonage provider", + "operationId": "messagingCreateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Vonage provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVonageProvider", + "group": "providers", + "weight": 273, + "cookies": false, + "type": "", + "demo": "messaging\/create-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "x-example": "<API_SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/vonage\/{providerId}": { + "patch": { + "summary": "Update Vonage provider", + "operationId": "messagingUpdateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Update a Vonage provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVonageProvider", + "group": "providers", + "weight": 286, + "cookies": false, + "type": "", + "demo": "messaging\/update-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "x-example": "<API_SECRET>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/{providerId}": { + "get": { + "summary": "Get provider", + "operationId": "messagingGetProvider", + "tags": [ + "messaging" + ], + "description": "Get a provider by its unique ID.\n", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getProvider", + "group": "providers", + "weight": 278, + "cookies": false, + "type": "", + "demo": "messaging\/get-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete provider", + "operationId": "messagingDeleteProvider", + "tags": [ + "messaging" + ], + "description": "Delete a provider by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteProvider", + "group": "providers", + "weight": 289, + "cookies": false, + "type": "", + "demo": "messaging\/delete-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/providers\/{providerId}\/logs": { + "get": { + "summary": "List provider logs", + "operationId": "messagingListProviderLogs", + "tags": [ + "messaging" + ], + "description": "Get the provider activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listProviderLogs", + "group": "providers", + "weight": 277, + "cookies": false, + "type": "", + "demo": "messaging\/list-provider-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/subscribers\/{subscriberId}\/logs": { + "get": { + "summary": "List subscriber logs", + "operationId": "messagingListSubscriberLogs", + "tags": [ + "messaging" + ], + "description": "Get the subscriber activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSubscriberLogs", + "group": "subscribers", + "weight": 298, + "cookies": false, + "type": "", + "demo": "messaging\/list-subscriber-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/topics": { + "get": { + "summary": "List topics", + "operationId": "messagingListTopics", + "tags": [ + "messaging" + ], + "description": "Get a list of all topics from the current Appwrite project.", + "responses": { + "200": { + "description": "Topic list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topicList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTopics", + "group": "topics", + "weight": 291, + "cookies": false, + "type": "", + "demo": "messaging\/list-topics.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create topic", + "operationId": "messagingCreateTopic", + "tags": [ + "messaging" + ], + "description": "Create a new topic.", + "responses": { + "201": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTopic", + "group": "topics", + "weight": 290, + "cookies": false, + "type": "", + "demo": "messaging\/create-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topicId": { + "type": "string", + "description": "Topic ID. Choose a custom Topic ID or a new Topic ID.", + "x-example": "<TOPIC_ID>" + }, + "name": { + "type": "string", + "description": "Topic Name.", + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "topicId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}": { + "get": { + "summary": "Get topic", + "operationId": "messagingGetTopic", + "tags": [ + "messaging" + ], + "description": "Get a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTopic", + "group": "topics", + "weight": 293, + "cookies": false, + "type": "", + "demo": "messaging\/get-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update topic", + "operationId": "messagingUpdateTopic", + "tags": [ + "messaging" + ], + "description": "Update a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTopic", + "group": "topics", + "weight": 294, + "cookies": false, + "type": "", + "demo": "messaging\/update-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Topic Name.", + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete topic", + "operationId": "messagingDeleteTopic", + "tags": [ + "messaging" + ], + "description": "Delete a topic by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTopic", + "group": "topics", + "weight": 295, + "cookies": false, + "type": "", + "demo": "messaging\/delete-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/logs": { + "get": { + "summary": "List topic logs", + "operationId": "messagingListTopicLogs", + "tags": [ + "messaging" + ], + "description": "Get the topic activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTopicLogs", + "group": "topics", + "weight": 292, + "cookies": false, + "type": "", + "demo": "messaging\/list-topic-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "get": { + "summary": "List subscribers", + "operationId": "messagingListSubscribers", + "tags": [ + "messaging" + ], + "description": "Get a list of all subscribers from the current Appwrite project.", + "responses": { + "200": { + "description": "Subscriber list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriberList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSubscribers", + "group": "subscribers", + "weight": 297, + "cookies": false, + "type": "", + "demo": "messaging\/list-subscribers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 296, + "cookies": false, + "type": "", + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "JWT": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "x-example": "<SUBSCRIBER_ID>" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "x-example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "get": { + "summary": "Get subscriber", + "operationId": "messagingGetSubscriber", + "tags": [ + "messaging" + ], + "description": "Get a subscriber by its unique ID.\n", + "responses": { + "200": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSubscriber", + "group": "subscribers", + "weight": 299, + "cookies": false, + "type": "", + "demo": "messaging\/get-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 300, + "cookies": false, + "type": "", + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "JWT": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites": { + "get": { + "summary": "List sites", + "operationId": "sitesList", + "tags": [ + "sites" + ], + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Sites List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/siteList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "sites", + "weight": 469, + "cookies": false, + "type": "", + "demo": "sites\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create site", + "operationId": "sitesCreate", + "tags": [ + "sites" + ], + "description": "Create a new site.", + "responses": { + "201": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "sites", + "weight": 467, + "cookies": false, + "type": "", + "demo": "sites\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "siteId": { + "type": "string", + "description": "Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<SITE_ID>" + }, + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "x-example": "<FALLBACK_FILE>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "x-example": null + } + }, + "required": [ + "siteId", + "name", + "framework", + "buildRuntime" + ] + } + } + } + } + } + }, + "\/sites\/frameworks": { + "get": { + "summary": "List frameworks", + "operationId": "sitesListFrameworks", + "tags": [ + "sites" + ], + "description": "Get a list of all frameworks that are currently available on the server instance.", + "responses": { + "200": { + "description": "Frameworks List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/frameworkList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listFrameworks", + "group": "frameworks", + "weight": 472, + "cookies": false, + "type": "", + "demo": "sites\/list-frameworks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "sitesListSpecifications", + "tags": [ + "sites" + ], + "description": "List allowed site specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSpecifications", + "group": "frameworks", + "weight": 495, + "cookies": false, + "type": "", + "demo": "sites\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/{siteId}": { + "get": { + "summary": "Get site", + "operationId": "sitesGet", + "tags": [ + "sites" + ], + "description": "Get a site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "sites", + "weight": 468, + "cookies": false, + "type": "", + "demo": "sites\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update site", + "operationId": "sitesUpdate", + "tags": [ + "sites" + ], + "description": "Update site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "sites", + "weight": 470, + "cookies": false, + "type": "", + "demo": "sites\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "x-example": "<FALLBACK_FILE>" + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "x-example": null + } + }, + "required": [ + "name", + "framework" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete site", + "operationId": "sitesDelete", + "tags": [ + "sites" + ], + "description": "Delete a site by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "sites", + "weight": 471, + "cookies": false, + "type": "", + "demo": "sites\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployment": { + "patch": { + "summary": "Update site's deployment", + "operationId": "sitesUpdateSiteDeployment", + "tags": [ + "sites" + ], + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSiteDeployment", + "group": "sites", + "weight": 478, + "cookies": false, + "type": "", + "demo": "sites\/update-site-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "sitesListDeployments", + "tags": [ + "sites" + ], + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 477, + "cookies": false, + "type": "", + "demo": "sites\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "sitesCreateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 473, + "cookies": false, + "type": "upload", + "demo": "sites\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "installCommand": { + "type": "string", + "description": "Install Commands.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Commands.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "code": { + "type": "string", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "x-example": null + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "code", + "activate" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "sitesCreateDuplicateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 481, + "cookies": false, + "type": "", + "demo": "sites\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "sitesCreateTemplateDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 474, + "cookies": false, + "type": "", + "demo": "sites\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to site code in the template repo.", + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the site template.", + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "sitesCreateVcsDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 475, + "cookies": false, + "type": "", + "demo": "sites\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "x-example": "branch", + "enum": [ + "branch", + "commit", + "tag" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "sitesGetDeployment", + "tags": [ + "sites" + ], + "description": "Get a site deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 476, + "cookies": false, + "type": "", + "demo": "sites\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "sitesDeleteDeployment", + "tags": [ + "sites" + ], + "description": "Delete a site deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 479, + "cookies": false, + "type": "", + "demo": "sites\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "sitesGetDeploymentDownload", + "tags": [ + "sites" + ], + "description": "Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 480, + "cookies": false, + "type": "location", + "demo": "sites\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "sitesUpdateDeploymentStatus", + "tags": [ + "sites" + ], + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 482, + "cookies": false, + "type": "", + "demo": "sites\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "tags": [ + "sites" + ], + "description": "Get a list of all site logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 484, + "cookies": false, + "type": "", + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "tags": [ + "sites" + ], + "description": "Get a site request log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getLog", + "group": "logs", + "weight": 483, + "cookies": false, + "type": "", + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<LOG_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "tags": [ + "sites" + ], + "description": "Delete a site log by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteLog", + "group": "logs", + "weight": 485, + "cookies": false, + "type": "", + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<LOG_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "sitesListVariables", + "tags": [ + "sites" + ], + "description": "Get a list of all variables of a specific site.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 488, + "cookies": false, + "type": "", + "demo": "sites\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "sitesCreateVariable", + "tags": [ + "sites" + ], + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 486, + "cookies": false, + "type": "", + "demo": "sites\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "sitesGetVariable", + "tags": [ + "sites" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 487, + "cookies": false, + "type": "", + "demo": "sites\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "sitesUpdateVariable", + "tags": [ + "sites" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 489, + "cookies": false, + "type": "", + "demo": "sites\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "sitesDeleteVariable", + "tags": [ + "sites" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 490, + "cookies": false, + "type": "", + "demo": "sites\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets": { + "get": { + "summary": "List buckets", + "operationId": "storageListBuckets", + "tags": [ + "storage" + ], + "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Buckets List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucketList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listBuckets", + "group": "buckets", + "weight": 155, + "cookies": false, + "type": "", + "demo": "storage\/list-buckets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create bucket", + "operationId": "storageCreateBucket", + "tags": [ + "storage" + ], + "description": "Create a new storage bucket.", + "responses": { + "201": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBucket", + "group": "buckets", + "weight": 154, + "cookies": false, + "type": "", + "demo": "storage\/create-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<BUCKET_ID>" + }, + "name": { + "type": "string", + "description": "Bucket name", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "x-example": false + } + }, + "required": [ + "bucketId", + "name" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}": { + "get": { + "summary": "Get bucket", + "operationId": "storageGetBucket", + "tags": [ + "storage" + ], + "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBucket", + "group": "buckets", + "weight": 156, + "cookies": false, + "type": "", + "demo": "storage\/get-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update bucket", + "operationId": "storageUpdateBucket", + "tags": [ + "storage" + ], + "description": "Update a storage bucket by its unique ID.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBucket", + "group": "buckets", + "weight": 157, + "cookies": false, + "type": "", + "demo": "storage\/update-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Bucket name", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete bucket", + "operationId": "storageDeleteBucket", + "tags": [ + "storage" + ], + "description": "Delete a storage bucket by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteBucket", + "group": "buckets", + "weight": 158, + "cookies": false, + "type": "", + "demo": "storage\/delete-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/fileList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 160, + "cookies": false, + "type": "", + "demo": "storage\/list-files.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 159, + "cookies": false, + "type": "upload", + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "fileId": { + "type": "string", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<FILE_ID>", + "x-upload-id": true + }, + "file": { + "type": "string", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "x-example": null + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "fileId", + "file" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 161, + "cookies": false, + "type": "", + "demo": "storage\/get-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 166, + "cookies": false, + "type": "", + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 167, + "cookies": false, + "type": "", + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 163, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "tags": [ + "storage" + ], + "description": "Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 162, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-preview.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "schema": { + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center" + }, + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "x-example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0 + }, + "in": "query" + }, + { + "name": "background", + "description": "Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "x-example": "jpg", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "" + }, + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 164, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-view.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb": { + "get": { + "summary": "List databases", + "operationId": "tablesDBList", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "tablesdb", + "weight": 376, + "cookies": false, + "type": "", + "demo": "tablesdb\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "tablesDBCreate", + "tags": [ + "tablesDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "tablesdb", + "weight": 372, + "cookies": false, + "type": "", + "demo": "tablesdb\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "tablesDBGet", + "tags": [ + "tablesDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tablesdb", + "weight": 373, + "cookies": false, + "type": "", + "demo": "tablesdb\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "tablesDBUpdate", + "tags": [ + "tablesDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tablesdb", + "weight": 374, + "cookies": false, + "type": "", + "demo": "tablesdb\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "tablesDBDelete", + "tags": [ + "tablesDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tablesdb", + "weight": 375, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables": { + "get": { + "summary": "List tables", + "operationId": "tablesDBListTables", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Tables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/tableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTables", + "group": "tables", + "weight": 383, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-tables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-tables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create table", + "operationId": "tablesDBCreateTable", + "tags": [ + "tablesDB" + ], + "description": "Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTable", + "group": "tables", + "weight": 379, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "tableId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TABLE_ID>" + }, + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "tableId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}": { + "get": { + "summary": "Get table", + "operationId": "tablesDBGetTable", + "tags": [ + "tablesDB" + ], + "description": "Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTable", + "group": "tables", + "weight": 380, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update table", + "operationId": "tablesDBUpdateTable", + "tags": [ + "tablesDB" + ], + "description": "Update a table by its unique ID.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTable", + "group": "tables", + "weight": 381, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete table", + "operationId": "tablesDBDeleteTable", + "tags": [ + "tablesDB" + ], + "description": "Delete a table by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTable", + "group": "tables", + "weight": 382, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns": { + "get": { + "summary": "List columns", + "operationId": "tablesDBListColumns", + "tags": [ + "tablesDB" + ], + "description": "List columns in the table.", + "responses": { + "200": { + "description": "Columns List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listColumns", + "group": "columns", + "weight": 388, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-columns.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-columns.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean": { + "post": { + "summary": "Create boolean column", + "operationId": "tablesDBCreateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a boolean column.\n", + "responses": { + "202": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBooleanColumn", + "group": "columns", + "weight": 389, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean\/{key}": { + "patch": { + "summary": "Update boolean column", + "operationId": "tablesDBUpdateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a boolean column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBooleanColumn", + "group": "columns", + "weight": 390, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime": { + "post": { + "summary": "Create datetime column", + "operationId": "tablesDBCreateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a date time column according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDatetimeColumn", + "group": "columns", + "weight": 391, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime column", + "operationId": "tablesDBUpdateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a date time column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDatetimeColumn", + "group": "columns", + "weight": 392, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email": { + "post": { + "summary": "Create email column", + "operationId": "tablesDBCreateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an email column.\n", + "responses": { + "202": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailColumn", + "group": "columns", + "weight": 393, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email\/{key}": { + "patch": { + "summary": "Update email column", + "operationId": "tablesDBUpdateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an email column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailColumn", + "group": "columns", + "weight": 394, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum": { + "post": { + "summary": "Create enum column", + "operationId": "tablesDBCreateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column.", + "responses": { + "202": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEnumColumn", + "group": "columns", + "weight": 395, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum\/{key}": { + "patch": { + "summary": "Update enum column", + "operationId": "tablesDBUpdateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an enum column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEnumColumn", + "group": "columns", + "weight": 396, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float": { + "post": { + "summary": "Create float column", + "operationId": "tablesDBCreateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a float column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFloatColumn", + "group": "columns", + "weight": 397, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float\/{key}": { + "patch": { + "summary": "Update float column", + "operationId": "tablesDBUpdateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a float column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFloatColumn", + "group": "columns", + "weight": 398, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer": { + "post": { + "summary": "Create integer column", + "operationId": "tablesDBCreateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an integer column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIntegerColumn", + "group": "columns", + "weight": 399, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer\/{key}": { + "patch": { + "summary": "Update integer column", + "operationId": "tablesDBUpdateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an integer column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIntegerColumn", + "group": "columns", + "weight": 400, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip": { + "post": { + "summary": "Create IP address column", + "operationId": "tablesDBCreateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Create IP address column.\n", + "responses": { + "202": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIpColumn", + "group": "columns", + "weight": 401, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip\/{key}": { + "patch": { + "summary": "Update IP address column", + "operationId": "tablesDBUpdateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an ip column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIpColumn", + "group": "columns", + "weight": 402, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line column.", + "responses": { + "202": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 403, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 404, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point column.", + "responses": { + "202": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 405, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 406, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon column.", + "responses": { + "202": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 407, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { + "post": { + "summary": "Create relationship column", + "operationId": "tablesDBCreateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Create relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "202": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRelationshipColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedTableId": { + "type": "string", + "description": "Related Table ID.", + "x-example": "<RELATED_TABLE_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "x-example": false + }, + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Column Key.", + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedTableId", + "type" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string": { + "post": { + "summary": "Create string column", + "operationId": "tablesDBCreateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a string column.\n", + "responses": { + "202": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createStringColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "size": { + "type": "integer", + "description": "Column size for text columns, in number of characters.", + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string\/{key}": { + "patch": { + "summary": "Update string column", + "operationId": "tablesDBUpdateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a string column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStringColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string column.", + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url": { + "post": { + "summary": "Create URL column", + "operationId": "tablesDBCreateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a URL column.\n", + "responses": { + "202": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createUrlColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url\/{key}": { + "patch": { + "summary": "Update URL column", + "operationId": "tablesDBUpdateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an url column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateUrlColumn", + "group": "columns", + "weight": 414, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}": { + "get": { + "summary": "Get column", + "operationId": "tablesDBGetColumn", + "tags": [ + "tablesDB" + ], + "description": "Get column by ID.", + "responses": { + "200": { + "description": "ColumnBoolean, or ColumnInteger, or ColumnFloat, or ColumnEmail, or ColumnEnum, or ColumnURL, or ColumnIP, or ColumnDatetime, or ColumnRelationship, or ColumnString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getColumn", + "group": "columns", + "weight": 386, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete column", + "operationId": "tablesDBDeleteColumn", + "tags": [ + "tablesDB" + ], + "description": "Deletes a column.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteColumn", + "group": "columns", + "weight": 387, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}\/relationship": { + "patch": { + "summary": "Update relationship column", + "operationId": "tablesDBUpdateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Update relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "200": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRelationshipColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "tablesDBListIndexes", + "tags": [ + "tablesDB" + ], + "description": "List indexes on the table.", + "responses": { + "200": { + "description": "Column Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndexList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 418, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "tablesDBCreateIndex", + "tags": [ + "tablesDB" + ], + "description": "Creates an index on the columns listed. Your index should include all the columns you will query in a single request.\nType can be `key`, `fulltext`, or `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 415, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "columns": { + "type": "array", + "description": "Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "columns" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "tablesDBGetIndex", + "tags": [ + "tablesDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 416, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "tablesDBDeleteIndex", + "tags": [ + "tablesDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 417, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + }, + { + "name": "createRows", + "namespace": "tablesDB", + "desc": "Create rows", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-rows.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<ROW_ID>" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Upsert rows", + "operationId": "tablesDBUpsertRows", + "tags": [ + "tablesDB" + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRows", + "group": "rows", + "weight": 424, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRows", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "demo": "tablesdb\/upsert-rows.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "description": "Array of row data as JSON objects. May contain partial rows.", + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "rows" + ] + } + } + } + } + }, + "patch": { + "summary": "Update rows", + "operationId": "tablesDBUpdateRows", + "tags": [ + "tablesDB" + ], + "description": "Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRows", + "group": "rows", + "weight": 422, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only column and value pairs to be updated.", + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete rows", + "operationId": "tablesDBDeleteRows", + "tags": [ + "tablesDB" + ], + "description": "Bulk delete rows using queries, if no queries are passed then all rows are deleted.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRows", + "group": "rows", + "weight": 426, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-rows.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/teamList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 171, + "cookies": false, + "type": "", + "demo": "teams\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 170, + "cookies": false, + "type": "", + "demo": "teams\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TEAM_ID>" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 172, + "cookies": false, + "type": "", + "demo": "teams\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 174, + "cookies": false, + "type": "", + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 176, + "cookies": false, + "type": "", + "demo": "teams\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 178, + "cookies": false, + "type": "", + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 177, + "cookies": false, + "type": "", + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 179, + "cookies": false, + "type": "", + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 180, + "cookies": false, + "type": "", + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "tags": [ + "teams" + ], + "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 182, + "cookies": false, + "type": "", + "demo": "teams\/delete-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 181, + "cookies": false, + "type": "", + "demo": "teams\/update-membership-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 173, + "cookies": false, + "type": "", + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 175, + "cookies": false, + "type": "", + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "files", + "weight": 507, + "cookies": false, + "type": "", + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFileToken", + "group": "files", + "weight": 505, + "cookies": false, + "type": "", + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "x-example": null, + "x-nullable": true + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tokens", + "weight": 506, + "cookies": false, + "type": "", + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tokens", + "weight": 508, + "cookies": false, + "type": "", + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "x-example": null, + "x-nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tokens", + "weight": 509, + "cookies": false, + "type": "", + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users": { + "get": { + "summary": "List users", + "operationId": "usersList", + "tags": [ + "users" + ], + "description": "Get a list of all the project's users. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Users List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/userList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "users", + "weight": 193, + "cookies": false, + "type": "", + "demo": "users\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user", + "operationId": "usersCreate", + "tags": [ + "users" + ], + "description": "Create a new user.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "users", + "weight": 184, + "cookies": false, + "type": "", + "demo": "users\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "Plain text user password. Must be at least 8 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId" + ] + } + } + } + } + } + }, + "\/users\/argon2": { + "post": { + "summary": "Create user with Argon2 password", + "operationId": "usersCreateArgon2User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createArgon2User", + "group": "users", + "weight": 187, + "cookies": false, + "type": "", + "demo": "users\/create-argon-2-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Argon2.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/bcrypt": { + "post": { + "summary": "Create user with bcrypt password", + "operationId": "usersCreateBcryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBcryptUser", + "group": "users", + "weight": 185, + "cookies": false, + "type": "", + "demo": "users\/create-bcrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Bcrypt.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/identities": { + "get": { + "summary": "List identities", + "operationId": "usersListIdentities", + "tags": [ + "users" + ], + "description": "Get identities for all users.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 201, + "cookies": false, + "type": "", + "demo": "users\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/users\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "usersDeleteIdentity", + "tags": [ + "users" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 224, + "cookies": false, + "type": "", + "demo": "users\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<IDENTITY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/md5": { + "post": { + "summary": "Create user with MD5 password", + "operationId": "usersCreateMD5User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMD5User", + "group": "users", + "weight": 186, + "cookies": false, + "type": "", + "demo": "users\/create-md-5-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using MD5.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/phpass": { + "post": { + "summary": "Create user with PHPass password", + "operationId": "usersCreatePHPassUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPHPassUser", + "group": "users", + "weight": 189, + "cookies": false, + "type": "", + "demo": "users\/create-ph-pass-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using PHPass.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/scrypt": { + "post": { + "summary": "Create user with Scrypt password", + "operationId": "usersCreateScryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createScryptUser", + "group": "users", + "weight": 190, + "cookies": false, + "type": "", + "demo": "users\/create-scrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt.", + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Optional salt used to hash password.", + "x-example": "<PASSWORD_SALT>" + }, + "passwordCpu": { + "type": "integer", + "description": "Optional CPU cost used to hash password.", + "x-example": null + }, + "passwordMemory": { + "type": "integer", + "description": "Optional memory cost used to hash password.", + "x-example": null + }, + "passwordParallel": { + "type": "integer", + "description": "Optional parallelization cost used to hash password.", + "x-example": null + }, + "passwordLength": { + "type": "integer", + "description": "Optional hash length used to hash password.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordCpu", + "passwordMemory", + "passwordParallel", + "passwordLength" + ] + } + } + } + } + } + }, + "\/users\/scrypt-modified": { + "post": { + "summary": "Create user with Scrypt modified password", + "operationId": "usersCreateScryptModifiedUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createScryptModifiedUser", + "group": "users", + "weight": 191, + "cookies": false, + "type": "", + "demo": "users\/create-scrypt-modified-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt Modified.", + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Salt used to hash password.", + "x-example": "<PASSWORD_SALT>" + }, + "passwordSaltSeparator": { + "type": "string", + "description": "Salt separator used to hash password.", + "x-example": "<PASSWORD_SALT_SEPARATOR>" + }, + "passwordSignerKey": { + "type": "string", + "description": "Signer key used to hash password.", + "x-example": "<PASSWORD_SIGNER_KEY>" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordSaltSeparator", + "passwordSignerKey" + ] + } + } + } + } + } + }, + "\/users\/sha": { + "post": { + "summary": "Create user with SHA password", + "operationId": "usersCreateSHAUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSHAUser", + "group": "users", + "weight": 188, + "cookies": false, + "type": "", + "demo": "users\/create-sha-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using SHA.", + "x-example": "password" + }, + "passwordVersion": { + "type": "string", + "description": "Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'", + "x-example": "sha1", + "enum": [ + "sha1", + "sha224", + "sha256", + "sha384", + "sha512\/224", + "sha512\/256", + "sha512", + "sha3-224", + "sha3-256", + "sha3-384", + "sha3-512" + ], + "x-enum-name": "PasswordHash", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/{userId}": { + "get": { + "summary": "Get user", + "operationId": "usersGet", + "tags": [ + "users" + ], + "description": "Get a user by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "users", + "weight": 194, + "cookies": false, + "type": "", + "demo": "users\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user", + "operationId": "usersDelete", + "tags": [ + "users" + ], + "description": "Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https:\/\/appwrite.io\/docs\/server\/users#usersUpdateStatus) endpoint instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "users", + "weight": 222, + "cookies": false, + "type": "", + "demo": "users\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/email": { + "patch": { + "summary": "Update email", + "operationId": "usersUpdateEmail", + "tags": [ + "users" + ], + "description": "Update the user email by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "users", + "weight": 207, + "cookies": false, + "type": "", + "demo": "users\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + } + }, + "required": [ + "email" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/jwts": { + "post": { + "summary": "Create user JWT", + "operationId": "usersCreateJWT", + "tags": [ + "users" + ], + "description": "Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "sessions", + "weight": 225, + "cookies": false, + "type": "", + "demo": "users\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "sessionId": { + "type": "string", + "description": "Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.", + "x-example": "<SESSION_ID>" + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "x-example": 0 + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/labels": { + "put": { + "summary": "Update user labels", + "operationId": "usersUpdateLabels", + "tags": [ + "users" + ], + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLabels", + "group": "users", + "weight": 203, + "cookies": false, + "type": "", + "demo": "users\/update-labels.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "labels": { + "type": "array", + "description": "Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/logs": { + "get": { + "summary": "List user logs", + "operationId": "usersListLogs", + "tags": [ + "users" + ], + "description": "Get the user activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 199, + "cookies": false, + "type": "", + "demo": "users\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/memberships": { + "get": { + "summary": "List user memberships", + "operationId": "usersListMemberships", + "tags": [ + "users" + ], + "description": "Get the user membership list by its unique ID.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 198, + "cookies": false, + "type": "", + "demo": "users\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfa", + "group": "users", + "weight": 212, + "cookies": false, + "type": "", + "demo": "users\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + }, + "methods": [ + { + "name": "updateMfa", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + } + }, + { + "name": "updateMFA", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 217, + "cookies": false, + "type": "", + "demo": "users\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 213, + "cookies": false, + "type": "", + "demo": "users\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 214, + "cookies": false, + "type": "", + "demo": "users\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 216, + "cookies": false, + "type": "", + "demo": "users\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 215, + "cookies": false, + "type": "", + "demo": "users\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/name": { + "patch": { + "summary": "Update name", + "operationId": "usersUpdateName", + "tags": [ + "users" + ], + "description": "Update the user name by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "users", + "weight": 205, + "cookies": false, + "type": "", + "demo": "users\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/password": { + "patch": { + "summary": "Update password", + "operationId": "usersUpdatePassword", + "tags": [ + "users" + ], + "description": "Update the user password by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePassword", + "group": "users", + "weight": 206, + "cookies": false, + "type": "", + "demo": "users\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "x-example": null + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "usersUpdatePhone", + "tags": [ + "users" + ], + "description": "Update the user phone by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhone", + "group": "users", + "weight": 208, + "cookies": false, + "type": "", + "demo": "users\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "User phone number.", + "x-example": "+12065550100" + } + }, + "required": [ + "number" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/prefs": { + "get": { + "summary": "Get user preferences", + "operationId": "usersGetPrefs", + "tags": [ + "users" + ], + "description": "Get the user preferences by its unique ID.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "users", + "weight": 195, + "cookies": false, + "type": "", + "demo": "users\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user preferences", + "operationId": "usersUpdatePrefs", + "tags": [ + "users" + ], + "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "users", + "weight": 210, + "cookies": false, + "type": "", + "demo": "users\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/sessions": { + "get": { + "summary": "List user sessions", + "operationId": "usersListSessions", + "tags": [ + "users" + ], + "description": "Get the user sessions list by its unique ID.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 197, + "cookies": false, + "type": "", + "demo": "users\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create session", + "operationId": "usersCreateSession", + "tags": [ + "users" + ], + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 218, + "cookies": false, + "type": "", + "demo": "users\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user sessions", + "operationId": "usersDeleteSessions", + "tags": [ + "users" + ], + "description": "Delete all user's sessions by using the user's unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 221, + "cookies": false, + "type": "", + "demo": "users\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/sessions\/{sessionId}": { + "delete": { + "summary": "Delete user session", + "operationId": "usersDeleteSession", + "tags": [ + "users" + ], + "description": "Delete a user sessions by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 220, + "cookies": false, + "type": "", + "demo": "users\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "sessionId", + "description": "Session ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SESSION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/status": { + "patch": { + "summary": "Update user status", + "operationId": "usersUpdateStatus", + "tags": [ + "users" + ], + "description": "Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStatus", + "group": "users", + "weight": 202, + "cookies": false, + "type": "", + "demo": "users\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets": { + "get": { + "summary": "List user targets", + "operationId": "usersListTargets", + "tags": [ + "users" + ], + "description": "List the messaging targets that are associated with a user.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTargets", + "group": "targets", + "weight": 200, + "cookies": false, + "type": "", + "demo": "users\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user target", + "operationId": "usersCreateTarget", + "tags": [ + "users" + ], + "description": "Create a messaging target.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTarget", + "group": "targets", + "weight": 192, + "cookies": false, + "type": "", + "demo": "users\/create-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TARGET_ID>" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email", + "enum": [ + "email", + "sms", + "push" + ], + "x-enum-name": "MessagingProviderType", + "x-enum-keys": [] + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "x-example": "<NAME>" + } + }, + "required": [ + "targetId", + "providerType", + "identifier" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets\/{targetId}": { + "get": { + "summary": "Get user target", + "operationId": "usersGetTarget", + "tags": [ + "users" + ], + "description": "Get a user's push notification target by ID.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTarget", + "group": "targets", + "weight": 196, + "cookies": false, + "type": "", + "demo": "users\/get-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user target", + "operationId": "usersUpdateTarget", + "tags": [ + "users" + ], + "description": "Update a messaging target.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTarget", + "group": "targets", + "weight": 211, + "cookies": false, + "type": "", + "demo": "users\/update-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "x-example": "<NAME>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete user target", + "operationId": "usersDeleteTarget", + "tags": [ + "users" + ], + "description": "Delete a messaging target.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTarget", + "group": "targets", + "weight": 223, + "cookies": false, + "type": "", + "demo": "users\/delete-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/tokens": { + "post": { + "summary": "Create token", + "operationId": "usersCreateToken", + "tags": [ + "users" + ], + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createToken", + "group": "sessions", + "weight": 219, + "cookies": false, + "type": "", + "demo": "users\/create-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "length": { + "type": "integer", + "description": "Token length in characters. The default length is 6 characters", + "x-example": 4 + }, + "expire": { + "type": "integer", + "description": "Token expiration period in seconds. The default expiration is 15 minutes.", + "x-example": 60 + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/verification": { + "patch": { + "summary": "Update email verification", + "operationId": "usersUpdateEmailVerification", + "tags": [ + "users" + ], + "description": "Update the user email verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailVerification", + "group": "users", + "weight": 209, + "cookies": false, + "type": "", + "demo": "users\/update-email-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "emailVerification": { + "type": "boolean", + "description": "User email verification status.", + "x-example": false + } + }, + "required": [ + "emailVerification" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/verification\/phone": { + "patch": { + "summary": "Update phone verification", + "operationId": "usersUpdatePhoneVerification", + "tags": [ + "users" + ], + "description": "Update the user phone verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "users", + "weight": 204, + "cookies": false, + "type": "", + "demo": "users\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phoneVerification": { + "type": "boolean", + "description": "User phone verification status.", + "x-example": false + } + }, + "required": [ + "phoneVerification" + ] + } + } + } + } + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "components": { + "schemas": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true, + "example": [] + }, + "error": { + "description": "Error", + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Error message.", + "x-example": "Not found" + }, + "code": { + "type": "string", + "description": "Error code.", + "x-example": "404" + }, + "type": { + "type": "string", + "description": "Error type. You can learn more about all the error types at https:\/\/appwrite.io\/docs\/error-codes#errorTypes", + "x-example": "not_found" + }, + "version": { + "type": "string", + "description": "Server version number.", + "x-example": "1.0" + } + }, + "required": [ + "message", + "code", + "type", + "version" + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "$ref": "#\/components\/schemas\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "$ref": "#\/components\/schemas\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ], + "example": { + "total": 5, + "documents": "" + } + }, + "tableList": { + "description": "Tables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tables": { + "type": "array", + "description": "List of tables.", + "items": { + "$ref": "#\/components\/schemas\/table" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tables" + ], + "example": { + "total": 5, + "tables": "" + } + }, + "collectionList": { + "description": "Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections that matched your query.", + "x-example": 5, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "$ref": "#\/components\/schemas\/collection" + }, + "x-example": "" + } + }, + "required": [ + "total", + "collections" + ], + "example": { + "total": 5, + "collections": "" + } + }, + "databaseList": { + "description": "Databases List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of databases that matched your query.", + "x-example": 5, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "List of databases.", + "items": { + "$ref": "#\/components\/schemas\/database" + }, + "x-example": "" + } + }, + "required": [ + "total", + "databases" + ], + "example": { + "total": 5, + "databases": "" + } + }, + "indexList": { + "description": "Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "columnIndexList": { + "description": "Column Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "userList": { + "description": "Users List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of users that matched your query.", + "x-example": 5, + "format": "int32" + }, + "users": { + "type": "array", + "description": "List of users.", + "items": { + "$ref": "#\/components\/schemas\/user" + }, + "x-example": "" + } + }, + "required": [ + "total", + "users" + ], + "example": { + "total": 5, + "users": "" + } + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "$ref": "#\/components\/schemas\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ], + "example": { + "total": 5, + "sessions": "" + } + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "$ref": "#\/components\/schemas\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ], + "example": { + "total": 5, + "identities": "" + } + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "$ref": "#\/components\/schemas\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ], + "example": { + "total": 5, + "logs": "" + } + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "$ref": "#\/components\/schemas\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ], + "example": { + "total": 5, + "files": "" + } + }, + "bucketList": { + "description": "Buckets List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of buckets that matched your query.", + "x-example": 5, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "List of buckets.", + "items": { + "$ref": "#\/components\/schemas\/bucket" + }, + "x-example": "" + } + }, + "required": [ + "total", + "buckets" + ], + "example": { + "total": 5, + "buckets": "" + } + }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ], + "example": { + "total": 5, + "tokens": "" + } + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "$ref": "#\/components\/schemas\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ], + "example": { + "total": 5, + "teams": "" + } + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "$ref": "#\/components\/schemas\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ], + "example": { + "total": 5, + "memberships": "" + } + }, + "siteList": { + "description": "Sites List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sites that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "List of sites.", + "items": { + "$ref": "#\/components\/schemas\/site" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sites" + ], + "example": { + "total": 5, + "sites": "" + } + }, + "functionList": { + "description": "Functions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of functions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "List of functions.", + "items": { + "$ref": "#\/components\/schemas\/function" + }, + "x-example": "" + } + }, + "required": [ + "total", + "functions" + ], + "example": { + "total": 5, + "functions": "" + } + }, + "frameworkList": { + "description": "Frameworks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworks that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks.", + "items": { + "$ref": "#\/components\/schemas\/framework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworks" + ], + "example": { + "total": 5, + "frameworks": "" + } + }, + "runtimeList": { + "description": "Runtimes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes.", + "items": { + "$ref": "#\/components\/schemas\/runtime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimes" + ], + "example": { + "total": 5, + "runtimes": "" + } + }, + "deploymentList": { + "description": "Deployments List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of deployments that matched your query.", + "x-example": 5, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "List of deployments.", + "items": { + "$ref": "#\/components\/schemas\/deployment" + }, + "x-example": "" + } + }, + "required": [ + "total", + "deployments" + ], + "example": { + "total": 5, + "deployments": "" + } + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "$ref": "#\/components\/schemas\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ], + "example": { + "total": 5, + "executions": "" + } + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "$ref": "#\/components\/schemas\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ], + "example": { + "total": 5, + "countries": "" + } + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "$ref": "#\/components\/schemas\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ], + "example": { + "total": 5, + "continents": "" + } + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "$ref": "#\/components\/schemas\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ], + "example": { + "total": 5, + "languages": "" + } + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "$ref": "#\/components\/schemas\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ], + "example": { + "total": 5, + "currencies": "" + } + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "$ref": "#\/components\/schemas\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ], + "example": { + "total": 5, + "phones": "" + } + }, + "variableList": { + "description": "Variables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of variables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "variables": { + "type": "array", + "description": "List of variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": "" + } + }, + "required": [ + "total", + "variables" + ], + "example": { + "total": 5, + "variables": "" + } + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "$ref": "#\/components\/schemas\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ], + "example": { + "total": 5, + "localeCodes": "" + } + }, + "providerList": { + "description": "Provider list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of providers that matched your query.", + "x-example": 5, + "format": "int32" + }, + "providers": { + "type": "array", + "description": "List of providers.", + "items": { + "$ref": "#\/components\/schemas\/provider" + }, + "x-example": "" + } + }, + "required": [ + "total", + "providers" + ], + "example": { + "total": 5, + "providers": "" + } + }, + "messageList": { + "description": "Message list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of messages that matched your query.", + "x-example": 5, + "format": "int32" + }, + "messages": { + "type": "array", + "description": "List of messages.", + "items": { + "$ref": "#\/components\/schemas\/message" + }, + "x-example": "" + } + }, + "required": [ + "total", + "messages" + ], + "example": { + "total": 5, + "messages": "" + } + }, + "topicList": { + "description": "Topic list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of topics that matched your query.", + "x-example": 5, + "format": "int32" + }, + "topics": { + "type": "array", + "description": "List of topics.", + "items": { + "$ref": "#\/components\/schemas\/topic" + }, + "x-example": "" + } + }, + "required": [ + "total", + "topics" + ], + "example": { + "total": 5, + "topics": "" + } + }, + "subscriberList": { + "description": "Subscriber list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of subscribers that matched your query.", + "x-example": 5, + "format": "int32" + }, + "subscribers": { + "type": "array", + "description": "List of subscribers.", + "items": { + "$ref": "#\/components\/schemas\/subscriber" + }, + "x-example": "" + } + }, + "required": [ + "total", + "subscribers" + ], + "example": { + "total": 5, + "subscribers": "" + } + }, + "targetList": { + "description": "Target list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of targets that matched your query.", + "x-example": 5, + "format": "int32" + }, + "targets": { + "type": "array", + "description": "List of targets.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "x-example": "" + } + }, + "required": [ + "total", + "targets" + ], + "example": { + "total": 5, + "targets": "" + } + }, + "specificationList": { + "description": "Specifications List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of specifications that matched your query.", + "x-example": 5, + "format": "int32" + }, + "specifications": { + "type": "array", + "description": "List of specifications.", + "items": { + "$ref": "#\/components\/schemas\/specification" + }, + "x-example": "" + } + }, + "required": [ + "total", + "specifications" + ], + "example": { + "total": 5, + "specifications": "" + } + }, + "database": { + "description": "Database", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Database name.", + "x-example": "My Database" + }, + "$createdAt": { + "type": "string", + "description": "Database creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Database update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "enabled": { + "type": "boolean", + "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "type": { + "type": "string", + "description": "Database type.", + "x-example": "legacy" + } + }, + "required": [ + "$id", + "name", + "$createdAt", + "$updatedAt", + "enabled", + "type" + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false, + "type": "legacy" + } + }, + "collection": { + "description": "Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "x-example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } + }, + "attributeList": { + "description": "Attributes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of attributes in the given collection.", + "x-example": 5, + "format": "int32" + }, + "attributes": { + "type": "array", + "description": "List of attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "attributes" + ], + "example": { + "total": 5, + "attributes": "" + } + }, + "attributeString": { + "description": "AttributeString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "attributeInteger": { + "description": "AttributeInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 10, + "format": "int32", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "attributeFloat": { + "description": "AttributeFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 2.5, + "format": "double", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "attributeBoolean": { + "description": "AttributeBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "attributeEmail": { + "description": "AttributeEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "attributeEnum": { + "description": "AttributeEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "attributeIp": { + "description": "AttributeIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "attributeUrl": { + "description": "AttributeURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "http:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } + }, + "attributeDatetime": { + "description": "AttributeDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "attributeRelationship": { + "description": "AttributeRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedCollection": { + "type": "string", + "description": "The ID of the related collection.", + "x-example": "collection" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedCollection", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + 0, + 0 + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "table": { + "description": "Table", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Table creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Table update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Table permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Table name.", + "x-example": "My Table" + }, + "enabled": { + "type": "boolean", + "description": "Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "rowSecurity": { + "type": "boolean", + "description": "Whether row-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "columns": { + "type": "array", + "description": "Table columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Table indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "rowSecurity", + "columns", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Table", + "enabled": false, + "rowSecurity": true, + "columns": {}, + "indexes": {} + } + }, + "columnList": { + "description": "Columns List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of columns in the given table.", + "x-example": 5, + "format": "int32" + }, + "columns": { + "type": "array", + "description": "List of columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "columns" + ], + "example": { + "total": 5, + "columns": "" + } + }, + "columnString": { + "description": "ColumnString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnInteger": { + "description": "ColumnInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 10, + "format": "int32", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnFloat": { + "description": "ColumnFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 2.5, + "format": "double", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "columnBoolean": { + "description": "ColumnBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "columnEmail": { + "description": "ColumnEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "columnEnum": { + "description": "ColumnEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "columnIp": { + "description": "ColumnIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "columnUrl": { + "description": "ColumnURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "https:\/\/example.com" + } + }, + "columnDatetime": { + "description": "ColumnDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "columnRelationship": { + "description": "ColumnRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedTable": { + "type": "string", + "description": "The ID of the related table.", + "x-example": "table" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedTable", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedTable": "table", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + 0, + 0 + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "index": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "attributes": { + "type": "array", + "description": "Index attributes.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index attributes length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "attributes", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [] + } + }, + "columnIndex": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "columns": { + "type": "array", + "description": "Index columns.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index columns length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "columns", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "columns": [], + "lengths": [], + "orders": [] + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/algoArgon2" + }, + { + "$ref": "#\/components\/schemas\/algoScrypt" + }, + { + "$ref": "#\/components\/schemas\/algoScryptModified" + }, + { + "$ref": "#\/components\/schemas\/algoBcrypt" + }, + { + "$ref": "#\/components\/schemas\/algoPhpass" + }, + { + "$ref": "#\/components\/schemas\/algoSha" + }, + { + "$ref": "#\/components\/schemas\/algoMd5" + } + ] + }, + "nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ], + "example": { + "type": "md5" + } + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ], + "example": { + "type": "sha" + } + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ], + "example": { + "type": "phpass" + } + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ], + "example": { + "type": "bcrypt" + } + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "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.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "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.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ], + "example": { + "code": "en-us", + "name": "US" + } + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } + }, + "bucket": { + "description": "Bucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Bucket creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Bucket update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Bucket permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "fileSecurity": { + "type": "boolean", + "description": "Whether file-level security is enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "name": { + "type": "string", + "description": "Bucket name.", + "x-example": "Documents" + }, + "enabled": { + "type": "boolean", + "description": "Bucket enabled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size supported.", + "x-example": 100, + "format": "int32" + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions.", + "items": { + "type": "string" + }, + "x-example": [ + "jpg", + "png" + ] + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" + }, + "encryption": { + "type": "boolean", + "description": "Bucket is encrypted.", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Virus scanning is enabled.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "fileSecurity", + "name", + "enabled", + "maximumFileSize", + "allowedFileExtensions", + "compression", + "encryption", + "antivirus" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } + }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "files" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceType", + "expire", + "secret", + "accessedAt" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } + }, + "site": { + "description": "Site", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Site ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Site creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Site update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Site name.", + "x-example": "My Site" + }, + "enabled": { + "type": "boolean", + "description": "Site enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "framework": { + "type": "string", + "description": "Site framework.", + "x-example": "react" + }, + "deploymentId": { + "type": "string", + "description": "Site's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "deploymentScreenshotLight": { + "type": "string", + "description": "Screenshot of active deployment with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentScreenshotDark": { + "type": "string", + "description": "Screenshot of active deployment with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentId": { + "type": "string", + "description": "Site's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "vars": { + "type": "array", + "description": "Site variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": [] + }, + "timeout": { + "type": "integer", + "description": "Site request timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the site dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the site.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The directory where the site build output is located.", + "x-example": "build" + }, + "installationId": { + "type": "string", + "description": "Site VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": "sites\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + }, + "buildRuntime": { + "type": "string", + "description": "Site build runtime.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework adapter.", + "x-example": "static" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "enabled", + "live", + "logging", + "framework", + "deploymentId", + "deploymentCreatedAt", + "deploymentScreenshotLight", + "deploymentScreenshotDark", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "vars", + "timeout", + "installCommand", + "buildCommand", + "outputDirectory", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification", + "buildRuntime", + "adapter", + "fallbackFile" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } + }, + "function": { + "description": "Function", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "execute": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + }, + "name": { + "type": "string", + "description": "Function name.", + "x-example": "My Function" + }, + "enabled": { + "type": "boolean", + "description": "Function enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "runtime": { + "type": "string", + "description": "Function execution and build runtime.", + "x-example": "python-3.8" + }, + "deploymentId": { + "type": "string", + "description": "Function's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentId": { + "type": "string", + "description": "Function's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "vars": { + "type": "array", + "description": "Function variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": [] + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "schedule": { + "type": "string", + "description": "Function execution schedule in CRON format.", + "x-example": "5 4 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "version": { + "type": "string", + "description": "Version of Open Runtimes used for the function.", + "x-example": "v2" + }, + "installationId": { + "type": "string", + "description": "Function VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "functions\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "execute", + "name", + "enabled", + "live", + "logging", + "runtime", + "deploymentId", + "deploymentCreatedAt", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "events", + "schedule", + "timeout", + "entrypoint", + "commands", + "version", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } + }, + "runtime": { + "description": "Runtime", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Runtime ID.", + "x-example": "python-3.8" + }, + "key": { + "type": "string", + "description": "Parent runtime key.", + "x-example": "python" + }, + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "Python" + }, + "version": { + "type": "string", + "description": "Runtime version.", + "x-example": "3.8" + }, + "base": { + "type": "string", + "description": "Base Docker image used to build the runtime.", + "x-example": "python:3.8-alpine" + }, + "image": { + "type": "string", + "description": "Image name of Docker Hub.", + "x-example": "appwrite\\\/runtime-for-python:3.8" + }, + "logo": { + "type": "string", + "description": "Name of the logo image.", + "x-example": "python.png" + }, + "supports": { + "type": "array", + "description": "List of supported architectures.", + "items": { + "type": "string" + }, + "x-example": "amd64" + } + }, + "required": [ + "$id", + "key", + "name", + "version", + "base", + "image", + "logo", + "supports" + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } + }, + "framework": { + "description": "Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, + "runtimes": { + "type": "array", + "description": "List of supported runtime versions.", + "items": { + "type": "string" + }, + "x-example": [ + "static-1", + "node-22" + ] + }, + "adapters": { + "type": "array", + "description": "List of supported adapters.", + "items": { + "$ref": "#\/components\/schemas\/frameworkAdapter" + }, + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "buildRuntime", + "runtimes", + "adapters" + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Adapter key.", + "x-example": "static" + }, + "installCommand": { + "type": "string", + "description": "Default command to download dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Default command to build site into output directory.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Default output directory of build.", + "x-example": ".\/dist" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "installCommand", + "buildCommand", + "outputDirectory", + "fallbackFile" + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } + }, + "deployment": { + "description": "Deployment", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Deployment update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "type": { + "type": "string", + "description": "Type of deployment.", + "x-example": "vcs" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea6g16897e" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "functions" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file to use to execute the deployment code.", + "x-example": "index.js" + }, + "sourceSize": { + "type": "integer", + "description": "The code size in bytes.", + "x-example": 128, + "format": "int32" + }, + "buildSize": { + "type": "integer", + "description": "The build output size in bytes.", + "x-example": 128, + "format": "int32" + }, + "totalSize": { + "type": "integer", + "description": "The total size in bytes (source and build output).", + "x-example": 128, + "format": "int32" + }, + "buildId": { + "type": "string", + "description": "The current build ID.", + "x-example": "5e5ea5c16897e" + }, + "activate": { + "type": "boolean", + "description": "Whether the deployment should be automatically activated.", + "x-example": true + }, + "screenshotLight": { + "type": "string", + "description": "Screenshot with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "screenshotDark": { + "type": "string", + "description": "Screenshot with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "status": { + "type": "string", + "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] + }, + "buildLogs": { + "type": "string", + "description": "The build logs.", + "x-example": "Compiling source files..." + }, + "buildDuration": { + "type": "integer", + "description": "The current build time in seconds.", + "x-example": 128, + "format": "int32" + }, + "providerRepositoryName": { + "type": "string", + "description": "The name of the vcs provider repository", + "x-example": "database" + }, + "providerRepositoryOwner": { + "type": "string", + "description": "The name of the vcs provider repository owner", + "x-example": "utopia" + }, + "providerRepositoryUrl": { + "type": "string", + "description": "The url of the vcs provider repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" + }, + "providerCommitHash": { + "type": "string", + "description": "The commit hash of the vcs commit", + "x-example": "7c3f25d" + }, + "providerCommitAuthorUrl": { + "type": "string", + "description": "The url of vcs commit author", + "x-example": "https:\/\/github.com\/vermakhushboo" + }, + "providerCommitAuthor": { + "type": "string", + "description": "The name of vcs commit author", + "x-example": "Khushboo Verma" + }, + "providerCommitMessage": { + "type": "string", + "description": "The commit message", + "x-example": "Update index.js" + }, + "providerCommitUrl": { + "type": "string", + "description": "The url of the vcs commit", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" + }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, + "providerBranchUrl": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "type", + "resourceId", + "resourceType", + "entrypoint", + "sourceSize", + "buildSize", + "totalSize", + "buildId", + "activate", + "screenshotLight", + "screenshotDark", + "status", + "buildLogs", + "buildDuration", + "providerRepositoryName", + "providerRepositoryOwner", + "providerRepositoryUrl", + "providerCommitHash", + "providerCommitAuthorUrl", + "providerCommitAuthor", + "providerCommitMessage", + "providerCommitUrl", + "providerBranch", + "providerBranchUrl" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "deploymentId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "variable": { + "description": "Variable", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Variable ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Variable key.", + "x-example": "API_KEY" + }, + "value": { + "type": "string", + "description": "Variable value.", + "x-example": "myPa$$word1" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "resourceType": { + "type": "string", + "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", + "x-example": "function" + }, + "resourceId": { + "type": "string", + "description": "ID of resource to which the variable belongs. If resourceType is \"project\", it is empty. If resourceType is \"function\", it is ID of the function.", + "x-example": "myAwesomeFunction" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "value", + "secret", + "resourceType", + "resourceId" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "United States", + "code": "US" + } + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "Europe", + "code": "EU" + } + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } + }, + "healthAntivirus": { + "description": "Health Antivirus", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Antivirus version.", + "x-example": "1.0.0" + }, + "status": { + "type": "string", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] + } + }, + "required": [ + "version", + "status" + ], + "example": { + "version": "1.0.0", + "status": "online" + } + }, + "healthQueue": { + "description": "Health Queue", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Amount of actions in the queue.", + "x-example": 8, + "format": "int32" + } + }, + "required": [ + "size" + ], + "example": { + "size": 8 + } + }, + "healthStatus": { + "description": "Health Status", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the service.", + "x-example": "database" + }, + "ping": { + "type": "integer", + "description": "Duration in milliseconds how long the health check took.", + "x-example": 128, + "format": "int32" + }, + "status": { + "type": "string", + "description": "Service status. Possible values are: `pass`, `fail`", + "x-example": "pass", + "enum": [ + "pass", + "fail" + ], + "x-enum-name": "HealthCheckStatus" + } + }, + "required": [ + "name", + "ping", + "status" + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } + }, + "healthCertificate": { + "description": "Health Certificate", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Certificate name", + "x-example": "\/CN=www.google.com" + }, + "subjectSN": { + "type": "string", + "description": "Subject SN", + "x-example": "" + }, + "issuerOrganisation": { + "type": "string", + "description": "Issuer organisation", + "x-example": "" + }, + "validFrom": { + "type": "string", + "description": "Valid from", + "x-example": "1704200998" + }, + "validTo": { + "type": "string", + "description": "Valid to", + "x-example": "1711458597" + }, + "signatureTypeSN": { + "type": "string", + "description": "Signature type SN", + "x-example": "RSA-SHA256" + } + }, + "required": [ + "name", + "subjectSN", + "issuerOrganisation", + "validFrom", + "validTo", + "signatureTypeSN" + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } + }, + "healthTime": { + "description": "Health Time", + "type": "object", + "properties": { + "remoteTime": { + "type": "integer", + "description": "Current unix timestamp on trustful remote server.", + "x-example": 1639490751, + "format": "int32" + }, + "localTime": { + "type": "integer", + "description": "Current unix timestamp of local server where Appwrite runs.", + "x-example": 1639490844, + "format": "int32" + }, + "diff": { + "type": "integer", + "description": "Difference of unix remote and local timestamps in milliseconds.", + "x-example": 93, + "format": "int32" + } + }, + "required": [ + "remoteTime", + "localTime", + "diff" + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } + }, + "specification": { + "description": "Specification", + "type": "object", + "properties": { + "memory": { + "type": "integer", + "description": "Memory size in MB.", + "x-example": 512, + "format": "int32" + }, + "cpus": { + "type": "number", + "description": "Number of CPUs.", + "x-example": 1, + "format": "double" + }, + "enabled": { + "type": "boolean", + "description": "Is size enabled.", + "x-example": true + }, + "slug": { + "type": "string", + "description": "Size slug.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "memory", + "cpus", + "enabled", + "slug" + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ], + "example": { + "secret": true, + "uri": true + } + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } + }, + "provider": { + "description": "Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Provider ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Provider creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Provider update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name for the provider instance.", + "x-example": "Mailgun" + }, + "provider": { + "type": "string", + "description": "The name of the provider service.", + "x-example": "mailgun" + }, + "enabled": { + "type": "boolean", + "description": "Is provider enabled?", + "x-example": true + }, + "type": { + "type": "string", + "description": "Type of provider.", + "x-example": "sms" + }, + "credentials": { + "type": "object", + "description": "Provider credentials.", + "x-example": { + "key": "123456789" + } + }, + "options": { + "type": "object", + "description": "Provider options.", + "x-example": { + "from": "sender-email@mydomain" + }, + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "provider", + "enabled", + "type", + "credentials" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } + }, + "message": { + "description": "Message", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Message ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Message creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Message update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerType": { + "type": "string", + "description": "Message provider type.", + "x-example": "email" + }, + "topics": { + "type": "array", + "description": "Topic IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "users": { + "type": "array", + "description": "User IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "targets": { + "type": "array", + "description": "Target IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for message.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveredAt": { + "type": "string", + "description": "The time when the message was delivered.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveryErrors": { + "type": "array", + "description": "Delivery errors if any.", + "items": { + "type": "string" + }, + "x-example": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "nullable": true + }, + "deliveredTotal": { + "type": "integer", + "description": "Number of recipients the message was delivered to.", + "x-example": 1, + "format": "int32" + }, + "data": { + "type": "object", + "description": "Data of the message.", + "x-example": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + } + }, + "status": { + "type": "string", + "description": "Status of delivery.", + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "providerType", + "topics", + "users", + "targets", + "deliveredTotal", + "data", + "status" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } + }, + "topic": { + "description": "Topic", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Topic creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Topic update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name of the topic.", + "x-example": "events" + }, + "emailTotal": { + "type": "integer", + "description": "Total count of email subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "smsTotal": { + "type": "integer", + "description": "Total count of SMS subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "pushTotal": { + "type": "integer", + "description": "Total count of push subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "subscribe": { + "type": "array", + "description": "Subscribe permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "emailTotal", + "smsTotal", + "pushTotal", + "subscribe" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "$ref": "#\/components\/schemas\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } + } + }, + "securitySchemes": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "Key": { + "type": "apiKey", + "name": "X-Appwrite-Key", + "description": "Your secret API key", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_API_KEY>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header" + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Session": { + "type": "apiKey", + "name": "X-Appwrite-Session", + "description": "The user session to authenticate with", + "in": "header" + }, + "ForwardedUserAgent": { + "type": "apiKey", + "name": "X-Forwarded-User-Agent", + "description": "The user agent string of the client that made the request", + "in": "header" + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index abeab8a56f..d57b9f83b2 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.7.0", + "version": "1.8.0", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -44,13 +44,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "account", "weight": 10, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", "rate-limit": 0, @@ -93,13 +93,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "account", "weight": 9, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", "rate-limit": 10, @@ -178,13 +178,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "account", "weight": 35, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", "rate-limit": 0, @@ -254,13 +254,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listIdentities", "group": "identities", "weight": 58, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-identities.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", "rate-limit": 0, @@ -313,13 +313,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteIdentity", "group": "identities", "weight": 59, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-identity.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", "rate-limit": 0, @@ -376,14 +376,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "tokens", "weight": 30, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-j-w-t.md", + "demo": "account\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", "rate-limit": 100, "rate-time": 3600, @@ -425,13 +425,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", "weight": 32, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", "rate-limit": 0, @@ -491,14 +491,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMFA", "group": "mfa", "weight": 45, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/update-m-f-a.md", + "demo": "account\/update-mfa.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", "rate-limit": 0, "rate-time": 3600, @@ -561,13 +561,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", "weight": 47, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", "rate-limit": 0, @@ -579,6 +579,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -627,13 +681,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", "weight": 48, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", "rate-limit": 0, @@ -645,6 +699,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -705,13 +817,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", "weight": 52, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", "rate-limit": 0, @@ -723,6 +835,58 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -773,13 +937,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", "weight": 53, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", "rate-limit": 10, @@ -791,6 +955,60 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], "auth": { "Project": [] } @@ -847,13 +1065,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", "weight": 54, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", "rate-limit": 10, @@ -865,6 +1083,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], "auth": { "Project": [] } @@ -923,13 +1199,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listMfaFactors", "group": "mfa", "weight": 46, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-mfa-factors.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", "rate-limit": 0, @@ -941,6 +1217,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], "auth": { "Project": [] } @@ -974,13 +1296,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", "weight": 51, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", "rate-limit": 0, @@ -992,6 +1314,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1023,13 +1391,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", "weight": 49, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", "rate-limit": 0, @@ -1041,6 +1409,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1072,13 +1486,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", "weight": 50, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", "rate-limit": 0, @@ -1090,6 +1504,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1123,13 +1583,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "account", "weight": 33, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", "rate-limit": 0, @@ -1193,13 +1653,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePassword", "group": "account", "weight": 34, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-password.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", "rate-limit": 10, @@ -1268,13 +1728,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhone", "group": "account", "weight": 36, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", "rate-limit": 0, @@ -1344,13 +1804,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "account", "weight": 31, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", "rate-limit": 0, @@ -1393,13 +1853,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "account", "weight": 37, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", "rate-limit": 0, @@ -1431,7 +1891,7 @@ "prefs": { "type": "object", "description": "Prefs key-value JSON object.", - "x-example": "{}" + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" } }, "required": [ @@ -1463,13 +1923,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRecovery", "group": "recovery", "weight": 39, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", "rate-limit": 10, @@ -1540,13 +2000,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateRecovery", "group": "recovery", "weight": 40, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", "rate-limit": 10, @@ -1622,13 +2082,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSessions", "group": "sessions", "weight": 12, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", "rate-limit": 0, @@ -1664,13 +2124,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSessions", "group": "sessions", "weight": 13, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", "rate-limit": 100, @@ -1715,13 +2175,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createAnonymousSession", "group": "sessions", "weight": 18, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-anonymous-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", "rate-limit": 50, @@ -1764,13 +2224,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailPasswordSession", "group": "sessions", "weight": 17, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-password-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", "rate-limit": 10, @@ -1838,14 +2298,14 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMagicURLSession", "group": "sessions", "weight": 27, "cookies": false, "type": "", - "deprecated": true, - "demo": "account\/update-magic-u-r-l-session.md", + "demo": "account\/update-magic-url-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, "rate-time": 3600, @@ -1856,6 +2316,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -1905,14 +2369,14 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "createOAuth2Session", "group": "sessions", "weight": 20, "cookies": false, "type": "webAuth", - "deprecated": false, - "demo": "account\/create-o-auth2session.md", + "demo": "account\/create-o-auth-2-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md", "rate-limit": 50, "rate-time": 3600, @@ -2047,13 +2511,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updatePhoneSession", "group": "sessions", "weight": 28, "cookies": false, "type": "", - "deprecated": true, "demo": "account\/update-phone-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -2065,6 +2529,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -2121,13 +2589,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSession", "group": "sessions", "weight": 19, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -2195,13 +2663,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSession", "group": "sessions", "weight": 14, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", "rate-limit": 0, @@ -2256,13 +2724,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSession", "group": "sessions", "weight": 16, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", "rate-limit": 10, @@ -2310,13 +2778,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSession", "group": "sessions", "weight": 15, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", "rate-limit": 100, @@ -2373,13 +2841,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateStatus", "group": "account", "weight": 38, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", "rate-limit": 0, @@ -2424,13 +2892,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPushTarget", "group": "pushTargets", "weight": 55, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, @@ -2503,13 +2971,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePushTarget", "group": "pushTargets", "weight": 56, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, @@ -2574,13 +3042,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deletePushTarget", "group": "pushTargets", "weight": 57, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, @@ -2622,7 +3090,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2635,13 +3103,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailToken", "group": "tokens", "weight": 26, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, @@ -2673,7 +3141,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "<USER_ID>" }, "email": { @@ -2717,14 +3185,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMagicURLToken", "group": "tokens", "weight": 25, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-magic-u-r-l-token.md", + "demo": "account\/create-magic-url-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", "rate-limit": 60, "rate-time": 3600, @@ -2755,7 +3223,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "<USER_ID>" }, "email": { @@ -2797,14 +3265,14 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "createOAuth2Token", "group": "tokens", "weight": 24, "cookies": false, "type": "webAuth", - "deprecated": false, - "demo": "account\/create-o-auth2token.md", + "demo": "account\/create-o-auth-2-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", "rate-limit": 50, "rate-time": 3600, @@ -2939,13 +3407,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneToken", "group": "tokens", "weight": 29, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", "rate-limit": 10, @@ -2977,7 +3445,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "x-example": "<USER_ID>" }, "phone": { @@ -3016,13 +3484,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVerification", "group": "verification", "weight": 41, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", "rate-limit": 10, @@ -3084,13 +3552,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVerification", "group": "verification", "weight": 42, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", "rate-limit": 10, @@ -3160,13 +3628,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneVerification", "group": "verification", "weight": 43, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", "rate-limit": 10, @@ -3212,13 +3680,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhoneVerification", "group": "verification", "weight": 44, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", "rate-limit": 10, @@ -3281,13 +3749,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getBrowser", "group": null, "weight": 61, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-browser.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", "rate-limit": 0, @@ -3407,13 +3875,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getCreditCard", "group": null, "weight": 60, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-credit-card.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", "rate-limit": 0, @@ -3440,7 +3908,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "schema": { "type": "string", @@ -3458,7 +3926,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3478,7 +3946,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -3539,13 +4007,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getFavicon", "group": null, "weight": 64, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-favicon.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", "rate-limit": 0, @@ -3597,13 +4065,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getFlag", "group": null, "weight": 62, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-flag.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", "rate-limit": 0, @@ -4085,13 +4553,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getImage", "group": null, "weight": 63, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-image.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", "rate-limit": 0, @@ -4167,13 +4635,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getInitials", "group": null, "weight": 66, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-initials.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", "rate-limit": 0, @@ -4259,14 +4727,14 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getQR", "group": null, "weight": 65, "cookies": false, "type": "location", - "deprecated": false, - "demo": "avatars\/get-q-r.md", + "demo": "avatars\/get-qr.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", "rate-limit": 0, "rate-time": 3600, @@ -4358,13 +4826,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listDocuments", "group": "documents", - "weight": 110, + "weight": 335, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", "rate-limit": 0, @@ -4377,6 +4845,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, "auth": { "Project": [] } @@ -4443,13 +4915,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createDocument", "group": "documents", - "weight": 109, + "weight": 327, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", "rate-limit": 120, @@ -4462,13 +4934,17 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, "methods": [ { "name": "createDocument", + "namespace": "databases", + "desc": "Create document", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [] }, "parameters": [ "databaseId", @@ -4489,7 +4965,12 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } } ], "auth": { @@ -4539,7 +5020,7 @@ "data": { "type": "object", "description": "Document data as JSON object.", - "x-example": "{}" + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" }, "permissions": { "type": "array", @@ -4584,13 +5065,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getDocument", "group": "documents", - "weight": 111, + "weight": 328, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", "rate-limit": 0, @@ -4603,6 +5084,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, "auth": { "Project": [] } @@ -4661,14 +5146,14 @@ ] }, "put": { - "summary": "Upsert document", + "summary": "Upsert a document", "operationId": "databasesUpsertDocument", "tags": [ "databases" ], "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { - "200": { + "201": { "description": "Document", "content": { "application\/json": { @@ -4679,13 +5164,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "upsertDocument", "group": "documents", - "weight": 114, + "weight": 331, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/upsert-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", "rate-limit": 120, @@ -4698,6 +5183,45 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], "auth": { "Project": [] } @@ -4788,13 +5312,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDocument", "group": "documents", - "weight": 113, + "weight": 329, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", "rate-limit": 120, @@ -4807,6 +5331,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, "auth": { "Project": [] } @@ -4887,13 +5415,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 333, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", "rate-limit": 60, @@ -4906,6 +5434,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, "auth": { "Project": [] } @@ -4951,6 +5483,244 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/functions\/{functionId}\/executions": { "get": { "summary": "List executions", @@ -4971,13 +5741,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 456, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-executions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", "rate-limit": 0, @@ -5046,13 +5816,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 454, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "rate-limit": 0, @@ -5111,7 +5881,7 @@ }, "method": { "type": "string", - "description": "HTTP method of execution. Default value is GET.", + "description": "HTTP method of execution. Default value is POST.", "x-example": "GET", "enum": [ "GET", @@ -5119,7 +5889,8 @@ "PUT", "PATCH", "DELETE", - "OPTIONS" + "OPTIONS", + "HEAD" ], "x-enum-name": "ExecutionMethod", "x-enum-keys": [] @@ -5132,7 +5903,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "<SCHEDULED_AT>" } } } @@ -5161,13 +5932,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 455, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", "rate-limit": 0, @@ -5235,13 +6006,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 250, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/query.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -5287,13 +6058,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 249, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/mutation.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -5339,13 +6110,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 70, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", "rate-limit": 0, @@ -5391,13 +6162,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 71, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", "rate-limit": 0, @@ -5443,13 +6214,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 75, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-continents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", "rate-limit": 0, @@ -5495,13 +6266,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 72, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", "rate-limit": 0, @@ -5547,14 +6318,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 73, "cookies": false, "type": "", - "deprecated": false, - "demo": "locale\/list-countries-e-u.md", + "demo": "locale\/list-countries-eu.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", "rate-limit": 0, "rate-time": 3600, @@ -5599,13 +6370,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 74, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries-phones.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", "rate-limit": 0, @@ -5651,13 +6422,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 76, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-currencies.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", "rate-limit": 0, @@ -5703,13 +6474,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 77, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-languages.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", "rate-limit": 0, @@ -5755,13 +6526,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 296, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", "rate-limit": 0, @@ -5838,13 +6609,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 300, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", "rate-limit": 0, @@ -5913,13 +6684,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 160, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/list-files.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", "rate-limit": 0, @@ -5999,13 +6770,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 159, "cookies": false, "type": "upload", - "deprecated": false, "demo": "storage\/create-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", "rate-limit": 60, @@ -6097,13 +6868,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 161, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", "rate-limit": 0, @@ -6169,13 +6940,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 166, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/update-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", "rate-limit": 60, @@ -6258,13 +7029,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 167, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/delete-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", "rate-limit": 60, @@ -6325,13 +7096,13 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 163, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", "rate-limit": 0, @@ -6403,13 +7174,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 162, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-preview.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", "rate-limit": 0, @@ -6595,7 +7366,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -6630,13 +7402,13 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 164, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-view.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", "rate-limit": 0, @@ -6695,6 +7467,901 @@ ] } }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<ROW_ID>" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/teams": { "get": { "summary": "List teams", @@ -6715,13 +8382,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 171, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", "rate-limit": 0, @@ -6791,13 +8458,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 170, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", "rate-limit": 0, @@ -6876,13 +8543,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 172, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", "rate-limit": 0, @@ -6938,13 +8605,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 174, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", "rate-limit": 0, @@ -7012,13 +8679,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 176, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", "rate-limit": 0, @@ -7076,13 +8743,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 178, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list-memberships.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", "rate-limit": 0, @@ -7162,13 +8829,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 177, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", "rate-limit": 10, @@ -7273,13 +8940,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 179, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", "rate-limit": 0, @@ -7345,13 +9012,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 180, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", "rate-limit": 0, @@ -7432,13 +9099,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 182, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", "rate-limit": 0, @@ -7506,13 +9173,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 181, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", "rate-limit": 0, @@ -7604,13 +9271,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 173, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", "rate-limit": 0, @@ -7665,13 +9332,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 175, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", "rate-limit": 0, @@ -7741,6 +9408,10 @@ "name": "databases", "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, { "name": "locale", "description": "The Locale service allows you to customize your app based on your users' location." @@ -7803,7 +9474,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -7835,7 +9507,41 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "$ref": "#\/components\/schemas\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } }, "documentList": { "description": "Documents List", @@ -7843,7 +9549,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of documents documents that matched your query.", + "description": "Total number of documents that matched your query.", "x-example": 5, "format": "int32" }, @@ -7859,7 +9565,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "sessionList": { "description": "Sessions List", @@ -7867,7 +9577,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of sessions documents that matched your query.", + "description": "Total number of sessions that matched your query.", "x-example": 5, "format": "int32" }, @@ -7883,7 +9593,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -7891,7 +9605,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of identities documents that matched your query.", + "description": "Total number of identities that matched your query.", "x-example": 5, "format": "int32" }, @@ -7907,7 +9621,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -7915,7 +9633,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of logs documents that matched your query.", + "description": "Total number of logs that matched your query.", "x-example": 5, "format": "int32" }, @@ -7931,7 +9649,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -7939,7 +9661,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of files documents that matched your query.", + "description": "Total number of files that matched your query.", "x-example": 5, "format": "int32" }, @@ -7955,7 +9677,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "teamList": { "description": "Teams List", @@ -7963,7 +9689,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of teams documents that matched your query.", + "description": "Total number of teams that matched your query.", "x-example": 5, "format": "int32" }, @@ -7979,7 +9705,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -7987,7 +9717,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of memberships documents that matched your query.", + "description": "Total number of memberships that matched your query.", "x-example": 5, "format": "int32" }, @@ -8003,7 +9733,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "executionList": { "description": "Executions List", @@ -8011,7 +9745,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of executions documents that matched your query.", + "description": "Total number of executions that matched your query.", "x-example": 5, "format": "int32" }, @@ -8027,7 +9761,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -8035,7 +9773,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of countries documents that matched your query.", + "description": "Total number of countries that matched your query.", "x-example": 5, "format": "int32" }, @@ -8051,7 +9789,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -8059,7 +9801,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of continents documents that matched your query.", + "description": "Total number of continents that matched your query.", "x-example": 5, "format": "int32" }, @@ -8075,7 +9817,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -8083,7 +9829,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of languages documents that matched your query.", + "description": "Total number of languages that matched your query.", "x-example": 5, "format": "int32" }, @@ -8099,7 +9845,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -8107,7 +9857,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of currencies documents that matched your query.", + "description": "Total number of currencies that matched your query.", "x-example": 5, "format": "int32" }, @@ -8123,7 +9873,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -8131,7 +9885,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of phones documents that matched your query.", + "description": "Total number of phones that matched your query.", "x-example": 5, "format": "int32" }, @@ -8147,7 +9901,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -8155,7 +9913,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of localeCodes documents that matched your query.", + "description": "Total number of localeCodes that matched your query.", "x-example": 5, "format": "int32" }, @@ -8171,7 +9929,82 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } }, "document": { "description": "Document", @@ -8182,15 +10015,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -8216,12 +10058,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -8355,7 +10214,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -8516,7 +10398,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -8530,7 +10438,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -8544,7 +10455,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -8558,7 +10472,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -8572,7 +10489,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -8614,7 +10534,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -8646,7 +10573,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -8681,12 +10614,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -8873,7 +10817,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -8941,7 +10918,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -8985,7 +10974,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -8999,7 +10996,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -9049,7 +11049,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -9069,7 +11078,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -9151,7 +11164,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "team": { "description": "Team", @@ -9202,7 +11230,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -9293,7 +11332,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "execution": { "description": "Execution", @@ -9311,7 +11367,7 @@ }, "$updatedAt": { "type": "string", - "description": "Execution upate date in ISO 8601 format.", + "description": "Execution update date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, "$permissions": { @@ -9329,15 +11385,31 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -9351,7 +11423,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "$ref": "#\/components\/schemas\/headers" }, @@ -9413,6 +11485,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -9424,7 +11497,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "country": { "description": "Country", @@ -9444,7 +11547,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -9464,7 +11571,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -9490,7 +11601,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -9542,7 +11658,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -9568,7 +11693,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "headers": { "description": "Headers", @@ -9588,7 +11718,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -9620,7 +11754,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -9640,7 +11780,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -9660,7 +11806,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -9692,7 +11842,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "subscriber": { "description": "Subscriber", @@ -9766,7 +11922,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -9828,7 +12004,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 19ce78915c..ab36ae475c 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.7.0", + "version": "1.8.0", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -44,13 +44,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "account", "weight": 10, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", "rate-limit": 0, @@ -92,13 +92,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "account", "weight": 9, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", "rate-limit": 10, @@ -168,13 +168,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "account", "weight": 11, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md", "rate-limit": 0, @@ -216,13 +216,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "account", "weight": 35, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", "rate-limit": 0, @@ -291,13 +291,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listIdentities", "group": "identities", "weight": 58, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-identities.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", "rate-limit": 0, @@ -349,13 +349,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteIdentity", "group": "identities", "weight": 59, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-identity.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", "rate-limit": 0, @@ -411,14 +411,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "tokens", "weight": 30, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-j-w-t.md", + "demo": "account\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", "rate-limit": 100, "rate-time": 3600, @@ -460,13 +460,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", "weight": 32, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", "rate-limit": 0, @@ -525,14 +525,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMFA", "group": "mfa", "weight": 45, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/update-m-f-a.md", + "demo": "account\/update-mfa.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", "rate-limit": 0, "rate-time": 3600, @@ -594,13 +594,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", "weight": 47, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", "rate-limit": 0, @@ -612,6 +612,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -659,13 +713,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", "weight": 48, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", "rate-limit": 0, @@ -677,6 +731,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -736,13 +848,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", "weight": 52, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", "rate-limit": 0, @@ -754,6 +866,58 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -803,13 +967,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", "weight": 53, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", "rate-limit": 10, @@ -821,6 +985,60 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], "auth": { "Project": [] } @@ -877,13 +1095,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", "weight": 54, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", "rate-limit": 10, @@ -895,6 +1113,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], "auth": { "Project": [] } @@ -952,13 +1228,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listMfaFactors", "group": "mfa", "weight": 46, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-mfa-factors.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", "rate-limit": 0, @@ -970,6 +1246,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], "auth": { "Project": [] } @@ -1002,13 +1324,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", "weight": 51, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", "rate-limit": 0, @@ -1020,6 +1342,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1050,13 +1418,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", "weight": 49, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", "rate-limit": 0, @@ -1068,6 +1436,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1098,13 +1512,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", "weight": 50, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", "rate-limit": 0, @@ -1116,6 +1530,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1148,13 +1608,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "account", "weight": 33, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", "rate-limit": 0, @@ -1217,13 +1677,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePassword", "group": "account", "weight": 34, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-password.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", "rate-limit": 10, @@ -1291,13 +1751,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhone", "group": "account", "weight": 36, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", "rate-limit": 0, @@ -1366,13 +1826,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "account", "weight": 31, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", "rate-limit": 0, @@ -1414,13 +1874,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "account", "weight": 37, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", "rate-limit": 0, @@ -1451,7 +1911,7 @@ "prefs": { "type": "object", "description": "Prefs key-value JSON object.", - "x-example": "{}" + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" } }, "required": [ @@ -1483,13 +1943,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRecovery", "group": "recovery", "weight": 39, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", "rate-limit": 10, @@ -1559,13 +2019,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateRecovery", "group": "recovery", "weight": 40, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", "rate-limit": 10, @@ -1640,13 +2100,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSessions", "group": "sessions", "weight": 12, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", "rate-limit": 0, @@ -1681,13 +2141,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSessions", "group": "sessions", "weight": 13, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", "rate-limit": 100, @@ -1731,13 +2191,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createAnonymousSession", "group": "sessions", "weight": 18, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-anonymous-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", "rate-limit": 50, @@ -1780,13 +2240,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailPasswordSession", "group": "sessions", "weight": 17, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-password-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", "rate-limit": 10, @@ -1854,14 +2314,14 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMagicURLSession", "group": "sessions", "weight": 27, "cookies": false, "type": "", - "deprecated": true, - "demo": "account\/update-magic-u-r-l-session.md", + "demo": "account\/update-magic-url-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, "rate-time": 3600, @@ -1872,6 +2332,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -1921,14 +2385,14 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "createOAuth2Session", "group": "sessions", "weight": 20, "cookies": false, "type": "webAuth", - "deprecated": false, - "demo": "account\/create-o-auth2session.md", + "demo": "account\/create-o-auth-2-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md", "rate-limit": 50, "rate-time": 3600, @@ -2063,13 +2527,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updatePhoneSession", "group": "sessions", "weight": 28, "cookies": false, "type": "", - "deprecated": true, "demo": "account\/update-phone-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -2081,6 +2545,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -2137,13 +2605,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSession", "group": "sessions", "weight": 19, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -2211,13 +2679,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSession", "group": "sessions", "weight": 14, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", "rate-limit": 0, @@ -2271,13 +2739,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSession", "group": "sessions", "weight": 16, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", "rate-limit": 10, @@ -2324,13 +2792,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSession", "group": "sessions", "weight": 15, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", "rate-limit": 100, @@ -2386,13 +2854,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateStatus", "group": "account", "weight": 38, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", "rate-limit": 0, @@ -2436,13 +2904,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPushTarget", "group": "pushTargets", "weight": 55, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, @@ -2514,13 +2982,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePushTarget", "group": "pushTargets", "weight": 56, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, @@ -2584,13 +3052,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deletePushTarget", "group": "pushTargets", "weight": 57, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, @@ -2631,7 +3099,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2644,13 +3112,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailToken", "group": "tokens", "weight": 26, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, @@ -2682,7 +3150,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "<USER_ID>" }, "email": { @@ -2726,14 +3194,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMagicURLToken", "group": "tokens", "weight": 25, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-magic-u-r-l-token.md", + "demo": "account\/create-magic-url-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", "rate-limit": 60, "rate-time": 3600, @@ -2764,7 +3232,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "<USER_ID>" }, "email": { @@ -2806,14 +3274,14 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "createOAuth2Token", "group": "tokens", "weight": 24, "cookies": false, "type": "webAuth", - "deprecated": false, - "demo": "account\/create-o-auth2token.md", + "demo": "account\/create-o-auth-2-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", "rate-limit": 50, "rate-time": 3600, @@ -2948,13 +3416,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneToken", "group": "tokens", "weight": 29, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", "rate-limit": 10, @@ -2986,7 +3454,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "x-example": "<USER_ID>" }, "phone": { @@ -3025,13 +3493,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVerification", "group": "verification", "weight": 41, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", "rate-limit": 10, @@ -3092,13 +3560,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVerification", "group": "verification", "weight": 42, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", "rate-limit": 10, @@ -3167,13 +3635,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneVerification", "group": "verification", "weight": 43, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", "rate-limit": 10, @@ -3218,13 +3686,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhoneVerification", "group": "verification", "weight": 44, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", "rate-limit": 10, @@ -3286,13 +3754,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getBrowser", "group": null, "weight": 61, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-browser.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", "rate-limit": 0, @@ -3412,13 +3880,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getCreditCard", "group": null, "weight": 60, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-credit-card.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", "rate-limit": 0, @@ -3445,7 +3913,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "schema": { "type": "string", @@ -3463,7 +3931,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3483,7 +3951,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -3544,13 +4012,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getFavicon", "group": null, "weight": 64, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-favicon.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", "rate-limit": 0, @@ -3602,13 +4070,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getFlag", "group": null, "weight": 62, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-flag.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", "rate-limit": 0, @@ -4090,13 +4558,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getImage", "group": null, "weight": 63, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-image.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", "rate-limit": 0, @@ -4172,13 +4640,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getInitials", "group": null, "weight": 66, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-initials.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", "rate-limit": 0, @@ -4264,14 +4732,14 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getQR", "group": null, "weight": 65, "cookies": false, "type": "location", - "deprecated": false, - "demo": "avatars\/get-q-r.md", + "demo": "avatars\/get-qr.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", "rate-limit": 0, "rate-time": 3600, @@ -4356,13 +4824,13 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "chat", "group": "console", - "weight": 308, + "weight": 252, "cookies": false, "type": "", - "deprecated": false, "demo": "assistant\/chat.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/assistant\/chat.md", "rate-limit": 15, @@ -4416,13 +4884,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "getResource", "group": null, - "weight": 432, + "weight": 496, "cookies": false, "type": "", - "deprecated": false, "demo": "console\/get-resource.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCheck if a resource ID is available.", "rate-limit": 120, @@ -4491,13 +4959,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "variables", "group": "console", - "weight": 307, + "weight": 251, "cookies": false, "type": "", - "deprecated": false, "demo": "console\/variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/console\/variables.md", "rate-limit": 0, @@ -4539,13 +5007,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "list", "group": "databases", - "weight": 71, + "weight": 316, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", "rate-limit": 0, @@ -4556,6 +5024,37 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + }, + "methods": [ + { + "name": "list", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "queries", + "search" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/databaseList" + } + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "demo": "databases\/list.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + } + } + ], "auth": { "Project": [] } @@ -4612,13 +5111,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "create", "group": "databases", - "weight": 70, + "weight": 312, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", "rate-limit": 0, @@ -4629,6 +5128,41 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + }, + "methods": [ + { + "name": "create", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Create a new Database.\n", + "demo": "databases\/create.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + } + } + ], "auth": { "Project": [] } @@ -4674,11 +5208,11 @@ "\/databases\/usage": { "get": { "summary": "Get databases usage stats", - "operationId": "databasesGetUsage", + "operationId": "databasesListUsage", "tags": [ "databases" ], - "description": "Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageDatabases", @@ -4691,15 +5225,15 @@ } } }, + "deprecated": true, "x-appwrite": { - "method": "getUsage", + "method": "listUsage", "group": null, - "weight": 119, + "weight": 319, "cookies": false, "type": "", - "deprecated": false, - "demo": "databases\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", + "demo": "databases\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4708,6 +5242,36 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listUsage" + }, + "methods": [ + { + "name": "listUsage", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "range" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/usageDatabases" + } + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "databases\/list-usage.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listUsage" + } + } + ], "auth": { "Project": [] } @@ -4720,7 +5284,7 @@ "parameters": [ { "name": "range", - "description": "`Date range.", + "description": "Date range.", "required": false, "schema": { "type": "string", @@ -4730,7 +5294,7 @@ "30d", "90d" ], - "x-enum-name": "DatabaseUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -4763,13 +5327,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "get", "group": "databases", - "weight": 72, + "weight": 313, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", "rate-limit": 0, @@ -4780,6 +5344,38 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + }, + "methods": [ + { + "name": "get", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "demo": "databases\/get.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + } + } + ], "auth": { "Project": [] } @@ -4822,13 +5418,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "update", "group": "databases", - "weight": 74, + "weight": 314, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", "rate-limit": 0, @@ -4839,6 +5435,41 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + }, + "methods": [ + { + "name": "update", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Update a database by its unique ID.", + "demo": "databases\/update.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + } + } + ], "auth": { "Project": [] } @@ -4898,13 +5529,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "delete", "group": "databases", - "weight": 75, + "weight": 315, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", "rate-limit": 0, @@ -4915,6 +5546,37 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + }, + "methods": [ + { + "name": "delete", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "demo": "databases\/delete.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + } + } + ], "auth": { "Project": [] } @@ -4959,13 +5621,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listCollections", "group": "collections", - "weight": 77, + "weight": 324, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-collections.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", "rate-limit": 0, @@ -4976,6 +5638,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTables" + }, "auth": { "Project": [] } @@ -5024,7 +5690,7 @@ ] }, "post": { - "summary": "Create collection", + "summary": "Create collections", "operationId": "databasesCreateCollection", "tags": [ "databases" @@ -5042,13 +5708,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createCollection", "group": "collections", - "weight": 76, + "weight": 320, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", "rate-limit": 0, @@ -5059,6 +5725,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTable" + }, "auth": { "Project": [] } @@ -5146,13 +5816,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getCollection", "group": "collections", - "weight": 78, + "weight": 321, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", "rate-limit": 0, @@ -5163,6 +5833,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTable" + }, "auth": { "Project": [] } @@ -5215,13 +5889,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateCollection", "group": "collections", - "weight": 80, + "weight": 322, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", "rate-limit": 0, @@ -5232,6 +5906,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTable" + }, "auth": { "Project": [] } @@ -5314,13 +5992,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteCollection", "group": "collections", - "weight": 81, + "weight": 323, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", "rate-limit": 0, @@ -5331,6 +6009,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTable" + }, "auth": { "Project": [] } @@ -5385,13 +6067,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listAttributes", "group": "attributes", - "weight": 92, + "weight": 341, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-attributes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", "rate-limit": 0, @@ -5402,6 +6084,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listColumns" + }, "auth": { "Project": [] } @@ -5425,7 +6111,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -5469,13 +6155,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createBooleanAttribute", "group": "attributes", - "weight": 89, + "weight": 342, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-boolean-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", "rate-limit": 0, @@ -5486,6 +6172,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBooleanColumn" + }, "auth": { "Project": [] } @@ -5509,7 +6199,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "schema": { "type": "string", @@ -5575,13 +6265,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateBooleanAttribute", "group": "attributes", - "weight": 101, + "weight": 343, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-boolean-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", "rate-limit": 0, @@ -5592,6 +6282,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBooleanColumn" + }, "auth": { "Project": [] } @@ -5615,7 +6309,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", "required": true, "schema": { "type": "string", @@ -5686,13 +6380,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createDatetimeAttribute", "group": "attributes", - "weight": 90, + "weight": 344, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-datetime-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", "rate-limit": 0, @@ -5703,6 +6397,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createDatetimeColumn" + }, "auth": { "Project": [] } @@ -5726,7 +6424,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", "required": true, "schema": { "type": "string", @@ -5774,7 +6472,7 @@ }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { "patch": { - "summary": "Update dateTime attribute", + "summary": "Update datetime attribute", "operationId": "databasesUpdateDatetimeAttribute", "tags": [ "databases" @@ -5792,13 +6490,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDatetimeAttribute", "group": "attributes", - "weight": 102, + "weight": 345, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-datetime-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", "rate-limit": 0, @@ -5809,6 +6507,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateDatetimeColumn" + }, "auth": { "Project": [] } @@ -5832,7 +6534,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -5903,13 +6605,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createEmailAttribute", "group": "attributes", - "weight": 83, + "weight": 346, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-email-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", "rate-limit": 0, @@ -5920,6 +6622,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEmailColumn" + }, "auth": { "Project": [] } @@ -5943,7 +6649,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6009,13 +6715,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateEmailAttribute", "group": "attributes", - "weight": 95, + "weight": 347, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-email-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", "rate-limit": 0, @@ -6026,6 +6732,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEmailColumn" + }, "auth": { "Project": [] } @@ -6049,7 +6759,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6086,7 +6796,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -6107,7 +6817,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "description": "Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -6120,15 +6830,15 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createEnumAttribute", "group": "attributes", - "weight": 84, + "weight": 348, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-enum-attribute.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-enum-attribute.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -6137,6 +6847,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEnumColumn" + }, "auth": { "Project": [] } @@ -6160,7 +6874,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6182,7 +6896,7 @@ }, "elements": { "type": "array", - "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "description": "Array of enum values.", "x-example": null, "items": { "type": "string" @@ -6235,13 +6949,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateEnumAttribute", "group": "attributes", - "weight": 96, + "weight": 349, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-enum-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", "rate-limit": 0, @@ -6252,6 +6966,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEnumColumn" + }, "auth": { "Project": [] } @@ -6275,7 +6993,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6301,7 +7019,7 @@ "properties": { "elements": { "type": "array", - "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "description": "Updated list of enum values.", "x-example": null, "items": { "type": "string" @@ -6320,7 +7038,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -6355,13 +7073,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createFloatAttribute", "group": "attributes", - "weight": 88, + "weight": 350, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-float-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", "rate-limit": 0, @@ -6372,6 +7090,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createFloatColumn" + }, "auth": { "Project": [] } @@ -6395,7 +7117,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6422,17 +7144,17 @@ }, "min": { "type": "number", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value.", "x-example": null }, "max": { "type": "number", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value.", "x-example": null }, "default": { "type": "number", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when required.", "x-example": null }, "array": { @@ -6471,13 +7193,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateFloatAttribute", "group": "attributes", - "weight": 100, + "weight": 351, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-float-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", "rate-limit": 0, @@ -6488,6 +7210,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateFloatColumn" + }, "auth": { "Project": [] } @@ -6511,7 +7237,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6542,23 +7268,23 @@ }, "min": { "type": "number", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value.", "x-example": null }, "max": { "type": "number", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value.", "x-example": null }, "default": { "type": "number", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when required.", "x-example": null, "x-nullable": true }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -6592,13 +7318,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIntegerAttribute", "group": "attributes", - "weight": 87, + "weight": 352, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-integer-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", "rate-limit": 0, @@ -6609,6 +7335,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIntegerColumn" + }, "auth": { "Project": [] } @@ -6632,7 +7362,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6659,17 +7389,17 @@ }, "min": { "type": "integer", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value", "x-example": null }, "max": { "type": "integer", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value", "x-example": null }, "default": { "type": "integer", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when attribute is required.", "x-example": null }, "array": { @@ -6708,13 +7438,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateIntegerAttribute", "group": "attributes", - "weight": 99, + "weight": 353, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-integer-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", "rate-limit": 0, @@ -6725,6 +7455,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIntegerColumn" + }, "auth": { "Project": [] } @@ -6748,7 +7482,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6779,23 +7513,23 @@ }, "min": { "type": "integer", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value", "x-example": null }, "max": { "type": "integer", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value", "x-example": null }, "default": { "type": "integer", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when attribute is required.", "x-example": null, "x-nullable": true }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -6829,13 +7563,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIpAttribute", "group": "attributes", - "weight": 85, + "weight": 354, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-ip-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", "rate-limit": 0, @@ -6846,6 +7580,235 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIpColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 355, + "cookies": false, + "type": "", + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIpColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 356, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, "auth": { "Project": [] } @@ -6895,14 +7858,17 @@ "x-example": false }, "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": null - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "x-example": false + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true } }, "required": [ @@ -6915,35 +7881,35 @@ } } }, - "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { "patch": { - "summary": "Update IP address attribute", - "operationId": "databasesUpdateIpAttribute", + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", "responses": { "200": { - "description": "AttributeIP", + "description": "AttributeLine", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/attributeIp" + "$ref": "#\/components\/schemas\/attributeLine" } } } } }, + "deprecated": true, "x-appwrite": { - "method": "updateIpAttribute", + "method": "updateLineAttribute", "group": "attributes", - "weight": 97, + "weight": 357, "cookies": false, "type": "", - "deprecated": false, - "demo": "databases\/update-ip-attribute.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -6952,6 +7918,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, "auth": { "Project": [] } @@ -6975,7 +7945,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", "required": true, "schema": { "type": "string", @@ -7005,9 +7975,16 @@ "x-example": false }, "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": null, + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, "x-nullable": true }, "newKey": { @@ -7017,8 +7994,7 @@ } }, "required": [ - "required", - "default" + "required" ] } } @@ -7026,35 +8002,35 @@ } } }, - "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { "post": { - "summary": "Create relationship attribute", - "operationId": "databasesCreateRelationshipAttribute", + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", "tags": [ "databases" ], - "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "description": "Create a geometric point attribute.", "responses": { "202": { - "description": "AttributeRelationship", + "description": "AttributePoint", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/attributeRelationship" + "$ref": "#\/components\/schemas\/attributePoint" } } } } }, + "deprecated": true, "x-appwrite": { - "method": "createRelationshipAttribute", + "method": "createPointAttribute", "group": "attributes", - "weight": 91, + "weight": 358, "cookies": false, "type": "", - "deprecated": false, - "demo": "databases\/create-relationship-attribute.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -7063,6 +8039,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, "auth": { "Project": [] } @@ -7095,6 +8075,474 @@ "in": "path" } ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 359, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 360, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createRelationshipAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/create-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRelationshipColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], "requestBody": { "content": { "application\/json": { @@ -7103,7 +8551,7 @@ "properties": { "relatedCollectionId": { "type": "string", - "description": "Related Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Related Collection ID.", "x-example": "<RELATED_COLLECTION_ID>" }, "type": { @@ -7177,13 +8625,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 82, + "weight": 364, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-string-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", "rate-limit": 0, @@ -7194,6 +8642,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createStringColumn" + }, "auth": { "Project": [] } @@ -7217,7 +8669,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "schema": { "type": "string", @@ -7294,13 +8746,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 94, + "weight": 365, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-string-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", "rate-limit": 0, @@ -7311,6 +8763,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateStringColumn" + }, "auth": { "Project": [] } @@ -7334,7 +8790,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "schema": { "type": "string", @@ -7376,7 +8832,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -7410,13 +8866,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 86, + "weight": 366, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-url-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", "rate-limit": 0, @@ -7427,6 +8883,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createUrlColumn" + }, "auth": { "Project": [] } @@ -7450,7 +8910,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -7516,13 +8976,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 98, + "weight": 367, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-url-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", "rate-limit": 0, @@ -7533,6 +8993,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateUrlColumn" + }, "auth": { "Project": [] } @@ -7556,7 +9020,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -7593,7 +9057,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -7658,13 +9122,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getAttribute", "group": "attributes", - "weight": 93, + "weight": 339, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", "rate-limit": 0, @@ -7675,6 +9139,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getColumn" + }, "auth": { "Project": [] } @@ -7698,7 +9166,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -7729,13 +9197,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteAttribute", "group": "attributes", - "weight": 104, + "weight": 340, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", "rate-limit": 0, @@ -7746,6 +9214,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteColumn" + }, "auth": { "Project": [] } @@ -7769,7 +9241,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -7809,13 +9281,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 103, + "weight": 363, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-relationship-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", "rate-limit": 0, @@ -7826,6 +9298,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRelationshipColumn" + }, "auth": { "Project": [] } @@ -7849,7 +9325,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -7887,7 +9363,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } } @@ -7917,13 +9393,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listDocuments", "group": "documents", - "weight": 110, + "weight": 335, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", "rate-limit": 0, @@ -7936,6 +9412,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, "auth": { "Project": [] } @@ -8002,13 +9482,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createDocument", "group": "documents", - "weight": 109, + "weight": 327, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", "rate-limit": 120, @@ -8021,13 +9501,17 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, "methods": [ { "name": "createDocument", + "namespace": "databases", + "desc": "Create document", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [] }, "parameters": [ "databaseId", @@ -8048,7 +9532,42 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + }, + { + "name": "createDocuments", + "namespace": "databases", + "desc": "Create documents", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRows" + } } ], "auth": { @@ -8098,7 +9617,7 @@ "data": { "type": "object", "description": "Document data as JSON object.", - "x-example": "{}" + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" }, "permissions": { "type": "array", @@ -8123,14 +9642,14 @@ } }, "put": { - "summary": "Create or update documents", + "summary": "Upsert documents", "operationId": "databasesUpsertDocuments", "tags": [ "databases" ], "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", "responses": { - "200": { + "201": { "description": "Documents List", "content": { "application\/json": { @@ -8141,13 +9660,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 332, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/upsert-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", "rate-limit": 120, @@ -8155,9 +9674,46 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + }, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "demo": "databases\/upsert-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + } + } + ], "auth": { "Project": [] } @@ -8204,7 +9760,10 @@ "type": "object" } } - } + }, + "required": [ + "documents" + ] } } } @@ -8229,13 +9788,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 330, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", "rate-limit": 120, @@ -8243,9 +9802,14 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRows" + }, "auth": { "Project": [] } @@ -8322,13 +9886,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 334, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", "rate-limit": 60, @@ -8336,9 +9900,14 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRows" + }, "auth": { "Project": [] } @@ -8412,13 +9981,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getDocument", "group": "documents", - "weight": 111, + "weight": 328, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", "rate-limit": 0, @@ -8431,6 +10000,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, "auth": { "Project": [] } @@ -8489,14 +10062,14 @@ ] }, "put": { - "summary": "Upsert document", + "summary": "Upsert a document", "operationId": "databasesUpsertDocument", "tags": [ "databases" ], "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { - "200": { + "201": { "description": "Document", "content": { "application\/json": { @@ -8507,13 +10080,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "upsertDocument", "group": "documents", - "weight": 114, + "weight": 331, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/upsert-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", "rate-limit": 120, @@ -8526,6 +10099,45 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], "auth": { "Project": [] } @@ -8616,13 +10228,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDocument", "group": "documents", - "weight": 113, + "weight": 329, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", "rate-limit": 120, @@ -8635,6 +10247,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, "auth": { "Project": [] } @@ -8715,13 +10331,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 333, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", "rate-limit": 60, @@ -8734,6 +10350,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, "auth": { "Project": [] } @@ -8799,13 +10419,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listDocumentLogs", "group": "logs", - "weight": 112, + "weight": 336, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-document-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md", "rate-limit": 0, @@ -8816,6 +10436,10 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRowLogs" + }, "auth": { "Project": [] } @@ -8872,6 +10496,244 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -8892,13 +10754,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 106, + "weight": 371, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-indexes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", "rate-limit": 0, @@ -8909,6 +10771,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listIndexes" + }, "auth": { "Project": [] } @@ -8974,13 +10840,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIndex", - "group": "collections", - "weight": 105, + "group": "indexes", + "weight": 368, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", "rate-limit": 0, @@ -8991,6 +10857,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIndex" + }, "auth": { "Project": [] } @@ -9041,7 +10911,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -9102,13 +10973,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 107, + "weight": 369, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", "rate-limit": 0, @@ -9119,6 +10990,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getIndex" + }, "auth": { "Project": [] } @@ -9173,13 +11048,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 108, + "weight": 370, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", "rate-limit": 0, @@ -9190,6 +11065,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteIndex" + }, "auth": { "Project": [] } @@ -9253,13 +11132,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listCollectionLogs", "group": "collections", - "weight": 79, + "weight": 325, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-collection-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md", "rate-limit": 0, @@ -9270,6 +11149,10 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTableLogs" + }, "auth": { "Project": [] } @@ -9336,13 +11219,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 121, + "weight": 326, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-collection-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", "rate-limit": 0, @@ -9353,6 +11236,10 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTableUsage" + }, "auth": { "Project": [] } @@ -9385,7 +11272,7 @@ "30d", "90d" ], - "x-enum-name": "DatabaseUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -9428,13 +11315,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 73, + "weight": 317, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-logs.md", "rate-limit": 0, @@ -9445,6 +11332,39 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listDatabaseLogs" + }, + "methods": [ + { + "name": "listLogs", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "queries" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/logList" + } + ], + "description": "Get the database activity logs list by its unique ID.", + "demo": "databases\/list-logs.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listDatabaseLogs" + } + } + ], "auth": { "Project": [] } @@ -9484,7 +11404,7 @@ "\/databases\/{databaseId}\/usage": { "get": { "summary": "Get database usage stats", - "operationId": "databasesGetDatabaseUsage", + "operationId": "databasesGetUsage", "tags": [ "databases" ], @@ -9501,14 +11421,14 @@ } } }, + "deprecated": true, "x-appwrite": { - "method": "getDatabaseUsage", + "method": "getUsage", "group": null, - "weight": 120, + "weight": 318, "cookies": false, "type": "", - "deprecated": false, - "demo": "databases\/get-database-usage.md", + "demo": "databases\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", "rate-limit": 0, "rate-time": 3600, @@ -9518,6 +11438,39 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getUsage" + }, + "methods": [ + { + "name": "getUsage", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "range" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/usageDatabase" + } + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "databases\/get-usage.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getUsage" + } + } + ], "auth": { "Project": [] } @@ -9540,7 +11493,7 @@ }, { "name": "range", - "description": "`Date range.", + "description": "Date range.", "required": false, "schema": { "type": "string", @@ -9550,7 +11503,7 @@ "30d", "90d" ], - "x-enum-name": "DatabaseUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -9583,13 +11536,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 440, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", "rate-limit": 0, @@ -9656,13 +11609,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 437, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", "rate-limit": 0, @@ -9741,6 +11694,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9766,7 +11720,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9887,13 +11842,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 442, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-runtimes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", "rate-limit": 0, @@ -9936,13 +11891,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 443, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-specifications.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", "rate-limit": 0, @@ -9986,13 +11941,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 402, + "weight": 466, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-templates.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", "rate-limit": 0, @@ -10086,13 +12041,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 401, + "weight": 465, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", "rate-limit": 0, @@ -10146,13 +12101,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listUsage", "group": null, - "weight": 395, + "weight": 459, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "rate-limit": 0, @@ -10185,7 +12140,7 @@ "30d", "90d" ], - "x-enum-name": "FunctionUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -10218,13 +12173,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 438, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", "rate-limit": 0, @@ -10277,13 +12232,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 439, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", "rate-limit": 0, @@ -10369,6 +12324,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -10394,7 +12350,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -10505,13 +12462,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 441, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", "rate-limit": 0, @@ -10566,13 +12523,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 446, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-function-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", "rate-limit": 0, @@ -10646,13 +12603,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 447, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-deployments.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", "rate-limit": 0, @@ -10729,13 +12686,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 444, "cookies": false, "type": "upload", - "deprecated": false, "demo": "functions\/create-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "rate-limit": 0, @@ -10825,13 +12782,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 452, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-duplicate-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "rate-limit": 0, @@ -10910,13 +12867,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 449, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-template-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", "rate-limit": 0, @@ -11013,13 +12970,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 450, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-vcs-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "rate-limit": 0, @@ -11110,13 +13067,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 445, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", "rate-limit": 0, @@ -11172,13 +13129,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 448, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", "rate-limit": 0, @@ -11236,13 +13193,13 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 451, "cookies": false, "type": "location", - "deprecated": false, "demo": "functions\/get-deployment-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "rate-limit": 0, @@ -11326,13 +13283,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 453, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-deployment-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "rate-limit": 0, @@ -11397,13 +13354,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 456, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-executions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", "rate-limit": 0, @@ -11472,13 +13429,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 454, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "rate-limit": 0, @@ -11537,7 +13494,7 @@ }, "method": { "type": "string", - "description": "HTTP method of execution. Default value is GET.", + "description": "HTTP method of execution. Default value is POST.", "x-example": "GET", "enum": [ "GET", @@ -11545,7 +13502,8 @@ "PUT", "PATCH", "DELETE", - "OPTIONS" + "OPTIONS", + "HEAD" ], "x-enum-name": "ExecutionMethod", "x-enum-keys": [] @@ -11558,7 +13516,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "<SCHEDULED_AT>" } } } @@ -11587,13 +13545,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 455, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", "rate-limit": 0, @@ -11652,13 +13610,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 457, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", "rate-limit": 0, @@ -11723,13 +13681,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getUsage", "group": null, - "weight": 394, + "weight": 458, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "rate-limit": 0, @@ -11772,7 +13730,7 @@ "30d", "90d" ], - "x-enum-name": "FunctionUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -11805,13 +13763,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 462, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", "rate-limit": 0, @@ -11864,13 +13822,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 460, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", "rate-limit": 0, @@ -11955,13 +13913,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 461, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", "rate-limit": 0, @@ -12024,13 +13982,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 463, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", "rate-limit": 0, @@ -12115,13 +14073,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 464, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", "rate-limit": 0, @@ -12186,13 +14144,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 250, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/query.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -12238,13 +14196,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 249, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/mutation.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -12290,13 +14248,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 78, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md", "rate-limit": 0, @@ -12339,13 +14297,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 99, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-antivirus.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md", "rate-limit": 0, @@ -12388,13 +14346,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 81, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-cache.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md", "rate-limit": 0, @@ -12437,13 +14395,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 86, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-certificate.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", "rate-limit": 0, @@ -12497,14 +14455,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 80, "cookies": false, "type": "", - "deprecated": false, - "demo": "health\/get-d-b.md", + "demo": "health\/get-db.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md", "rate-limit": 0, "rate-time": 3600, @@ -12546,13 +14504,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 82, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-pub-sub.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", "rate-limit": 0, @@ -12595,13 +14553,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 88, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-builds.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", "rate-limit": 0, @@ -12657,13 +14615,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 87, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-certificates.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md", "rate-limit": 0, @@ -12719,13 +14677,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 89, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-databases.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", "rate-limit": 0, @@ -12792,13 +14750,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 90, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-deletes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", "rate-limit": 0, @@ -12854,13 +14812,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 100, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-failed-jobs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", "rate-limit": 0, @@ -12942,13 +14900,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 94, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-functions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md", "rate-limit": 0, @@ -13004,13 +14962,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 85, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md", "rate-limit": 0, @@ -13066,13 +15024,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 91, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-mails.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", "rate-limit": 0, @@ -13128,13 +15086,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 92, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-messaging.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", "rate-limit": 0, @@ -13190,13 +15148,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 93, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-migrations.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", "rate-limit": 0, @@ -13234,7 +15192,7 @@ }, "\/health\/queue\/stats-resources": { "get": { - "summary": "Get stats resources queue", + "summary": "Get stats resources queue", "operationId": "healthGetQueueStatsResources", "tags": [ "health" @@ -13252,13 +15210,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 95, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-stats-resources.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", "rate-limit": 0, @@ -13314,13 +15272,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 96, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", "rate-limit": 0, @@ -13376,13 +15334,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 84, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-webhooks.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md", "rate-limit": 0, @@ -13438,13 +15396,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 98, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-storage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", "rate-limit": 0, @@ -13487,13 +15445,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 97, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-storage-local.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md", "rate-limit": 0, @@ -13536,13 +15494,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 83, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-time.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md", "rate-limit": 0, @@ -13585,13 +15543,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 70, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", "rate-limit": 0, @@ -13637,13 +15595,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 71, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", "rate-limit": 0, @@ -13689,13 +15647,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 75, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-continents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", "rate-limit": 0, @@ -13741,13 +15699,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 72, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", "rate-limit": 0, @@ -13793,14 +15751,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 73, "cookies": false, "type": "", - "deprecated": false, - "demo": "locale\/list-countries-e-u.md", + "demo": "locale\/list-countries-eu.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", "rate-limit": 0, "rate-time": 3600, @@ -13845,13 +15803,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 74, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries-phones.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", "rate-limit": 0, @@ -13897,13 +15855,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 76, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-currencies.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", "rate-limit": 0, @@ -13949,13 +15907,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 77, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-languages.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", "rate-limit": 0, @@ -14001,13 +15959,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 304, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-messages.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", "rate-limit": 0, @@ -14077,13 +16035,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 301, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", "rate-limit": 0, @@ -14221,13 +16179,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 308, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", "rate-limit": 0, @@ -14367,13 +16325,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 303, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-push.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", "rate-limit": 0, @@ -14541,13 +16499,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 310, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-push.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", "rate-limit": 0, @@ -14719,13 +16677,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 302, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-sms.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", "rate-limit": 0, @@ -14737,6 +16695,74 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + }, + "methods": [ + { + "name": "createSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + } + }, + { + "name": "createSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md" + } + ], "auth": { "Project": [] } @@ -14828,13 +16854,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 309, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-sms.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, @@ -14846,6 +16872,72 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + }, + "methods": [ + { + "name": "updateSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + } + }, + { + "name": "updateSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md" + } + ], "auth": { "Project": [] } @@ -14940,13 +17032,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 307, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-message.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", "rate-limit": 0, @@ -14993,13 +17085,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 311, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", "rate-limit": 0, @@ -15055,13 +17147,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 305, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-message-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", "rate-limit": 0, @@ -15130,13 +17222,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 306, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-targets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", "rate-limit": 0, @@ -15205,13 +17297,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 276, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-providers.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", "rate-limit": 0, @@ -15281,13 +17373,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 275, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-apns-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", "rate-limit": 0, @@ -15299,6 +17391,76 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + }, + "methods": [ + { + "name": "createApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + } + }, + { + "name": "createAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md" + } + ], "auth": { "Project": [] } @@ -15386,13 +17548,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 288, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-apns-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", "rate-limit": 0, @@ -15404,6 +17566,74 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + }, + "methods": [ + { + "name": "updateApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + } + }, + { + "name": "updateAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md" + } + ], "auth": { "Project": [] } @@ -15494,13 +17724,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 274, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-fcm-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", "rate-limit": 0, @@ -15512,6 +17742,68 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + }, + "methods": [ + { + "name": "createFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + } + }, + { + "name": "createFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md" + } + ], "auth": { "Project": [] } @@ -15579,13 +17871,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 287, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-fcm-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", "rate-limit": 0, @@ -15597,6 +17889,66 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + }, + "methods": [ + { + "name": "updateFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + } + }, + { + "name": "updateFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md" + } + ], "auth": { "Project": [] } @@ -15667,13 +18019,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 266, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-mailgun-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", "rate-limit": 0, @@ -15782,13 +18134,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 279, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-mailgun-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", "rate-limit": 0, @@ -15900,14 +18252,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 269, "cookies": false, "type": "", - "deprecated": false, - "demo": "messaging\/create-msg91provider.md", + "demo": "messaging\/create-msg-91-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", "rate-limit": 0, "rate-time": 3600, @@ -15995,14 +18347,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 282, "cookies": false, "type": "", - "deprecated": false, - "demo": "messaging\/update-msg91provider.md", + "demo": "messaging\/update-msg-91-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", "rate-limit": 0, "rate-time": 3600, @@ -16093,13 +18445,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 267, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-sendgrid-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", "rate-limit": 0, @@ -16198,13 +18550,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 280, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-sendgrid-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", "rate-limit": 0, @@ -16306,13 +18658,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 268, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-smtp-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", "rate-limit": 0, @@ -16324,6 +18676,90 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + }, + "methods": [ + { + "name": "createSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + } + }, + { + "name": "createSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md" + } + ], "auth": { "Project": [] } @@ -16449,13 +18885,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 281, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-smtp-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", "rate-limit": 0, @@ -16467,6 +18903,86 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + }, + "methods": [ + { + "name": "updateSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + } + }, + { + "name": "updateSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md" + } + ], "auth": { "Project": [] } @@ -16594,13 +19110,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 270, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-telesign-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", "rate-limit": 0, @@ -16689,13 +19205,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 283, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-telesign-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", "rate-limit": 0, @@ -16787,13 +19303,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 271, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-textmagic-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", "rate-limit": 0, @@ -16882,13 +19398,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 284, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-textmagic-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", "rate-limit": 0, @@ -16980,13 +19496,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 272, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-twilio-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", "rate-limit": 0, @@ -17075,13 +19591,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 285, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-twilio-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", "rate-limit": 0, @@ -17173,13 +19689,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 273, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-vonage-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", "rate-limit": 0, @@ -17268,13 +19784,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 286, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-vonage-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", "rate-limit": 0, @@ -17366,13 +19882,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 278, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", "rate-limit": 0, @@ -17419,13 +19935,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 289, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", "rate-limit": 0, @@ -17481,13 +19997,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 277, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-provider-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", "rate-limit": 0, @@ -17556,13 +20072,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 298, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-subscriber-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", "rate-limit": 0, @@ -17631,13 +20147,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 291, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-topics.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", "rate-limit": 0, @@ -17705,13 +20221,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 290, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", "rate-limit": 0, @@ -17788,13 +20304,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 293, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", "rate-limit": 0, @@ -17848,13 +20364,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 294, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", "rate-limit": 0, @@ -17925,13 +20441,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 295, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", "rate-limit": 0, @@ -17987,13 +20503,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 292, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-topic-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", "rate-limit": 0, @@ -18062,13 +20578,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 297, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-subscribers.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", "rate-limit": 0, @@ -18146,13 +20662,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 296, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", "rate-limit": 0, @@ -18236,13 +20752,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 299, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", "rate-limit": 0, @@ -18299,13 +20815,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 300, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", "rate-limit": 0, @@ -18374,13 +20890,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": null, - "weight": 314, + "weight": 258, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/list-migrations.md", "rate-limit": 0, @@ -18448,13 +20964,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 309, + "weight": 253, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/create-appwrite-migration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite.md", "rate-limit": 0, @@ -18536,13 +21052,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 316, + "weight": 260, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/get-appwrite-report.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite-report.md", "rate-limit": 0, @@ -18629,13 +21145,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createCsvMigration", "group": null, - "weight": 313, + "weight": 257, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/create-csv-migration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-csv.md", "rate-limit": 0, @@ -18675,6 +21191,11 @@ "type": "string", "description": "Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.", "x-example": "[ID1:ID2]" + }, + "internalFile": { + "type": "boolean", + "description": "Is the file stored in an internal bucket?", + "x-example": false } }, "required": [ @@ -18708,13 +21229,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 310, + "weight": 254, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/create-firebase-migration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase.md", "rate-limit": 0, @@ -18784,13 +21305,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 317, + "weight": 261, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/get-firebase-report.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-report.md", "rate-limit": 0, @@ -18856,13 +21377,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 312, + "weight": 256, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/create-n-host-migration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost.md", "rate-limit": 0, @@ -18967,13 +21488,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 319, + "weight": 263, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/get-n-host-report.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost-report.md", "rate-limit": 0, @@ -19100,13 +21621,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 311, + "weight": 255, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/create-supabase-migration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase.md", "rate-limit": 0, @@ -19205,13 +21726,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 318, + "weight": 262, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/get-supabase-report.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase-report.md", "rate-limit": 0, @@ -19329,13 +21850,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": null, - "weight": 315, + "weight": 259, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/get-migration.md", "rate-limit": 0, @@ -19387,13 +21908,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "retry", "group": null, - "weight": 320, + "weight": 264, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/retry.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/retry-migration.md", "rate-limit": 0, @@ -19438,13 +21959,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": null, - "weight": 321, + "weight": 265, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/delete-migration.md", "rate-limit": 0, @@ -19498,13 +22019,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 148, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", "rate-limit": 0, @@ -19586,13 +22107,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listVariables", "group": null, - "weight": 202, + "weight": 150, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/list-variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/list-variables.md", "rate-limit": 0, @@ -19632,13 +22153,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVariable", "group": null, - "weight": 201, + "weight": 149, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/create-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/create-variable.md", "rate-limit": 0, @@ -19710,13 +22231,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getVariable", "group": null, - "weight": 203, + "weight": 151, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/get-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-variable.md", "rate-limit": 0, @@ -19768,13 +22289,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 204, + "weight": 152, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/update-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/update-variable.md", "rate-limit": 0, @@ -19848,13 +22369,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 205, + "weight": 153, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/delete-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/delete-variable.md", "rate-limit": 0, @@ -19908,15 +22429,15 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "projects", - "weight": 155, + "weight": 436, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/list.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all projects. You can use the query params to filter your results. ", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19980,13 +22501,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "projects", - "weight": 154, + "weight": 102, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create.md", "rate-limit": 0, @@ -20114,13 +22635,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "projects", - "weight": 156, + "weight": 103, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get.md", "rate-limit": 0, @@ -20172,13 +22693,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "projects", - "weight": 157, + "weight": 104, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update.md", "rate-limit": 0, @@ -20287,13 +22808,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "projects", - "weight": 174, + "weight": 121, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete.md", "rate-limit": 0, @@ -20347,13 +22868,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 161, + "weight": 108, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-api-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status.md", "rate-limit": 0, @@ -20364,6 +22885,68 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatus" + }, + "methods": [ + { + "name": "updateApiStatus", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "api", + "status" + ], + "required": [ + "projectId", + "api", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "demo": "projects\/update-api-status.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatus" + } + }, + { + "name": "updateAPIStatus", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "api", + "status" + ], + "required": [ + "projectId", + "api", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "demo": "projects\/update-api-status.md" + } + ], "auth": { "Project": [] } @@ -20439,13 +23022,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 162, + "weight": 109, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-api-status-all.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status-all.md", "rate-limit": 0, @@ -20456,6 +23039,64 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatusAll" + }, + "methods": [ + { + "name": "updateApiStatusAll", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "status" + ], + "required": [ + "projectId", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "demo": "projects\/update-api-status-all.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatusAll" + } + }, + { + "name": "updateAPIStatusAll", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "status" + ], + "required": [ + "projectId", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "demo": "projects\/update-api-status-all.md" + } + ], "auth": { "Project": [] } @@ -20518,13 +23159,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 167, + "weight": 114, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-duration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-duration.md", "rate-limit": 0, @@ -20597,13 +23238,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 166, + "weight": 113, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-limit.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-limit.md", "rate-limit": 0, @@ -20676,13 +23317,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 172, + "weight": 119, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-sessions-limit.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-sessions-limit.md", "rate-limit": 0, @@ -20755,13 +23396,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 165, + "weight": 112, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-memberships-privacy.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-memberships-privacy.md", "rate-limit": 0, @@ -20846,13 +23487,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 173, + "weight": 120, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-mock-numbers.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-mock-numbers.md", "rate-limit": 0, @@ -20928,13 +23569,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 170, + "weight": 117, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-password-dictionary.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-dictionary.md", "rate-limit": 0, @@ -21007,13 +23648,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 169, + "weight": 116, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-password-history.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-history.md", "rate-limit": 0, @@ -21086,13 +23727,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 171, + "weight": 118, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-personal-data-check.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-personal-data-check.md", "rate-limit": 0, @@ -21165,13 +23806,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 164, + "weight": 111, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-session-alerts.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-alerts.md", "rate-limit": 0, @@ -21224,6 +23865,85 @@ } } }, + "\/projects\/{projectId}\/auth\/session-invalidation": { + "patch": { + "summary": "Update invalidate session option of the project", + "operationId": "projectsUpdateSessionInvalidation", + "tags": [ + "projects" + ], + "description": "Invalidate all existing sessions. An optional auth security setting for projects, and enabled by default for console project.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSessionInvalidation", + "group": "auth", + "weight": 147, + "cookies": false, + "type": "", + "demo": "projects\/update-session-invalidation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-invalidation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Update authentication session invalidation status. Use this endpoint to enable or disable session invalidation on password change", + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, "\/projects\/{projectId}\/auth\/{method}": { "patch": { "summary": "Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.", @@ -21244,13 +23964,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 168, + "weight": 115, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-status.md", "rate-limit": 0, @@ -21344,13 +24064,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 371, + "weight": 434, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/list-dev-keys.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", "rate-limit": 0, @@ -21412,13 +24132,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 368, + "weight": 431, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create-dev-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", "rate-limit": 0, @@ -21497,13 +24217,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 370, + "weight": 433, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-dev-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", "rate-limit": 0, @@ -21565,13 +24285,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 369, + "weight": 432, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-dev-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", "rate-limit": 0, @@ -21651,13 +24371,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 372, + "weight": 435, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-dev-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", "rate-limit": 0, @@ -21721,14 +24441,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 186, + "weight": 133, "cookies": false, "type": "", - "deprecated": false, - "demo": "projects\/create-j-w-t.md", + "demo": "projects\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-jwt.md", "rate-limit": 0, "rate-time": 3600, @@ -21808,13 +24528,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 182, + "weight": 129, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/list-keys.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-keys.md", "rate-limit": 0, @@ -21866,13 +24586,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 181, + "weight": 128, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-key.md", "rate-limit": 0, @@ -21959,13 +24679,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 183, + "weight": 130, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-key.md", "rate-limit": 0, @@ -22027,13 +24747,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 184, + "weight": 131, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-key.md", "rate-limit": 0, @@ -22121,13 +24841,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 185, + "weight": 132, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-key.md", "rate-limit": 0, @@ -22191,14 +24911,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 163, + "weight": 110, "cookies": false, "type": "", - "deprecated": false, - "demo": "projects\/update-o-auth2.md", + "demo": "projects\/update-o-auth-2.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-oauth2.md", "rate-limit": 0, "rate-time": 3600, @@ -22329,13 +25049,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 188, + "weight": 135, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/list-platforms.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-platforms.md", "rate-limit": 0, @@ -22387,13 +25107,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 187, + "weight": 134, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create-platform.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-platform.md", "rate-limit": 0, @@ -22506,13 +25226,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 189, + "weight": 136, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-platform.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-platform.md", "rate-limit": 0, @@ -22574,13 +25294,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 190, + "weight": 137, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-platform.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-platform.md", "rate-limit": 0, @@ -22669,13 +25389,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 191, + "weight": 138, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-platform.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-platform.md", "rate-limit": 0, @@ -22739,13 +25459,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 159, + "weight": 106, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-service-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status.md", "rate-limit": 0, @@ -22791,6 +25511,7 @@ "account", "avatars", "databases", + "tablesdb", "locale", "health", "storage", @@ -22840,13 +25561,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 160, + "weight": 107, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-service-status-all.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status-all.md", "rate-limit": 0, @@ -22919,13 +25640,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 192, + "weight": 139, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-smtp.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-smtp.md", "rate-limit": 0, @@ -22936,6 +25657,80 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMTP" + }, + "methods": [ + { + "name": "updateSmtp", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "enabled", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "enabled" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "demo": "projects\/update-smtp.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMTP" + } + }, + { + "name": "updateSMTP", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "enabled", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "enabled" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/project" + } + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "demo": "projects\/update-smtp.md" + } + ], "auth": { "Project": [] } @@ -23037,13 +25832,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 193, + "weight": 140, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create-smtp-test.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-smtp-test.md", "rate-limit": 0, @@ -23054,6 +25849,84 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.createSMTPTest" + }, + "methods": [ + { + "name": "createSmtpTest", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "host" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Send a test email to verify SMTP configuration. ", + "demo": "projects\/create-smtp-test.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.createSMTPTest" + } + }, + { + "name": "createSMTPTest", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "host" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Send a test email to verify SMTP configuration. ", + "demo": "projects\/create-smtp-test.md" + } + ], "auth": { "Project": [] } @@ -23168,13 +26041,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 158, + "weight": 105, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-team.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-team.md", "rate-limit": 0, @@ -23247,13 +26120,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 195, + "weight": 142, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-email-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-email-template.md", "rate-limit": 0, @@ -23471,13 +26344,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 197, + "weight": 144, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-email-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-email-template.md", "rate-limit": 0, @@ -23735,13 +26608,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 199, + "weight": 146, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-email-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-email-template.md", "rate-limit": 0, @@ -23961,13 +26834,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 194, + "weight": 141, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-sms-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-sms-template.md", "rate-limit": 0, @@ -23978,6 +26851,68 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.getSMSTemplate" + }, + "methods": [ + { + "name": "getSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "demo": "projects\/get-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.getSMSTemplate" + } + }, + { + "name": "getSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "demo": "projects\/get-sms-template.md" + } + ], "auth": { "Project": [] } @@ -24182,13 +27117,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 196, + "weight": 143, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-sms-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-sms-template.md", "rate-limit": 0, @@ -24199,6 +27134,72 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMSTemplate" + }, + "methods": [ + { + "name": "updateSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale", + "message" + ], + "required": [ + "projectId", + "type", + "locale", + "message" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "demo": "projects\/update-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMSTemplate" + } + }, + { + "name": "updateSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale", + "message" + ], + "required": [ + "projectId", + "type", + "locale", + "message" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "demo": "projects\/update-sms-template.md" + } + ], "auth": { "Project": [] } @@ -24422,13 +27423,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 198, + "weight": 145, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-sms-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-sms-template.md", "rate-limit": 0, @@ -24439,6 +27440,68 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.deleteSMSTemplate" + }, + "methods": [ + { + "name": "deleteSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "demo": "projects\/delete-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.deleteSMSTemplate" + } + }, + { + "name": "deleteSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/smsTemplate" + } + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "demo": "projects\/delete-sms-template.md" + } + ], "auth": { "Project": [] } @@ -24645,13 +27708,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 176, + "weight": 123, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/list-webhooks.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-webhooks.md", "rate-limit": 0, @@ -24703,13 +27766,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 175, + "weight": 122, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create-webhook.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-webhook.md", "rate-limit": 0, @@ -24818,13 +27881,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 177, + "weight": 124, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-webhook.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-webhook.md", "rate-limit": 0, @@ -24886,13 +27949,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 178, + "weight": 125, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-webhook.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook.md", "rate-limit": 0, @@ -25002,13 +28065,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 180, + "weight": 127, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-webhook.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-webhook.md", "rate-limit": 0, @@ -25072,13 +28135,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 179, + "weight": 126, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-webhook-signature.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook-signature.md", "rate-limit": 0, @@ -25142,15 +28205,15 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listRules", "group": null, - "weight": 292, + "weight": 502, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/list-rules.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/list-rules.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the proxy rules. You can use the query params to filter your results.", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25216,14 +28279,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 433, + "weight": 497, "cookies": false, "type": "", - "deprecated": false, - "demo": "proxy\/create-a-p-i-rule.md", + "demo": "proxy\/create-api-rule.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite's API on custom domain.", "rate-limit": 10, "rate-time": 60, @@ -25283,13 +28346,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 435, + "weight": 499, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/create-function-rule.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for executing Appwrite Function on custom domain.", "rate-limit": 10, @@ -25361,13 +28424,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 436, + "weight": 500, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/create-redirect-rule.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for to redirect from custom domain to another domain.", "rate-limit": 10, @@ -25420,12 +28483,33 @@ "Temporary Redirect 307", "Permanent Redirect 308" ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "x-example": "<RESOURCE_ID>" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] } }, "required": [ "domain", "url", - "statusCode" + "statusCode", + "resourceId", + "resourceType" ] } } @@ -25453,13 +28537,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 434, + "weight": 498, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/create-site-rule.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite Site on custom domain.", "rate-limit": 10, @@ -25531,15 +28615,15 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getRule", "group": null, - "weight": 293, + "weight": 501, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/get-rule.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/get-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a proxy rule by its unique ID.", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25582,15 +28666,15 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 294, + "weight": 503, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/delete-rule.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/delete-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a proxy rule by its unique ID.", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25642,15 +28726,15 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 295, + "weight": 504, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/update-rule-verification.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/update-rule-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterRetry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25702,13 +28786,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 469, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", "rate-limit": 0, @@ -25772,13 +28856,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 467, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", "rate-limit": 0, @@ -25910,6 +28994,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -25935,7 +29020,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26019,13 +29105,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 472, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-frameworks.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", "rate-limit": 0, @@ -26068,13 +29154,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 495, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-specifications.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", "rate-limit": 0, @@ -26118,13 +29204,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 427, + "weight": 491, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-templates.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", "rate-limit": 0, @@ -26218,13 +29304,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 428, + "weight": 492, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", "rate-limit": 0, @@ -26278,13 +29364,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listUsage", "group": null, - "weight": 429, + "weight": 493, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "rate-limit": 0, @@ -26317,7 +29403,7 @@ "30d", "90d" ], - "x-enum-name": "SiteUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -26350,13 +29436,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 468, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", "rate-limit": 0, @@ -26409,13 +29495,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 470, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", "rate-limit": 0, @@ -26554,6 +29640,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26579,7 +29666,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26652,13 +29740,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 471, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", "rate-limit": 0, @@ -26713,13 +29801,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 478, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-site-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", "rate-limit": 0, @@ -26793,13 +29881,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 477, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-deployments.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", "rate-limit": 0, @@ -26876,13 +29964,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 473, "cookies": false, "type": "upload", - "deprecated": false, "demo": "sites\/create-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", "rate-limit": 0, @@ -26977,13 +30065,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 481, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-duplicate-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "rate-limit": 0, @@ -27057,13 +30145,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 474, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-template-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", "rate-limit": 0, @@ -27160,13 +30248,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 475, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-vcs-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "rate-limit": 0, @@ -27258,13 +30346,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 476, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", "rate-limit": 0, @@ -27320,13 +30408,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 479, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", "rate-limit": 0, @@ -27384,13 +30472,13 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 480, "cookies": false, "type": "location", - "deprecated": false, "demo": "sites\/get-deployment-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "rate-limit": 0, @@ -27474,13 +30562,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 482, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-deployment-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "rate-limit": 0, @@ -27545,13 +30633,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 484, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", "rate-limit": 0, @@ -27616,13 +30704,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 483, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-log.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", "rate-limit": 0, @@ -27678,13 +30766,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 485, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-log.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", "rate-limit": 0, @@ -27749,13 +30837,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getUsage", "group": null, - "weight": 430, + "weight": 494, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "rate-limit": 0, @@ -27798,7 +30886,7 @@ "30d", "90d" ], - "x-enum-name": "SiteUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -27831,13 +30919,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 488, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", "rate-limit": 0, @@ -27890,13 +30978,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 486, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", "rate-limit": 0, @@ -27981,13 +31069,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 487, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", "rate-limit": 0, @@ -28050,13 +31138,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 489, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", "rate-limit": 0, @@ -28141,13 +31229,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 490, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", "rate-limit": 0, @@ -28212,13 +31300,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 155, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/list-buckets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", "rate-limit": 0, @@ -28285,13 +31373,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 154, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/create-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", "rate-limit": 0, @@ -28412,13 +31500,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 156, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", "rate-limit": 0, @@ -28471,13 +31559,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 157, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/update-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", "rate-limit": 0, @@ -28595,13 +31683,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 158, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/delete-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", "rate-limit": 0, @@ -28656,13 +31744,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 160, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/list-files.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", "rate-limit": 0, @@ -28742,13 +31830,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 159, "cookies": false, "type": "upload", - "deprecated": false, "demo": "storage\/create-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", "rate-limit": 60, @@ -28840,13 +31928,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 161, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", "rate-limit": 0, @@ -28912,13 +32000,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 166, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/update-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", "rate-limit": 60, @@ -29001,13 +32089,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 167, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/delete-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", "rate-limit": 60, @@ -29068,13 +32156,13 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 163, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", "rate-limit": 0, @@ -29146,13 +32234,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 162, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-preview.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", "rate-limit": 0, @@ -29338,7 +32426,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -29373,13 +32462,13 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 164, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-view.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", "rate-limit": 0, @@ -29458,13 +32547,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getUsage", "group": null, - "weight": 220, + "weight": 168, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-usage.md", "rate-limit": 0, @@ -29497,7 +32586,7 @@ "30d", "90d" ], - "x-enum-name": "StorageUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -29530,13 +32619,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 221, + "weight": 169, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-bucket-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", "rate-limit": 0, @@ -29579,7 +32668,6184 @@ "30d", "90d" ], - "x-enum-name": "StorageUsageRange", + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb": { + "get": { + "summary": "List databases", + "operationId": "tablesDBList", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "tablesdb", + "weight": 376, + "cookies": false, + "type": "", + "demo": "tablesdb\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "tablesDBCreate", + "tags": [ + "tablesDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "tablesdb", + "weight": 372, + "cookies": false, + "type": "", + "demo": "tablesdb\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/usage": { + "get": { + "summary": "Get TablesDB usage stats", + "operationId": "tablesDBListUsage", + "tags": [ + "tablesDB" + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabases", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageDatabases" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 378, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "methods": [ + { + "name": "listUsage", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "range" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/usageDatabases" + } + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "tablesdb\/list-usage.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "tablesDBGet", + "tags": [ + "tablesDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tablesdb", + "weight": 373, + "cookies": false, + "type": "", + "demo": "tablesdb\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "tablesDBUpdate", + "tags": [ + "tablesDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tablesdb", + "weight": 374, + "cookies": false, + "type": "", + "demo": "tablesdb\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "tablesDBDelete", + "tags": [ + "tablesDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tablesdb", + "weight": 375, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables": { + "get": { + "summary": "List tables", + "operationId": "tablesDBListTables", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Tables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/tableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTables", + "group": "tables", + "weight": 383, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-tables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-tables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create table", + "operationId": "tablesDBCreateTable", + "tags": [ + "tablesDB" + ], + "description": "Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTable", + "group": "tables", + "weight": 379, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "tableId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TABLE_ID>" + }, + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "tableId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}": { + "get": { + "summary": "Get table", + "operationId": "tablesDBGetTable", + "tags": [ + "tablesDB" + ], + "description": "Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTable", + "group": "tables", + "weight": 380, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update table", + "operationId": "tablesDBUpdateTable", + "tags": [ + "tablesDB" + ], + "description": "Update a table by its unique ID.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTable", + "group": "tables", + "weight": 381, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete table", + "operationId": "tablesDBDeleteTable", + "tags": [ + "tablesDB" + ], + "description": "Delete a table by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTable", + "group": "tables", + "weight": 382, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns": { + "get": { + "summary": "List columns", + "operationId": "tablesDBListColumns", + "tags": [ + "tablesDB" + ], + "description": "List columns in the table.", + "responses": { + "200": { + "description": "Columns List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listColumns", + "group": "columns", + "weight": 388, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-columns.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-columns.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean": { + "post": { + "summary": "Create boolean column", + "operationId": "tablesDBCreateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a boolean column.\n", + "responses": { + "202": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBooleanColumn", + "group": "columns", + "weight": 389, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean\/{key}": { + "patch": { + "summary": "Update boolean column", + "operationId": "tablesDBUpdateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a boolean column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBooleanColumn", + "group": "columns", + "weight": 390, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime": { + "post": { + "summary": "Create datetime column", + "operationId": "tablesDBCreateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a date time column according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDatetimeColumn", + "group": "columns", + "weight": 391, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime column", + "operationId": "tablesDBUpdateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a date time column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDatetimeColumn", + "group": "columns", + "weight": 392, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email": { + "post": { + "summary": "Create email column", + "operationId": "tablesDBCreateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an email column.\n", + "responses": { + "202": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailColumn", + "group": "columns", + "weight": 393, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email\/{key}": { + "patch": { + "summary": "Update email column", + "operationId": "tablesDBUpdateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an email column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailColumn", + "group": "columns", + "weight": 394, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum": { + "post": { + "summary": "Create enum column", + "operationId": "tablesDBCreateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column.", + "responses": { + "202": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEnumColumn", + "group": "columns", + "weight": 395, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum\/{key}": { + "patch": { + "summary": "Update enum column", + "operationId": "tablesDBUpdateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an enum column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEnumColumn", + "group": "columns", + "weight": 396, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float": { + "post": { + "summary": "Create float column", + "operationId": "tablesDBCreateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a float column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFloatColumn", + "group": "columns", + "weight": 397, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float\/{key}": { + "patch": { + "summary": "Update float column", + "operationId": "tablesDBUpdateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a float column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFloatColumn", + "group": "columns", + "weight": 398, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer": { + "post": { + "summary": "Create integer column", + "operationId": "tablesDBCreateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an integer column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIntegerColumn", + "group": "columns", + "weight": 399, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer\/{key}": { + "patch": { + "summary": "Update integer column", + "operationId": "tablesDBUpdateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an integer column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIntegerColumn", + "group": "columns", + "weight": 400, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip": { + "post": { + "summary": "Create IP address column", + "operationId": "tablesDBCreateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Create IP address column.\n", + "responses": { + "202": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIpColumn", + "group": "columns", + "weight": 401, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip\/{key}": { + "patch": { + "summary": "Update IP address column", + "operationId": "tablesDBUpdateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an ip column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIpColumn", + "group": "columns", + "weight": 402, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line column.", + "responses": { + "202": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 403, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 404, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point column.", + "responses": { + "202": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 405, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 406, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon column.", + "responses": { + "202": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 407, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { + "post": { + "summary": "Create relationship column", + "operationId": "tablesDBCreateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Create relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "202": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRelationshipColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedTableId": { + "type": "string", + "description": "Related Table ID.", + "x-example": "<RELATED_TABLE_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "x-example": false + }, + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Column Key.", + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedTableId", + "type" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string": { + "post": { + "summary": "Create string column", + "operationId": "tablesDBCreateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a string column.\n", + "responses": { + "202": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createStringColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "size": { + "type": "integer", + "description": "Column size for text columns, in number of characters.", + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string\/{key}": { + "patch": { + "summary": "Update string column", + "operationId": "tablesDBUpdateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a string column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStringColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string column.", + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url": { + "post": { + "summary": "Create URL column", + "operationId": "tablesDBCreateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a URL column.\n", + "responses": { + "202": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createUrlColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url\/{key}": { + "patch": { + "summary": "Update URL column", + "operationId": "tablesDBUpdateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an url column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateUrlColumn", + "group": "columns", + "weight": 414, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}": { + "get": { + "summary": "Get column", + "operationId": "tablesDBGetColumn", + "tags": [ + "tablesDB" + ], + "description": "Get column by ID.", + "responses": { + "200": { + "description": "ColumnBoolean, or ColumnInteger, or ColumnFloat, or ColumnEmail, or ColumnEnum, or ColumnURL, or ColumnIP, or ColumnDatetime, or ColumnRelationship, or ColumnString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getColumn", + "group": "columns", + "weight": 386, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete column", + "operationId": "tablesDBDeleteColumn", + "tags": [ + "tablesDB" + ], + "description": "Deletes a column.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteColumn", + "group": "columns", + "weight": 387, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}\/relationship": { + "patch": { + "summary": "Update relationship column", + "operationId": "tablesDBUpdateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Update relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "200": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRelationshipColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "tablesDBListIndexes", + "tags": [ + "tablesDB" + ], + "description": "List indexes on the table.", + "responses": { + "200": { + "description": "Column Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndexList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 418, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "tablesDBCreateIndex", + "tags": [ + "tablesDB" + ], + "description": "Creates an index on the columns listed. Your index should include all the columns you will query in a single request.\nType can be `key`, `fulltext`, or `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 415, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "columns": { + "type": "array", + "description": "Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "columns" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "tablesDBGetIndex", + "tags": [ + "tablesDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 416, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "tablesDBDeleteIndex", + "tags": [ + "tablesDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 417, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/logs": { + "get": { + "summary": "List table logs", + "operationId": "tablesDBListTableLogs", + "tags": [ + "tablesDB" + ], + "description": "Get the table activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTableLogs", + "group": "tables", + "weight": 384, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-table-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + }, + { + "name": "createRows", + "namespace": "tablesDB", + "desc": "Create rows", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-rows.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<ROW_ID>" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Upsert rows", + "operationId": "tablesDBUpsertRows", + "tags": [ + "tablesDB" + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRows", + "group": "rows", + "weight": 424, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRows", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "demo": "tablesdb\/upsert-rows.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "description": "Array of row data as JSON objects. May contain partial rows.", + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "rows" + ] + } + } + } + } + }, + "patch": { + "summary": "Update rows", + "operationId": "tablesDBUpdateRows", + "tags": [ + "tablesDB" + ], + "description": "Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRows", + "group": "rows", + "weight": 422, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only column and value pairs to be updated.", + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete rows", + "operationId": "tablesDBDeleteRows", + "tags": [ + "tablesDB" + ], + "description": "Bulk delete rows using queries, if no queries are passed then all rows are deleted.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRows", + "group": "rows", + "weight": 426, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-rows.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/logs": { + "get": { + "summary": "List row logs", + "operationId": "tablesDBListRowLogs", + "tags": [ + "tablesDB" + ], + "description": "Get the row activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRowLogs", + "group": "logs", + "weight": 428, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-row-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/usage": { + "get": { + "summary": "Get table usage stats", + "operationId": "tablesDBGetTableUsage", + "tags": [ + "tablesDB" + ], + "description": "Get usage metrics and statistics for a table. Returning the total number of rows. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageTable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageTable" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTableUsage", + "group": null, + "weight": 385, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/usage": { + "get": { + "summary": "Get TablesDB usage stats", + "operationId": "tablesDBGetUsage", + "tags": [ + "tablesDB" + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabase", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageDatabase" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 377, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-database-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "methods": [ + { + "name": "getUsage", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "range" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/usageDatabase" + } + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "tablesdb\/get-usage.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -29612,13 +38878,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 171, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", "rate-limit": 0, @@ -29688,13 +38954,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 170, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", "rate-limit": 0, @@ -29773,13 +39039,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 172, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", "rate-limit": 0, @@ -29835,13 +39101,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 174, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", "rate-limit": 0, @@ -29909,13 +39175,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 176, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", "rate-limit": 0, @@ -29973,13 +39239,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 235, + "weight": 183, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md", "rate-limit": 0, @@ -30046,13 +39312,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 178, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list-memberships.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", "rate-limit": 0, @@ -30132,13 +39398,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 177, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", "rate-limit": 10, @@ -30243,13 +39509,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 179, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", "rate-limit": 0, @@ -30315,13 +39581,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 180, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", "rate-limit": 0, @@ -30402,13 +39668,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 182, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", "rate-limit": 0, @@ -30476,13 +39742,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 181, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", "rate-limit": 0, @@ -30573,13 +39839,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 173, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", "rate-limit": 0, @@ -30633,13 +39899,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 175, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", "rate-limit": 0, @@ -30714,13 +39980,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 507, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", "rate-limit": 0, @@ -30794,13 +40060,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 505, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/create-file-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", "rate-limit": 60, @@ -30883,13 +40149,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 506, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", "rate-limit": 0, @@ -30943,13 +40209,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 508, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", "rate-limit": 60, @@ -31013,13 +40279,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 509, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", "rate-limit": 60, @@ -31075,13 +40341,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 193, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md", "rate-limit": 0, @@ -31148,13 +40414,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 184, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md", "rate-limit": 0, @@ -31236,14 +40502,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 187, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-argon2user.md", + "demo": "users\/create-argon-2-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", "rate-limit": 0, "rate-time": 3600, @@ -31321,13 +40587,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 185, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-bcrypt-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", "rate-limit": 0, @@ -31406,13 +40672,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 201, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-identities.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", "rate-limit": 0, @@ -31474,13 +40740,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 224, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-identity.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", "rate-limit": 0, @@ -31535,14 +40801,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 186, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-m-d5user.md", + "demo": "users\/create-md-5-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", "rate-limit": 0, "rate-time": 3600, @@ -31620,14 +40886,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 189, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-p-h-pass-user.md", + "demo": "users\/create-ph-pass-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", "rate-limit": 0, "rate-time": 3600, @@ -31705,13 +40971,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 190, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-scrypt-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", "rate-limit": 0, @@ -31820,13 +41086,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 191, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-scrypt-modified-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", "rate-limit": 0, @@ -31923,14 +41189,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 188, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-s-h-a-user.md", + "demo": "users\/create-sha-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", "rate-limit": 0, "rate-time": 3600, @@ -32028,13 +41294,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getUsage", "group": null, - "weight": 278, + "weight": 226, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-usage.md", "rate-limit": 0, @@ -32067,7 +41333,7 @@ "30d", "90d" ], - "x-enum-name": "UserUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -32100,13 +41366,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 194, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md", "rate-limit": 0, @@ -32152,13 +41418,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 222, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", "rate-limit": 0, @@ -32213,13 +41479,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 207, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", "rate-limit": 0, @@ -32293,14 +41559,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 225, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-j-w-t.md", + "demo": "users\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", "rate-limit": 0, "rate-time": 3600, @@ -32375,13 +41641,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 203, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-labels.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", "rate-limit": 0, @@ -32458,13 +41724,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 199, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", "rate-limit": 0, @@ -32532,13 +41798,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 198, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-memberships.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", "rate-limit": 0, @@ -32617,13 +41883,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 212, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-mfa.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", "rate-limit": 0, @@ -32634,6 +41900,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + }, + "methods": [ + { + "name": "updateMfa", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + } + }, + { + "name": "updateMFA", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md" + } + ], "auth": { "Project": [] } @@ -32690,13 +42014,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 217, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", "rate-limit": 0, @@ -32707,6 +42031,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -32766,13 +42146,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 213, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-mfa-factors.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", "rate-limit": 0, @@ -32783,6 +42163,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md" + } + ], "auth": { "Project": [] } @@ -32827,13 +42261,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 214, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", "rate-limit": 0, @@ -32844,6 +42278,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -32886,13 +42374,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 216, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", "rate-limit": 0, @@ -32903,6 +42391,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -32945,13 +42487,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 215, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", "rate-limit": 0, @@ -32962,6 +42504,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -33006,13 +42602,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 205, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", "rate-limit": 0, @@ -33086,13 +42682,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 206, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-password.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", "rate-limit": 0, @@ -33166,13 +42762,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 208, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-phone.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", "rate-limit": 0, @@ -33246,13 +42842,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 195, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md", "rate-limit": 0, @@ -33305,13 +42901,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 210, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md", "rate-limit": 0, @@ -33385,13 +42981,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 197, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", "rate-limit": 0, @@ -33444,13 +43040,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 218, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", "rate-limit": 0, @@ -33496,13 +43092,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 221, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", "rate-limit": 0, @@ -33550,13 +43146,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 220, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", "rate-limit": 0, @@ -33621,13 +43217,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 202, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md", "rate-limit": 0, @@ -33701,13 +43297,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 200, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-targets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", "rate-limit": 0, @@ -33742,7 +43338,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "schema": { "type": "array", @@ -33774,13 +43370,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 192, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", "rate-limit": 0, @@ -33884,13 +43480,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 196, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", "rate-limit": 0, @@ -33954,13 +43550,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 211, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", "rate-limit": 0, @@ -34043,13 +43639,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 223, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", "rate-limit": 0, @@ -34115,13 +43711,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 219, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", "rate-limit": 0, @@ -34197,13 +43793,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 209, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-email-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", "rate-limit": 0, @@ -34277,13 +43873,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 204, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", "rate-limit": 0, @@ -34357,13 +43953,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 282, + "weight": 230, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/create-repository-detection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository-detection.md", "rate-limit": 0, @@ -34453,13 +44049,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 283, + "weight": 231, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/list-repositories.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repositories.md", "rate-limit": 0, @@ -34538,13 +44134,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 284, + "weight": 232, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/create-repository.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository.md", "rate-limit": 0, @@ -34623,13 +44219,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 285, + "weight": 233, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/get-repository.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository.md", "rate-limit": 0, @@ -34693,13 +44289,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 286, + "weight": 234, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/list-repository-branches.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repository-branches.md", "rate-limit": 0, @@ -34750,7 +44346,7 @@ "tags": [ "vcs" ], - "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "VCS Content List", @@ -34763,13 +44359,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 281, + "weight": 229, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/get-repository-contents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository-contents.md", "rate-limit": 0, @@ -34820,6 +44416,17 @@ "default": "" }, "in": "query" + }, + { + "name": "providerReference", + "description": "Git reference (branch, tag, commit) to get contents from", + "required": false, + "schema": { + "type": "string", + "x-example": "<PROVIDER_REFERENCE>", + "default": "" + }, + "in": "query" } ] } @@ -34837,13 +44444,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 291, + "weight": 239, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/update-external-deployments.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/update-external-deployments.md", "rate-limit": 0, @@ -34926,13 +44533,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 288, + "weight": 236, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/list-installations.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-installations.md", "rate-limit": 0, @@ -35000,13 +44607,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 289, + "weight": 237, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/get-installation.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-installation.md", "rate-limit": 0, @@ -35051,13 +44658,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 290, + "weight": 238, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/delete-installation.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/delete-installation.md", "rate-limit": 0, @@ -35105,6 +44712,10 @@ "name": "databases", "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, { "name": "locale", "description": "The Locale service allows you to customize your app based on your users' location." @@ -35167,7 +44778,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -35199,7 +44811,41 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "$ref": "#\/components\/schemas\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } }, "documentList": { "description": "Documents List", @@ -35207,7 +44853,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of documents documents that matched your query.", + "description": "Total number of documents that matched your query.", "x-example": 5, "format": "int32" }, @@ -35223,7 +44869,39 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } + }, + "tableList": { + "description": "Tables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tables": { + "type": "array", + "description": "List of tables.", + "items": { + "$ref": "#\/components\/schemas\/table" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tables" + ], + "example": { + "total": 5, + "tables": "" + } }, "collectionList": { "description": "Collections List", @@ -35231,7 +44909,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of collections documents that matched your query.", + "description": "Total number of collections that matched your query.", "x-example": 5, "format": "int32" }, @@ -35247,7 +44925,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -35255,7 +44937,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of databases documents that matched your query.", + "description": "Total number of databases that matched your query.", "x-example": 5, "format": "int32" }, @@ -35271,7 +44953,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -35279,7 +44965,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of indexes documents that matched your query.", + "description": "Total number of indexes that matched your query.", "x-example": 5, "format": "int32" }, @@ -35295,7 +44981,39 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "columnIndexList": { + "description": "Column Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -35303,7 +45021,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of users documents that matched your query.", + "description": "Total number of users that matched your query.", "x-example": 5, "format": "int32" }, @@ -35319,7 +45037,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -35327,7 +45049,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of sessions documents that matched your query.", + "description": "Total number of sessions that matched your query.", "x-example": 5, "format": "int32" }, @@ -35343,7 +45065,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -35351,7 +45077,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of identities documents that matched your query.", + "description": "Total number of identities that matched your query.", "x-example": 5, "format": "int32" }, @@ -35367,7 +45093,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -35375,7 +45105,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of logs documents that matched your query.", + "description": "Total number of logs that matched your query.", "x-example": 5, "format": "int32" }, @@ -35391,7 +45121,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -35399,7 +45133,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of files documents that matched your query.", + "description": "Total number of files that matched your query.", "x-example": 5, "format": "int32" }, @@ -35415,7 +45149,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -35423,7 +45161,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of buckets documents that matched your query.", + "description": "Total number of buckets that matched your query.", "x-example": 5, "format": "int32" }, @@ -35439,7 +45177,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -35447,7 +45189,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of tokens documents that matched your query.", + "description": "Total number of tokens that matched your query.", "x-example": 5, "format": "int32" }, @@ -35463,7 +45205,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -35471,7 +45217,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of teams documents that matched your query.", + "description": "Total number of teams that matched your query.", "x-example": 5, "format": "int32" }, @@ -35487,7 +45233,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -35495,7 +45245,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of memberships documents that matched your query.", + "description": "Total number of memberships that matched your query.", "x-example": 5, "format": "int32" }, @@ -35511,7 +45261,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -35519,7 +45273,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of sites documents that matched your query.", + "description": "Total number of sites that matched your query.", "x-example": 5, "format": "int32" }, @@ -35535,7 +45289,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "templateSiteList": { "description": "Site Templates List", @@ -35543,7 +45301,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of templates documents that matched your query.", + "description": "Total number of templates that matched your query.", "x-example": 5, "format": "int32" }, @@ -35559,7 +45317,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "functionList": { "description": "Functions List", @@ -35567,7 +45329,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of functions documents that matched your query.", + "description": "Total number of functions that matched your query.", "x-example": 5, "format": "int32" }, @@ -35583,7 +45345,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "templateFunctionList": { "description": "Function Templates List", @@ -35591,7 +45357,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of templates documents that matched your query.", + "description": "Total number of templates that matched your query.", "x-example": 5, "format": "int32" }, @@ -35607,7 +45373,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "installationList": { "description": "Installations List", @@ -35615,7 +45385,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of installations documents that matched your query.", + "description": "Total number of installations that matched your query.", "x-example": 5, "format": "int32" }, @@ -35631,7 +45401,11 @@ "required": [ "total", "installations" - ] + ], + "example": { + "total": 5, + "installations": "" + } }, "providerRepositoryFrameworkList": { "description": "Framework Provider Repositories List", @@ -35639,7 +45413,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of frameworkProviderRepositories documents that matched your query.", + "description": "Total number of frameworkProviderRepositories that matched your query.", "x-example": 5, "format": "int32" }, @@ -35655,7 +45429,11 @@ "required": [ "total", "frameworkProviderRepositories" - ] + ], + "example": { + "total": 5, + "frameworkProviderRepositories": "" + } }, "providerRepositoryRuntimeList": { "description": "Runtime Provider Repositories List", @@ -35663,7 +45441,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of runtimeProviderRepositories documents that matched your query.", + "description": "Total number of runtimeProviderRepositories that matched your query.", "x-example": 5, "format": "int32" }, @@ -35679,7 +45457,11 @@ "required": [ "total", "runtimeProviderRepositories" - ] + ], + "example": { + "total": 5, + "runtimeProviderRepositories": "" + } }, "branchList": { "description": "Branches List", @@ -35687,7 +45469,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of branches documents that matched your query.", + "description": "Total number of branches that matched your query.", "x-example": 5, "format": "int32" }, @@ -35703,7 +45485,11 @@ "required": [ "total", "branches" - ] + ], + "example": { + "total": 5, + "branches": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -35711,7 +45497,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of frameworks documents that matched your query.", + "description": "Total number of frameworks that matched your query.", "x-example": 5, "format": "int32" }, @@ -35727,7 +45513,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -35735,7 +45525,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of runtimes documents that matched your query.", + "description": "Total number of runtimes that matched your query.", "x-example": 5, "format": "int32" }, @@ -35751,7 +45541,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -35759,7 +45553,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of deployments documents that matched your query.", + "description": "Total number of deployments that matched your query.", "x-example": 5, "format": "int32" }, @@ -35775,7 +45569,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -35783,7 +45581,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of executions documents that matched your query.", + "description": "Total number of executions that matched your query.", "x-example": 5, "format": "int32" }, @@ -35799,7 +45597,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "projectList": { "description": "Projects List", @@ -35807,7 +45609,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of projects documents that matched your query.", + "description": "Total number of projects that matched your query.", "x-example": 5, "format": "int32" }, @@ -35823,7 +45625,11 @@ "required": [ "total", "projects" - ] + ], + "example": { + "total": 5, + "projects": "" + } }, "webhookList": { "description": "Webhooks List", @@ -35831,7 +45637,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of webhooks documents that matched your query.", + "description": "Total number of webhooks that matched your query.", "x-example": 5, "format": "int32" }, @@ -35847,7 +45653,11 @@ "required": [ "total", "webhooks" - ] + ], + "example": { + "total": 5, + "webhooks": "" + } }, "keyList": { "description": "API Keys List", @@ -35855,7 +45665,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of keys documents that matched your query.", + "description": "Total number of keys that matched your query.", "x-example": 5, "format": "int32" }, @@ -35871,7 +45681,11 @@ "required": [ "total", "keys" - ] + ], + "example": { + "total": 5, + "keys": "" + } }, "devKeyList": { "description": "Dev Keys List", @@ -35879,7 +45693,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of devKeys documents that matched your query.", + "description": "Total number of devKeys that matched your query.", "x-example": 5, "format": "int32" }, @@ -35895,7 +45709,11 @@ "required": [ "total", "devKeys" - ] + ], + "example": { + "total": 5, + "devKeys": "" + } }, "platformList": { "description": "Platforms List", @@ -35903,7 +45721,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of platforms documents that matched your query.", + "description": "Total number of platforms that matched your query.", "x-example": 5, "format": "int32" }, @@ -35919,7 +45737,11 @@ "required": [ "total", "platforms" - ] + ], + "example": { + "total": 5, + "platforms": "" + } }, "countryList": { "description": "Countries List", @@ -35927,7 +45749,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of countries documents that matched your query.", + "description": "Total number of countries that matched your query.", "x-example": 5, "format": "int32" }, @@ -35943,7 +45765,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -35951,7 +45777,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of continents documents that matched your query.", + "description": "Total number of continents that matched your query.", "x-example": 5, "format": "int32" }, @@ -35967,7 +45793,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -35975,7 +45805,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of languages documents that matched your query.", + "description": "Total number of languages that matched your query.", "x-example": 5, "format": "int32" }, @@ -35991,7 +45821,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -35999,7 +45833,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of currencies documents that matched your query.", + "description": "Total number of currencies that matched your query.", "x-example": 5, "format": "int32" }, @@ -36015,7 +45849,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -36023,7 +45861,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of phones documents that matched your query.", + "description": "Total number of phones that matched your query.", "x-example": 5, "format": "int32" }, @@ -36039,7 +45877,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -36047,7 +45889,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of variables documents that matched your query.", + "description": "Total number of variables that matched your query.", "x-example": 5, "format": "int32" }, @@ -36063,7 +45905,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "proxyRuleList": { "description": "Rule List", @@ -36071,7 +45917,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of rules documents that matched your query.", + "description": "Total number of rules that matched your query.", "x-example": 5, "format": "int32" }, @@ -36087,7 +45933,11 @@ "required": [ "total", "rules" - ] + ], + "example": { + "total": 5, + "rules": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -36095,7 +45945,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of localeCodes documents that matched your query.", + "description": "Total number of localeCodes that matched your query.", "x-example": 5, "format": "int32" }, @@ -36111,7 +45961,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -36119,7 +45973,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of providers documents that matched your query.", + "description": "Total number of providers that matched your query.", "x-example": 5, "format": "int32" }, @@ -36135,7 +45989,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -36143,7 +46001,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of messages documents that matched your query.", + "description": "Total number of messages that matched your query.", "x-example": 5, "format": "int32" }, @@ -36159,7 +46017,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -36167,7 +46029,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of topics documents that matched your query.", + "description": "Total number of topics that matched your query.", "x-example": 5, "format": "int32" }, @@ -36183,7 +46045,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -36191,7 +46057,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of subscribers documents that matched your query.", + "description": "Total number of subscribers that matched your query.", "x-example": 5, "format": "int32" }, @@ -36207,7 +46073,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -36215,7 +46085,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of targets documents that matched your query.", + "description": "Total number of targets that matched your query.", "x-example": 5, "format": "int32" }, @@ -36231,7 +46101,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "migrationList": { "description": "Migrations List", @@ -36239,7 +46113,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of migrations documents that matched your query.", + "description": "Total number of migrations that matched your query.", "x-example": 5, "format": "int32" }, @@ -36255,7 +46129,11 @@ "required": [ "total", "migrations" - ] + ], + "example": { + "total": 5, + "migrations": "" + } }, "specificationList": { "description": "Specifications List", @@ -36263,7 +46141,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of specifications documents that matched your query.", + "description": "Total number of specifications that matched your query.", "x-example": 5, "format": "int32" }, @@ -36279,7 +46157,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "vcsContentList": { "description": "VCS Content List", @@ -36287,7 +46169,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of contents documents that matched your query.", + "description": "Total number of contents that matched your query.", "x-example": 5, "format": "int32" }, @@ -36303,7 +46185,11 @@ "required": [ "total", "contents" - ] + ], + "example": { + "total": 5, + "contents": "" + } }, "database": { "description": "Database", @@ -36333,6 +46219,11 @@ "type": "boolean", "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", "x-example": false + }, + "type": { + "type": "string", + "description": "Database type.", + "x-example": "legacy" } }, "required": [ @@ -36340,8 +46231,17 @@ "name", "$createdAt", "$updatedAt", - "enabled" - ] + "enabled", + "type" + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false, + "type": "legacy" + } }, "collection": { "description": "Collection", @@ -36424,6 +46324,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -36451,7 +46360,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -36495,6 +46418,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -36506,7 +46438,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -36525,7 +46461,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36564,6 +46508,12 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "default", "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "nullable": true } }, "required": [ @@ -36575,7 +46525,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -36594,7 +46557,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36652,7 +46623,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -36671,7 +46655,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36729,7 +46721,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -36748,7 +46753,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36791,7 +46804,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -36810,7 +46834,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36859,7 +46891,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -36878,7 +46922,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36936,7 +46988,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -36955,7 +47020,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -37004,7 +47077,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -37023,7 +47108,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -37072,7 +47165,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -37091,7 +47196,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -37140,7 +47253,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -37159,7 +47284,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -37232,15 +47365,1700 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + 0, + 0 + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "table": { + "description": "Table", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Table creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Table update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Table permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Table name.", + "x-example": "My Table" + }, + "enabled": { + "type": "boolean", + "description": "Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "rowSecurity": { + "type": "boolean", + "description": "Whether row-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "columns": { + "type": "array", + "description": "Table columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Table indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "rowSecurity", + "columns", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Table", + "enabled": false, + "rowSecurity": true, + "columns": {}, + "indexes": {} + } + }, + "columnList": { + "description": "Columns List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of columns in the given table.", + "x-example": 5, + "format": "int32" + }, + "columns": { + "type": "array", + "description": "List of columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "columns" + ], + "example": { + "total": 5, + "columns": "" + } + }, + "columnString": { + "description": "ColumnString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnInteger": { + "description": "ColumnInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 10, + "format": "int32", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnFloat": { + "description": "ColumnFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 2.5, + "format": "double", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "columnBoolean": { + "description": "ColumnBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "columnEmail": { + "description": "ColumnEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "columnEnum": { + "description": "ColumnEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "columnIp": { + "description": "ColumnIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "columnUrl": { + "description": "ColumnURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "https:\/\/example.com" + } + }, + "columnDatetime": { + "description": "ColumnDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "columnRelationship": { + "description": "ColumnRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedTable": { + "type": "string", + "description": "The ID of the related table.", + "x-example": "table" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedTable", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedTable": "table", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + 0, + 0 + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } }, "index": { "description": "Index", "type": "object", "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, "key": { "type": "string", - "description": "Index Key.", + "description": "Index key.", "x-example": "index1" }, "type": { @@ -37251,7 +49069,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -37283,6 +49108,40 @@ }, "x-example": [], "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "attributes", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [] + } + }, + "columnIndex": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" }, "$createdAt": { "type": "string", @@ -37293,18 +49152,148 @@ "type": "string", "description": "Index update date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "columns": { + "type": "array", + "description": "Index columns.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index columns length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "nullable": true } }, "required": [ + "$id", + "$createdAt", + "$updatedAt", "key", "type", "status", "error", - "attributes", - "lengths", + "columns", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "columns": [], + "lengths": [], + "orders": [] + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", "$createdAt", - "$updatedAt" - ] + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } }, "document": { "description": "Document", @@ -37315,15 +49304,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -37349,12 +49347,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -37488,7 +49503,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -37649,7 +49687,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -37663,7 +49727,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -37677,7 +49744,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -37691,7 +49761,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -37705,7 +49778,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -37747,7 +49823,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -37779,7 +49862,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -37814,12 +49903,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -38006,7 +50106,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -38074,7 +50207,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -38118,7 +50263,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -38132,7 +50285,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -38182,7 +50338,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -38202,7 +50367,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -38284,7 +50453,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -38376,7 +50560,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -38426,7 +50629,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -38477,7 +50689,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -38568,7 +50791,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -38754,7 +50994,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "templateSite": { "description": "Template Site", @@ -38849,7 +51120,22 @@ "providerOwner", "providerVersion", "variables" - ] + ], + "example": { + "key": "starter", + "name": "Starter site", + "tagline": "Minimal web app integrating with Appwrite.", + "demoUrl": "https:\/\/nextjs-starter.appwrite.network\/", + "screenshotDark": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png", + "screenshotLight": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png", + "useCases": "Starter", + "frameworks": [], + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [] + } }, "templateFramework": { "description": "Template Framework", @@ -38911,7 +51197,18 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/build", + "providerRootDirectory": ".\/svelte-kit\/starter", + "buildRuntime": "node-22", + "adapter": "ssr", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -39100,7 +51397,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "templateFunction": { "description": "Template Function", @@ -39229,7 +51556,26 @@ "providerVersion", "variables", "scopes" - ] + ], + "example": { + "icon": "icon-lightning-bolt", + "id": "starter", + "name": "Starter function", + "tagline": "A simple function to get started.", + "permissions": "any", + "events": "account.create", + "cron": "0 0 * * *", + "timeout": 300, + "useCases": "Starter", + "runtimes": [], + "instructions": "For documentation and instructions check out <link>.", + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [], + "scopes": "users.read" + } }, "templateRuntime": { "description": "Template Runtime", @@ -39261,7 +51607,13 @@ "commands", "entrypoint", "providerRootDirectory" - ] + ], + "example": { + "name": "node-19.0", + "commands": "npm install", + "entrypoint": "index.js", + "providerRootDirectory": "node\/starter" + } }, "templateVariable": { "description": "Template Variable", @@ -39311,7 +51663,16 @@ "placeholder", "required", "type" - ] + ], + "example": { + "name": "APPWRITE_DATABASE_ID", + "description": "The ID of the Appwrite database that contains the collection to sync.", + "value": "512", + "secret": false, + "placeholder": "64a55...7b912", + "required": false, + "type": "password" + } }, "installation": { "description": "Installation", @@ -39355,7 +51716,15 @@ "provider", "organization", "providerInstallationId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "provider": "github", + "organization": "appwrite", + "providerInstallationId": "5322" + } }, "providerRepository": { "description": "ProviderRepository", @@ -39386,6 +51755,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39398,8 +51772,18 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime" + } }, "providerRepositoryFramework": { "description": "ProviderRepositoryFramework", @@ -39430,6 +51814,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39447,9 +51836,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "framework" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "framework": "nextjs" + } }, "providerRepositoryRuntime": { "description": "ProviderRepositoryRuntime", @@ -39480,6 +51880,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39497,9 +51902,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "runtime" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "runtime": "node-22" + } }, "detectionFramework": { "description": "DetectionFramework", @@ -39531,7 +51947,13 @@ "installCommand", "buildCommand", "outputDirectory" - ] + ], + "example": { + "framework": "nuxt", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" + } }, "detectionRuntime": { "description": "DetectionRuntime", @@ -39557,7 +51979,12 @@ "runtime", "entrypoint", "commands" - ] + ], + "example": { + "runtime": "node", + "entrypoint": "index.js", + "commands": "npm install && npm run build" + } }, "vcsContent": { "description": "VcsContents", @@ -39584,7 +52011,12 @@ }, "required": [ "name" - ] + ], + "example": { + "size": 1523, + "isDirectory": true, + "name": "Main.java" + } }, "branch": { "description": "Branch", @@ -39598,7 +52030,10 @@ }, "required": [ "name" - ] + ], + "example": { + "name": "main" + } }, "runtime": { "description": "Runtime", @@ -39657,7 +52092,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -39712,7 +52157,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -39750,7 +52213,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -39832,7 +52302,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -39860,11 +52337,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -39890,6 +52362,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -39917,14 +52394,43 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -39942,7 +52448,7 @@ }, "$updatedAt": { "type": "string", - "description": "Execution upate date in ISO 8601 format.", + "description": "Execution update date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, "$permissions": { @@ -39960,15 +52466,31 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -39982,7 +52504,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "$ref": "#\/components\/schemas\/headers" }, @@ -40044,6 +52566,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -40055,7 +52578,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "project": { "description": "Project", @@ -40195,6 +52748,11 @@ "description": "Whether or not to show user MFA status in the teams membership response.", "x-example": true }, + "authInvalidateSessions": { + "type": "boolean", + "description": "Whether or not all existing sessions should be invalidated on password change", + "x-example": true + }, "oAuthProviders": { "type": "array", "description": "List of Auth Providers.", @@ -40341,7 +52899,12 @@ }, "serviceStatusForDatabases": { "type": "boolean", - "description": "Databases service status", + "description": "Databases (legacy) service status", + "x-example": true + }, + "serviceStatusForTablesdb": { + "type": "boolean", + "description": "TablesDB service status", "x-example": true }, "serviceStatusForLocale": { @@ -40416,6 +52979,7 @@ "authMembershipsUserName", "authMembershipsUserEmail", "authMembershipsMfa", + "authInvalidateSessions", "oAuthProviders", "platforms", "webhooks", @@ -40442,6 +53006,7 @@ "serviceStatusForAccount", "serviceStatusForAvatars", "serviceStatusForDatabases", + "serviceStatusForTablesdb", "serviceStatusForLocale", "serviceStatusForHealth", "serviceStatusForStorage", @@ -40451,7 +53016,75 @@ "serviceStatusForFunctions", "serviceStatusForGraphql", "serviceStatusForMessaging" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "description": "This is a new project.", + "teamId": "1592981250", + "logo": "5f5c451b403cb", + "url": "5f5c451b403cb", + "legalName": "Company LTD.", + "legalCountry": "US", + "legalState": "New York", + "legalCity": "New York City.", + "legalAddress": "620 Eighth Avenue, New York, NY 10018", + "legalTaxId": "131102020", + "authDuration": 60, + "authLimit": 100, + "authSessionsLimit": 10, + "authPasswordHistory": 5, + "authPasswordDictionary": true, + "authPersonalDataCheck": true, + "authMockNumbers": [ + {} + ], + "authSessionAlerts": true, + "authMembershipsUserName": true, + "authMembershipsUserEmail": true, + "authMembershipsMfa": true, + "authInvalidateSessions": true, + "oAuthProviders": [ + {} + ], + "platforms": {}, + "webhooks": {}, + "keys": {}, + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyTo": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "securepassword", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "authEmailPassword": true, + "authUsersAuthMagicURL": true, + "authEmailOtp": true, + "authAnonymous": true, + "authInvites": true, + "authJWT": true, + "authPhone": true, + "serviceStatusForAccount": true, + "serviceStatusForAvatars": true, + "serviceStatusForDatabases": true, + "serviceStatusForTablesdb": true, + "serviceStatusForLocale": true, + "serviceStatusForHealth": true, + "serviceStatusForStorage": true, + "serviceStatusForTeams": true, + "serviceStatusForUsers": true, + "serviceStatusForSites": true, + "serviceStatusForFunctions": true, + "serviceStatusForGraphql": true, + "serviceStatusForMessaging": true + } }, "webhook": { "description": "Webhook", @@ -40488,7 +53121,10 @@ "items": { "type": "string" }, - "x-example": "database.collections.update" + "x-example": [ + "databases.tables.update", + "databases.collections.update" + ] }, "security": { "type": "boolean", @@ -40541,7 +53177,25 @@ "enabled", "logs", "attempts" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": [ + "databases.tables.update", + "databases.collections.update" + ], + "security": true, + "httpUser": "username", + "httpPass": "password", + "signatureKey": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } }, "key": { "description": "Key", @@ -40609,7 +53263,18 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "devKey": { "description": "DevKey", @@ -40668,7 +53333,17 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "mockNumber": { "description": "Mock Number", @@ -40688,7 +53363,11 @@ "required": [ "phone", "otp" - ] + ], + "example": { + "phone": "+1612842323", + "otp": "123456" + } }, "authProvider": { "description": "AuthProvider", @@ -40726,7 +53405,14 @@ "appId", "secret", "enabled" - ] + ], + "example": { + "key": "github", + "name": "GitHub", + "appId": "259125845563242502", + "secret": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ", + "enabled": "" + } }, "platform": { "description": "Platform", @@ -40755,7 +53441,16 @@ "type": { "type": "string", "description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.", - "x-example": "web" + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "ios", + "android", + "unity" + ] }, "key": { "type": "string", @@ -40770,7 +53465,7 @@ "hostname": { "type": "string", "description": "Web app hostname. Empty string for other platforms.", - "x-example": true + "x-example": "app.example.com" }, "httpUser": { "type": "string", @@ -40794,7 +53489,19 @@ "hostname", "httpUser", "httpPass" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "key": "com.company.appname", + "store": "", + "hostname": "app.example.com", + "httpUser": "username", + "httpPass": "password" + } }, "variable": { "description": "Variable", @@ -40850,7 +53557,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -40870,7 +53587,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -40890,7 +53611,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -40916,7 +53641,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -40968,7 +53698,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -40994,7 +53733,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -41007,14 +53751,23 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -41029,7 +53782,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -41048,15 +53804,25 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "description": "Service status. Possible values are: `pass`, `fail`", + "x-example": "pass", + "enum": [ + "pass", + "fail" + ], + "x-enum-name": "HealthCheckStatus" } }, "required": [ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -41100,7 +53866,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -41129,7 +53903,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "metric": { "description": "Metric", @@ -41150,7 +53929,11 @@ "required": [ "value", "date" - ] + ], + "example": { + "value": 1, + "date": "2020-10-15T06:38:00.000+00:00" + } }, "metricBreakdown": { "description": "Metric Breakdown", @@ -41184,7 +53967,13 @@ "required": [ "name", "value" - ] + ], + "example": { + "resourceId": "5e5ea5c16897e", + "name": "Documents", + "value": 1, + "estimate": 1 + } }, "usageDatabases": { "description": "UsageDatabases", @@ -41207,12 +53996,24 @@ "x-example": 0, "format": "int32" }, + "tablesTotal": { + "type": "integer", + "description": "Total aggregated number of tables.", + "x-example": 0, + "format": "int32" + }, "documentsTotal": { "type": "integer", "description": "Total aggregated number of documents.", "x-example": 0, "format": "int32" }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, "storageTotal": { "type": "integer", "description": "Total aggregated number of total databases storage in bytes.", @@ -41247,6 +54048,14 @@ }, "x-example": [] }, + "tables": { + "type": "array", + "description": "Aggregated number of tables per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, "documents": { "type": "array", "description": "Aggregated number of documents per period.", @@ -41255,6 +54064,14 @@ }, "x-example": [] }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, "storage": { "type": "array", "description": "An array of the aggregated number of databases storage in bytes per period.", @@ -41284,17 +54101,40 @@ "range", "databasesTotal", "collectionsTotal", + "tablesTotal", "documentsTotal", + "rowsTotal", "storageTotal", "databasesReadsTotal", "databasesWritesTotal", "databases", "collections", + "tables", "documents", + "rows", "storage", "databasesReads", "databasesWrites" - ] + ], + "example": { + "range": "30d", + "databasesTotal": 0, + "collectionsTotal": 0, + "tablesTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "storageTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "databases": [], + "collections": [], + "tables": [], + "documents": [], + "rows": [], + "storage": [], + "databasesReads": [], + "databasesWrites": [] + } }, "usageDatabase": { "description": "UsageDatabase", @@ -41311,12 +54151,24 @@ "x-example": 0, "format": "int32" }, + "tablesTotal": { + "type": "integer", + "description": "Total aggregated number of tables.", + "x-example": 0, + "format": "int32" + }, "documentsTotal": { "type": "integer", "description": "Total aggregated number of documents.", "x-example": 0, "format": "int32" }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, "storageTotal": { "type": "integer", "description": "Total aggregated number of total storage used in bytes.", @@ -41343,6 +54195,14 @@ }, "x-example": [] }, + "tables": { + "type": "array", + "description": "Aggregated number of tables per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, "documents": { "type": "array", "description": "Aggregated number of documents per period.", @@ -41351,6 +54211,14 @@ }, "x-example": [] }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, "storage": { "type": "array", "description": "Aggregated storage used in bytes per period.", @@ -41379,16 +54247,72 @@ "required": [ "range", "collectionsTotal", + "tablesTotal", "documentsTotal", + "rowsTotal", "storageTotal", "databaseReadsTotal", "databaseWritesTotal", "collections", + "tables", "documents", + "rows", "storage", "databaseReads", "databaseWrites" - ] + ], + "example": { + "range": "30d", + "collectionsTotal": 0, + "tablesTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "storageTotal": 0, + "databaseReadsTotal": 0, + "databaseWritesTotal": 0, + "collections": [], + "tables": [], + "documents": [], + "rows": [], + "storage": [], + "databaseReads": [], + "databaseWrites": [] + } + }, + "usageTable": { + "description": "UsageTable", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of of rows.", + "x-example": 0, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "rowsTotal", + "rows" + ], + "example": { + "range": "30d", + "rowsTotal": 0, + "rows": [] + } }, "usageCollection": { "description": "UsageCollection", @@ -41418,7 +54342,12 @@ "range", "documentsTotal", "documents" - ] + ], + "example": { + "range": "30d", + "documentsTotal": 0, + "documents": [] + } }, "usageUsers": { "description": "UsageUsers", @@ -41464,7 +54393,14 @@ "sessionsTotal", "users", "sessions" - ] + ], + "example": { + "range": "30d", + "usersTotal": 0, + "sessionsTotal": 0, + "users": [], + "sessions": [] + } }, "usageStorage": { "description": "StorageUsage", @@ -41526,7 +54462,16 @@ "buckets", "files", "storage" - ] + ], + "example": { + "range": "30d", + "bucketsTotal": 0, + "filesTotal": 0, + "filesStorageTotal": 0, + "buckets": [], + "files": [], + "storage": [] + } }, "usageBuckets": { "description": "UsageBuckets", @@ -41588,7 +54533,16 @@ "storage", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "range": "30d", + "filesTotal": 0, + "filesStorageTotal": 0, + "files": [], + "storage": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "usageFunctions": { "description": "UsageFunctions", @@ -41794,7 +54748,34 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "functionsTotal": 0, + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "functions": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageFunction": { "description": "UsageFunction", @@ -41991,7 +54972,33 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageSites": { "description": "UsageSites", @@ -42245,7 +55252,40 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "sitesTotal": 0, + "sites": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageSite": { "description": "UsageSite", @@ -42490,7 +55530,39 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageProject": { "description": "UsageProject", @@ -42508,6 +55580,12 @@ "x-example": 0, "format": "int32" }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, "databasesTotal": { "type": "integer", "description": "Total aggregated number of databases.", @@ -42714,6 +55792,7 @@ "required": [ "executionsTotal", "documentsTotal", + "rowsTotal", "databasesTotal", "databasesStorageTotal", "usersTotal", @@ -42743,7 +55822,41 @@ "databasesWrites", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "executionsTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "databasesTotal": 0, + "databasesStorageTotal": 0, + "usersTotal": 0, + "filesStorageTotal": 0, + "functionsStorageTotal": 0, + "buildsStorageTotal": 0, + "deploymentsStorageTotal": 0, + "bucketsTotal": 0, + "executionsMbSecondsTotal": 0, + "buildsMbSecondsTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "requests": [], + "network": [], + "users": [], + "executions": [], + "executionsBreakdown": [], + "bucketsBreakdown": [], + "databasesStorageBreakdown": [], + "executionsMbSecondsBreakdown": [], + "buildsMbSecondsBreakdown": [], + "functionsStorageBreakdown": [], + "authPhoneTotal": 0, + "authPhoneEstimate": 0, + "authPhoneCountryBreakdown": [], + "databasesReads": [], + "databasesWrites": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "headers": { "description": "Headers", @@ -42763,7 +55876,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -42797,7 +55914,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "proxyRule": { "description": "Rule", @@ -42852,7 +55975,11 @@ "deploymentResourceType": { "type": "string", "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", - "x-example": "function" + "x-example": "function", + "enum": [ + "function", + "site" + ] }, "deploymentResourceId": { "type": "string", @@ -42862,12 +55989,18 @@ "deploymentVcsProviderBranch": { "type": "string", "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", - "x-example": "function" + "x-example": "main" }, "status": { "type": "string", "description": "Domain verification status. Possible values are \"created\", \"verifying\", \"verified\" and \"unverified\"", - "x-example": "verified" + "x-example": "verified", + "enum": [ + "created", + "verifying", + "verified", + "unverified" + ] }, "logs": { "type": "string", @@ -42896,7 +56029,24 @@ "status", "logs", "renewAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "main", + "status": "verified", + "logs": "HTTP challegne failed.", + "renewAt": "datetime" + } }, "smsTemplate": { "description": "SmsTemplate", @@ -42922,7 +56072,12 @@ "type", "locale", "message" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account." + } }, "emailTemplate": { "description": "EmailTemplate", @@ -42972,7 +56127,16 @@ "senderEmail", "replyTo", "subject" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyTo": "emails@appwrite.io", + "subject": "Please verify your email address" + } }, "consoleVariables": { "description": "Console Variables", @@ -42993,6 +56157,11 @@ "description": "AAAA target for your Appwrite custom domains.", "x-example": "::1" }, + "_APP_DOMAIN_TARGET_CAA": { + "type": "string", + "description": "CAA target for your Appwrite custom domains.", + "x-example": "digicert.com" + }, "_APP_STORAGE_LIMIT": { "type": "integer", "description": "Maximum file size allowed for file upload in bytes.", @@ -43050,6 +56219,7 @@ "_APP_DOMAIN_TARGET_CNAME", "_APP_DOMAIN_TARGET_A", "_APP_DOMAIN_TARGET_AAAA", + "_APP_DOMAIN_TARGET_CAA", "_APP_STORAGE_LIMIT", "_APP_COMPUTE_SIZE_LIMIT", "_APP_USAGE_STATS", @@ -43060,7 +56230,23 @@ "_APP_DOMAIN_FUNCTIONS", "_APP_OPTIONS_FORCE_HTTPS", "_APP_DOMAINS_NAMESERVERS" - ] + ], + "example": { + "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", + "_APP_DOMAIN_TARGET_A": "127.0.0.1", + "_APP_DOMAIN_TARGET_AAAA": "::1", + "_APP_DOMAIN_TARGET_CAA": "digicert.com", + "_APP_STORAGE_LIMIT": "30000000", + "_APP_COMPUTE_SIZE_LIMIT": "30000000", + "_APP_USAGE_STATS": "enabled", + "_APP_VCS_ENABLED": true, + "_APP_DOMAIN_ENABLED": true, + "_APP_ASSISTANT_ENABLED": true, + "_APP_DOMAIN_SITES": "sites.localhost", + "_APP_DOMAIN_FUNCTIONS": "functions.localhost", + "_APP_OPTIONS_FORCE_HTTPS": "enabled", + "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -43092,7 +56278,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -43112,7 +56304,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -43132,7 +56330,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -43164,7 +56366,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -43230,7 +56438,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -43326,7 +56549,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ @@ -43340,7 +56570,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -43402,7 +56658,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -43476,7 +56742,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -43538,7 +56824,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } }, "migration": { "description": "Migration", @@ -43626,7 +56923,23 @@ "statusCounters", "resourceData", "errors" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "stage": "init", + "source": "Appwrite", + "destination": "Appwrite", + "resources": [ + "user" + ], + "resourceId": "databaseId:collectionId", + "statusCounters": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}", + "resourceData": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]", + "errors": [] + } }, "migrationReport": { "description": "Migration Report", @@ -43650,9 +56963,9 @@ "x-example": 20, "format": "int32" }, - "document": { + "row": { "type": "integer", - "description": "Number of documents to be migrated.", + "description": "Number of rows to be migrated.", "x-example": 20, "format": "int32" }, @@ -43690,13 +57003,24 @@ "user", "team", "database", - "document", + "row", "file", "bucket", "function", "size", "version" - ] + ], + "example": { + "user": 20, + "team": 20, + "database": 20, + "row": 20, + "file": 20, + "bucket": 20, + "function": 20, + "size": 30000, + "version": "1.4.0" + } } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index db615d642c..93a0d9d46b 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.7.0", + "version": "1.8.0", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -44,13 +44,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "account", "weight": 10, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", "rate-limit": 0, @@ -94,13 +94,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "account", "weight": 9, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", "rate-limit": 10, @@ -179,13 +179,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "account", "weight": 35, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", "rate-limit": 0, @@ -256,13 +256,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listIdentities", "group": "identities", "weight": 58, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-identities.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", "rate-limit": 0, @@ -316,13 +316,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteIdentity", "group": "identities", "weight": 59, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-identity.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", "rate-limit": 0, @@ -380,14 +380,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "tokens", "weight": 30, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-j-w-t.md", + "demo": "account\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", "rate-limit": 100, "rate-time": 3600, @@ -429,13 +429,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", "weight": 32, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", "rate-limit": 0, @@ -496,14 +496,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMFA", "group": "mfa", "weight": 45, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/update-m-f-a.md", + "demo": "account\/update-mfa.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", "rate-limit": 0, "rate-time": 3600, @@ -567,13 +567,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", "weight": 47, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", "rate-limit": 0, @@ -585,6 +585,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], "auth": { "Project": [], "Session": [] @@ -634,13 +690,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", "weight": 48, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", "rate-limit": 0, @@ -652,6 +708,66 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], "auth": { "Project": [], "Session": [] @@ -713,13 +829,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", "weight": 52, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", "rate-limit": 0, @@ -731,6 +847,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], "auth": { "Project": [], "Session": [] @@ -782,13 +952,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", "weight": 53, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", "rate-limit": 10, @@ -800,6 +970,60 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], "auth": { "Project": [] } @@ -856,13 +1080,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", "weight": 54, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", "rate-limit": 10, @@ -874,6 +1098,66 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], "auth": { "Project": [], "Session": [] @@ -933,13 +1217,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listMfaFactors", "group": "mfa", "weight": 46, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-mfa-factors.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", "rate-limit": 0, @@ -951,6 +1235,54 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], "auth": { "Project": [], "Session": [] @@ -985,13 +1317,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", "weight": 51, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", "rate-limit": 0, @@ -1003,6 +1335,54 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Session": [] @@ -1035,13 +1415,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", "weight": 49, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", "rate-limit": 0, @@ -1053,6 +1433,54 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Session": [] @@ -1085,13 +1513,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", "weight": 50, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", "rate-limit": 0, @@ -1103,6 +1531,54 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Session": [] @@ -1137,13 +1613,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "account", "weight": 33, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", "rate-limit": 0, @@ -1208,13 +1684,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePassword", "group": "account", "weight": 34, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-password.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", "rate-limit": 10, @@ -1284,13 +1760,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhone", "group": "account", "weight": 36, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", "rate-limit": 0, @@ -1361,13 +1837,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "account", "weight": 31, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", "rate-limit": 0, @@ -1411,13 +1887,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "account", "weight": 37, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", "rate-limit": 0, @@ -1450,7 +1926,7 @@ "prefs": { "type": "object", "description": "Prefs key-value JSON object.", - "x-example": "{}" + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" } }, "required": [ @@ -1482,13 +1958,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRecovery", "group": "recovery", "weight": 39, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", "rate-limit": 10, @@ -1560,13 +2036,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateRecovery", "group": "recovery", "weight": 40, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", "rate-limit": 10, @@ -1643,13 +2119,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSessions", "group": "sessions", "weight": 12, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", "rate-limit": 0, @@ -1686,13 +2162,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSessions", "group": "sessions", "weight": 13, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", "rate-limit": 100, @@ -1738,13 +2214,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createAnonymousSession", "group": "sessions", "weight": 18, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-anonymous-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", "rate-limit": 50, @@ -1787,13 +2263,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailPasswordSession", "group": "sessions", "weight": 17, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-password-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", "rate-limit": 10, @@ -1861,14 +2337,14 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMagicURLSession", "group": "sessions", "weight": 27, "cookies": false, "type": "", - "deprecated": true, - "demo": "account\/update-magic-u-r-l-session.md", + "demo": "account\/update-magic-url-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, "rate-time": 3600, @@ -1879,6 +2355,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -1935,13 +2415,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updatePhoneSession", "group": "sessions", "weight": 28, "cookies": false, "type": "", - "deprecated": true, "demo": "account\/update-phone-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -1953,6 +2433,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -2009,13 +2493,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSession", "group": "sessions", "weight": 19, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -2083,13 +2567,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSession", "group": "sessions", "weight": 14, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", "rate-limit": 0, @@ -2145,13 +2629,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSession", "group": "sessions", "weight": 16, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", "rate-limit": 10, @@ -2200,13 +2684,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSession", "group": "sessions", "weight": 15, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", "rate-limit": 100, @@ -2264,13 +2748,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateStatus", "group": "account", "weight": 38, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", "rate-limit": 0, @@ -2303,7 +2787,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2316,13 +2800,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailToken", "group": "tokens", "weight": 26, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, @@ -2354,7 +2838,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "<USER_ID>" }, "email": { @@ -2398,14 +2882,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMagicURLToken", "group": "tokens", "weight": 25, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-magic-u-r-l-token.md", + "demo": "account\/create-magic-url-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", "rate-limit": 60, "rate-time": 3600, @@ -2436,7 +2920,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "x-example": "<USER_ID>" }, "email": { @@ -2478,14 +2962,14 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "createOAuth2Token", "group": "tokens", "weight": 24, "cookies": false, "type": "webAuth", - "deprecated": false, - "demo": "account\/create-o-auth2token.md", + "demo": "account\/create-o-auth-2-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", "rate-limit": 50, "rate-time": 3600, @@ -2620,13 +3104,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneToken", "group": "tokens", "weight": 29, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", "rate-limit": 10, @@ -2658,7 +3142,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "x-example": "<USER_ID>" }, "phone": { @@ -2697,13 +3181,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVerification", "group": "verification", "weight": 41, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", "rate-limit": 10, @@ -2766,13 +3250,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVerification", "group": "verification", "weight": 42, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", "rate-limit": 10, @@ -2843,13 +3327,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneVerification", "group": "verification", "weight": 43, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", "rate-limit": 10, @@ -2896,13 +3380,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhoneVerification", "group": "verification", "weight": 44, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", "rate-limit": 10, @@ -2966,13 +3450,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getBrowser", "group": null, "weight": 61, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-browser.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", "rate-limit": 0, @@ -3094,13 +3578,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getCreditCard", "group": null, "weight": 60, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-credit-card.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", "rate-limit": 0, @@ -3129,7 +3613,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "schema": { "type": "string", @@ -3147,7 +3631,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3167,7 +3651,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -3228,13 +3712,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getFavicon", "group": null, "weight": 64, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-favicon.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", "rate-limit": 0, @@ -3288,13 +3772,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getFlag", "group": null, "weight": 62, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-flag.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", "rate-limit": 0, @@ -3778,13 +4262,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getImage", "group": null, "weight": 63, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-image.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", "rate-limit": 0, @@ -3862,13 +4346,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getInitials", "group": null, "weight": 66, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-initials.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", "rate-limit": 0, @@ -3956,14 +4440,14 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getQR", "group": null, "weight": 65, "cookies": false, "type": "location", - "deprecated": false, - "demo": "avatars\/get-q-r.md", + "demo": "avatars\/get-qr.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", "rate-limit": 0, "rate-time": 3600, @@ -4057,13 +4541,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "list", "group": "databases", - "weight": 71, + "weight": 316, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", "rate-limit": 0, @@ -4074,6 +4558,38 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + }, + "methods": [ + { + "name": "list", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "queries", + "search" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/databaseList" + } + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "demo": "databases\/list.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + } + } + ], "auth": { "Project": [], "Key": [] @@ -4131,13 +4647,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "create", "group": "databases", - "weight": 70, + "weight": 312, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", "rate-limit": 0, @@ -4148,6 +4664,42 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + }, + "methods": [ + { + "name": "create", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Create a new Database.\n", + "demo": "databases\/create.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + } + } + ], "auth": { "Project": [], "Key": [] @@ -4211,13 +4763,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "get", "group": "databases", - "weight": 72, + "weight": 313, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", "rate-limit": 0, @@ -4228,6 +4780,39 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + }, + "methods": [ + { + "name": "get", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "demo": "databases\/get.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + } + } + ], "auth": { "Project": [], "Key": [] @@ -4271,13 +4856,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "update", "group": "databases", - "weight": 74, + "weight": 314, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", "rate-limit": 0, @@ -4288,6 +4873,42 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + }, + "methods": [ + { + "name": "update", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/database" + } + ], + "description": "Update a database by its unique ID.", + "demo": "databases\/update.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + } + } + ], "auth": { "Project": [], "Key": [] @@ -4348,13 +4969,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "delete", "group": "databases", - "weight": 75, + "weight": 315, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", "rate-limit": 0, @@ -4365,6 +4986,38 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + }, + "methods": [ + { + "name": "delete", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "demo": "databases\/delete.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + } + } + ], "auth": { "Project": [], "Key": [] @@ -4410,13 +5063,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listCollections", "group": "collections", - "weight": 77, + "weight": 324, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-collections.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", "rate-limit": 0, @@ -4427,6 +5080,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTables" + }, "auth": { "Project": [], "Key": [] @@ -4476,7 +5133,7 @@ ] }, "post": { - "summary": "Create collection", + "summary": "Create collections", "operationId": "databasesCreateCollection", "tags": [ "databases" @@ -4494,13 +5151,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createCollection", "group": "collections", - "weight": 76, + "weight": 320, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", "rate-limit": 0, @@ -4511,6 +5168,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTable" + }, "auth": { "Project": [], "Key": [] @@ -4599,13 +5260,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getCollection", "group": "collections", - "weight": 78, + "weight": 321, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", "rate-limit": 0, @@ -4616,6 +5277,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTable" + }, "auth": { "Project": [], "Key": [] @@ -4669,13 +5334,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateCollection", "group": "collections", - "weight": 80, + "weight": 322, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", "rate-limit": 0, @@ -4686,6 +5351,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTable" + }, "auth": { "Project": [], "Key": [] @@ -4769,13 +5438,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteCollection", "group": "collections", - "weight": 81, + "weight": 323, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", "rate-limit": 0, @@ -4786,6 +5455,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTable" + }, "auth": { "Project": [], "Key": [] @@ -4841,13 +5514,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listAttributes", "group": "attributes", - "weight": 92, + "weight": 341, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-attributes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", "rate-limit": 0, @@ -4858,6 +5531,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listColumns" + }, "auth": { "Project": [], "Key": [] @@ -4882,7 +5559,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -4926,13 +5603,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createBooleanAttribute", "group": "attributes", - "weight": 89, + "weight": 342, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-boolean-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", "rate-limit": 0, @@ -4943,6 +5620,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBooleanColumn" + }, "auth": { "Project": [], "Key": [] @@ -4967,7 +5648,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "schema": { "type": "string", @@ -5033,13 +5714,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateBooleanAttribute", "group": "attributes", - "weight": 101, + "weight": 343, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-boolean-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", "rate-limit": 0, @@ -5050,6 +5731,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBooleanColumn" + }, "auth": { "Project": [], "Key": [] @@ -5074,7 +5759,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", "required": true, "schema": { "type": "string", @@ -5145,13 +5830,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createDatetimeAttribute", "group": "attributes", - "weight": 90, + "weight": 344, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-datetime-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", "rate-limit": 0, @@ -5162,6 +5847,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createDatetimeColumn" + }, "auth": { "Project": [], "Key": [] @@ -5186,7 +5875,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", "required": true, "schema": { "type": "string", @@ -5234,7 +5923,7 @@ }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { "patch": { - "summary": "Update dateTime attribute", + "summary": "Update datetime attribute", "operationId": "databasesUpdateDatetimeAttribute", "tags": [ "databases" @@ -5252,13 +5941,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDatetimeAttribute", "group": "attributes", - "weight": 102, + "weight": 345, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-datetime-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", "rate-limit": 0, @@ -5269,6 +5958,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateDatetimeColumn" + }, "auth": { "Project": [], "Key": [] @@ -5293,7 +5986,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -5364,13 +6057,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createEmailAttribute", "group": "attributes", - "weight": 83, + "weight": 346, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-email-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", "rate-limit": 0, @@ -5381,6 +6074,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEmailColumn" + }, "auth": { "Project": [], "Key": [] @@ -5405,7 +6102,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -5471,13 +6168,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateEmailAttribute", "group": "attributes", - "weight": 95, + "weight": 347, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-email-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", "rate-limit": 0, @@ -5488,6 +6185,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEmailColumn" + }, "auth": { "Project": [], "Key": [] @@ -5512,7 +6213,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -5549,7 +6250,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -5570,7 +6271,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "description": "Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -5583,15 +6284,15 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createEnumAttribute", "group": "attributes", - "weight": 84, + "weight": 348, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-enum-attribute.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-enum-attribute.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -5600,6 +6301,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEnumColumn" + }, "auth": { "Project": [], "Key": [] @@ -5624,7 +6329,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -5646,7 +6351,7 @@ }, "elements": { "type": "array", - "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "description": "Array of enum values.", "x-example": null, "items": { "type": "string" @@ -5699,13 +6404,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateEnumAttribute", "group": "attributes", - "weight": 96, + "weight": 349, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-enum-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", "rate-limit": 0, @@ -5716,6 +6421,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEnumColumn" + }, "auth": { "Project": [], "Key": [] @@ -5740,7 +6449,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -5766,7 +6475,7 @@ "properties": { "elements": { "type": "array", - "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "description": "Updated list of enum values.", "x-example": null, "items": { "type": "string" @@ -5785,7 +6494,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -5820,13 +6529,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createFloatAttribute", "group": "attributes", - "weight": 88, + "weight": 350, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-float-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", "rate-limit": 0, @@ -5837,6 +6546,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createFloatColumn" + }, "auth": { "Project": [], "Key": [] @@ -5861,7 +6574,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -5888,17 +6601,17 @@ }, "min": { "type": "number", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value.", "x-example": null }, "max": { "type": "number", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value.", "x-example": null }, "default": { "type": "number", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when required.", "x-example": null }, "array": { @@ -5937,13 +6650,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateFloatAttribute", "group": "attributes", - "weight": 100, + "weight": 351, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-float-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", "rate-limit": 0, @@ -5954,6 +6667,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateFloatColumn" + }, "auth": { "Project": [], "Key": [] @@ -5978,7 +6695,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6009,23 +6726,23 @@ }, "min": { "type": "number", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value.", "x-example": null }, "max": { "type": "number", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value.", "x-example": null }, "default": { "type": "number", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when required.", "x-example": null, "x-nullable": true }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -6059,13 +6776,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIntegerAttribute", "group": "attributes", - "weight": 87, + "weight": 352, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-integer-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", "rate-limit": 0, @@ -6076,6 +6793,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIntegerColumn" + }, "auth": { "Project": [], "Key": [] @@ -6100,7 +6821,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6127,17 +6848,17 @@ }, "min": { "type": "integer", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value", "x-example": null }, "max": { "type": "integer", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value", "x-example": null }, "default": { "type": "integer", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when attribute is required.", "x-example": null }, "array": { @@ -6176,13 +6897,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateIntegerAttribute", "group": "attributes", - "weight": 99, + "weight": 353, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-integer-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", "rate-limit": 0, @@ -6193,6 +6914,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIntegerColumn" + }, "auth": { "Project": [], "Key": [] @@ -6217,7 +6942,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6248,23 +6973,23 @@ }, "min": { "type": "integer", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value", "x-example": null }, "max": { "type": "integer", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value", "x-example": null }, "default": { "type": "integer", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when attribute is required.", "x-example": null, "x-nullable": true }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -6298,13 +7023,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIpAttribute", "group": "attributes", - "weight": 85, + "weight": 354, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-ip-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", "rate-limit": 0, @@ -6315,6 +7040,237 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIpColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 355, + "cookies": false, + "type": "", + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIpColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 356, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, "auth": { "Project": [], "Key": [] @@ -6365,14 +7321,17 @@ "x-example": false }, "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": null - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "x-example": false + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true } }, "required": [ @@ -6385,35 +7344,35 @@ } } }, - "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { "patch": { - "summary": "Update IP address attribute", - "operationId": "databasesUpdateIpAttribute", + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", "responses": { "200": { - "description": "AttributeIP", + "description": "AttributeLine", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/attributeIp" + "$ref": "#\/components\/schemas\/attributeLine" } } } } }, + "deprecated": true, "x-appwrite": { - "method": "updateIpAttribute", + "method": "updateLineAttribute", "group": "attributes", - "weight": 97, + "weight": 357, "cookies": false, "type": "", - "deprecated": false, - "demo": "databases\/update-ip-attribute.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -6422,6 +7381,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, "auth": { "Project": [], "Key": [] @@ -6446,7 +7409,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", "required": true, "schema": { "type": "string", @@ -6476,9 +7439,16 @@ "x-example": false }, "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": null, + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, "x-nullable": true }, "newKey": { @@ -6488,8 +7458,7 @@ } }, "required": [ - "required", - "default" + "required" ] } } @@ -6497,35 +7466,35 @@ } } }, - "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { "post": { - "summary": "Create relationship attribute", - "operationId": "databasesCreateRelationshipAttribute", + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", "tags": [ "databases" ], - "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "description": "Create a geometric point attribute.", "responses": { "202": { - "description": "AttributeRelationship", + "description": "AttributePoint", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/attributeRelationship" + "$ref": "#\/components\/schemas\/attributePoint" } } } } }, + "deprecated": true, "x-appwrite": { - "method": "createRelationshipAttribute", + "method": "createPointAttribute", "group": "attributes", - "weight": 91, + "weight": 358, "cookies": false, "type": "", - "deprecated": false, - "demo": "databases\/create-relationship-attribute.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -6534,6 +7503,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, "auth": { "Project": [], "Key": [] @@ -6567,6 +7540,478 @@ "in": "path" } ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 359, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 360, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createRelationshipAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/create-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRelationshipColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], "requestBody": { "content": { "application\/json": { @@ -6575,7 +8020,7 @@ "properties": { "relatedCollectionId": { "type": "string", - "description": "Related Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Related Collection ID.", "x-example": "<RELATED_COLLECTION_ID>" }, "type": { @@ -6649,13 +8094,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 82, + "weight": 364, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-string-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", "rate-limit": 0, @@ -6666,6 +8111,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createStringColumn" + }, "auth": { "Project": [], "Key": [] @@ -6690,7 +8139,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "schema": { "type": "string", @@ -6767,13 +8216,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 94, + "weight": 365, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-string-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", "rate-limit": 0, @@ -6784,6 +8233,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateStringColumn" + }, "auth": { "Project": [], "Key": [] @@ -6808,7 +8261,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "schema": { "type": "string", @@ -6850,7 +8303,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -6884,13 +8337,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 86, + "weight": 366, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-url-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", "rate-limit": 0, @@ -6901,6 +8354,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createUrlColumn" + }, "auth": { "Project": [], "Key": [] @@ -6925,7 +8382,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -6991,13 +8448,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 98, + "weight": 367, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-url-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", "rate-limit": 0, @@ -7008,6 +8465,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateUrlColumn" + }, "auth": { "Project": [], "Key": [] @@ -7032,7 +8493,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -7069,7 +8530,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } }, @@ -7134,13 +8595,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getAttribute", "group": "attributes", - "weight": 93, + "weight": 339, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", "rate-limit": 0, @@ -7151,6 +8612,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getColumn" + }, "auth": { "Project": [], "Key": [] @@ -7175,7 +8640,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -7206,13 +8671,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteAttribute", "group": "attributes", - "weight": 104, + "weight": 340, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", "rate-limit": 0, @@ -7223,6 +8688,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteColumn" + }, "auth": { "Project": [], "Key": [] @@ -7247,7 +8716,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -7287,13 +8756,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 103, + "weight": 363, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-relationship-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", "rate-limit": 0, @@ -7304,6 +8773,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRelationshipColumn" + }, "auth": { "Project": [], "Key": [] @@ -7328,7 +8801,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "schema": { "type": "string", @@ -7366,7 +8839,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "x-example": null } } @@ -7396,13 +8869,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listDocuments", "group": "documents", - "weight": 110, + "weight": 335, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", "rate-limit": 0, @@ -7415,6 +8888,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, "auth": { "Project": [], "Session": [] @@ -7483,13 +8960,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createDocument", "group": "documents", - "weight": 109, + "weight": 327, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", "rate-limit": 120, @@ -7502,13 +8979,18 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, "methods": [ { "name": "createDocument", + "namespace": "databases", + "desc": "Create document", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [], + "Session": [] }, "parameters": [ "databaseId", @@ -7529,7 +9011,43 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + }, + { + "name": "createDocuments", + "namespace": "databases", + "desc": "Create documents", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRows" + } } ], "auth": { @@ -7581,7 +9099,7 @@ "data": { "type": "object", "description": "Document data as JSON object.", - "x-example": "{}" + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" }, "permissions": { "type": "array", @@ -7606,14 +9124,14 @@ } }, "put": { - "summary": "Create or update documents", + "summary": "Upsert documents", "operationId": "databasesUpsertDocuments", "tags": [ "databases" ], "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", "responses": { - "200": { + "201": { "description": "Documents List", "content": { "application\/json": { @@ -7624,13 +9142,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 332, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/upsert-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", "rate-limit": 120, @@ -7638,9 +9156,47 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + }, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "demo": "databases\/upsert-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + } + } + ], "auth": { "Project": [], "Key": [] @@ -7688,7 +9244,10 @@ "type": "object" } } - } + }, + "required": [ + "documents" + ] } } } @@ -7713,13 +9272,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 330, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", "rate-limit": 120, @@ -7727,9 +9286,14 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRows" + }, "auth": { "Project": [], "Key": [] @@ -7807,13 +9371,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 334, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", "rate-limit": 60, @@ -7821,9 +9385,14 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRows" + }, "auth": { "Project": [], "Key": [] @@ -7898,13 +9467,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getDocument", "group": "documents", - "weight": 111, + "weight": 328, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", "rate-limit": 0, @@ -7917,6 +9486,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, "auth": { "Project": [], "Session": [] @@ -7977,14 +9550,14 @@ ] }, "put": { - "summary": "Upsert document", + "summary": "Upsert a document", "operationId": "databasesUpsertDocument", "tags": [ "databases" ], "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { - "200": { + "201": { "description": "Document", "content": { "application\/json": { @@ -7995,13 +9568,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "upsertDocument", "group": "documents", - "weight": 114, + "weight": 331, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/upsert-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", "rate-limit": 120, @@ -8014,6 +9587,46 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], "auth": { "Project": [], "Session": [] @@ -8106,13 +9719,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDocument", "group": "documents", - "weight": 113, + "weight": 329, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", "rate-limit": 120, @@ -8125,6 +9738,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, "auth": { "Project": [], "Session": [] @@ -8207,13 +9824,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 333, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", "rate-limit": 60, @@ -8226,6 +9843,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, "auth": { "Project": [], "Session": [] @@ -8273,6 +9894,248 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -8293,13 +10156,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 106, + "weight": 371, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-indexes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", "rate-limit": 0, @@ -8310,6 +10173,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listIndexes" + }, "auth": { "Project": [], "Key": [] @@ -8376,13 +10243,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIndex", - "group": "collections", - "weight": 105, + "group": "indexes", + "weight": 368, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", "rate-limit": 0, @@ -8393,6 +10260,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIndex" + }, "auth": { "Project": [], "Key": [] @@ -8444,7 +10315,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -8505,13 +10377,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 107, + "weight": 369, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", "rate-limit": 0, @@ -8522,6 +10394,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getIndex" + }, "auth": { "Project": [], "Key": [] @@ -8577,13 +10453,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 108, + "weight": 370, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", "rate-limit": 0, @@ -8594,6 +10470,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteIndex" + }, "auth": { "Project": [], "Key": [] @@ -8658,13 +10538,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 440, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", "rate-limit": 0, @@ -8732,13 +10612,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 437, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", "rate-limit": 0, @@ -8818,6 +10698,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -8843,7 +10724,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -8964,13 +10846,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 442, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-runtimes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", "rate-limit": 0, @@ -9014,13 +10896,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 443, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-specifications.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", "rate-limit": 0, @@ -9065,13 +10947,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 438, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", "rate-limit": 0, @@ -9125,13 +11007,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 439, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", "rate-limit": 0, @@ -9218,6 +11100,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9243,7 +11126,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9354,13 +11238,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 441, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", "rate-limit": 0, @@ -9416,13 +11300,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 446, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-function-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", "rate-limit": 0, @@ -9497,13 +11381,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 447, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-deployments.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", "rate-limit": 0, @@ -9581,13 +11465,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 444, "cookies": false, "type": "upload", - "deprecated": false, "demo": "functions\/create-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "rate-limit": 0, @@ -9678,13 +11562,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 452, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-duplicate-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "rate-limit": 0, @@ -9764,13 +11648,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 449, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-template-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", "rate-limit": 0, @@ -9868,13 +11752,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 450, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-vcs-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "rate-limit": 0, @@ -9966,13 +11850,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 445, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", "rate-limit": 0, @@ -10029,13 +11913,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 448, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", "rate-limit": 0, @@ -10094,13 +11978,13 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 451, "cookies": false, "type": "location", - "deprecated": false, "demo": "functions\/get-deployment-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "rate-limit": 0, @@ -10185,13 +12069,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 453, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-deployment-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "rate-limit": 0, @@ -10257,13 +12141,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 456, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-executions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", "rate-limit": 0, @@ -10334,13 +12218,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 454, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "rate-limit": 0, @@ -10401,7 +12285,7 @@ }, "method": { "type": "string", - "description": "HTTP method of execution. Default value is GET.", + "description": "HTTP method of execution. Default value is POST.", "x-example": "GET", "enum": [ "GET", @@ -10409,7 +12293,8 @@ "PUT", "PATCH", "DELETE", - "OPTIONS" + "OPTIONS", + "HEAD" ], "x-enum-name": "ExecutionMethod", "x-enum-keys": [] @@ -10422,7 +12307,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "<SCHEDULED_AT>" } } } @@ -10451,13 +12336,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 455, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", "rate-limit": 0, @@ -10518,13 +12403,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 457, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", "rate-limit": 0, @@ -10590,13 +12475,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 462, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", "rate-limit": 0, @@ -10650,13 +12535,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 460, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", "rate-limit": 0, @@ -10742,13 +12627,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 461, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", "rate-limit": 0, @@ -10812,13 +12697,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 463, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", "rate-limit": 0, @@ -10904,13 +12789,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 464, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", "rate-limit": 0, @@ -10976,13 +12861,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 250, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/query.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -11030,13 +12915,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 249, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/mutation.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -11084,13 +12969,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 78, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md", "rate-limit": 0, @@ -11134,13 +13019,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 99, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-antivirus.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md", "rate-limit": 0, @@ -11184,13 +13069,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 81, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-cache.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md", "rate-limit": 0, @@ -11234,13 +13119,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 86, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-certificate.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", "rate-limit": 0, @@ -11295,14 +13180,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 80, "cookies": false, "type": "", - "deprecated": false, - "demo": "health\/get-d-b.md", + "demo": "health\/get-db.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md", "rate-limit": 0, "rate-time": 3600, @@ -11345,13 +13230,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 82, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-pub-sub.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", "rate-limit": 0, @@ -11395,13 +13280,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 88, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-builds.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", "rate-limit": 0, @@ -11458,13 +13343,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 87, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-certificates.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md", "rate-limit": 0, @@ -11521,13 +13406,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 89, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-databases.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", "rate-limit": 0, @@ -11595,13 +13480,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 90, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-deletes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", "rate-limit": 0, @@ -11658,13 +13543,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 100, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-failed-jobs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", "rate-limit": 0, @@ -11747,13 +13632,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 94, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-functions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md", "rate-limit": 0, @@ -11810,13 +13695,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 85, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md", "rate-limit": 0, @@ -11873,13 +13758,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 91, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-mails.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", "rate-limit": 0, @@ -11936,13 +13821,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 92, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-messaging.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", "rate-limit": 0, @@ -11999,13 +13884,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 93, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-migrations.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", "rate-limit": 0, @@ -12044,7 +13929,7 @@ }, "\/health\/queue\/stats-resources": { "get": { - "summary": "Get stats resources queue", + "summary": "Get stats resources queue", "operationId": "healthGetQueueStatsResources", "tags": [ "health" @@ -12062,13 +13947,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 95, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-stats-resources.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", "rate-limit": 0, @@ -12125,13 +14010,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 96, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", "rate-limit": 0, @@ -12188,13 +14073,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 84, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-webhooks.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md", "rate-limit": 0, @@ -12251,13 +14136,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 98, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-storage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", "rate-limit": 0, @@ -12301,13 +14186,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 97, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-storage-local.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md", "rate-limit": 0, @@ -12351,13 +14236,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 83, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-time.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md", "rate-limit": 0, @@ -12401,13 +14286,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 70, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", "rate-limit": 0, @@ -12455,13 +14340,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 71, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", "rate-limit": 0, @@ -12509,13 +14394,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 75, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-continents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", "rate-limit": 0, @@ -12563,13 +14448,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 72, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", "rate-limit": 0, @@ -12617,14 +14502,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 73, "cookies": false, "type": "", - "deprecated": false, - "demo": "locale\/list-countries-e-u.md", + "demo": "locale\/list-countries-eu.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", "rate-limit": 0, "rate-time": 3600, @@ -12671,13 +14556,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 74, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries-phones.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", "rate-limit": 0, @@ -12725,13 +14610,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 76, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-currencies.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", "rate-limit": 0, @@ -12779,13 +14664,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 77, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-languages.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", "rate-limit": 0, @@ -12833,13 +14718,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 304, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-messages.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", "rate-limit": 0, @@ -12910,13 +14795,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 301, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", "rate-limit": 0, @@ -13055,13 +14940,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 308, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", "rate-limit": 0, @@ -13202,13 +15087,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 303, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-push.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", "rate-limit": 0, @@ -13377,13 +15262,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 310, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-push.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", "rate-limit": 0, @@ -13556,13 +15441,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 302, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-sms.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", "rate-limit": 0, @@ -13574,6 +15459,76 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + }, + "methods": [ + { + "name": "createSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + } + }, + { + "name": "createSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md" + } + ], "auth": { "Project": [], "Key": [] @@ -13666,13 +15621,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 309, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-sms.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, @@ -13684,6 +15639,74 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + }, + "methods": [ + { + "name": "updateSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + } + }, + { + "name": "updateSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md" + } + ], "auth": { "Project": [], "Key": [] @@ -13779,13 +15802,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 307, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-message.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", "rate-limit": 0, @@ -13833,13 +15856,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 311, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", "rate-limit": 0, @@ -13896,13 +15919,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 305, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-message-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", "rate-limit": 0, @@ -13972,13 +15995,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 306, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-targets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", "rate-limit": 0, @@ -14048,13 +16071,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 276, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-providers.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", "rate-limit": 0, @@ -14125,13 +16148,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 275, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-apns-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", "rate-limit": 0, @@ -14143,6 +16166,78 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + }, + "methods": [ + { + "name": "createApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + } + }, + { + "name": "createAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -14231,13 +16326,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 288, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-apns-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", "rate-limit": 0, @@ -14249,6 +16344,76 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + }, + "methods": [ + { + "name": "updateApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + } + }, + { + "name": "updateAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -14340,13 +16505,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 274, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-fcm-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", "rate-limit": 0, @@ -14358,6 +16523,70 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + }, + "methods": [ + { + "name": "createFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + } + }, + { + "name": "createFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -14426,13 +16655,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 287, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-fcm-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", "rate-limit": 0, @@ -14444,6 +16673,68 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + }, + "methods": [ + { + "name": "updateFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + } + }, + { + "name": "updateFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -14515,13 +16806,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 266, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-mailgun-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", "rate-limit": 0, @@ -14631,13 +16922,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 279, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-mailgun-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", "rate-limit": 0, @@ -14750,14 +17041,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 269, "cookies": false, "type": "", - "deprecated": false, - "demo": "messaging\/create-msg91provider.md", + "demo": "messaging\/create-msg-91-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", "rate-limit": 0, "rate-time": 3600, @@ -14846,14 +17137,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 282, "cookies": false, "type": "", - "deprecated": false, - "demo": "messaging\/update-msg91provider.md", + "demo": "messaging\/update-msg-91-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", "rate-limit": 0, "rate-time": 3600, @@ -14945,13 +17236,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 267, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-sendgrid-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", "rate-limit": 0, @@ -15051,13 +17342,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 280, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-sendgrid-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", "rate-limit": 0, @@ -15160,13 +17451,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 268, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-smtp-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", "rate-limit": 0, @@ -15178,6 +17469,92 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + }, + "methods": [ + { + "name": "createSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + } + }, + { + "name": "createSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -15304,13 +17681,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 281, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-smtp-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", "rate-limit": 0, @@ -15322,6 +17699,88 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + }, + "methods": [ + { + "name": "updateSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + } + }, + { + "name": "updateSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -15450,13 +17909,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 270, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-telesign-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", "rate-limit": 0, @@ -15546,13 +18005,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 283, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-telesign-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", "rate-limit": 0, @@ -15645,13 +18104,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 271, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-textmagic-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", "rate-limit": 0, @@ -15741,13 +18200,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 284, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-textmagic-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", "rate-limit": 0, @@ -15840,13 +18299,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 272, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-twilio-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", "rate-limit": 0, @@ -15936,13 +18395,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 285, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-twilio-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", "rate-limit": 0, @@ -16035,13 +18494,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 273, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-vonage-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", "rate-limit": 0, @@ -16131,13 +18590,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 286, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-vonage-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", "rate-limit": 0, @@ -16230,13 +18689,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 278, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", "rate-limit": 0, @@ -16284,13 +18743,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 289, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", "rate-limit": 0, @@ -16347,13 +18806,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 277, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-provider-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", "rate-limit": 0, @@ -16423,13 +18882,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 298, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-subscriber-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", "rate-limit": 0, @@ -16499,13 +18958,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 291, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-topics.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", "rate-limit": 0, @@ -16574,13 +19033,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 290, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", "rate-limit": 0, @@ -16658,13 +19117,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 293, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", "rate-limit": 0, @@ -16719,13 +19178,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 294, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", "rate-limit": 0, @@ -16797,13 +19256,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 295, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", "rate-limit": 0, @@ -16860,13 +19319,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 292, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-topic-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", "rate-limit": 0, @@ -16936,13 +19395,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 297, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-subscribers.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", "rate-limit": 0, @@ -17021,13 +19480,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 296, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", "rate-limit": 0, @@ -17113,13 +19572,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 299, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", "rate-limit": 0, @@ -17177,13 +19636,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 300, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", "rate-limit": 0, @@ -17254,13 +19713,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 469, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", "rate-limit": 0, @@ -17325,13 +19784,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 467, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", "rate-limit": 0, @@ -17464,6 +19923,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17489,7 +19949,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -17573,13 +20034,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 472, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-frameworks.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", "rate-limit": 0, @@ -17623,13 +20084,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 495, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-specifications.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", "rate-limit": 0, @@ -17674,13 +20135,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 468, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", "rate-limit": 0, @@ -17734,13 +20195,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 470, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", "rate-limit": 0, @@ -17880,6 +20341,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17905,7 +20367,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -17978,13 +20441,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 471, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", "rate-limit": 0, @@ -18040,13 +20503,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 478, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-site-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", "rate-limit": 0, @@ -18121,13 +20584,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 477, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-deployments.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", "rate-limit": 0, @@ -18205,13 +20668,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 473, "cookies": false, "type": "upload", - "deprecated": false, "demo": "sites\/create-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", "rate-limit": 0, @@ -18307,13 +20770,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 481, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-duplicate-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "rate-limit": 0, @@ -18388,13 +20851,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 474, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-template-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", "rate-limit": 0, @@ -18492,13 +20955,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 475, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-vcs-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "rate-limit": 0, @@ -18591,13 +21054,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 476, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", "rate-limit": 0, @@ -18654,13 +21117,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 479, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", "rate-limit": 0, @@ -18719,13 +21182,13 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 480, "cookies": false, "type": "location", - "deprecated": false, "demo": "sites\/get-deployment-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "rate-limit": 0, @@ -18810,13 +21273,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 482, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-deployment-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "rate-limit": 0, @@ -18882,13 +21345,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 484, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", "rate-limit": 0, @@ -18954,13 +21417,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 483, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-log.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", "rate-limit": 0, @@ -19017,13 +21480,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 485, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-log.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", "rate-limit": 0, @@ -19089,13 +21552,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 488, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", "rate-limit": 0, @@ -19149,13 +21612,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 486, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", "rate-limit": 0, @@ -19241,13 +21704,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 487, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", "rate-limit": 0, @@ -19311,13 +21774,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 489, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", "rate-limit": 0, @@ -19403,13 +21866,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 490, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", "rate-limit": 0, @@ -19475,13 +21938,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 155, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/list-buckets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", "rate-limit": 0, @@ -19549,13 +22012,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 154, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/create-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", "rate-limit": 0, @@ -19677,13 +22140,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 156, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", "rate-limit": 0, @@ -19737,13 +22200,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 157, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/update-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", "rate-limit": 0, @@ -19862,13 +22325,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 158, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/delete-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", "rate-limit": 0, @@ -19924,13 +22387,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 160, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/list-files.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", "rate-limit": 0, @@ -20012,13 +22475,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 159, "cookies": false, "type": "upload", - "deprecated": false, "demo": "storage\/create-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", "rate-limit": 60, @@ -20112,13 +22575,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 161, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", "rate-limit": 0, @@ -20186,13 +22649,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 166, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/update-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", "rate-limit": 60, @@ -20277,13 +22740,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 167, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/delete-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", "rate-limit": 60, @@ -20346,13 +22809,13 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 163, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", "rate-limit": 0, @@ -20426,13 +22889,13 @@ "description": "Image" } }, + "deprecated": false, "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 162, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-preview.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", "rate-limit": 0, @@ -20620,7 +23083,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -20655,13 +23119,13 @@ "description": "File" } }, + "deprecated": false, "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 164, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-view.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", "rate-limit": 0, @@ -20722,6 +23186,5765 @@ ] } }, + "\/tablesdb": { + "get": { + "summary": "List databases", + "operationId": "tablesDBList", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "tablesdb", + "weight": 376, + "cookies": false, + "type": "", + "demo": "tablesdb\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "tablesDBCreate", + "tags": [ + "tablesDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "tablesdb", + "weight": 372, + "cookies": false, + "type": "", + "demo": "tablesdb\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "tablesDBGet", + "tags": [ + "tablesDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tablesdb", + "weight": 373, + "cookies": false, + "type": "", + "demo": "tablesdb\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "tablesDBUpdate", + "tags": [ + "tablesDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tablesdb", + "weight": 374, + "cookies": false, + "type": "", + "demo": "tablesdb\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "tablesDBDelete", + "tags": [ + "tablesDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tablesdb", + "weight": 375, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables": { + "get": { + "summary": "List tables", + "operationId": "tablesDBListTables", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Tables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/tableList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTables", + "group": "tables", + "weight": 383, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-tables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-tables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create table", + "operationId": "tablesDBCreateTable", + "tags": [ + "tablesDB" + ], + "description": "Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTable", + "group": "tables", + "weight": 379, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "tableId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TABLE_ID>" + }, + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "tableId", + "name" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}": { + "get": { + "summary": "Get table", + "operationId": "tablesDBGetTable", + "tags": [ + "tablesDB" + ], + "description": "Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTable", + "group": "tables", + "weight": 380, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update table", + "operationId": "tablesDBUpdateTable", + "tags": [ + "tablesDB" + ], + "description": "Update a table by its unique ID.", + "responses": { + "200": { + "description": "Table", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/table" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTable", + "group": "tables", + "weight": 381, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete table", + "operationId": "tablesDBDeleteTable", + "tags": [ + "tablesDB" + ], + "description": "Delete a table by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTable", + "group": "tables", + "weight": 382, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns": { + "get": { + "summary": "List columns", + "operationId": "tablesDBListColumns", + "tags": [ + "tablesDB" + ], + "description": "List columns in the table.", + "responses": { + "200": { + "description": "Columns List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listColumns", + "group": "columns", + "weight": 388, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-columns.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-columns.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean": { + "post": { + "summary": "Create boolean column", + "operationId": "tablesDBCreateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a boolean column.\n", + "responses": { + "202": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBooleanColumn", + "group": "columns", + "weight": 389, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean\/{key}": { + "patch": { + "summary": "Update boolean column", + "operationId": "tablesDBUpdateBooleanColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a boolean column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnBoolean" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBooleanColumn", + "group": "columns", + "weight": 390, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime": { + "post": { + "summary": "Create datetime column", + "operationId": "tablesDBCreateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a date time column according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDatetimeColumn", + "group": "columns", + "weight": 391, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime column", + "operationId": "tablesDBUpdateDatetimeColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a date time column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnDatetime" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDatetimeColumn", + "group": "columns", + "weight": 392, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email": { + "post": { + "summary": "Create email column", + "operationId": "tablesDBCreateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an email column.\n", + "responses": { + "202": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailColumn", + "group": "columns", + "weight": 393, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email\/{key}": { + "patch": { + "summary": "Update email column", + "operationId": "tablesDBUpdateEmailColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an email column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEmail" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailColumn", + "group": "columns", + "weight": 394, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum": { + "post": { + "summary": "Create enum column", + "operationId": "tablesDBCreateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column.", + "responses": { + "202": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEnumColumn", + "group": "columns", + "weight": 395, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum\/{key}": { + "patch": { + "summary": "Update enum column", + "operationId": "tablesDBUpdateEnumColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an enum column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnEnum" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEnumColumn", + "group": "columns", + "weight": 396, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float": { + "post": { + "summary": "Create float column", + "operationId": "tablesDBCreateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a float column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFloatColumn", + "group": "columns", + "weight": 397, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float\/{key}": { + "patch": { + "summary": "Update float column", + "operationId": "tablesDBUpdateFloatColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a float column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnFloat" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFloatColumn", + "group": "columns", + "weight": 398, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer": { + "post": { + "summary": "Create integer column", + "operationId": "tablesDBCreateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Create an integer column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIntegerColumn", + "group": "columns", + "weight": 399, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer\/{key}": { + "patch": { + "summary": "Update integer column", + "operationId": "tablesDBUpdateIntegerColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an integer column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnInteger" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIntegerColumn", + "group": "columns", + "weight": 400, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip": { + "post": { + "summary": "Create IP address column", + "operationId": "tablesDBCreateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Create IP address column.\n", + "responses": { + "202": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIpColumn", + "group": "columns", + "weight": 401, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip\/{key}": { + "patch": { + "summary": "Update IP address column", + "operationId": "tablesDBUpdateIpColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an ip column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIp" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIpColumn", + "group": "columns", + "weight": 402, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line column.", + "responses": { + "202": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 403, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 404, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point column.", + "responses": { + "202": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 405, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 406, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "x-example": "[1, 2]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon column.", + "responses": { + "202": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 407, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "items": { + "oneOf": [ + { + "type": "array" + } + ] + }, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { + "post": { + "summary": "Create relationship column", + "operationId": "tablesDBCreateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Create relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "202": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRelationshipColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedTableId": { + "type": "string", + "description": "Related Table ID.", + "x-example": "<RELATED_TABLE_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "x-example": false + }, + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Column Key.", + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedTableId", + "type" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string": { + "post": { + "summary": "Create string column", + "operationId": "tablesDBCreateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a string column.\n", + "responses": { + "202": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createStringColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "size": { + "type": "integer", + "description": "Column size for text columns, in number of characters.", + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string\/{key}": { + "patch": { + "summary": "Update string column", + "operationId": "tablesDBUpdateStringColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a string column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnString" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStringColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string column.", + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url": { + "post": { + "summary": "Create URL column", + "operationId": "tablesDBCreateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a URL column.\n", + "responses": { + "202": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createUrlColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url\/{key}": { + "patch": { + "summary": "Update URL column", + "operationId": "tablesDBUpdateUrlColumn", + "tags": [ + "tablesDB" + ], + "description": "Update an url column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnUrl" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateUrlColumn", + "group": "columns", + "weight": 414, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}": { + "get": { + "summary": "Get column", + "operationId": "tablesDBGetColumn", + "tags": [ + "tablesDB" + ], + "description": "Get column by ID.", + "responses": { + "200": { + "description": "ColumnBoolean, or ColumnInteger, or ColumnFloat, or ColumnEmail, or ColumnEnum, or ColumnURL, or ColumnIP, or ColumnDatetime, or ColumnRelationship, or ColumnString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getColumn", + "group": "columns", + "weight": 386, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete column", + "operationId": "tablesDBDeleteColumn", + "tags": [ + "tablesDB" + ], + "description": "Deletes a column.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteColumn", + "group": "columns", + "weight": 387, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}\/relationship": { + "patch": { + "summary": "Update relationship column", + "operationId": "tablesDBUpdateRelationshipColumn", + "tags": [ + "tablesDB" + ], + "description": "Update relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "200": { + "description": "ColumnRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnRelationship" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRelationshipColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "tablesDBListIndexes", + "tags": [ + "tablesDB" + ], + "description": "List indexes on the table.", + "responses": { + "200": { + "description": "Column Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndexList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 418, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "tablesDBCreateIndex", + "tags": [ + "tablesDB" + ], + "description": "Creates an index on the columns listed. Your index should include all the columns you will query in a single request.\nType can be `key`, `fulltext`, or `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 415, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "columns": { + "type": "array", + "description": "Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "columns" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "tablesDBGetIndex", + "tags": [ + "tablesDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnIndex" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 416, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "tablesDBDeleteIndex", + "tags": [ + "tablesDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 417, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + }, + { + "name": "createRows", + "namespace": "tablesDB", + "desc": "Create rows", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-rows.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<ROW_ID>" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Upsert rows", + "operationId": "tablesDBUpsertRows", + "tags": [ + "tablesDB" + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRows", + "group": "rows", + "weight": 424, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRows", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/rowList" + } + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "demo": "tablesdb\/upsert-rows.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "description": "Array of row data as JSON objects. May contain partial rows.", + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "rows" + ] + } + } + } + } + }, + "patch": { + "summary": "Update rows", + "operationId": "tablesDBUpdateRows", + "tags": [ + "tablesDB" + ], + "description": "Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRows", + "group": "rows", + "weight": 422, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only column and value pairs to be updated.", + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete rows", + "operationId": "tablesDBDeleteRows", + "tags": [ + "tablesDB" + ], + "description": "Bulk delete rows using queries, if no queries are passed then all rows are deleted.", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRows", + "group": "rows", + "weight": 426, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-rows.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/row" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TABLE_ID>" + }, + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ROW_ID>" + }, + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/teams": { "get": { "summary": "List teams", @@ -20742,13 +28965,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 171, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", "rate-limit": 0, @@ -20820,13 +29043,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 170, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", "rate-limit": 0, @@ -20907,13 +29130,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 172, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", "rate-limit": 0, @@ -20971,13 +29194,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 174, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", "rate-limit": 0, @@ -21047,13 +29270,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 176, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", "rate-limit": 0, @@ -21113,13 +29336,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 178, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list-memberships.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", "rate-limit": 0, @@ -21201,13 +29424,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 177, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", "rate-limit": 10, @@ -21314,13 +29537,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 179, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", "rate-limit": 0, @@ -21388,13 +29611,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 180, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", "rate-limit": 0, @@ -21477,13 +29700,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 182, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", "rate-limit": 0, @@ -21553,13 +29776,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 181, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", "rate-limit": 0, @@ -21652,13 +29875,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 173, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", "rate-limit": 0, @@ -21714,13 +29937,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 175, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", "rate-limit": 0, @@ -21797,13 +30020,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 507, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", "rate-limit": 0, @@ -21878,13 +30101,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 505, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/create-file-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", "rate-limit": 60, @@ -21968,13 +30191,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 506, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", "rate-limit": 0, @@ -22029,13 +30252,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 508, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", "rate-limit": 60, @@ -22100,13 +30323,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 509, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", "rate-limit": 60, @@ -22163,13 +30386,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 193, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md", "rate-limit": 0, @@ -22237,13 +30460,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 184, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md", "rate-limit": 0, @@ -22326,14 +30549,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 187, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-argon2user.md", + "demo": "users\/create-argon-2-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", "rate-limit": 0, "rate-time": 3600, @@ -22412,13 +30635,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 185, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-bcrypt-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", "rate-limit": 0, @@ -22498,13 +30721,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 201, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-identities.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", "rate-limit": 0, @@ -22567,13 +30790,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 224, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-identity.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", "rate-limit": 0, @@ -22629,14 +30852,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 186, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-m-d5user.md", + "demo": "users\/create-md-5-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", "rate-limit": 0, "rate-time": 3600, @@ -22715,14 +30938,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 189, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-p-h-pass-user.md", + "demo": "users\/create-ph-pass-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", "rate-limit": 0, "rate-time": 3600, @@ -22801,13 +31024,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 190, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-scrypt-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", "rate-limit": 0, @@ -22917,13 +31140,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 191, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-scrypt-modified-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", "rate-limit": 0, @@ -23021,14 +31244,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 188, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-s-h-a-user.md", + "demo": "users\/create-sha-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", "rate-limit": 0, "rate-time": 3600, @@ -23127,13 +31350,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 194, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md", "rate-limit": 0, @@ -23180,13 +31403,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 222, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", "rate-limit": 0, @@ -23242,13 +31465,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 207, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", "rate-limit": 0, @@ -23323,14 +31546,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 225, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-j-w-t.md", + "demo": "users\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", "rate-limit": 0, "rate-time": 3600, @@ -23406,13 +31629,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 203, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-labels.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", "rate-limit": 0, @@ -23490,13 +31713,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 199, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", "rate-limit": 0, @@ -23565,13 +31788,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 198, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-memberships.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", "rate-limit": 0, @@ -23651,13 +31874,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 212, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-mfa.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", "rate-limit": 0, @@ -23668,6 +31891,66 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + }, + "methods": [ + { + "name": "updateMfa", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + } + }, + { + "name": "updateMFA", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md" + } + ], "auth": { "Project": [], "Key": [] @@ -23725,13 +32008,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 217, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", "rate-limit": 0, @@ -23742,6 +32025,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md" + } + ], "auth": { "Project": [], "Key": [] @@ -23802,13 +32143,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 213, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-mfa-factors.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", "rate-limit": 0, @@ -23819,6 +32160,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md" + } + ], "auth": { "Project": [], "Key": [] @@ -23864,13 +32261,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 214, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", "rate-limit": 0, @@ -23881,6 +32278,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Key": [] @@ -23924,13 +32377,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 216, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", "rate-limit": 0, @@ -23941,6 +32394,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Key": [] @@ -23984,13 +32493,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 215, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", "rate-limit": 0, @@ -24001,6 +32510,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Key": [] @@ -24046,13 +32611,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 205, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", "rate-limit": 0, @@ -24127,13 +32692,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 206, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-password.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", "rate-limit": 0, @@ -24208,13 +32773,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 208, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-phone.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", "rate-limit": 0, @@ -24289,13 +32854,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 195, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md", "rate-limit": 0, @@ -24349,13 +32914,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 210, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md", "rate-limit": 0, @@ -24430,13 +32995,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 197, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", "rate-limit": 0, @@ -24490,13 +33055,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 218, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", "rate-limit": 0, @@ -24543,13 +33108,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 221, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", "rate-limit": 0, @@ -24598,13 +33163,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 220, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", "rate-limit": 0, @@ -24670,13 +33235,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 202, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md", "rate-limit": 0, @@ -24751,13 +33316,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 200, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-targets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", "rate-limit": 0, @@ -24793,7 +33358,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "schema": { "type": "array", @@ -24825,13 +33390,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 192, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", "rate-limit": 0, @@ -24936,13 +33501,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 196, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", "rate-limit": 0, @@ -25007,13 +33572,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 211, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", "rate-limit": 0, @@ -25097,13 +33662,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 223, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", "rate-limit": 0, @@ -25170,13 +33735,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 219, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", "rate-limit": 0, @@ -25253,13 +33818,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 209, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-email-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", "rate-limit": 0, @@ -25334,13 +33899,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 204, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", "rate-limit": 0, @@ -25409,6 +33974,10 @@ "name": "databases", "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, { "name": "locale", "description": "The Locale service allows you to customize your app based on your users' location." @@ -25471,7 +34040,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -25503,7 +34073,41 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "$ref": "#\/components\/schemas\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } }, "documentList": { "description": "Documents List", @@ -25511,7 +34115,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of documents documents that matched your query.", + "description": "Total number of documents that matched your query.", "x-example": 5, "format": "int32" }, @@ -25527,7 +34131,39 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } + }, + "tableList": { + "description": "Tables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tables": { + "type": "array", + "description": "List of tables.", + "items": { + "$ref": "#\/components\/schemas\/table" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tables" + ], + "example": { + "total": 5, + "tables": "" + } }, "collectionList": { "description": "Collections List", @@ -25535,7 +34171,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of collections documents that matched your query.", + "description": "Total number of collections that matched your query.", "x-example": 5, "format": "int32" }, @@ -25551,7 +34187,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -25559,7 +34199,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of databases documents that matched your query.", + "description": "Total number of databases that matched your query.", "x-example": 5, "format": "int32" }, @@ -25575,7 +34215,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -25583,7 +34227,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of indexes documents that matched your query.", + "description": "Total number of indexes that matched your query.", "x-example": 5, "format": "int32" }, @@ -25599,7 +34243,39 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "columnIndexList": { + "description": "Column Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -25607,7 +34283,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of users documents that matched your query.", + "description": "Total number of users that matched your query.", "x-example": 5, "format": "int32" }, @@ -25623,7 +34299,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -25631,7 +34311,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of sessions documents that matched your query.", + "description": "Total number of sessions that matched your query.", "x-example": 5, "format": "int32" }, @@ -25647,7 +34327,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -25655,7 +34339,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of identities documents that matched your query.", + "description": "Total number of identities that matched your query.", "x-example": 5, "format": "int32" }, @@ -25671,7 +34355,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -25679,7 +34367,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of logs documents that matched your query.", + "description": "Total number of logs that matched your query.", "x-example": 5, "format": "int32" }, @@ -25695,7 +34383,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -25703,7 +34395,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of files documents that matched your query.", + "description": "Total number of files that matched your query.", "x-example": 5, "format": "int32" }, @@ -25719,7 +34411,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -25727,7 +34423,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of buckets documents that matched your query.", + "description": "Total number of buckets that matched your query.", "x-example": 5, "format": "int32" }, @@ -25743,7 +34439,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -25751,7 +34451,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of tokens documents that matched your query.", + "description": "Total number of tokens that matched your query.", "x-example": 5, "format": "int32" }, @@ -25767,7 +34467,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -25775,7 +34479,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of teams documents that matched your query.", + "description": "Total number of teams that matched your query.", "x-example": 5, "format": "int32" }, @@ -25791,7 +34495,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -25799,7 +34507,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of memberships documents that matched your query.", + "description": "Total number of memberships that matched your query.", "x-example": 5, "format": "int32" }, @@ -25815,7 +34523,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -25823,7 +34535,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of sites documents that matched your query.", + "description": "Total number of sites that matched your query.", "x-example": 5, "format": "int32" }, @@ -25839,7 +34551,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "functionList": { "description": "Functions List", @@ -25847,7 +34563,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of functions documents that matched your query.", + "description": "Total number of functions that matched your query.", "x-example": 5, "format": "int32" }, @@ -25863,7 +34579,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -25871,7 +34591,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of frameworks documents that matched your query.", + "description": "Total number of frameworks that matched your query.", "x-example": 5, "format": "int32" }, @@ -25887,7 +34607,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -25895,7 +34619,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of runtimes documents that matched your query.", + "description": "Total number of runtimes that matched your query.", "x-example": 5, "format": "int32" }, @@ -25911,7 +34635,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -25919,7 +34647,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of deployments documents that matched your query.", + "description": "Total number of deployments that matched your query.", "x-example": 5, "format": "int32" }, @@ -25935,7 +34663,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -25943,7 +34675,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of executions documents that matched your query.", + "description": "Total number of executions that matched your query.", "x-example": 5, "format": "int32" }, @@ -25959,7 +34691,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -25967,7 +34703,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of countries documents that matched your query.", + "description": "Total number of countries that matched your query.", "x-example": 5, "format": "int32" }, @@ -25983,7 +34719,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -25991,7 +34731,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of continents documents that matched your query.", + "description": "Total number of continents that matched your query.", "x-example": 5, "format": "int32" }, @@ -26007,7 +34747,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -26015,7 +34759,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of languages documents that matched your query.", + "description": "Total number of languages that matched your query.", "x-example": 5, "format": "int32" }, @@ -26031,7 +34775,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -26039,7 +34787,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of currencies documents that matched your query.", + "description": "Total number of currencies that matched your query.", "x-example": 5, "format": "int32" }, @@ -26055,7 +34803,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -26063,7 +34815,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of phones documents that matched your query.", + "description": "Total number of phones that matched your query.", "x-example": 5, "format": "int32" }, @@ -26079,7 +34831,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -26087,7 +34843,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of variables documents that matched your query.", + "description": "Total number of variables that matched your query.", "x-example": 5, "format": "int32" }, @@ -26103,7 +34859,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -26111,7 +34871,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of localeCodes documents that matched your query.", + "description": "Total number of localeCodes that matched your query.", "x-example": 5, "format": "int32" }, @@ -26127,7 +34887,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -26135,7 +34899,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of providers documents that matched your query.", + "description": "Total number of providers that matched your query.", "x-example": 5, "format": "int32" }, @@ -26151,7 +34915,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -26159,7 +34927,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of messages documents that matched your query.", + "description": "Total number of messages that matched your query.", "x-example": 5, "format": "int32" }, @@ -26175,7 +34943,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -26183,7 +34955,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of topics documents that matched your query.", + "description": "Total number of topics that matched your query.", "x-example": 5, "format": "int32" }, @@ -26199,7 +34971,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -26207,7 +34983,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of subscribers documents that matched your query.", + "description": "Total number of subscribers that matched your query.", "x-example": 5, "format": "int32" }, @@ -26223,7 +34999,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -26231,7 +35011,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of targets documents that matched your query.", + "description": "Total number of targets that matched your query.", "x-example": 5, "format": "int32" }, @@ -26247,7 +35027,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "specificationList": { "description": "Specifications List", @@ -26255,7 +35039,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of specifications documents that matched your query.", + "description": "Total number of specifications that matched your query.", "x-example": 5, "format": "int32" }, @@ -26271,7 +35055,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "database": { "description": "Database", @@ -26301,6 +35089,11 @@ "type": "boolean", "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", "x-example": false + }, + "type": { + "type": "string", + "description": "Database type.", + "x-example": "legacy" } }, "required": [ @@ -26308,8 +35101,17 @@ "name", "$createdAt", "$updatedAt", - "enabled" - ] + "enabled", + "type" + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false, + "type": "legacy" + } }, "collection": { "description": "Collection", @@ -26392,6 +35194,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -26419,7 +35230,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -26463,6 +35288,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -26474,7 +35308,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -26493,7 +35331,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -26532,6 +35378,12 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "default", "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "nullable": true } }, "required": [ @@ -26543,7 +35395,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -26562,7 +35427,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -26620,7 +35493,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -26639,7 +35525,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -26697,7 +35591,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -26716,7 +35623,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -26759,7 +35674,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -26778,7 +35704,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -26827,7 +35761,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -26846,7 +35792,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -26904,7 +35858,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -26923,7 +35890,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -26972,7 +35947,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -26991,7 +35978,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -27040,7 +36035,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -27059,7 +36066,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -27108,7 +36123,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -27127,7 +36154,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -27200,15 +36235,1700 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + 0, + 0 + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "table": { + "description": "Table", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Table creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Table update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Table permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Table name.", + "x-example": "My Table" + }, + "enabled": { + "type": "boolean", + "description": "Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "rowSecurity": { + "type": "boolean", + "description": "Whether row-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "columns": { + "type": "array", + "description": "Table columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Table indexes.", + "items": { + "$ref": "#\/components\/schemas\/columnIndex" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "rowSecurity", + "columns", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Table", + "enabled": false, + "rowSecurity": true, + "columns": {}, + "indexes": {} + } + }, + "columnList": { + "description": "Columns List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of columns in the given table.", + "x-example": 5, + "format": "int32" + }, + "columns": { + "type": "array", + "description": "List of columns.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/columnBoolean" + }, + { + "$ref": "#\/components\/schemas\/columnInteger" + }, + { + "$ref": "#\/components\/schemas\/columnFloat" + }, + { + "$ref": "#\/components\/schemas\/columnEmail" + }, + { + "$ref": "#\/components\/schemas\/columnEnum" + }, + { + "$ref": "#\/components\/schemas\/columnUrl" + }, + { + "$ref": "#\/components\/schemas\/columnIp" + }, + { + "$ref": "#\/components\/schemas\/columnDatetime" + }, + { + "$ref": "#\/components\/schemas\/columnRelationship" + }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, + { + "$ref": "#\/components\/schemas\/columnString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "columns" + ], + "example": { + "total": 5, + "columns": "" + } + }, + "columnString": { + "description": "ColumnString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnInteger": { + "description": "ColumnInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 10, + "format": "int32", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnFloat": { + "description": "ColumnFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 2.5, + "format": "double", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "columnBoolean": { + "description": "ColumnBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "columnEmail": { + "description": "ColumnEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "columnEnum": { + "description": "ColumnEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "columnIp": { + "description": "ColumnIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "columnUrl": { + "description": "ColumnURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "https:\/\/example.com" + } + }, + "columnDatetime": { + "description": "ColumnDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "columnRelationship": { + "description": "ColumnRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedTable": { + "type": "string", + "description": "The ID of the related table.", + "x-example": "table" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedTable", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedTable": "table", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + 0, + 0 + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } }, "index": { "description": "Index", "type": "object", "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, "key": { "type": "string", - "description": "Index Key.", + "description": "Index key.", "x-example": "index1" }, "type": { @@ -27219,7 +37939,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -27251,6 +37978,40 @@ }, "x-example": [], "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "attributes", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [] + } + }, + "columnIndex": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" }, "$createdAt": { "type": "string", @@ -27261,18 +38022,148 @@ "type": "string", "description": "Index update date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "columns": { + "type": "array", + "description": "Index columns.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index columns length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "nullable": true } }, "required": [ + "$id", + "$createdAt", + "$updatedAt", "key", "type", "status", "error", - "attributes", - "lengths", + "columns", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "columns": [], + "lengths": [], + "orders": [] + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", "$createdAt", - "$updatedAt" - ] + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } }, "document": { "description": "Document", @@ -27283,15 +38174,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -27317,12 +38217,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -27456,7 +38373,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -27617,7 +38557,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -27631,7 +38597,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -27645,7 +38614,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -27659,7 +38631,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -27673,7 +38648,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -27715,7 +38693,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -27747,7 +38732,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -27782,12 +38773,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -27974,7 +38976,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -28042,7 +39077,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -28086,7 +39133,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -28100,7 +39155,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -28150,7 +39208,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -28170,7 +39237,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -28252,7 +39323,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -28344,7 +39430,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -28394,7 +39499,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -28445,7 +39559,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -28536,7 +39661,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -28722,7 +39864,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -28911,7 +40084,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "runtime": { "description": "Runtime", @@ -28970,7 +40173,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -29025,7 +40238,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -29063,7 +40294,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -29145,7 +40383,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -29173,11 +40418,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -29203,6 +40443,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -29230,14 +40475,43 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -29255,7 +40529,7 @@ }, "$updatedAt": { "type": "string", - "description": "Execution upate date in ISO 8601 format.", + "description": "Execution update date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, "$permissions": { @@ -29273,15 +40547,31 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -29295,7 +40585,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "$ref": "#\/components\/schemas\/headers" }, @@ -29357,6 +40647,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -29368,7 +40659,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "variable": { "description": "Variable", @@ -29424,7 +40745,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -29444,7 +40775,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -29464,7 +40799,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -29490,7 +40829,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -29542,7 +40886,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -29568,7 +40921,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -29581,14 +40939,23 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -29603,7 +40970,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -29622,15 +40992,25 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "description": "Service status. Possible values are: `pass`, `fail`", + "x-example": "pass", + "enum": [ + "pass", + "fail" + ], + "x-enum-name": "HealthCheckStatus" } }, "required": [ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -29674,7 +41054,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -29703,7 +41091,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "headers": { "description": "Headers", @@ -29723,7 +41116,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -29757,7 +41154,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -29789,7 +41192,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -29809,7 +41218,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -29829,7 +41244,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -29861,7 +41280,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -29927,7 +41352,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -30023,7 +41463,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ @@ -30037,7 +41484,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -30099,7 +41572,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -30173,7 +41656,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -30235,7 +41738,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "securitySchemes": { diff --git a/app/config/specs/swagger2-1.7.x-client.json b/app/config/specs/swagger2-1.7.x-client.json index 5c1b764e1e..ff6b6d8984 100644 --- a/app/config/specs/swagger2-1.7.x-client.json +++ b/app/config/specs/swagger2-1.7.x-client.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.7.0", + "version": "1.7.4", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -2751,7 +2751,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2799,7 +2799,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -2886,7 +2886,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -3111,7 +3111,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -3451,7 +3451,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3576,7 +3575,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3594,7 +3592,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "type": "string", "x-example": "amex", @@ -3611,7 +3609,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3631,7 +3629,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -3707,7 +3705,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3770,7 +3767,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4257,7 +4253,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4340,7 +4335,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4431,7 +4425,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4522,7 +4515,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4603,8 +4595,8 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", - "server", "server" ], "packaging": false, @@ -4612,9 +4604,7 @@ { "name": "createDocument", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [] }, "parameters": [ "databaseId", @@ -4743,7 +4733,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4833,7 +4822,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4938,7 +4926,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5023,7 +5010,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -5035,7 +5022,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5078,6 +5064,222 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/functions\/{functionId}\/executions": { "get": { "summary": "List executions", @@ -5101,7 +5303,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -5113,7 +5315,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5175,7 +5376,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -5187,7 +5388,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5261,7 +5461,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "<SCHEDULED_AT>" } } } @@ -5292,7 +5492,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -5304,7 +5504,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5364,7 +5563,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 308, "cookies": false, "type": "graphql", "deprecated": false, @@ -5376,8 +5575,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -5438,7 +5636,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -5450,8 +5648,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -5510,7 +5707,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5522,7 +5719,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5562,7 +5758,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5574,7 +5770,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5614,7 +5809,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -5626,7 +5821,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5666,7 +5860,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -5678,7 +5872,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5718,7 +5911,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -5730,7 +5923,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5770,7 +5962,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -5782,7 +5974,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5822,7 +6013,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -5834,7 +6025,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5874,7 +6064,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -5886,7 +6076,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5928,7 +6117,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -5941,8 +6130,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -6013,7 +6201,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -6026,8 +6214,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -6084,7 +6271,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6096,7 +6283,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6167,7 +6353,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -6179,7 +6365,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6257,7 +6442,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6269,7 +6454,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6327,7 +6511,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6339,7 +6523,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6416,7 +6599,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6428,7 +6611,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6486,7 +6668,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -6498,7 +6680,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6565,7 +6746,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -6577,7 +6758,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6729,7 +6909,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -6771,7 +6952,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -6783,7 +6964,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6850,7 +7030,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -6862,7 +7042,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6925,7 +7104,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -6937,7 +7116,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7015,7 +7193,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7027,7 +7205,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7077,7 +7254,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7089,7 +7266,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7152,7 +7328,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7164,7 +7340,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7214,7 +7389,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -7226,7 +7401,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7297,7 +7471,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7309,7 +7483,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7410,7 +7583,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -7422,7 +7595,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7480,7 +7652,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -7492,7 +7664,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7566,7 +7737,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -7578,7 +7749,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7638,7 +7808,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -7732,7 +7902,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7793,7 +7963,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7924,7 +8094,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "documentList": { "description": "Documents List", @@ -7949,7 +8120,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "sessionList": { "description": "Sessions List", @@ -7974,7 +8149,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -7999,7 +8178,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -8024,7 +8207,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -8049,7 +8236,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "teamList": { "description": "Teams List", @@ -8074,7 +8265,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -8099,7 +8294,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "executionList": { "description": "Executions List", @@ -8124,7 +8323,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -8149,7 +8352,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -8174,7 +8381,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -8199,7 +8410,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -8224,7 +8439,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -8249,7 +8468,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -8274,7 +8497,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "document": { "description": "Document", @@ -8285,15 +8512,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -8319,12 +8555,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -8458,7 +8711,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -8621,7 +8897,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -8635,7 +8937,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -8649,7 +8954,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -8663,7 +8971,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -8677,7 +8988,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -8719,7 +9033,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -8751,7 +9072,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -8786,12 +9113,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -8978,7 +9316,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -9046,7 +9417,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -9090,7 +9473,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -9104,7 +9495,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -9154,7 +9548,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -9174,7 +9577,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -9256,7 +9663,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "team": { "description": "Team", @@ -9308,7 +9730,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -9399,7 +9832,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "execution": { "description": "Execution", @@ -9435,6 +9885,11 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -9521,6 +9976,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -9532,7 +9988,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "country": { "description": "Country", @@ -9552,7 +10038,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -9572,7 +10062,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -9598,7 +10092,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -9650,7 +10149,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -9676,7 +10184,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "headers": { "description": "Headers", @@ -9696,7 +10209,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -9728,7 +10245,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -9748,7 +10271,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -9768,7 +10297,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -9800,7 +10333,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "subscriber": { "description": "Subscriber", @@ -9875,7 +10414,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -9937,7 +10496,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "externalDocs": { diff --git a/app/config/specs/swagger2-1.7.x-console.json b/app/config/specs/swagger2-1.7.x-console.json index 96705f3e61..26862c78bc 100644 --- a/app/config/specs/swagger2-1.7.x-console.json +++ b/app/config/specs/swagger2-1.7.x-console.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.7.0", + "version": "1.7.4", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -2770,7 +2770,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2818,7 +2818,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -2905,7 +2905,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -3130,7 +3130,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -3466,7 +3466,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3591,7 +3590,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3609,7 +3607,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "type": "string", "x-example": "amex", @@ -3626,7 +3624,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3646,7 +3644,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -3722,7 +3720,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3785,7 +3782,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4272,7 +4268,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4355,7 +4350,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4446,7 +4440,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4527,7 +4520,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 308, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -4590,7 +4583,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 432, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -4661,7 +4654,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 307, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -4863,7 +4856,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -8064,7 +8057,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8145,8 +8137,8 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", - "server", "server" ], "packaging": false, @@ -8154,9 +8146,7 @@ { "name": "createDocument", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [] }, "parameters": [ "databaseId", @@ -8178,6 +8168,29 @@ } ], "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, + { + "name": "createDocuments", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { @@ -8250,7 +8263,7 @@ ] }, "put": { - "summary": "Create or update documents", + "summary": "Upsert documents", "operationId": "databasesUpsertDocuments", "consumes": [ "application\/json" @@ -8273,7 +8286,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -8284,6 +8297,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8323,13 +8337,16 @@ "documents": { "type": "array", "description": "Array of document data as JSON objects. May contain partial documents.", - "default": [], + "default": null, "x-example": null, "items": { "type": "object" } } - } + }, + "required": [ + "documents" + ] } } ] @@ -8358,7 +8375,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -8369,6 +8386,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8449,7 +8467,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -8460,6 +8478,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8546,7 +8565,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8636,7 +8654,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8741,7 +8758,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8826,7 +8842,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8838,7 +8854,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8967,6 +8982,222 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -9417,7 +9648,7 @@ "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -9573,7 +9804,7 @@ "x-appwrite": { "method": "getDatabaseUsage", "group": null, - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -9651,7 +9882,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -9723,7 +9954,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -9809,6 +10040,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9834,7 +10066,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9972,7 +10205,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -10021,7 +10254,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -10071,7 +10304,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 402, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -10165,7 +10398,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 401, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -10223,7 +10456,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 395, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -10293,7 +10526,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -10352,7 +10585,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -10440,6 +10673,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -10465,7 +10699,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -10597,7 +10832,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -10658,7 +10893,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -10735,7 +10970,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -10815,7 +11050,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 382, "cookies": false, "type": "upload", "deprecated": false, @@ -10907,7 +11142,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -10992,7 +11227,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -11098,7 +11333,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -11194,7 +11429,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -11256,7 +11491,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -11323,7 +11558,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 389, "cookies": false, "type": "location", "deprecated": false, @@ -11334,7 +11569,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "functions.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -11409,7 +11643,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -11476,7 +11710,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -11488,7 +11722,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11550,7 +11783,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -11562,7 +11795,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11636,7 +11868,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "<SCHEDULED_AT>" } } } @@ -11667,7 +11899,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -11679,7 +11911,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11732,7 +11963,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -11799,7 +12030,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 394, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -11877,7 +12108,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -11936,7 +12167,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -12026,7 +12257,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -12093,7 +12324,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -12185,7 +12416,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -12254,7 +12485,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 308, "cookies": false, "type": "graphql", "deprecated": false, @@ -12266,8 +12497,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -12328,7 +12558,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -12340,8 +12570,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -12400,7 +12629,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12449,7 +12678,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -12498,7 +12727,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12547,7 +12776,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12605,7 +12834,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12654,7 +12883,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12703,7 +12932,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12763,7 +12992,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12823,7 +13052,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12892,7 +13121,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12952,7 +13181,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -13036,7 +13265,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -13096,7 +13325,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -13156,7 +13385,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13216,7 +13445,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13276,7 +13505,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13336,7 +13565,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -13396,7 +13625,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -13456,7 +13685,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -13516,7 +13745,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -13565,7 +13794,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -13614,7 +13843,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -13663,7 +13892,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13675,7 +13904,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13715,7 +13943,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13727,7 +13955,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13767,7 +13994,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -13779,7 +14006,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13819,7 +14045,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -13831,7 +14057,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13871,7 +14096,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -13883,7 +14108,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13923,7 +14147,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -13935,7 +14159,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13975,7 +14198,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -13987,7 +14210,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -14027,7 +14249,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -14039,7 +14261,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -14079,7 +14300,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14154,7 +14375,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14312,7 +14533,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -14467,7 +14688,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14662,7 +14883,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14856,7 +15077,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14974,7 +15195,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15088,7 +15309,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15143,7 +15364,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -15203,7 +15424,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15275,7 +15496,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15347,7 +15568,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -15422,7 +15643,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -15537,7 +15758,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -15650,7 +15871,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -15741,7 +15962,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -15830,7 +16051,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -15957,7 +16178,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -16082,7 +16303,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -16185,7 +16406,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -16286,7 +16507,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -16401,7 +16622,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -16514,7 +16735,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -16673,7 +16894,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -16829,7 +17050,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -16932,7 +17153,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -17033,7 +17254,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -17136,7 +17357,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -17237,7 +17458,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -17340,7 +17561,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -17441,7 +17662,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -17544,7 +17765,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -17643,7 +17864,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -17698,7 +17919,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -17758,7 +17979,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -17830,7 +18051,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -17902,7 +18123,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -17975,7 +18196,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -18063,7 +18284,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -18123,7 +18344,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -18202,7 +18423,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -18262,7 +18483,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -18334,7 +18555,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -18415,7 +18636,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -18428,8 +18649,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -18503,7 +18723,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -18566,7 +18786,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -18579,8 +18799,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -18637,7 +18856,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 314, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -18710,7 +18929,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 309, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -18802,7 +19021,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 316, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -18890,7 +19109,7 @@ "x-appwrite": { "method": "createCsvMigration", "group": null, - "weight": 313, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -18974,7 +19193,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 310, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -19052,7 +19271,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 317, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -19123,7 +19342,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 312, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -19242,7 +19461,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 319, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -19362,7 +19581,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 311, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -19474,7 +19693,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 318, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -19585,7 +19804,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 315, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -19643,7 +19862,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 320, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -19696,7 +19915,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 321, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -19754,7 +19973,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19836,7 +20055,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -19884,7 +20103,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -19965,7 +20184,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -20023,7 +20242,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -20106,7 +20325,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 205, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -20164,7 +20383,7 @@ "x-appwrite": { "method": "list", "group": "projects", - "weight": 155, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -20235,7 +20454,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 154, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -20382,7 +20601,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 156, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20440,7 +20659,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 157, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20565,7 +20784,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 174, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -20625,7 +20844,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 161, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20717,7 +20936,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 162, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20795,7 +21014,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 167, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20873,7 +21092,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 166, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20951,7 +21170,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 172, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -21029,7 +21248,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 165, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -21121,7 +21340,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 173, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -21202,7 +21421,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 170, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -21280,7 +21499,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 169, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -21358,7 +21577,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 171, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -21436,7 +21655,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 164, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -21514,7 +21733,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 168, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -21609,7 +21828,7 @@ "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 371, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -21679,7 +21898,7 @@ "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 368, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -21762,7 +21981,7 @@ "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 370, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -21828,7 +22047,7 @@ "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 369, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -21914,7 +22133,7 @@ "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 372, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -21982,7 +22201,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 186, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -22067,7 +22286,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 182, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -22125,7 +22344,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 181, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -22217,7 +22436,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 183, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -22283,7 +22502,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 184, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -22378,7 +22597,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 185, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -22446,7 +22665,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 163, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -22584,7 +22803,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 188, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22642,7 +22861,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 187, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22762,7 +22981,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 189, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -22828,7 +23047,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 190, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -22925,7 +23144,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 191, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -22993,7 +23212,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 159, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -23094,7 +23313,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 160, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -23172,7 +23391,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 192, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23301,7 +23520,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 193, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23439,7 +23658,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 158, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -23515,7 +23734,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 195, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -23735,7 +23954,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 197, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -23998,7 +24217,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 199, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -24218,7 +24437,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 194, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -24435,7 +24654,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 196, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -24670,7 +24889,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 198, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -24887,7 +25106,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 176, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -24945,7 +25164,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 175, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -25063,7 +25282,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 177, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -25129,7 +25348,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 178, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -25250,7 +25469,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 180, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -25318,7 +25537,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 179, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -25384,7 +25603,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 292, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -25457,7 +25676,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 433, + "weight": 435, "cookies": false, "type": "", "deprecated": false, @@ -25527,7 +25746,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 435, + "weight": 437, "cookies": false, "type": "", "deprecated": false, @@ -25610,7 +25829,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 436, + "weight": 438, "cookies": false, "type": "", "deprecated": false, @@ -25670,12 +25889,35 @@ "Temporary Redirect 307", "Permanent Redirect 308" ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "default": null, + "x-example": "<RESOURCE_ID>" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "default": null, + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] } }, "required": [ "domain", "url", - "statusCode" + "statusCode", + "resourceId", + "resourceType" ] } } @@ -25707,7 +25949,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 434, + "weight": 436, "cookies": false, "type": "", "deprecated": false, @@ -25788,7 +26030,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -25841,7 +26083,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 294, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -25901,7 +26143,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -25959,7 +26201,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -26031,7 +26273,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -26177,6 +26419,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26202,7 +26445,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26296,7 +26540,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -26345,7 +26589,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -26395,7 +26639,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 427, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -26489,7 +26733,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 428, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -26547,7 +26791,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 429, + "weight": 431, "cookies": false, "type": "", "deprecated": false, @@ -26617,7 +26861,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -26676,7 +26920,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -26824,6 +27068,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26849,7 +27094,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26936,7 +27182,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -26997,7 +27243,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -27074,7 +27320,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -27154,7 +27400,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 411, "cookies": false, "type": "upload", "deprecated": false, @@ -27254,7 +27500,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -27333,7 +27579,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -27439,7 +27685,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -27536,7 +27782,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -27598,7 +27844,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -27665,7 +27911,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 418, "cookies": false, "type": "location", "deprecated": false, @@ -27676,7 +27922,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "sites.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -27751,7 +27996,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -27818,7 +28063,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -27889,7 +28134,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -27953,7 +28198,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -28020,7 +28265,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 430, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -28098,7 +28343,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -28157,7 +28402,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -28247,7 +28492,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -28314,7 +28559,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -28406,7 +28651,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -28473,7 +28718,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -28545,7 +28790,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -28682,7 +28927,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -28741,7 +28986,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -28874,7 +29119,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -28933,7 +29178,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -28945,7 +29190,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29016,7 +29260,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -29028,7 +29272,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29106,7 +29349,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -29118,7 +29361,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29176,7 +29418,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -29188,7 +29430,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29265,7 +29506,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -29277,7 +29518,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29335,7 +29575,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -29347,7 +29587,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29414,7 +29653,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -29426,7 +29665,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29578,7 +29816,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -29620,7 +29859,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -29632,7 +29871,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29699,7 +29937,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -29769,7 +30007,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -29847,7 +30085,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -29859,7 +30097,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29922,7 +30159,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -29934,7 +30171,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30012,7 +30248,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -30024,7 +30260,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30074,7 +30309,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -30086,7 +30321,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30149,7 +30383,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -30161,7 +30395,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30211,7 +30444,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -30281,7 +30514,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -30293,7 +30526,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30364,7 +30596,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -30376,7 +30608,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30477,7 +30708,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -30489,7 +30720,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30547,7 +30777,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -30559,7 +30789,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30633,7 +30862,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -30645,7 +30874,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30705,7 +30933,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -30798,7 +31026,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -30858,7 +31086,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -30936,7 +31164,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -31016,7 +31244,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -31100,7 +31328,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -31160,7 +31388,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -31231,7 +31459,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 443, "cookies": false, "type": "", "deprecated": false, @@ -31291,7 +31519,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -31363,7 +31591,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -31458,7 +31686,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -31549,7 +31777,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -31638,7 +31866,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -31707,7 +31935,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -31768,7 +31996,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -31859,7 +32087,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -31950,7 +32178,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -32076,7 +32304,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -32188,7 +32416,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -32298,7 +32526,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 278, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -32368,7 +32596,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -32422,7 +32650,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -32483,7 +32711,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -32562,7 +32790,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -32644,7 +32872,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -32724,7 +32952,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -32795,7 +33023,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -32877,7 +33105,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -32951,7 +33179,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -33023,7 +33251,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -33082,7 +33310,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -33141,7 +33369,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -33200,7 +33428,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -33261,7 +33489,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -33340,7 +33568,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -33419,7 +33647,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -33496,7 +33724,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -33555,7 +33783,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -33632,7 +33860,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -33691,7 +33919,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -33745,7 +33973,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -33801,7 +34029,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -33870,7 +34098,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -33947,7 +34175,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -33983,7 +34211,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "type": "array", "collectionFormat": "multi", @@ -34019,7 +34247,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -34130,7 +34358,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -34198,7 +34426,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -34288,7 +34516,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -34358,7 +34586,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -34440,7 +34668,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -34519,7 +34747,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -34598,7 +34826,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 282, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -34693,7 +34921,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 283, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -34774,7 +35002,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 284, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -34857,7 +35085,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 285, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -34923,7 +35151,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -34977,7 +35205,7 @@ "tags": [ "vcs" ], - "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "VCS Content List", @@ -34989,7 +35217,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 281, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -35037,6 +35265,15 @@ "x-example": "<PROVIDER_ROOT_DIRECTORY>", "default": "", "in": "query" + }, + { + "name": "providerReference", + "description": "Git reference (branch, tag, commit) to get contents from", + "required": false, + "type": "string", + "x-example": "<PROVIDER_REFERENCE>", + "default": "", + "in": "query" } ] } @@ -35063,7 +35300,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 291, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -35147,7 +35384,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -35218,7 +35455,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -35271,7 +35508,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -35381,7 +35618,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "documentList": { "description": "Documents List", @@ -35406,7 +35644,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -35431,7 +35673,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -35456,7 +35702,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -35481,7 +35731,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -35506,7 +35760,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -35531,7 +35789,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -35556,7 +35818,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -35581,7 +35847,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -35606,7 +35876,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -35631,7 +35905,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -35656,7 +35934,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -35681,7 +35963,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -35706,7 +35992,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -35731,7 +36021,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "templateSiteList": { "description": "Site Templates List", @@ -35756,7 +36050,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "functionList": { "description": "Functions List", @@ -35781,7 +36079,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "templateFunctionList": { "description": "Function Templates List", @@ -35806,7 +36108,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "installationList": { "description": "Installations List", @@ -35831,7 +36137,11 @@ "required": [ "total", "installations" - ] + ], + "example": { + "total": 5, + "installations": "" + } }, "providerRepositoryFrameworkList": { "description": "Framework Provider Repositories List", @@ -35856,7 +36166,11 @@ "required": [ "total", "frameworkProviderRepositories" - ] + ], + "example": { + "total": 5, + "frameworkProviderRepositories": "" + } }, "providerRepositoryRuntimeList": { "description": "Runtime Provider Repositories List", @@ -35881,7 +36195,11 @@ "required": [ "total", "runtimeProviderRepositories" - ] + ], + "example": { + "total": 5, + "runtimeProviderRepositories": "" + } }, "branchList": { "description": "Branches List", @@ -35906,7 +36224,11 @@ "required": [ "total", "branches" - ] + ], + "example": { + "total": 5, + "branches": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -35931,7 +36253,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -35956,7 +36282,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -35981,7 +36311,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -36006,7 +36340,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "projectList": { "description": "Projects List", @@ -36031,7 +36369,11 @@ "required": [ "total", "projects" - ] + ], + "example": { + "total": 5, + "projects": "" + } }, "webhookList": { "description": "Webhooks List", @@ -36056,7 +36398,11 @@ "required": [ "total", "webhooks" - ] + ], + "example": { + "total": 5, + "webhooks": "" + } }, "keyList": { "description": "API Keys List", @@ -36081,7 +36427,11 @@ "required": [ "total", "keys" - ] + ], + "example": { + "total": 5, + "keys": "" + } }, "devKeyList": { "description": "Dev Keys List", @@ -36106,7 +36456,11 @@ "required": [ "total", "devKeys" - ] + ], + "example": { + "total": 5, + "devKeys": "" + } }, "platformList": { "description": "Platforms List", @@ -36131,7 +36485,11 @@ "required": [ "total", "platforms" - ] + ], + "example": { + "total": 5, + "platforms": "" + } }, "countryList": { "description": "Countries List", @@ -36156,7 +36514,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -36181,7 +36543,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -36206,7 +36572,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -36231,7 +36601,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -36256,7 +36630,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -36281,7 +36659,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "proxyRuleList": { "description": "Rule List", @@ -36306,7 +36688,11 @@ "required": [ "total", "rules" - ] + ], + "example": { + "total": 5, + "rules": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -36331,7 +36717,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -36356,7 +36746,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -36381,7 +36775,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -36406,7 +36804,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -36431,7 +36833,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -36456,7 +36862,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "migrationList": { "description": "Migrations List", @@ -36481,7 +36891,11 @@ "required": [ "total", "migrations" - ] + ], + "example": { + "total": 5, + "migrations": "" + } }, "specificationList": { "description": "Specifications List", @@ -36506,7 +36920,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "vcsContentList": { "description": "VCS Content List", @@ -36531,7 +36949,11 @@ "required": [ "total", "contents" - ] + ], + "example": { + "total": 5, + "contents": "" + } }, "database": { "description": "Database", @@ -36569,7 +36991,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -36680,7 +37109,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -36735,7 +37178,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -36793,6 +37240,12 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "default", "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "x-nullable": true } }, "required": [ @@ -36804,7 +37257,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -36881,7 +37347,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -36958,7 +37437,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -37020,7 +37512,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -37088,7 +37591,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -37165,7 +37680,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -37233,7 +37761,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -37301,7 +37841,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -37369,7 +37921,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -37461,7 +38025,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -37533,7 +38113,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -37544,15 +38135,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -37578,12 +38178,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -37717,7 +38334,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -37880,7 +38520,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -37894,7 +38560,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -37908,7 +38577,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -37922,7 +38594,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -37936,7 +38611,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -37978,7 +38656,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -38010,7 +38695,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -38045,12 +38736,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -38237,7 +38939,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -38305,7 +39040,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -38349,7 +39096,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -38363,7 +39118,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -38413,7 +39171,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -38433,7 +39200,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -38515,7 +39286,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -38607,7 +39393,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -38657,7 +39462,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -38709,7 +39523,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -38800,7 +39625,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -38987,7 +39829,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "templateSite": { "description": "Template Site", @@ -39084,7 +39957,22 @@ "providerOwner", "providerVersion", "variables" - ] + ], + "example": { + "key": "starter", + "name": "Starter site", + "tagline": "Minimal web app integrating with Appwrite.", + "demoUrl": "https:\/\/nextjs-starter.appwrite.network\/", + "screenshotDark": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png", + "screenshotLight": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png", + "useCases": "Starter", + "frameworks": [], + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [] + } }, "templateFramework": { "description": "Template Framework", @@ -39146,7 +40034,18 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/build", + "providerRootDirectory": ".\/svelte-kit\/starter", + "buildRuntime": "node-22", + "adapter": "ssr", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -39336,7 +40235,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "templateFunction": { "description": "Template Function", @@ -39467,7 +40396,26 @@ "providerVersion", "variables", "scopes" - ] + ], + "example": { + "icon": "icon-lightning-bolt", + "id": "starter", + "name": "Starter function", + "tagline": "A simple function to get started.", + "permissions": "any", + "events": "account.create", + "cron": "0 0 * * *", + "timeout": 300, + "useCases": "Starter", + "runtimes": [], + "instructions": "For documentation and instructions check out <link>.", + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [], + "scopes": "users.read" + } }, "templateRuntime": { "description": "Template Runtime", @@ -39499,7 +40447,13 @@ "commands", "entrypoint", "providerRootDirectory" - ] + ], + "example": { + "name": "node-19.0", + "commands": "npm install", + "entrypoint": "index.js", + "providerRootDirectory": "node\/starter" + } }, "templateVariable": { "description": "Template Variable", @@ -39549,7 +40503,16 @@ "placeholder", "required", "type" - ] + ], + "example": { + "name": "APPWRITE_DATABASE_ID", + "description": "The ID of the Appwrite database that contains the collection to sync.", + "value": "512", + "secret": false, + "placeholder": "64a55...7b912", + "required": false, + "type": "password" + } }, "installation": { "description": "Installation", @@ -39593,7 +40556,15 @@ "provider", "organization", "providerInstallationId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "provider": "github", + "organization": "appwrite", + "providerInstallationId": "5322" + } }, "providerRepository": { "description": "ProviderRepository", @@ -39624,6 +40595,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39636,8 +40612,18 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime" + } }, "providerRepositoryFramework": { "description": "ProviderRepositoryFramework", @@ -39668,6 +40654,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39685,9 +40676,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "framework" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "framework": "nextjs" + } }, "providerRepositoryRuntime": { "description": "ProviderRepositoryRuntime", @@ -39718,6 +40720,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39735,9 +40742,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "runtime" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "runtime": "node-22" + } }, "detectionFramework": { "description": "DetectionFramework", @@ -39769,7 +40787,13 @@ "installCommand", "buildCommand", "outputDirectory" - ] + ], + "example": { + "framework": "nuxt", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" + } }, "detectionRuntime": { "description": "DetectionRuntime", @@ -39795,7 +40819,12 @@ "runtime", "entrypoint", "commands" - ] + ], + "example": { + "runtime": "node", + "entrypoint": "index.js", + "commands": "npm install && npm run build" + } }, "vcsContent": { "description": "VcsContents", @@ -39822,7 +40851,12 @@ }, "required": [ "name" - ] + ], + "example": { + "size": 1523, + "isDirectory": true, + "name": "Main.java" + } }, "branch": { "description": "Branch", @@ -39836,7 +40870,10 @@ }, "required": [ "name" - ] + ], + "example": { + "name": "main" + } }, "runtime": { "description": "Runtime", @@ -39895,7 +40932,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -39951,7 +40998,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -39989,7 +41054,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -40163,7 +41235,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -40199,6 +41300,11 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -40285,6 +41391,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -40296,7 +41403,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "project": { "description": "Project", @@ -40698,7 +41835,73 @@ "serviceStatusForFunctions", "serviceStatusForGraphql", "serviceStatusForMessaging" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "description": "This is a new project.", + "teamId": "1592981250", + "logo": "5f5c451b403cb", + "url": "5f5c451b403cb", + "legalName": "Company LTD.", + "legalCountry": "US", + "legalState": "New York", + "legalCity": "New York City.", + "legalAddress": "620 Eighth Avenue, New York, NY 10018", + "legalTaxId": "131102020", + "authDuration": 60, + "authLimit": 100, + "authSessionsLimit": 10, + "authPasswordHistory": 5, + "authPasswordDictionary": true, + "authPersonalDataCheck": true, + "authMockNumbers": [ + {} + ], + "authSessionAlerts": true, + "authMembershipsUserName": true, + "authMembershipsUserEmail": true, + "authMembershipsMfa": true, + "oAuthProviders": [ + {} + ], + "platforms": {}, + "webhooks": {}, + "keys": {}, + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyTo": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "securepassword", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "authEmailPassword": true, + "authUsersAuthMagicURL": true, + "authEmailOtp": true, + "authAnonymous": true, + "authInvites": true, + "authJWT": true, + "authPhone": true, + "serviceStatusForAccount": true, + "serviceStatusForAvatars": true, + "serviceStatusForDatabases": true, + "serviceStatusForLocale": true, + "serviceStatusForHealth": true, + "serviceStatusForStorage": true, + "serviceStatusForTeams": true, + "serviceStatusForUsers": true, + "serviceStatusForSites": true, + "serviceStatusForFunctions": true, + "serviceStatusForGraphql": true, + "serviceStatusForMessaging": true + } }, "webhook": { "description": "Webhook", @@ -40788,7 +41991,22 @@ "enabled", "logs", "attempts" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": "database.collections.update", + "security": true, + "httpUser": "username", + "httpPass": "password", + "signatureKey": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } }, "key": { "description": "Key", @@ -40856,7 +42074,18 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "devKey": { "description": "DevKey", @@ -40915,7 +42144,17 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "mockNumber": { "description": "Mock Number", @@ -40935,7 +42174,11 @@ "required": [ "phone", "otp" - ] + ], + "example": { + "phone": "+1612842323", + "otp": "123456" + } }, "authProvider": { "description": "AuthProvider", @@ -40973,7 +42216,14 @@ "appId", "secret", "enabled" - ] + ], + "example": { + "key": "github", + "name": "GitHub", + "appId": "259125845563242502", + "secret": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ", + "enabled": "" + } }, "platform": { "description": "Platform", @@ -41041,7 +42291,19 @@ "hostname", "httpUser", "httpPass" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "key": "com.company.appname", + "store": "", + "hostname": true, + "httpUser": "username", + "httpPass": "password" + } }, "variable": { "description": "Variable", @@ -41097,7 +42359,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -41117,7 +42389,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -41137,7 +42413,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -41163,7 +42443,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -41215,7 +42500,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -41241,7 +42535,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -41261,7 +42560,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -41276,7 +42579,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -41303,7 +42609,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -41347,7 +42658,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -41376,7 +42695,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "metric": { "description": "Metric", @@ -41397,7 +42721,11 @@ "required": [ "value", "date" - ] + ], + "example": { + "value": 1, + "date": "2020-10-15T06:38:00.000+00:00" + } }, "metricBreakdown": { "description": "Metric Breakdown", @@ -41431,7 +42759,13 @@ "required": [ "name", "value" - ] + ], + "example": { + "resourceId": "5e5ea5c16897e", + "name": "Documents", + "value": 1, + "estimate": 1 + } }, "usageDatabases": { "description": "UsageDatabases", @@ -41547,7 +42881,22 @@ "storage", "databasesReads", "databasesWrites" - ] + ], + "example": { + "range": "30d", + "databasesTotal": 0, + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "databases": [], + "collections": [], + "documents": [], + "storage": [], + "databasesReads": [], + "databasesWrites": [] + } }, "usageDatabase": { "description": "UsageDatabase", @@ -41646,7 +42995,20 @@ "storage", "databaseReads", "databaseWrites" - ] + ], + "example": { + "range": "30d", + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databaseReadsTotal": 0, + "databaseWritesTotal": 0, + "collections": [], + "documents": [], + "storage": [], + "databaseReads": [], + "databaseWrites": [] + } }, "usageCollection": { "description": "UsageCollection", @@ -41677,7 +43039,12 @@ "range", "documentsTotal", "documents" - ] + ], + "example": { + "range": "30d", + "documentsTotal": 0, + "documents": [] + } }, "usageUsers": { "description": "UsageUsers", @@ -41725,7 +43092,14 @@ "sessionsTotal", "users", "sessions" - ] + ], + "example": { + "range": "30d", + "usersTotal": 0, + "sessionsTotal": 0, + "users": [], + "sessions": [] + } }, "usageStorage": { "description": "StorageUsage", @@ -41790,7 +43164,16 @@ "buckets", "files", "storage" - ] + ], + "example": { + "range": "30d", + "bucketsTotal": 0, + "filesTotal": 0, + "filesStorageTotal": 0, + "buckets": [], + "files": [], + "storage": [] + } }, "usageBuckets": { "description": "UsageBuckets", @@ -41855,7 +43238,16 @@ "storage", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "range": "30d", + "filesTotal": 0, + "filesStorageTotal": 0, + "files": [], + "storage": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "usageFunctions": { "description": "UsageFunctions", @@ -42073,7 +43465,34 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "functionsTotal": 0, + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "functions": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageFunction": { "description": "UsageFunction", @@ -42281,7 +43700,33 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageSites": { "description": "UsageSites", @@ -42550,7 +43995,40 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "sitesTotal": 0, + "sites": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageSite": { "description": "UsageSite", @@ -42809,7 +44287,39 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageProject": { "description": "UsageProject", @@ -43076,7 +44586,40 @@ "databasesWrites", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "executionsTotal": 0, + "documentsTotal": 0, + "databasesTotal": 0, + "databasesStorageTotal": 0, + "usersTotal": 0, + "filesStorageTotal": 0, + "functionsStorageTotal": 0, + "buildsStorageTotal": 0, + "deploymentsStorageTotal": 0, + "bucketsTotal": 0, + "executionsMbSecondsTotal": 0, + "buildsMbSecondsTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "requests": [], + "network": [], + "users": [], + "executions": [], + "executionsBreakdown": [], + "bucketsBreakdown": [], + "databasesStorageBreakdown": [], + "executionsMbSecondsBreakdown": [], + "buildsMbSecondsBreakdown": [], + "functionsStorageBreakdown": [], + "authPhoneTotal": 0, + "authPhoneEstimate": 0, + "authPhoneCountryBreakdown": [], + "databasesReads": [], + "databasesWrites": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "headers": { "description": "Headers", @@ -43096,7 +44639,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -43130,7 +44677,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "proxyRule": { "description": "Rule", @@ -43229,7 +44782,24 @@ "status", "logs", "renewAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "function", + "status": "verified", + "logs": "HTTP challegne failed.", + "renewAt": "datetime" + } }, "smsTemplate": { "description": "SmsTemplate", @@ -43255,7 +44825,12 @@ "type", "locale", "message" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account." + } }, "emailTemplate": { "description": "EmailTemplate", @@ -43305,7 +44880,16 @@ "senderEmail", "replyTo", "subject" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyTo": "emails@appwrite.io", + "subject": "Please verify your email address" + } }, "consoleVariables": { "description": "Console Variables", @@ -43326,6 +44910,11 @@ "description": "AAAA target for your Appwrite custom domains.", "x-example": "::1" }, + "_APP_DOMAIN_TARGET_CAA": { + "type": "string", + "description": "CAA target for your Appwrite custom domains.", + "x-example": "digicert.com" + }, "_APP_STORAGE_LIMIT": { "type": "integer", "description": "Maximum file size allowed for file upload in bytes.", @@ -43383,6 +44972,7 @@ "_APP_DOMAIN_TARGET_CNAME", "_APP_DOMAIN_TARGET_A", "_APP_DOMAIN_TARGET_AAAA", + "_APP_DOMAIN_TARGET_CAA", "_APP_STORAGE_LIMIT", "_APP_COMPUTE_SIZE_LIMIT", "_APP_USAGE_STATS", @@ -43393,7 +44983,23 @@ "_APP_DOMAIN_FUNCTIONS", "_APP_OPTIONS_FORCE_HTTPS", "_APP_DOMAINS_NAMESERVERS" - ] + ], + "example": { + "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", + "_APP_DOMAIN_TARGET_A": "127.0.0.1", + "_APP_DOMAIN_TARGET_AAAA": "::1", + "_APP_DOMAIN_TARGET_CAA": "digicert.com", + "_APP_STORAGE_LIMIT": "30000000", + "_APP_COMPUTE_SIZE_LIMIT": "30000000", + "_APP_USAGE_STATS": "enabled", + "_APP_VCS_ENABLED": true, + "_APP_DOMAIN_ENABLED": true, + "_APP_ASSISTANT_ENABLED": true, + "_APP_DOMAIN_SITES": "sites.localhost", + "_APP_DOMAIN_FUNCTIONS": "functions.localhost", + "_APP_OPTIONS_FORCE_HTTPS": "enabled", + "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -43425,7 +45031,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -43445,7 +45057,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -43465,7 +45083,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -43497,7 +45119,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -43564,7 +45192,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -43675,7 +45318,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -43737,7 +45406,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -43812,7 +45491,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -43874,7 +45573,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } }, "migration": { "description": "Migration", @@ -43964,7 +45674,23 @@ "statusCounters", "resourceData", "errors" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "stage": "init", + "source": "Appwrite", + "destination": "Appwrite", + "resources": [ + "user" + ], + "resourceId": "databaseId:collectionId", + "statusCounters": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}", + "resourceData": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]", + "errors": [] + } }, "migrationReport": { "description": "Migration Report", @@ -44034,7 +45760,18 @@ "function", "size", "version" - ] + ], + "example": { + "user": 20, + "team": 20, + "database": 20, + "document": 20, + "file": 20, + "bucket": 20, + "function": 20, + "size": 30000, + "version": "1.4.0" + } } }, "externalDocs": { diff --git a/app/config/specs/swagger2-1.7.x-server.json b/app/config/specs/swagger2-1.7.x-server.json index c033008417..2a0035dec7 100644 --- a/app/config/specs/swagger2-1.7.x-server.json +++ b/app/config/specs/swagger2-1.7.x-server.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.7.0", + "version": "1.7.4", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -2438,7 +2438,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2486,7 +2486,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -2573,7 +2573,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -2798,7 +2798,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -3142,7 +3142,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3269,7 +3268,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3289,7 +3287,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "type": "string", "x-example": "amex", @@ -3306,7 +3304,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3326,7 +3324,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -3402,7 +3400,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3467,7 +3464,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3956,7 +3952,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4041,7 +4036,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4134,7 +4128,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7533,7 +7526,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7616,8 +7608,8 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", - "server", "server" ], "packaging": false, @@ -7625,9 +7617,8 @@ { "name": "createDocument", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [], + "Session": [] }, "parameters": [ "databaseId", @@ -7649,6 +7640,30 @@ } ], "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, + { + "name": "createDocuments", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { @@ -7723,7 +7738,7 @@ ] }, "put": { - "summary": "Create or update documents", + "summary": "Upsert documents", "operationId": "databasesUpsertDocuments", "consumes": [ "application\/json" @@ -7746,7 +7761,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -7757,6 +7772,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7797,13 +7813,16 @@ "documents": { "type": "array", "description": "Array of document data as JSON objects. May contain partial documents.", - "default": [], + "default": null, "x-example": null, "items": { "type": "object" } } - } + }, + "required": [ + "documents" + ] } } ] @@ -7832,7 +7851,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -7843,6 +7862,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7924,7 +7944,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -7935,6 +7955,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8022,7 +8043,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8114,7 +8134,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8221,7 +8240,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8308,7 +8326,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8320,7 +8338,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8365,6 +8382,226 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -8741,7 +8978,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -8814,7 +9051,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -8901,6 +9138,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -8926,7 +9164,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9064,7 +9303,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -9114,7 +9353,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -9165,7 +9404,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -9225,7 +9464,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -9314,6 +9553,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9339,7 +9579,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9471,7 +9712,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -9533,7 +9774,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -9611,7 +9852,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -9692,7 +9933,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 382, "cookies": false, "type": "upload", "deprecated": false, @@ -9785,7 +10026,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -9871,7 +10112,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -9978,7 +10219,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -10075,7 +10316,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -10138,7 +10379,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -10206,7 +10447,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 389, "cookies": false, "type": "location", "deprecated": false, @@ -10217,7 +10458,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "functions.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -10293,7 +10533,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -10361,7 +10601,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -10373,7 +10613,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10437,7 +10676,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -10449,7 +10688,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10525,7 +10763,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "<SCHEDULED_AT>" } } } @@ -10556,7 +10794,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -10568,7 +10806,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10623,7 +10860,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -10691,7 +10928,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -10751,7 +10988,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -10842,7 +11079,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -10910,7 +11147,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -11003,7 +11240,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -11073,7 +11310,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 308, "cookies": false, "type": "graphql", "deprecated": false, @@ -11085,8 +11322,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -11149,7 +11385,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -11161,8 +11397,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -11223,7 +11458,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -11273,7 +11508,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -11323,7 +11558,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11373,7 +11608,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11432,7 +11667,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11482,7 +11717,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11532,7 +11767,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11593,7 +11828,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11654,7 +11889,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11724,7 +11959,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11785,7 +12020,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -11870,7 +12105,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11931,7 +12166,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11992,7 +12227,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -12053,7 +12288,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12114,7 +12349,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12175,7 +12410,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12236,7 +12471,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -12297,7 +12532,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12358,7 +12593,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -12408,7 +12643,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -12458,7 +12693,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12508,7 +12743,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12520,7 +12755,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12562,7 +12796,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12574,7 +12808,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12616,7 +12849,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -12628,7 +12861,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12670,7 +12902,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12682,7 +12914,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12724,7 +12955,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12736,7 +12967,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12778,7 +13008,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -12790,7 +13020,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12832,7 +13061,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12844,7 +13073,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12886,7 +13114,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12898,7 +13126,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12940,7 +13167,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -13016,7 +13243,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -13175,7 +13402,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -13331,7 +13558,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -13527,7 +13754,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -13722,7 +13949,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -13841,7 +14068,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -13956,7 +14183,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -14012,7 +14239,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14073,7 +14300,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14146,7 +14373,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -14219,7 +14446,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -14295,7 +14522,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -14411,7 +14638,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -14525,7 +14752,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -14617,7 +14844,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -14707,7 +14934,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -14835,7 +15062,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -14961,7 +15188,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -15065,7 +15292,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -15167,7 +15394,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -15283,7 +15510,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -15397,7 +15624,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -15557,7 +15784,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -15714,7 +15941,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -15818,7 +16045,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -15920,7 +16147,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -16024,7 +16251,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -16126,7 +16353,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -16230,7 +16457,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -16332,7 +16559,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -16436,7 +16663,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -16536,7 +16763,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -16592,7 +16819,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -16653,7 +16880,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -16726,7 +16953,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -16799,7 +17026,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -16873,7 +17100,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -16962,7 +17189,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -17023,7 +17250,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -17103,7 +17330,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -17164,7 +17391,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -17237,7 +17464,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -17319,7 +17546,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -17332,8 +17559,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -17409,7 +17635,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -17473,7 +17699,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -17486,8 +17712,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -17546,7 +17771,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -17619,7 +17844,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -17766,6 +17991,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17791,7 +18017,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -17885,7 +18112,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -17935,7 +18162,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -17986,7 +18213,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -18046,7 +18273,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -18195,6 +18422,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -18220,7 +18448,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -18307,7 +18536,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -18369,7 +18598,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -18447,7 +18676,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -18528,7 +18757,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 411, "cookies": false, "type": "upload", "deprecated": false, @@ -18629,7 +18858,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -18709,7 +18938,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -18816,7 +19045,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -18914,7 +19143,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -18977,7 +19206,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -19045,7 +19274,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 418, "cookies": false, "type": "location", "deprecated": false, @@ -19056,7 +19285,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "sites.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -19132,7 +19360,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -19200,7 +19428,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -19272,7 +19500,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -19337,7 +19565,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -19405,7 +19633,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -19465,7 +19693,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -19556,7 +19784,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -19624,7 +19852,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -19717,7 +19945,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -19785,7 +20013,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -19858,7 +20086,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -19996,7 +20224,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -20056,7 +20284,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -20190,7 +20418,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -20250,7 +20478,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -20262,7 +20490,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20335,7 +20562,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -20347,7 +20574,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20427,7 +20653,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -20439,7 +20665,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20499,7 +20724,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -20511,7 +20736,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20590,7 +20814,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -20602,7 +20826,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20662,7 +20885,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -20674,7 +20897,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20743,7 +20965,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -20755,7 +20977,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20909,7 +21130,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -20951,7 +21173,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -20963,7 +21185,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21032,7 +21253,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -21044,7 +21265,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21109,7 +21329,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -21121,7 +21341,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21201,7 +21420,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -21213,7 +21432,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21265,7 +21483,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -21277,7 +21495,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21342,7 +21559,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -21354,7 +21571,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21406,7 +21622,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -21418,7 +21634,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21491,7 +21706,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -21503,7 +21718,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21606,7 +21820,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -21618,7 +21832,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21678,7 +21891,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -21690,7 +21903,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21766,7 +21978,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -21778,7 +21990,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21840,7 +22051,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -21935,7 +22146,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -21997,7 +22208,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -22077,7 +22288,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -22158,7 +22369,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -22243,7 +22454,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -22304,7 +22515,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -22376,7 +22587,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 443, "cookies": false, "type": "", "deprecated": false, @@ -22437,7 +22648,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -22510,7 +22721,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -22606,7 +22817,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -22698,7 +22909,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -22788,7 +22999,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -22858,7 +23069,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -22920,7 +23131,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -23012,7 +23223,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -23104,7 +23315,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -23231,7 +23442,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -23344,7 +23555,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -23455,7 +23666,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -23510,7 +23721,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -23572,7 +23783,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -23652,7 +23863,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -23735,7 +23946,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -23816,7 +24027,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -23888,7 +24099,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -23971,7 +24182,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -24046,7 +24257,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -24119,7 +24330,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -24179,7 +24390,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -24239,7 +24450,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -24299,7 +24510,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -24361,7 +24572,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -24441,7 +24652,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -24521,7 +24732,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -24599,7 +24810,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -24659,7 +24870,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -24737,7 +24948,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -24797,7 +25008,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -24852,7 +25063,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -24909,7 +25120,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -24979,7 +25190,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -25057,7 +25268,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -25094,7 +25305,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "type": "array", "collectionFormat": "multi", @@ -25130,7 +25341,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -25242,7 +25453,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -25311,7 +25522,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -25402,7 +25613,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -25473,7 +25684,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -25556,7 +25767,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -25636,7 +25847,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -25766,7 +25977,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "documentList": { "description": "Documents List", @@ -25791,7 +26003,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -25816,7 +26032,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -25841,7 +26061,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -25866,7 +26090,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -25891,7 +26119,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -25916,7 +26148,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -25941,7 +26177,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -25966,7 +26206,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -25991,7 +26235,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -26016,7 +26264,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -26041,7 +26293,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -26066,7 +26322,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -26091,7 +26351,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -26116,7 +26380,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "functionList": { "description": "Functions List", @@ -26141,7 +26409,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -26166,7 +26438,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -26191,7 +26467,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -26216,7 +26496,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -26241,7 +26525,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -26266,7 +26554,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -26291,7 +26583,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -26316,7 +26612,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -26341,7 +26641,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -26366,7 +26670,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -26391,7 +26699,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -26416,7 +26728,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -26441,7 +26757,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -26466,7 +26786,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -26491,7 +26815,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -26516,7 +26844,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -26541,7 +26873,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "specificationList": { "description": "Specifications List", @@ -26566,7 +26902,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "database": { "description": "Database", @@ -26604,7 +26944,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -26715,7 +27062,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -26770,7 +27131,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -26828,6 +27193,12 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "default", "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "x-nullable": true } }, "required": [ @@ -26839,7 +27210,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -26916,7 +27300,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -26993,7 +27390,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -27055,7 +27465,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -27123,7 +27544,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -27200,7 +27633,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -27268,7 +27714,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -27336,7 +27794,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -27404,7 +27874,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -27496,7 +27978,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -27568,7 +28066,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -27579,15 +28088,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -27613,12 +28131,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -27752,7 +28287,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -27915,7 +28473,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -27929,7 +28513,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -27943,7 +28530,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -27957,7 +28547,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -27971,7 +28564,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -28013,7 +28609,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -28045,7 +28648,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -28080,12 +28689,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -28272,7 +28892,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -28340,7 +28993,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -28384,7 +29049,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -28398,7 +29071,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -28448,7 +29124,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -28468,7 +29153,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -28550,7 +29239,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -28642,7 +29346,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -28692,7 +29415,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -28744,7 +29476,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -28835,7 +29578,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -29022,7 +29782,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -29212,7 +30003,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "runtime": { "description": "Runtime", @@ -29271,7 +30092,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -29327,7 +30158,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -29365,7 +30214,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -29539,7 +30395,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -29575,6 +30460,11 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -29661,6 +30551,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -29672,7 +30563,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "variable": { "description": "Variable", @@ -29728,7 +30649,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -29748,7 +30679,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -29768,7 +30703,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -29794,7 +30733,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -29846,7 +30790,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -29872,7 +30825,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -29892,7 +30850,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -29907,7 +30869,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -29934,7 +30899,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -29978,7 +30948,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -30007,7 +30985,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "headers": { "description": "Headers", @@ -30027,7 +31010,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -30061,7 +31048,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -30093,7 +31086,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -30113,7 +31112,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -30133,7 +31138,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -30165,7 +31174,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -30232,7 +31247,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -30343,7 +31373,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -30405,7 +31461,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -30480,7 +31546,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -30542,7 +31628,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "externalDocs": { diff --git a/app/config/specs/swagger2-1.8.x-client.json b/app/config/specs/swagger2-1.8.x-client.json new file mode 100644 index 0000000000..c2628533d0 --- /dev/null +++ b/app/config/specs/swagger2-1.8.x-client.json @@ -0,0 +1,12027 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.8.0", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "host": "cloud.appwrite.io", + "x-host-docs": "<REGION>.cloud.appwrite.io", + "basePath": "\/v1", + "schemes": [ + "https" + ], + "consumes": [ + "application\/json", + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "securityDefinitions": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_JWT>" + } + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Session": { + "type": "apiKey", + "name": "X-Appwrite-Session", + "description": "The user session to authenticate with", + "in": "header" + }, + "DevKey": { + "type": "apiKey", + "name": "X-Appwrite-Dev-Key", + "description": "Your secret dev API key", + "in": "header" + } + }, + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "demo": "account\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "demo": "account\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "demo": "account\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "schema": { + "$ref": "#\/definitions\/identityList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "type": "string", + "x-example": "<IDENTITY_ID>", + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "demo": "account\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "demo": "account\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "default": null, + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + ] + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "schema": { + "$ref": "#\/definitions\/mfaType" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + ] + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "schema": { + "$ref": "#\/definitions\/mfaChallenge" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "default": null, + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + ] + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "default": null, + "x-example": "<CHALLENGE_ID>" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + ] + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "schema": { + "$ref": "#\/definitions\/mfaFactors" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "demo": "account\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "default": "", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + ] + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + ] + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "demo": "account\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "demo": "account\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "demo": "account\/create-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "demo": "account\/update-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "default": null, + "x-example": "<SECRET>" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "schema": { + "$ref": "#\/definitions\/sessionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "demo": "account\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "demo": "account\/update-magic-url-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 session", + "operationId": "accountCreateOAuth2Session", + "consumes": [], + "produces": [ + "text\/html" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "301": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createOAuth2Session", + "group": "sessions", + "weight": 20, + "cookies": false, + "type": "webAuth", + "demo": "account\/create-o-auth-2-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "", + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "", + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "demo": "account\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "demo": "account\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/targets\/push": { + "post": { + "summary": "Create push target", + "operationId": "accountCreatePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", + "responses": { + "201": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPushTarget", + "group": "pushTargets", + "weight": 55, + "cookies": false, + "type": "", + "demo": "account\/create-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TARGET_ID>" + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + } + }, + "required": [ + "targetId", + "identifier" + ] + } + } + ] + } + }, + "\/account\/targets\/{targetId}\/push": { + "put": { + "summary": "Update push target", + "operationId": "accountUpdatePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePushTarget", + "group": "pushTargets", + "weight": 56, + "cookies": false, + "type": "", + "demo": "account\/update-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + } + }, + "required": [ + "identifier" + ] + } + } + ] + }, + "delete": { + "summary": "Delete push target", + "operationId": "accountDeletePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deletePushTarget", + "group": "pushTargets", + "weight": 57, + "cookies": false, + "type": "", + "demo": "account\/delete-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "demo": "account\/create-magic-url-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "consumes": [], + "produces": [ + "text\/html" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "demo": "account\/create-o-auth-2-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "", + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "", + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", + "default": null, + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + ] + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "demo": "avatars\/get-browser.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ], + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "demo": "avatars\/get-credit-card.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", + "required": true, + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "unionpay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ], + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "demo": "avatars\/get-favicon.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "demo": "avatars\/get-flag.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ], + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "demo": "avatars\/get-image.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "in": "query" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "demo": "avatars\/get-initials.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "type": "string", + "x-example": "<NAME>", + "default": "", + "in": "query" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500, + "in": "query" + }, + { + "name": "background", + "description": "Changes background color. By default a random color will be picked and stay will persistent to the given name.", + "required": false, + "type": "string", + "default": "", + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "demo": "avatars\/get-qr.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "type": "string", + "x-example": "<TEXT>", + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 400, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 1, + "in": "query" + }, + { + "name": "download", + "description": "Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.", + "required": false, + "type": "boolean", + "x-example": false, + "default": false, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 335, + "cookies": false, + "type": "", + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 327, + "cookies": false, + "type": "", + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, + "methods": [ + { + "name": "createDocument", + "namespace": "databases", + "desc": "Create document", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<DOCUMENT_ID>" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 328, + "cookies": false, + "type": "", + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "databasesUpsertDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 331, + "cookies": false, + "type": "", + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "default": {}, + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + ] + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 329, + "cookies": false, + "type": "", + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 333, + "cookies": false, + "type": "", + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 456, + "cookies": false, + "type": "", + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "consumes": [ + "application\/json" + ], + "produces": [ + "multipart\/form-data" + ], + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 454, + "cookies": false, + "type": "", + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "<BODY>" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "<PATH>" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is POST.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS", + "HEAD" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": "<SCHEDULED_AT>" + } + } + } + } + ] + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 455, + "cookies": false, + "type": "", + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "type": "string", + "x-example": "<EXECUTION_ID>", + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 250, + "cookies": false, + "type": "graphql", + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 249, + "cookies": false, + "type": "graphql", + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "responses": { + "200": { + "description": "Locale", + "schema": { + "$ref": "#\/definitions\/locale" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 70, + "cookies": false, + "type": "", + "demo": "locale\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "schema": { + "$ref": "#\/definitions\/localeCodeList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 71, + "cookies": false, + "type": "", + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "schema": { + "$ref": "#\/definitions\/continentList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 75, + "cookies": false, + "type": "", + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 72, + "cookies": false, + "type": "", + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 73, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-eu.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "schema": { + "$ref": "#\/definitions\/phoneList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 74, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Currencies List", + "schema": { + "$ref": "#\/definitions\/currencyList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 76, + "cookies": false, + "type": "", + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.", + "responses": { + "200": { + "description": "Languages List", + "schema": { + "$ref": "#\/definitions\/languageList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 77, + "cookies": false, + "type": "", + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "schema": { + "$ref": "#\/definitions\/subscriber" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 296, + "cookies": false, + "type": "", + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "default": null, + "x-example": "<SUBSCRIBER_ID>" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "default": null, + "x-example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 300, + "cookies": false, + "type": "", + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "schema": { + "$ref": "#\/definitions\/fileList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 160, + "cookies": false, + "type": "", + "demo": "storage\/list-files.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 159, + "cookies": false, + "type": "upload", + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "x-upload-id": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "formData" + }, + { + "name": "file", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "permissions", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "x-example": "[\"read(\"any\")\"]", + "in": "formData" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 161, + "cookies": false, + "type": "", + "demo": "storage\/get-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 166, + "cookies": false, + "type": "", + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 167, + "cookies": false, + "type": "", + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 163, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 162, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-preview.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center", + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "type": "string", + "default": "", + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "type": "number", + "format": "float", + "x-example": 0, + "default": 1, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0, + "in": "query" + }, + { + "name": "background", + "description": "Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.", + "required": false, + "type": "string", + "default": "", + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "type": "string", + "x-example": "jpg", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "", + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 164, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-view.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<ROW_ID>" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "default": [], + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "schema": { + "$ref": "#\/definitions\/teamList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 171, + "cookies": false, + "type": "", + "demo": "teams\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 170, + "cookies": false, + "type": "", + "demo": "teams\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TEAM_ID>" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": [ + "owner" + ], + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + ] + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 172, + "cookies": false, + "type": "", + "demo": "teams\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 174, + "cookies": false, + "type": "", + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 176, + "cookies": false, + "type": "", + "demo": "teams\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { + "$ref": "#\/definitions\/membershipList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 178, + "cookies": false, + "type": "", + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 177, + "cookies": false, + "type": "", + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "default": "", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "default": "", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 179, + "cookies": false, + "type": "", + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 180, + "cookies": false, + "type": "", + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "teams" + ], + "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 182, + "cookies": false, + "type": "", + "demo": "teams\/delete-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 181, + "cookies": false, + "type": "", + "demo": "teams\/update-membership-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 173, + "cookies": false, + "type": "", + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 175, + "cookies": false, + "type": "", + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "definitions": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true, + "example": [] + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "type": "object", + "$ref": "#\/definitions\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ], + "example": { + "total": 5, + "documents": "" + } + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ], + "example": { + "total": 5, + "sessions": "" + } + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "type": "object", + "$ref": "#\/definitions\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ], + "example": { + "total": 5, + "identities": "" + } + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "type": "object", + "$ref": "#\/definitions\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ], + "example": { + "total": 5, + "logs": "" + } + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "type": "object", + "$ref": "#\/definitions\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ], + "example": { + "total": 5, + "files": "" + } + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "type": "object", + "$ref": "#\/definitions\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ], + "example": { + "total": 5, + "teams": "" + } + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "type": "object", + "$ref": "#\/definitions\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ], + "example": { + "total": 5, + "memberships": "" + } + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ], + "example": { + "total": 5, + "executions": "" + } + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "type": "object", + "$ref": "#\/definitions\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ], + "example": { + "total": 5, + "countries": "" + } + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ], + "example": { + "total": 5, + "continents": "" + } + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "type": "object", + "$ref": "#\/definitions\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ], + "example": { + "total": 5, + "languages": "" + } + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "type": "object", + "$ref": "#\/definitions\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ], + "example": { + "total": 5, + "currencies": "" + } + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "type": "object", + "$ref": "#\/definitions\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ], + "example": { + "total": 5, + "phones": "" + } + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ], + "example": { + "total": 5, + "localeCodes": "" + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "x-nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "x-nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/algoArgon2" + }, + { + "$ref": "#\/definitions\/algoScrypt" + }, + { + "$ref": "#\/definitions\/algoScryptModified" + }, + { + "$ref": "#\/definitions\/algoBcrypt" + }, + { + "$ref": "#\/definitions\/algoPhpass" + }, + { + "$ref": "#\/definitions\/algoSha" + }, + { + "$ref": "#\/definitions\/algoMd5" + } + ] + }, + "x-nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ], + "example": { + "type": "md5" + } + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ], + "example": { + "type": "sha" + } + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ], + "example": { + "type": "phpass" + } + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ], + "example": { + "type": "bcrypt" + } + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "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.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "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.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ], + "example": { + "code": "en-us", + "name": "US" + } + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "deploymentId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "United States", + "code": "US" + } + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "Europe", + "code": "EU" + } + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ], + "example": { + "secret": true, + "uri": true + } + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "x-nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/swagger2-1.8.x-console.json b/app/config/specs/swagger2-1.8.x-console.json new file mode 100644 index 0000000000..e830f768be --- /dev/null +++ b/app/config/specs/swagger2-1.8.x-console.json @@ -0,0 +1,57082 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.8.0", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "host": "cloud.appwrite.io", + "x-host-docs": "<REGION>.cloud.appwrite.io", + "basePath": "\/v1", + "schemes": [ + "https" + ], + "consumes": [ + "application\/json", + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "securityDefinitions": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "Key": { + "type": "apiKey", + "name": "X-Appwrite-Key", + "description": "Your secret API key", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_API_KEY>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_JWT>" + } + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Mode": { + "type": "apiKey", + "name": "X-Appwrite-Mode", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "" + } + } + }, + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "demo": "account\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "demo": "account\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + }, + "delete": { + "summary": "Delete account", + "operationId": "accountDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete the currently logged in user.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "account", + "weight": 11, + "cookies": false, + "type": "", + "demo": "account\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "demo": "account\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "schema": { + "$ref": "#\/definitions\/identityList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "type": "string", + "x-example": "<IDENTITY_ID>", + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "demo": "account\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "demo": "account\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "default": null, + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + ] + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "schema": { + "$ref": "#\/definitions\/mfaType" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + ] + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "schema": { + "$ref": "#\/definitions\/mfaChallenge" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "default": null, + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + ] + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "default": null, + "x-example": "<CHALLENGE_ID>" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + ] + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "schema": { + "$ref": "#\/definitions\/mfaFactors" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "demo": "account\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "default": "", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + ] + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + ] + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "demo": "account\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "demo": "account\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "demo": "account\/create-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "demo": "account\/update-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "default": null, + "x-example": "<SECRET>" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "schema": { + "$ref": "#\/definitions\/sessionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "demo": "account\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "demo": "account\/update-magic-url-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 session", + "operationId": "accountCreateOAuth2Session", + "consumes": [], + "produces": [ + "text\/html" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "301": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createOAuth2Session", + "group": "sessions", + "weight": 20, + "cookies": false, + "type": "webAuth", + "demo": "account\/create-o-auth-2-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "", + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "", + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "demo": "account\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "demo": "account\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/targets\/push": { + "post": { + "summary": "Create push target", + "operationId": "accountCreatePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", + "responses": { + "201": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPushTarget", + "group": "pushTargets", + "weight": 55, + "cookies": false, + "type": "", + "demo": "account\/create-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TARGET_ID>" + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + } + }, + "required": [ + "targetId", + "identifier" + ] + } + } + ] + } + }, + "\/account\/targets\/{targetId}\/push": { + "put": { + "summary": "Update push target", + "operationId": "accountUpdatePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePushTarget", + "group": "pushTargets", + "weight": 56, + "cookies": false, + "type": "", + "demo": "account\/update-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + } + }, + "required": [ + "identifier" + ] + } + } + ] + }, + "delete": { + "summary": "Delete push target", + "operationId": "accountDeletePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deletePushTarget", + "group": "pushTargets", + "weight": 57, + "cookies": false, + "type": "", + "demo": "account\/delete-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "demo": "account\/create-magic-url-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "consumes": [], + "produces": [ + "text\/html" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "demo": "account\/create-o-auth-2-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "", + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "", + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", + "default": null, + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + ] + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "demo": "avatars\/get-browser.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ], + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "demo": "avatars\/get-credit-card.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", + "required": true, + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "unionpay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ], + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "demo": "avatars\/get-favicon.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "demo": "avatars\/get-flag.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ], + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "demo": "avatars\/get-image.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "in": "query" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "demo": "avatars\/get-initials.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "type": "string", + "x-example": "<NAME>", + "default": "", + "in": "query" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500, + "in": "query" + }, + { + "name": "background", + "description": "Changes background color. By default a random color will be picked and stay will persistent to the given name.", + "required": false, + "type": "string", + "default": "", + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "demo": "avatars\/get-qr.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "type": "string", + "x-example": "<TEXT>", + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 400, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 1, + "in": "query" + }, + { + "name": "download", + "description": "Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.", + "required": false, + "type": "boolean", + "x-example": false, + "default": false, + "in": "query" + } + ] + } + }, + "\/console\/assistant": { + "post": { + "summary": "Create assistant query", + "operationId": "assistantChat", + "consumes": [ + "application\/json" + ], + "produces": [ + "text\/plain" + ], + "tags": [ + "assistant" + ], + "description": "Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream. ", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "chat", + "group": "console", + "weight": 252, + "cookies": false, + "type": "", + "demo": "assistant\/chat.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/assistant\/chat.md", + "rate-limit": 15, + "rate-time": 3600, + "rate-key": "userId:{userId}", + "scope": "assistant.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "description": "Prompt. A string containing questions asked to the AI assistant.", + "default": null, + "x-example": "<PROMPT>" + } + }, + "required": [ + "prompt" + ] + } + } + ] + } + }, + "\/console\/resources": { + "get": { + "summary": "Check resource ID availability", + "operationId": "consoleGetResource", + "consumes": [], + "produces": [], + "tags": [ + "console" + ], + "description": "Check if a resource ID is available.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getResource", + "group": null, + "weight": 496, + "cookies": false, + "type": "", + "demo": "console\/get-resource.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCheck if a resource ID is available.", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "value", + "description": "Resource value.", + "required": true, + "type": "string", + "x-example": "<VALUE>", + "in": "query" + }, + { + "name": "type", + "description": "Resource type.", + "required": true, + "type": "string", + "x-example": "rules", + "enum": [ + "rules" + ], + "x-enum-name": "ConsoleResourceType", + "x-enum-keys": [], + "in": "query" + } + ] + } + }, + "\/console\/variables": { + "get": { + "summary": "Get variables", + "operationId": "consoleVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "console" + ], + "description": "Get all Environment Variables that are relevant for the console.", + "responses": { + "200": { + "description": "Console Variables", + "schema": { + "$ref": "#\/definitions\/consoleVariables" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "variables", + "group": "console", + "weight": 251, + "cookies": false, + "type": "", + "demo": "console\/variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/console\/variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/databases": { + "get": { + "summary": "List databases", + "operationId": "databasesList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "schema": { + "$ref": "#\/definitions\/databaseList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "list", + "group": "databases", + "weight": 316, + "cookies": false, + "type": "", + "demo": "databases\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + }, + "methods": [ + { + "name": "list", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "queries", + "search" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/databaseList" + } + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "demo": "databases\/list.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "databasesCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "create", + "group": "databases", + "weight": 312, + "cookies": false, + "type": "", + "demo": "databases\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + }, + "methods": [ + { + "name": "create", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/database" + } + ], + "description": "Create a new Database.\n", + "demo": "databases\/create.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + ] + } + }, + "\/databases\/usage": { + "get": { + "summary": "Get databases usage stats", + "operationId": "databasesListUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabases", + "schema": { + "$ref": "#\/definitions\/usageDatabases" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 319, + "cookies": false, + "type": "", + "demo": "databases\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listUsage" + }, + "methods": [ + { + "name": "listUsage", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "range" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/usageDatabases" + } + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "databases\/list-usage.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listUsage" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "databasesGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "get", + "group": "databases", + "weight": 313, + "cookies": false, + "type": "", + "demo": "databases\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + }, + "methods": [ + { + "name": "get", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/database" + } + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "demo": "databases\/get.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "databasesUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "update", + "group": "databases", + "weight": 314, + "cookies": false, + "type": "", + "demo": "databases\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + }, + "methods": [ + { + "name": "update", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/database" + } + ], + "description": "Update a database by its unique ID.", + "demo": "databases\/update.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete database", + "operationId": "databasesDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "delete", + "group": "databases", + "weight": 315, + "cookies": false, + "type": "", + "demo": "databases\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + }, + "methods": [ + { + "name": "delete", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "demo": "databases\/delete.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "databasesListCollections", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "schema": { + "$ref": "#\/definitions\/collectionList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listCollections", + "group": "collections", + "weight": 324, + "cookies": false, + "type": "", + "demo": "databases\/list-collections.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTables" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create collections", + "operationId": "databasesCreateCollection", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createCollection", + "group": "collections", + "weight": 320, + "cookies": false, + "type": "", + "demo": "databases\/create-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "collectionId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<COLLECTION_ID>" + }, + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "databasesGetCollection", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getCollection", + "group": "collections", + "weight": 321, + "cookies": false, + "type": "", + "demo": "databases\/get-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "databasesUpdateCollection", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateCollection", + "group": "collections", + "weight": 322, + "cookies": false, + "type": "", + "demo": "databases\/update-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete collection", + "operationId": "databasesDeleteCollection", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteCollection", + "group": "collections", + "weight": 323, + "cookies": false, + "type": "", + "demo": "databases\/delete-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTable" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes": { + "get": { + "summary": "List attributes", + "operationId": "databasesListAttributes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "List attributes in the collection.", + "responses": { + "200": { + "description": "Attributes List", + "schema": { + "$ref": "#\/definitions\/attributeList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listAttributes", + "group": "attributes", + "weight": 341, + "cookies": false, + "type": "", + "demo": "databases\/list-attributes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listColumns" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean": { + "post": { + "summary": "Create boolean attribute", + "operationId": "databasesCreateBooleanAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a boolean attribute.\n", + "responses": { + "202": { + "description": "AttributeBoolean", + "schema": { + "$ref": "#\/definitions\/attributeBoolean" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createBooleanAttribute", + "group": "attributes", + "weight": 342, + "cookies": false, + "type": "", + "demo": "databases\/create-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBooleanColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean\/{key}": { + "patch": { + "summary": "Update boolean attribute", + "operationId": "databasesUpdateBooleanAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a boolean attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeBoolean", + "schema": { + "$ref": "#\/definitions\/attributeBoolean" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateBooleanAttribute", + "group": "attributes", + "weight": 343, + "cookies": false, + "type": "", + "demo": "databases\/update-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBooleanColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime": { + "post": { + "summary": "Create datetime attribute", + "operationId": "databasesCreateDatetimeAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a date time attribute according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "AttributeDatetime", + "schema": { + "$ref": "#\/definitions\/attributeDatetime" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createDatetimeAttribute", + "group": "attributes", + "weight": 344, + "cookies": false, + "type": "", + "demo": "databases\/create-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createDatetimeColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { + "patch": { + "summary": "Update datetime attribute", + "operationId": "databasesUpdateDatetimeAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a date time attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeDatetime", + "schema": { + "$ref": "#\/definitions\/attributeDatetime" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDatetimeAttribute", + "group": "attributes", + "weight": 345, + "cookies": false, + "type": "", + "demo": "databases\/update-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateDatetimeColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email": { + "post": { + "summary": "Create email attribute", + "operationId": "databasesCreateEmailAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an email attribute.\n", + "responses": { + "202": { + "description": "AttributeEmail", + "schema": { + "$ref": "#\/definitions\/attributeEmail" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createEmailAttribute", + "group": "attributes", + "weight": 346, + "cookies": false, + "type": "", + "demo": "databases\/create-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEmailColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email\/{key}": { + "patch": { + "summary": "Update email attribute", + "operationId": "databasesUpdateEmailAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEmail", + "schema": { + "$ref": "#\/definitions\/attributeEmail" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateEmailAttribute", + "group": "attributes", + "weight": 347, + "cookies": false, + "type": "", + "demo": "databases\/update-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEmailColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum": { + "post": { + "summary": "Create enum attribute", + "operationId": "databasesCreateEnumAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "responses": { + "202": { + "description": "AttributeEnum", + "schema": { + "$ref": "#\/definitions\/attributeEnum" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createEnumAttribute", + "group": "attributes", + "weight": 348, + "cookies": false, + "type": "", + "demo": "databases\/create-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEnumColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum\/{key}": { + "patch": { + "summary": "Update enum attribute", + "operationId": "databasesUpdateEnumAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEnum", + "schema": { + "$ref": "#\/definitions\/attributeEnum" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateEnumAttribute", + "group": "attributes", + "weight": 349, + "cookies": false, + "type": "", + "demo": "databases\/update-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEnumColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float": { + "post": { + "summary": "Create float attribute", + "operationId": "databasesCreateFloatAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeFloat", + "schema": { + "$ref": "#\/definitions\/attributeFloat" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createFloatAttribute", + "group": "attributes", + "weight": 350, + "cookies": false, + "type": "", + "demo": "databases\/create-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createFloatColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value.", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value.", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float\/{key}": { + "patch": { + "summary": "Update float attribute", + "operationId": "databasesUpdateFloatAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeFloat", + "schema": { + "$ref": "#\/definitions\/attributeFloat" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateFloatAttribute", + "group": "attributes", + "weight": 351, + "cookies": false, + "type": "", + "demo": "databases\/update-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateFloatColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value.", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value.", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer": { + "post": { + "summary": "Create integer attribute", + "operationId": "databasesCreateIntegerAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeInteger", + "schema": { + "$ref": "#\/definitions\/attributeInteger" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIntegerAttribute", + "group": "attributes", + "weight": 352, + "cookies": false, + "type": "", + "demo": "databases\/create-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIntegerColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer\/{key}": { + "patch": { + "summary": "Update integer attribute", + "operationId": "databasesUpdateIntegerAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeInteger", + "schema": { + "$ref": "#\/definitions\/attributeInteger" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIntegerAttribute", + "group": "attributes", + "weight": 353, + "cookies": false, + "type": "", + "demo": "databases\/update-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIntegerColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip": { + "post": { + "summary": "Create IP address attribute", + "operationId": "databasesCreateIpAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create IP address attribute.\n", + "responses": { + "202": { + "description": "AttributeIP", + "schema": { + "$ref": "#\/definitions\/attributeIp" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIpAttribute", + "group": "attributes", + "weight": 354, + "cookies": false, + "type": "", + "demo": "databases\/create-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIpColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "schema": { + "$ref": "#\/definitions\/attributeIp" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 355, + "cookies": false, + "type": "", + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIpColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 356, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 357, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 358, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 359, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 360, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "schema": { + "$ref": "#\/definitions\/attributeRelationship" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createRelationshipAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/create-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRelationshipColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "relatedCollectionId": { + "type": "string", + "description": "Related Collection ID.", + "default": null, + "x-example": "<RELATED_COLLECTION_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "default": null, + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "default": false, + "x-example": false + }, + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Attribute Key.", + "default": null, + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": "restrict", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedCollectionId", + "type" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string": { + "post": { + "summary": "Create string attribute", + "operationId": "databasesCreateStringAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a string attribute.\n", + "responses": { + "202": { + "description": "AttributeString", + "schema": { + "$ref": "#\/definitions\/attributeString" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createStringAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/create-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createStringColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "size": { + "type": "integer", + "description": "Attribute size for text attributes, in number of characters.", + "default": null, + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string\/{key}": { + "patch": { + "summary": "Update string attribute", + "operationId": "databasesUpdateStringAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeString", + "schema": { + "$ref": "#\/definitions\/attributeString" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateStringAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/update-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateStringColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string attribute.", + "default": null, + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url": { + "post": { + "summary": "Create URL attribute", + "operationId": "databasesCreateUrlAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a URL attribute.\n", + "responses": { + "202": { + "description": "AttributeURL", + "schema": { + "$ref": "#\/definitions\/attributeUrl" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createUrlAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/create-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createUrlColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url\/{key}": { + "patch": { + "summary": "Update URL attribute", + "operationId": "databasesUpdateUrlAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeURL", + "schema": { + "$ref": "#\/definitions\/attributeUrl" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateUrlAttribute", + "group": "attributes", + "weight": 367, + "cookies": false, + "type": "", + "demo": "databases\/update-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateUrlColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}": { + "get": { + "summary": "Get attribute", + "operationId": "databasesGetAttribute", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get attribute by ID.", + "responses": { + "200": { + "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeRelationship, or AttributeString", + "schema": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getAttribute", + "group": "attributes", + "weight": 339, + "cookies": false, + "type": "", + "demo": "databases\/get-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete attribute", + "operationId": "databasesDeleteAttribute", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Deletes an attribute.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteAttribute", + "group": "attributes", + "weight": 340, + "cookies": false, + "type": "", + "demo": "databases\/delete-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}\/relationship": { + "patch": { + "summary": "Update relationship attribute", + "operationId": "databasesUpdateRelationshipAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "200": { + "description": "AttributeRelationship", + "schema": { + "$ref": "#\/definitions\/attributeRelationship" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateRelationshipAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/update-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRelationshipColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": null, + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 335, + "cookies": false, + "type": "", + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 327, + "cookies": false, + "type": "", + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, + "methods": [ + { + "name": "createDocument", + "namespace": "databases", + "desc": "Create document", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + }, + { + "name": "createDocuments", + "namespace": "databases", + "desc": "Create documents", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRows" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<DOCUMENT_ID>" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + }, + "put": { + "summary": "Upsert documents", + "operationId": "databasesUpsertDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 332, + "cookies": false, + "type": "", + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + }, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "demo": "databases\/upsert-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documents": { + "type": "array", + "description": "Array of document data as JSON objects. May contain partial documents.", + "default": null, + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "documents" + ] + } + } + ] + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDocuments", + "group": "documents", + "weight": 330, + "cookies": false, + "type": "", + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteDocuments", + "group": "documents", + "weight": 334, + "cookies": false, + "type": "", + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRows" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 328, + "cookies": false, + "type": "", + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "databasesUpsertDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 331, + "cookies": false, + "type": "", + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "default": {}, + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + ] + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 329, + "cookies": false, + "type": "", + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 333, + "cookies": false, + "type": "", + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/logs": { + "get": { + "summary": "List document logs", + "operationId": "databasesListDocumentLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get the document activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listDocumentLogs", + "group": "logs", + "weight": 336, + "cookies": false, + "type": "", + "demo": "databases\/list-document-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRowLogs" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "databasesListIndexes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "schema": { + "$ref": "#\/definitions\/indexList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 371, + "cookies": false, + "type": "", + "demo": "databases\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listIndexes" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "databasesCreateIndex", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/index" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 368, + "cookies": false, + "type": "", + "demo": "databases\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIndex" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "default": null, + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "default": null, + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "attributes": { + "type": "array", + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "default": [], + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "databasesGetIndex", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/index" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 369, + "cookies": false, + "type": "", + "demo": "databases\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getIndex" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "databasesDeleteIndex", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 370, + "cookies": false, + "type": "", + "demo": "databases\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteIndex" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/logs": { + "get": { + "summary": "List collection logs", + "operationId": "databasesListCollectionLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get the collection activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listCollectionLogs", + "group": "collections", + "weight": 325, + "cookies": false, + "type": "", + "demo": "databases\/list-collection-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTableLogs" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/usage": { + "get": { + "summary": "Get collection usage stats", + "operationId": "databasesGetCollectionUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageCollection", + "schema": { + "$ref": "#\/definitions\/usageCollection" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getCollectionUsage", + "group": null, + "weight": 326, + "cookies": false, + "type": "", + "demo": "databases\/get-collection-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTableUsage" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/logs": { + "get": { + "summary": "List database logs", + "operationId": "databasesListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get the database activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 317, + "cookies": false, + "type": "", + "demo": "databases\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listDatabaseLogs" + }, + "methods": [ + { + "name": "listLogs", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "queries" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/logList" + } + ], + "description": "Get the database activity logs list by its unique ID.", + "demo": "databases\/list-logs.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listDatabaseLogs" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/usage": { + "get": { + "summary": "Get database usage stats", + "operationId": "databasesGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabase", + "schema": { + "$ref": "#\/definitions\/usageDatabase" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 318, + "cookies": false, + "type": "", + "demo": "databases\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getUsage" + }, + "methods": [ + { + "name": "getUsage", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "range" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/usageDatabase" + } + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "databases\/get-usage.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getUsage" + } + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/functions": { + "get": { + "summary": "List functions", + "operationId": "functionsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Functions List", + "schema": { + "$ref": "#\/definitions\/functionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "functions", + "weight": 440, + "cookies": false, + "type": "", + "demo": "functions\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create function", + "operationId": "functionsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "responses": { + "201": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "functions", + "weight": 437, + "cookies": false, + "type": "", + "demo": "functions\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "functionId": { + "type": "string", + "description": "Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<FUNCTION_ID>" + }, + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "default": null, + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "default": "", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Function maximum execution time in seconds.", + "default": 15, + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "default": true, + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "default": "", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "default": "", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "functionId", + "name", + "runtime" + ] + } + } + ] + } + }, + "\/functions\/runtimes": { + "get": { + "summary": "List runtimes", + "operationId": "functionsListRuntimes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all runtimes that are currently active on your instance.", + "responses": { + "200": { + "description": "Runtimes List", + "schema": { + "$ref": "#\/definitions\/runtimeList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRuntimes", + "group": "runtimes", + "weight": 442, + "cookies": false, + "type": "", + "demo": "functions\/list-runtimes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "functionsListSpecifications", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "List allowed function specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "schema": { + "$ref": "#\/definitions\/specificationList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSpecifications", + "group": "runtimes", + "weight": 443, + "cookies": false, + "type": "", + "demo": "functions\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/templates": { + "get": { + "summary": "List templates", + "operationId": "functionsListTemplates", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "List available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "responses": { + "200": { + "description": "Function Templates List", + "schema": { + "$ref": "#\/definitions\/templateFunctionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTemplates", + "group": "templates", + "weight": 466, + "cookies": false, + "type": "", + "demo": "functions\/list-templates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "runtimes", + "description": "List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "useCases", + "description": "List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "limit", + "description": "Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 25, + "in": "query" + }, + { + "name": "offset", + "description": "Offset the list of returned templates. Maximum offset is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + } + ] + } + }, + "\/functions\/templates\/{templateId}": { + "get": { + "summary": "Get function template", + "operationId": "functionsGetTemplate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "responses": { + "200": { + "description": "Template Function", + "schema": { + "$ref": "#\/definitions\/templateFunction" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTemplate", + "group": "templates", + "weight": 465, + "cookies": false, + "type": "", + "demo": "functions\/get-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Template ID.", + "required": true, + "type": "string", + "x-example": "<TEMPLATE_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/usage": { + "get": { + "summary": "Get functions usage", + "operationId": "functionsListUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageFunctions", + "schema": { + "$ref": "#\/definitions\/usageFunctions" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 459, + "cookies": false, + "type": "", + "demo": "functions\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}": { + "get": { + "summary": "Get function", + "operationId": "functionsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "functions", + "weight": 438, + "cookies": false, + "type": "", + "demo": "functions\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update function", + "operationId": "functionsUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "functions", + "weight": 439, + "cookies": false, + "type": "", + "demo": "functions\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "default": "", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "default": "", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Maximum execution time in seconds.", + "default": 15, + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "default": true, + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "default": "", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "default": "", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Controle System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function", + "default": null, + "x-example": "<PROVIDER_REPOSITORY_ID>", + "x-nullable": true + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete function", + "operationId": "functionsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a function by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "functions", + "weight": 441, + "cookies": false, + "type": "", + "demo": "functions\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployment": { + "patch": { + "summary": "Update function's deployment", + "operationId": "functionsUpdateFunctionDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFunctionDeployment", + "group": "functions", + "weight": 446, + "cookies": false, + "type": "", + "demo": "functions\/update-function-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "functionsListDeployments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "schema": { + "$ref": "#\/definitions\/deploymentList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 447, + "cookies": false, + "type": "", + "demo": "functions\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "functionsCreateDeployment", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 444, + "cookies": false, + "type": "upload", + "demo": "functions\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "entrypoint", + "description": "Entrypoint File.", + "required": false, + "type": "string", + "x-example": "<ENTRYPOINT>", + "in": "formData" + }, + { + "name": "commands", + "description": "Build Commands.", + "required": false, + "type": "string", + "x-example": "<COMMANDS>", + "in": "formData" + }, + { + "name": "code", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "activate", + "description": "Automatically activate the deployment when it is finished building.", + "required": true, + "type": "boolean", + "x-example": false, + "in": "formData" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "functionsCreateDuplicateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 452, + "cookies": false, + "type": "", + "demo": "functions\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + }, + "buildId": { + "type": "string", + "description": "Build unique ID.", + "default": "", + "x-example": "<BUILD_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "functionsCreateTemplateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 449, + "cookies": false, + "type": "", + "demo": "functions\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "default": null, + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "default": null, + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to function code in the template repo.", + "default": null, + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the function template.", + "default": null, + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "functionsCreateVcsDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 450, + "cookies": false, + "type": "", + "demo": "functions\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "default": null, + "x-example": "branch", + "enum": [ + "branch", + "commit" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "default": null, + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "functionsGetDeployment", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 445, + "cookies": false, + "type": "", + "demo": "functions\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "functionsDeleteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a code deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 448, + "cookies": false, + "type": "", + "demo": "functions\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "functionsGetDeploymentDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "functions" + ], + "description": "Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 451, + "cookies": false, + "type": "location", + "demo": "functions\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source", + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "functionsUpdateDeploymentStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 453, + "cookies": false, + "type": "", + "demo": "functions\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 456, + "cookies": false, + "type": "", + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "consumes": [ + "application\/json" + ], + "produces": [ + "multipart\/form-data" + ], + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 454, + "cookies": false, + "type": "", + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "<BODY>" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "<PATH>" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is POST.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS", + "HEAD" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": "<SCHEDULED_AT>" + } + } + } + } + ] + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 455, + "cookies": false, + "type": "", + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "type": "string", + "x-example": "<EXECUTION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete execution", + "operationId": "functionsDeleteExecution", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a function execution by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteExecution", + "group": "executions", + "weight": 457, + "cookies": false, + "type": "", + "demo": "functions\/delete-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "type": "string", + "x-example": "<EXECUTION_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/usage": { + "get": { + "summary": "Get function usage", + "operationId": "functionsGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageFunction", + "schema": { + "$ref": "#\/definitions\/usageFunction" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 458, + "cookies": false, + "type": "", + "demo": "functions\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "functionsListVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all variables of a specific function.", + "responses": { + "200": { + "description": "Variables List", + "schema": { + "$ref": "#\/definitions\/variableList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 462, + "cookies": false, + "type": "", + "demo": "functions\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "functionsCreateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "responses": { + "201": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 460, + "cookies": false, + "type": "", + "demo": "functions\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "default": true, + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "functionsGetVariable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 461, + "cookies": false, + "type": "", + "demo": "functions\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "functionsUpdateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 463, + "cookies": false, + "type": "", + "demo": "functions\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "default": null, + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + ] + }, + "delete": { + "summary": "Delete variable", + "operationId": "functionsDeleteVariable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 464, + "cookies": false, + "type": "", + "demo": "functions\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 250, + "cookies": false, + "type": "graphql", + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 249, + "cookies": false, + "type": "graphql", + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/health": { + "get": { + "summary": "Get HTTP", + "operationId": "healthGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite HTTP server is up and responsive.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "health", + "weight": 78, + "cookies": false, + "type": "", + "demo": "health\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/anti-virus": { + "get": { + "summary": "Get antivirus", + "operationId": "healthGetAntivirus", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite Antivirus server is up and connection is successful.", + "responses": { + "200": { + "description": "Health Antivirus", + "schema": { + "$ref": "#\/definitions\/healthAntivirus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getAntivirus", + "group": "health", + "weight": 99, + "cookies": false, + "type": "", + "demo": "health\/get-antivirus.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/cache": { + "get": { + "summary": "Get cache", + "operationId": "healthGetCache", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite in-memory cache servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCache", + "group": "health", + "weight": 81, + "cookies": false, + "type": "", + "demo": "health\/get-cache.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/certificate": { + "get": { + "summary": "Get the SSL certificate for a domain", + "operationId": "healthGetCertificate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the SSL certificate for a domain", + "responses": { + "200": { + "description": "Health Certificate", + "schema": { + "$ref": "#\/definitions\/healthCertificate" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCertificate", + "group": "health", + "weight": 86, + "cookies": false, + "type": "", + "demo": "health\/get-certificate.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "domain", + "description": "string", + "required": false, + "type": "string", + "in": "query" + } + ] + } + }, + "\/health\/db": { + "get": { + "summary": "Get DB", + "operationId": "healthGetDB", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite database servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDB", + "group": "health", + "weight": 80, + "cookies": false, + "type": "", + "demo": "health\/get-db.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/pubsub": { + "get": { + "summary": "Get pubsub", + "operationId": "healthGetPubSub", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite pub-sub servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPubSub", + "group": "health", + "weight": 82, + "cookies": false, + "type": "", + "demo": "health\/get-pub-sub.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/queue\/builds": { + "get": { + "summary": "Get builds queue", + "operationId": "healthGetQueueBuilds", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of builds that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueBuilds", + "group": "queue", + "weight": 88, + "cookies": false, + "type": "", + "demo": "health\/get-queue-builds.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/certificates": { + "get": { + "summary": "Get certificates queue", + "operationId": "healthGetQueueCertificates", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueCertificates", + "group": "queue", + "weight": 87, + "cookies": false, + "type": "", + "demo": "health\/get-queue-certificates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/databases": { + "get": { + "summary": "Get databases queue", + "operationId": "healthGetQueueDatabases", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueDatabases", + "group": "queue", + "weight": 89, + "cookies": false, + "type": "", + "demo": "health\/get-queue-databases.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Queue name for which to check the queue size", + "required": false, + "type": "string", + "x-example": "<NAME>", + "default": "database_db_main", + "in": "query" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/deletes": { + "get": { + "summary": "Get deletes queue", + "operationId": "healthGetQueueDeletes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueDeletes", + "group": "queue", + "weight": 90, + "cookies": false, + "type": "", + "demo": "health\/get-queue-deletes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/failed\/{name}": { + "get": { + "summary": "Get number of failed queue jobs", + "operationId": "healthGetFailedJobs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Returns the amount of failed jobs in a given queue.\n", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFailedJobs", + "group": "queue", + "weight": 100, + "cookies": false, + "type": "", + "demo": "health\/get-failed-jobs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "The name of the queue", + "required": true, + "type": "string", + "x-example": "v1-database", + "enum": [ + "v1-database", + "v1-deletes", + "v1-audits", + "v1-mails", + "v1-functions", + "v1-stats-resources", + "v1-stats-usage", + "v1-webhooks", + "v1-certificates", + "v1-builds", + "v1-messaging", + "v1-migrations" + ], + "x-enum-name": null, + "x-enum-keys": [], + "in": "path" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/functions": { + "get": { + "summary": "Get functions queue", + "operationId": "healthGetQueueFunctions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueFunctions", + "group": "queue", + "weight": 94, + "cookies": false, + "type": "", + "demo": "health\/get-queue-functions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/logs": { + "get": { + "summary": "Get logs queue", + "operationId": "healthGetQueueLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueLogs", + "group": "queue", + "weight": 85, + "cookies": false, + "type": "", + "demo": "health\/get-queue-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/mails": { + "get": { + "summary": "Get mails queue", + "operationId": "healthGetQueueMails", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of mails that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMails", + "group": "queue", + "weight": 91, + "cookies": false, + "type": "", + "demo": "health\/get-queue-mails.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/messaging": { + "get": { + "summary": "Get messaging queue", + "operationId": "healthGetQueueMessaging", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of messages that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMessaging", + "group": "queue", + "weight": 92, + "cookies": false, + "type": "", + "demo": "health\/get-queue-messaging.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/migrations": { + "get": { + "summary": "Get migrations queue", + "operationId": "healthGetQueueMigrations", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMigrations", + "group": "queue", + "weight": 93, + "cookies": false, + "type": "", + "demo": "health\/get-queue-migrations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-resources": { + "get": { + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueStatsResources", + "group": "queue", + "weight": 95, + "cookies": false, + "type": "", + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueUsage", + "group": "queue", + "weight": 96, + "cookies": false, + "type": "", + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/webhooks": { + "get": { + "summary": "Get webhooks queue", + "operationId": "healthGetQueueWebhooks", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueWebhooks", + "group": "queue", + "weight": 84, + "cookies": false, + "type": "", + "demo": "health\/get-queue-webhooks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/storage": { + "get": { + "summary": "Get storage", + "operationId": "healthGetStorage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getStorage", + "group": "storage", + "weight": 98, + "cookies": false, + "type": "", + "demo": "health\/get-storage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/storage\/local": { + "get": { + "summary": "Get local storage", + "operationId": "healthGetStorageLocal", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite local storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getStorageLocal", + "group": "storage", + "weight": 97, + "cookies": false, + "type": "", + "demo": "health\/get-storage-local.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/time": { + "get": { + "summary": "Get time", + "operationId": "healthGetTime", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.", + "responses": { + "200": { + "description": "Health Time", + "schema": { + "$ref": "#\/definitions\/healthTime" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTime", + "group": "health", + "weight": 83, + "cookies": false, + "type": "", + "demo": "health\/get-time.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "responses": { + "200": { + "description": "Locale", + "schema": { + "$ref": "#\/definitions\/locale" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 70, + "cookies": false, + "type": "", + "demo": "locale\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "schema": { + "$ref": "#\/definitions\/localeCodeList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 71, + "cookies": false, + "type": "", + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "schema": { + "$ref": "#\/definitions\/continentList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 75, + "cookies": false, + "type": "", + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 72, + "cookies": false, + "type": "", + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 73, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-eu.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "schema": { + "$ref": "#\/definitions\/phoneList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 74, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Currencies List", + "schema": { + "$ref": "#\/definitions\/currencyList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 76, + "cookies": false, + "type": "", + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.", + "responses": { + "200": { + "description": "Languages List", + "schema": { + "$ref": "#\/definitions\/languageList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 77, + "cookies": false, + "type": "", + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages": { + "get": { + "summary": "List messages", + "operationId": "messagingListMessages", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all messages from the current Appwrite project.", + "responses": { + "200": { + "description": "Message list", + "schema": { + "$ref": "#\/definitions\/messageList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMessages", + "group": "messages", + "weight": 304, + "cookies": false, + "type": "", + "demo": "messaging\/list-messages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/email": { + "post": { + "summary": "Create email", + "operationId": "messagingCreateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new email message.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmail", + "group": "messages", + "weight": 301, + "cookies": false, + "type": "", + "demo": "messaging\/create-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "default": null, + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + }, + "required": [ + "messageId", + "subject", + "content" + ] + } + } + ] + } + }, + "\/messaging\/messages\/email\/{messageId}": { + "patch": { + "summary": "Update email", + "operationId": "messagingUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "messages", + "weight": 308, + "cookies": false, + "type": "", + "demo": "messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "default": null, + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "default": null, + "x-example": false + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/messaging\/messages\/push": { + "post": { + "summary": "Create push notification", + "operationId": "messagingCreatePush", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new push notification.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPush", + "group": "messages", + "weight": 303, + "cookies": false, + "type": "", + "demo": "messaging\/create-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "default": "", + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "default": "", + "x-example": "<BODY>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "data": { + "type": "object", + "description": "Additional key-value pair data for push notification.", + "default": {}, + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "default": "", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": "", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web Platform.", + "default": "", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS Platform.", + "default": "", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android Platform.", + "default": "", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android Platform.", + "default": "", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "default": -1, + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "default": "high", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + }, + "required": [ + "messageId" + ] + } + } + ] + } + }, + "\/messaging\/messages\/push\/{messageId}": { + "patch": { + "summary": "Update push notification", + "operationId": "messagingUpdatePush", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePush", + "group": "messages", + "weight": 310, + "cookies": false, + "type": "", + "demo": "messaging\/update-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "default": null, + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "default": null, + "x-example": "<BODY>" + }, + "data": { + "type": "object", + "description": "Additional Data for push notification.", + "default": {}, + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "default": null, + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": null, + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web platforms.", + "default": null, + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS platforms.", + "default": null, + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android platforms.", + "default": null, + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android platforms.", + "default": null, + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS platforms.", + "default": null, + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "default": null, + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + } + } + } + ] + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSms", + "group": "messages", + "weight": 302, + "cookies": false, + "type": "", + "demo": "messaging\/create-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + }, + "methods": [ + { + "name": "createSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + } + }, + { + "name": "createSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "content": { + "type": "string", + "description": "SMS Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + }, + "required": [ + "messageId", + "content" + ] + } + } + ] + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSms", + "group": "messages", + "weight": 309, + "cookies": false, + "type": "", + "demo": "messaging\/update-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + }, + "methods": [ + { + "name": "updateSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + } + }, + { + "name": "updateSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/messaging\/messages\/{messageId}": { + "get": { + "summary": "Get message", + "operationId": "messagingGetMessage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a message by its unique ID.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getMessage", + "group": "messages", + "weight": 307, + "cookies": false, + "type": "", + "demo": "messaging\/get-message.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete message", + "operationId": "messagingDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "messages", + "weight": 311, + "cookies": false, + "type": "", + "demo": "messaging\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/logs": { + "get": { + "summary": "List message logs", + "operationId": "messagingListMessageLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the message activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMessageLogs", + "group": "logs", + "weight": 305, + "cookies": false, + "type": "", + "demo": "messaging\/list-message-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/targets": { + "get": { + "summary": "List message targets", + "operationId": "messagingListTargets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of the targets associated with a message.", + "responses": { + "200": { + "description": "Target list", + "schema": { + "$ref": "#\/definitions\/targetList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTargets", + "group": "messages", + "weight": 306, + "cookies": false, + "type": "", + "demo": "messaging\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/providers": { + "get": { + "summary": "List providers", + "operationId": "messagingListProviders", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all providers from the current Appwrite project.", + "responses": { + "200": { + "description": "Provider list", + "schema": { + "$ref": "#\/definitions\/providerList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listProviders", + "group": "providers", + "weight": 276, + "cookies": false, + "type": "", + "demo": "messaging\/list-providers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createApnsProvider", + "group": "providers", + "weight": 275, + "cookies": false, + "type": "", + "demo": "messaging\/create-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + }, + "methods": [ + { + "name": "createApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + } + }, + { + "name": "createAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "default": "", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "default": "", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "default": "", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateApnsProvider", + "group": "providers", + "weight": 288, + "cookies": false, + "type": "", + "demo": "messaging\/update-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + }, + "methods": [ + { + "name": "updateApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + } + }, + { + "name": "updateAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "default": "", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "default": "", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "default": "", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "default": null, + "x-example": false + } + } + } + } + ] + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createFcmProvider", + "group": "providers", + "weight": 274, + "cookies": false, + "type": "", + "demo": "messaging\/create-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + }, + "methods": [ + { + "name": "createFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + } + }, + { + "name": "createFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "default": {}, + "x-example": "{}" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateFcmProvider", + "group": "providers", + "weight": 287, + "cookies": false, + "type": "", + "demo": "messaging\/update-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + }, + "methods": [ + { + "name": "updateFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + } + }, + { + "name": "updateFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "default": {}, + "x-example": "{}" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/mailgun": { + "post": { + "summary": "Create Mailgun provider", + "operationId": "messagingCreateMailgunProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Mailgun provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMailgunProvider", + "group": "providers", + "weight": 266, + "cookies": false, + "type": "", + "demo": "messaging\/create-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "default": "", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "default": "", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "default": null, + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/mailgun\/{providerId}": { + "patch": { + "summary": "Update Mailgun provider", + "operationId": "messagingUpdateMailgunProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Mailgun provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMailgunProvider", + "group": "providers", + "weight": 279, + "cookies": false, + "type": "", + "demo": "messaging\/update-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "default": "", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "default": "", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "default": null, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/msg91": { + "post": { + "summary": "Create Msg91 provider", + "operationId": "messagingCreateMsg91Provider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new MSG91 provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMsg91Provider", + "group": "providers", + "weight": 269, + "cookies": false, + "type": "", + "demo": "messaging\/create-msg-91-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID", + "default": "", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "default": "", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/msg91\/{providerId}": { + "patch": { + "summary": "Update Msg91 provider", + "operationId": "messagingUpdateMsg91Provider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a MSG91 provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMsg91Provider", + "group": "providers", + "weight": 282, + "cookies": false, + "type": "", + "demo": "messaging\/update-msg-91-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID.", + "default": "", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "default": "", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "default": "", + "x-example": "<AUTH_KEY>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/sendgrid": { + "post": { + "summary": "Create Sendgrid provider", + "operationId": "messagingCreateSendgridProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Sendgrid provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSendgridProvider", + "group": "providers", + "weight": 267, + "cookies": false, + "type": "", + "demo": "messaging\/create-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/sendgrid\/{providerId}": { + "patch": { + "summary": "Update Sendgrid provider", + "operationId": "messagingUpdateSendgridProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Sendgrid provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSendgridProvider", + "group": "providers", + "weight": 280, + "cookies": false, + "type": "", + "demo": "messaging\/update-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSmtpProvider", + "group": "providers", + "weight": 268, + "cookies": false, + "type": "", + "demo": "messaging\/create-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + }, + "methods": [ + { + "name": "createSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + } + }, + { + "name": "createSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "default": null, + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "The default SMTP server port.", + "default": 587, + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "default": "", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "default": "", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "default": true, + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "default": "", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + ] + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSmtpProvider", + "group": "providers", + "weight": 281, + "cookies": false, + "type": "", + "demo": "messaging\/update-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + }, + "methods": [ + { + "name": "updateSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + } + }, + { + "name": "updateSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "default": "", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "SMTP port.", + "default": null, + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "default": "", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be 'ssl' or 'tls'", + "default": "", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "default": null, + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "default": "", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + } + } + } + ] + } + }, + "\/messaging\/providers\/telesign": { + "post": { + "summary": "Create Telesign provider", + "operationId": "messagingCreateTelesignProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Telesign provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTelesignProvider", + "group": "providers", + "weight": 270, + "cookies": false, + "type": "", + "demo": "messaging\/create-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "default": "", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/telesign\/{providerId}": { + "patch": { + "summary": "Update Telesign provider", + "operationId": "messagingUpdateTelesignProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Telesign provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTelesignProvider", + "group": "providers", + "weight": 283, + "cookies": false, + "type": "", + "demo": "messaging\/update-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "default": "", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/textmagic": { + "post": { + "summary": "Create Textmagic provider", + "operationId": "messagingCreateTextmagicProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Textmagic provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTextmagicProvider", + "group": "providers", + "weight": 271, + "cookies": false, + "type": "", + "demo": "messaging\/create-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "default": "", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "default": "", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/textmagic\/{providerId}": { + "patch": { + "summary": "Update Textmagic provider", + "operationId": "messagingUpdateTextmagicProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Textmagic provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTextmagicProvider", + "group": "providers", + "weight": 284, + "cookies": false, + "type": "", + "demo": "messaging\/update-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "default": "", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "default": "", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/twilio": { + "post": { + "summary": "Create Twilio provider", + "operationId": "messagingCreateTwilioProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Twilio provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTwilioProvider", + "group": "providers", + "weight": 272, + "cookies": false, + "type": "", + "demo": "messaging\/create-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "default": "", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "default": "", + "x-example": "<AUTH_TOKEN>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/twilio\/{providerId}": { + "patch": { + "summary": "Update Twilio provider", + "operationId": "messagingUpdateTwilioProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Twilio provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTwilioProvider", + "group": "providers", + "weight": 285, + "cookies": false, + "type": "", + "demo": "messaging\/update-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "default": "", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "default": "", + "x-example": "<AUTH_TOKEN>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/vonage": { + "post": { + "summary": "Create Vonage provider", + "operationId": "messagingCreateVonageProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Vonage provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVonageProvider", + "group": "providers", + "weight": 273, + "cookies": false, + "type": "", + "demo": "messaging\/create-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "default": "", + "x-example": "<API_SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/vonage\/{providerId}": { + "patch": { + "summary": "Update Vonage provider", + "operationId": "messagingUpdateVonageProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Vonage provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVonageProvider", + "group": "providers", + "weight": 286, + "cookies": false, + "type": "", + "demo": "messaging\/update-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "default": "", + "x-example": "<API_SECRET>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/{providerId}": { + "get": { + "summary": "Get provider", + "operationId": "messagingGetProvider", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a provider by its unique ID.\n", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getProvider", + "group": "providers", + "weight": 278, + "cookies": false, + "type": "", + "demo": "messaging\/get-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete provider", + "operationId": "messagingDeleteProvider", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a provider by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteProvider", + "group": "providers", + "weight": 289, + "cookies": false, + "type": "", + "demo": "messaging\/delete-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/providers\/{providerId}\/logs": { + "get": { + "summary": "List provider logs", + "operationId": "messagingListProviderLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the provider activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listProviderLogs", + "group": "providers", + "weight": 277, + "cookies": false, + "type": "", + "demo": "messaging\/list-provider-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/subscribers\/{subscriberId}\/logs": { + "get": { + "summary": "List subscriber logs", + "operationId": "messagingListSubscriberLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the subscriber activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSubscriberLogs", + "group": "subscribers", + "weight": 298, + "cookies": false, + "type": "", + "demo": "messaging\/list-subscriber-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/topics": { + "get": { + "summary": "List topics", + "operationId": "messagingListTopics", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all topics from the current Appwrite project.", + "responses": { + "200": { + "description": "Topic list", + "schema": { + "$ref": "#\/definitions\/topicList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTopics", + "group": "topics", + "weight": 291, + "cookies": false, + "type": "", + "demo": "messaging\/list-topics.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create topic", + "operationId": "messagingCreateTopic", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new topic.", + "responses": { + "201": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTopic", + "group": "topics", + "weight": 290, + "cookies": false, + "type": "", + "demo": "messaging\/create-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topicId": { + "type": "string", + "description": "Topic ID. Choose a custom Topic ID or a new Topic ID.", + "default": null, + "x-example": "<TOPIC_ID>" + }, + "name": { + "type": "string", + "description": "Topic Name.", + "default": null, + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [ + "users" + ], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "topicId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/topics\/{topicId}": { + "get": { + "summary": "Get topic", + "operationId": "messagingGetTopic", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTopic", + "group": "topics", + "weight": 293, + "cookies": false, + "type": "", + "demo": "messaging\/get-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update topic", + "operationId": "messagingUpdateTopic", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTopic", + "group": "topics", + "weight": 294, + "cookies": false, + "type": "", + "demo": "messaging\/update-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Topic Name.", + "default": null, + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": null, + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete topic", + "operationId": "messagingDeleteTopic", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a topic by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTopic", + "group": "topics", + "weight": 295, + "cookies": false, + "type": "", + "demo": "messaging\/delete-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/logs": { + "get": { + "summary": "List topic logs", + "operationId": "messagingListTopicLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the topic activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTopicLogs", + "group": "topics", + "weight": 292, + "cookies": false, + "type": "", + "demo": "messaging\/list-topic-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "get": { + "summary": "List subscribers", + "operationId": "messagingListSubscribers", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all subscribers from the current Appwrite project.", + "responses": { + "200": { + "description": "Subscriber list", + "schema": { + "$ref": "#\/definitions\/subscriberList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSubscribers", + "group": "subscribers", + "weight": 297, + "cookies": false, + "type": "", + "demo": "messaging\/list-subscribers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "schema": { + "$ref": "#\/definitions\/subscriber" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 296, + "cookies": false, + "type": "", + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "default": null, + "x-example": "<SUBSCRIBER_ID>" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "default": null, + "x-example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "get": { + "summary": "Get subscriber", + "operationId": "messagingGetSubscriber", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a subscriber by its unique ID.\n", + "responses": { + "200": { + "description": "Subscriber", + "schema": { + "$ref": "#\/definitions\/subscriber" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSubscriber", + "group": "subscribers", + "weight": 299, + "cookies": false, + "type": "", + "demo": "messaging\/get-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 300, + "cookies": false, + "type": "", + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + } + ] + } + }, + "\/migrations": { + "get": { + "summary": "List migrations", + "operationId": "migrationsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.", + "responses": { + "200": { + "description": "Migrations List", + "schema": { + "$ref": "#\/definitions\/migrationList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": null, + "weight": 258, + "cookies": false, + "type": "", + "demo": "migrations\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/list-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/migrations\/appwrite": { + "post": { + "summary": "Create Appwrite migration", + "operationId": "migrationsCreateAppwriteMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project. ", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createAppwriteMigration", + "group": null, + "weight": 253, + "cookies": false, + "type": "", + "demo": "migrations\/create-appwrite-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "endpoint": { + "type": "string", + "description": "Source Appwrite endpoint", + "default": null, + "x-example": "https:\/\/example.com" + }, + "projectId": { + "type": "string", + "description": "Source Project ID", + "default": null, + "x-example": "<PROJECT_ID>" + }, + "apiKey": { + "type": "string", + "description": "Source API Key", + "default": null, + "x-example": "<API_KEY>" + } + }, + "required": [ + "resources", + "endpoint", + "projectId", + "apiKey" + ] + } + } + ] + } + }, + "\/migrations\/appwrite\/report": { + "get": { + "summary": "Get Appwrite migration report", + "operationId": "migrationsGetAppwriteReport", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", + "responses": { + "200": { + "description": "Migration Report", + "schema": { + "$ref": "#\/definitions\/migrationReport" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getAppwriteReport", + "group": null, + "weight": 260, + "cookies": false, + "type": "", + "demo": "migrations\/get-appwrite-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "in": "query" + }, + { + "name": "endpoint", + "description": "Source's Appwrite Endpoint", + "required": true, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "in": "query" + }, + { + "name": "projectID", + "description": "Source's Project ID", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "query" + }, + { + "name": "key", + "description": "Source's API Key", + "required": true, + "type": "string", + "x-example": "<KEY>", + "in": "query" + } + ] + } + }, + "\/migrations\/csv": { + "post": { + "summary": "Import documents from a CSV", + "operationId": "migrationsCreateCsvMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Import documents from a CSV file into your Appwrite database. This endpoint allows you to import documents from a CSV file uploaded to Appwrite Storage bucket.", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createCsvMigration", + "group": null, + "weight": 257, + "cookies": false, + "type": "", + "demo": "migrations\/create-csv-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-csv.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "default": null, + "x-example": "<BUCKET_ID>" + }, + "fileId": { + "type": "string", + "description": "File ID.", + "default": null, + "x-example": "<FILE_ID>" + }, + "resourceId": { + "type": "string", + "description": "Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.", + "default": null, + "x-example": "[ID1:ID2]" + }, + "internalFile": { + "type": "boolean", + "description": "Is the file stored in an internal bucket?", + "default": false, + "x-example": false + } + }, + "required": [ + "bucketId", + "fileId", + "resourceId" + ] + } + } + ] + } + }, + "\/migrations\/firebase": { + "post": { + "summary": "Create Firebase migration", + "operationId": "migrationsCreateFirebaseMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. ", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFirebaseMigration", + "group": null, + "weight": 254, + "cookies": false, + "type": "", + "demo": "migrations\/create-firebase-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "serviceAccount": { + "type": "string", + "description": "JSON of the Firebase service account credentials", + "default": null, + "x-example": "<SERVICE_ACCOUNT>" + } + }, + "required": [ + "resources", + "serviceAccount" + ] + } + } + ] + } + }, + "\/migrations\/firebase\/report": { + "get": { + "summary": "Get Firebase migration report", + "operationId": "migrationsGetFirebaseReport", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", + "responses": { + "200": { + "description": "Migration Report", + "schema": { + "$ref": "#\/definitions\/migrationReport" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFirebaseReport", + "group": null, + "weight": 261, + "cookies": false, + "type": "", + "demo": "migrations\/get-firebase-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "in": "query" + }, + { + "name": "serviceAccount", + "description": "JSON of the Firebase service account credentials", + "required": true, + "type": "string", + "x-example": "<SERVICE_ACCOUNT>", + "in": "query" + } + ] + } + }, + "\/migrations\/nhost": { + "post": { + "summary": "Create NHost migration", + "operationId": "migrationsCreateNHostMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project. ", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createNHostMigration", + "group": null, + "weight": 256, + "cookies": false, + "type": "", + "demo": "migrations\/create-n-host-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "subdomain": { + "type": "string", + "description": "Source's Subdomain", + "default": null, + "x-example": "<SUBDOMAIN>" + }, + "region": { + "type": "string", + "description": "Source's Region", + "default": null, + "x-example": "<REGION>" + }, + "adminSecret": { + "type": "string", + "description": "Source's Admin Secret", + "default": null, + "x-example": "<ADMIN_SECRET>" + }, + "database": { + "type": "string", + "description": "Source's Database Name", + "default": null, + "x-example": "<DATABASE>" + }, + "username": { + "type": "string", + "description": "Source's Database Username", + "default": null, + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Source's Database Password", + "default": null, + "x-example": "<PASSWORD>" + }, + "port": { + "type": "integer", + "description": "Source's Database Port", + "default": 5432, + "x-example": null + } + }, + "required": [ + "resources", + "subdomain", + "region", + "adminSecret", + "database", + "username", + "password" + ] + } + } + ] + } + }, + "\/migrations\/nhost\/report": { + "get": { + "summary": "Get NHost migration report", + "operationId": "migrationsGetNHostReport", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", + "responses": { + "200": { + "description": "Migration Report", + "schema": { + "$ref": "#\/definitions\/migrationReport" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getNHostReport", + "group": null, + "weight": 263, + "cookies": false, + "type": "", + "demo": "migrations\/get-n-host-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate.", + "required": true, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "in": "query" + }, + { + "name": "subdomain", + "description": "Source's Subdomain.", + "required": true, + "type": "string", + "x-example": "<SUBDOMAIN>", + "in": "query" + }, + { + "name": "region", + "description": "Source's Region.", + "required": true, + "type": "string", + "x-example": "<REGION>", + "in": "query" + }, + { + "name": "adminSecret", + "description": "Source's Admin Secret.", + "required": true, + "type": "string", + "x-example": "<ADMIN_SECRET>", + "in": "query" + }, + { + "name": "database", + "description": "Source's Database Name.", + "required": true, + "type": "string", + "x-example": "<DATABASE>", + "in": "query" + }, + { + "name": "username", + "description": "Source's Database Username.", + "required": true, + "type": "string", + "x-example": "<USERNAME>", + "in": "query" + }, + { + "name": "password", + "description": "Source's Database Password.", + "required": true, + "type": "string", + "x-example": "<PASSWORD>", + "in": "query" + }, + { + "name": "port", + "description": "Source's Database Port.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5432, + "in": "query" + } + ] + } + }, + "\/migrations\/supabase": { + "post": { + "summary": "Create Supabase migration", + "operationId": "migrationsCreateSupabaseMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project. ", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSupabaseMigration", + "group": null, + "weight": 255, + "cookies": false, + "type": "", + "demo": "migrations\/create-supabase-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "endpoint": { + "type": "string", + "description": "Source's Supabase Endpoint", + "default": null, + "x-example": "https:\/\/example.com" + }, + "apiKey": { + "type": "string", + "description": "Source's API Key", + "default": null, + "x-example": "<API_KEY>" + }, + "databaseHost": { + "type": "string", + "description": "Source's Database Host", + "default": null, + "x-example": "<DATABASE_HOST>" + }, + "username": { + "type": "string", + "description": "Source's Database Username", + "default": null, + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Source's Database Password", + "default": null, + "x-example": "<PASSWORD>" + }, + "port": { + "type": "integer", + "description": "Source's Database Port", + "default": 5432, + "x-example": null + } + }, + "required": [ + "resources", + "endpoint", + "apiKey", + "databaseHost", + "username", + "password" + ] + } + } + ] + } + }, + "\/migrations\/supabase\/report": { + "get": { + "summary": "Get Supabase migration report", + "operationId": "migrationsGetSupabaseReport", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", + "responses": { + "200": { + "description": "Migration Report", + "schema": { + "$ref": "#\/definitions\/migrationReport" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSupabaseReport", + "group": null, + "weight": 262, + "cookies": false, + "type": "", + "demo": "migrations\/get-supabase-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "in": "query" + }, + { + "name": "endpoint", + "description": "Source's Supabase Endpoint.", + "required": true, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "in": "query" + }, + { + "name": "apiKey", + "description": "Source's API Key.", + "required": true, + "type": "string", + "x-example": "<API_KEY>", + "in": "query" + }, + { + "name": "databaseHost", + "description": "Source's Database Host.", + "required": true, + "type": "string", + "x-example": "<DATABASE_HOST>", + "in": "query" + }, + { + "name": "username", + "description": "Source's Database Username.", + "required": true, + "type": "string", + "x-example": "<USERNAME>", + "in": "query" + }, + { + "name": "password", + "description": "Source's Database Password.", + "required": true, + "type": "string", + "x-example": "<PASSWORD>", + "in": "query" + }, + { + "name": "port", + "description": "Source's Database Port.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5432, + "in": "query" + } + ] + } + }, + "\/migrations\/{migrationId}": { + "get": { + "summary": "Get migration", + "operationId": "migrationsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process. ", + "responses": { + "200": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 259, + "cookies": false, + "type": "", + "demo": "migrations\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/get-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration unique ID.", + "required": true, + "type": "string", + "x-example": "<MIGRATION_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update retry migration", + "operationId": "migrationsRetry", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "retry", + "group": null, + "weight": 264, + "cookies": false, + "type": "", + "demo": "migrations\/retry.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/retry-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration unique ID.", + "required": true, + "type": "string", + "x-example": "<MIGRATION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete migration", + "operationId": "migrationsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "migrations" + ], + "description": "Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": null, + "weight": 265, + "cookies": false, + "type": "", + "demo": "migrations\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/delete-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration ID.", + "required": true, + "type": "string", + "x-example": "<MIGRATION_ID>", + "in": "path" + } + ] + } + }, + "\/project\/usage": { + "get": { + "summary": "Get project usage stats", + "operationId": "projectGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "project" + ], + "description": "Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.", + "responses": { + "200": { + "description": "UsageProject", + "schema": { + "$ref": "#\/definitions\/usageProject" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 148, + "cookies": false, + "type": "", + "demo": "project\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "startDate", + "description": "Starting date for the usage", + "required": true, + "type": "string", + "in": "query" + }, + { + "name": "endDate", + "description": "End date for the usage", + "required": true, + "type": "string", + "in": "query" + }, + { + "name": "period", + "description": "Period used", + "required": false, + "type": "string", + "x-example": "1h", + "enum": [ + "1h", + "1d" + ], + "x-enum-name": "ProjectUsageRange", + "x-enum-keys": [ + "One Hour", + "One Day" + ], + "default": "1d", + "in": "query" + } + ] + } + }, + "\/project\/variables": { + "get": { + "summary": "List variables", + "operationId": "projectListVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "project" + ], + "description": "Get a list of all project variables. These variables will be accessible in all Appwrite Functions at runtime.", + "responses": { + "200": { + "description": "Variables List", + "schema": { + "$ref": "#\/definitions\/variableList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listVariables", + "group": null, + "weight": 150, + "cookies": false, + "type": "", + "demo": "project\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/list-variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "projectCreateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "project" + ], + "description": "Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime.", + "responses": { + "201": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVariable", + "group": null, + "weight": 149, + "cookies": false, + "type": "", + "demo": "project\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/create-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "default": true, + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + ] + } + }, + "\/project\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "projectGetVariable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "project" + ], + "description": "Get a project variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getVariable", + "group": null, + "weight": 151, + "cookies": false, + "type": "", + "demo": "project\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "projectUpdateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "project" + ], + "description": "Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVariable", + "group": null, + "weight": 152, + "cookies": false, + "type": "", + "demo": "project\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/update-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "default": null, + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + ] + }, + "delete": { + "summary": "Delete variable", + "operationId": "projectDeleteVariable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "project" + ], + "description": "Delete a project variable by its unique ID. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteVariable", + "group": null, + "weight": 153, + "cookies": false, + "type": "", + "demo": "project\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/delete-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + } + }, + "\/projects": { + "get": { + "summary": "List projects", + "operationId": "projectsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a list of all projects. You can use the query params to filter your results. ", + "responses": { + "200": { + "description": "Projects List", + "schema": { + "$ref": "#\/definitions\/projectList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "projects", + "weight": 436, + "cookies": false, + "type": "", + "demo": "projects\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all projects. You can use the query params to filter your results. ", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create project", + "operationId": "projectsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new project. You can create a maximum of 100 projects per account. ", + "responses": { + "201": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "projects", + "weight": 102, + "cookies": false, + "type": "", + "demo": "projects\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "projectId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "Project name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "teamId": { + "type": "string", + "description": "Team unique ID.", + "default": null, + "x-example": "<TEAM_ID>" + }, + "region": { + "type": "string", + "description": "Project Region.", + "default": "default", + "x-example": "default", + "enum": [ + "default" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "description": { + "type": "string", + "description": "Project description. Max length: 256 chars.", + "default": "", + "x-example": "<DESCRIPTION>" + }, + "logo": { + "type": "string", + "description": "Project logo.", + "default": "", + "x-example": "<LOGO>" + }, + "url": { + "type": "string", + "description": "Project URL.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "legalName": { + "type": "string", + "description": "Project legal Name. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_NAME>" + }, + "legalCountry": { + "type": "string", + "description": "Project legal Country. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_COUNTRY>" + }, + "legalState": { + "type": "string", + "description": "Project legal State. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_STATE>" + }, + "legalCity": { + "type": "string", + "description": "Project legal City. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_CITY>" + }, + "legalAddress": { + "type": "string", + "description": "Project legal Address. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_ADDRESS>" + }, + "legalTaxId": { + "type": "string", + "description": "Project legal Tax ID. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_TAX_ID>" + } + }, + "required": [ + "projectId", + "name", + "teamId" + ] + } + } + ] + } + }, + "\/projects\/{projectId}": { + "get": { + "summary": "Get project", + "operationId": "projectsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "projects", + "weight": 103, + "cookies": false, + "type": "", + "demo": "projects\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update project", + "operationId": "projectsUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a project by its unique ID.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "projects", + "weight": 104, + "cookies": false, + "type": "", + "demo": "projects\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Project name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "description": { + "type": "string", + "description": "Project description. Max length: 256 chars.", + "default": "", + "x-example": "<DESCRIPTION>" + }, + "logo": { + "type": "string", + "description": "Project logo.", + "default": "", + "x-example": "<LOGO>" + }, + "url": { + "type": "string", + "description": "Project URL.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "legalName": { + "type": "string", + "description": "Project legal name. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_NAME>" + }, + "legalCountry": { + "type": "string", + "description": "Project legal country. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_COUNTRY>" + }, + "legalState": { + "type": "string", + "description": "Project legal state. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_STATE>" + }, + "legalCity": { + "type": "string", + "description": "Project legal city. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_CITY>" + }, + "legalAddress": { + "type": "string", + "description": "Project legal address. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_ADDRESS>" + }, + "legalTaxId": { + "type": "string", + "description": "Project legal tax ID. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_TAX_ID>" + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete project", + "operationId": "projectsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "Delete a project by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "projects", + "weight": 121, + "cookies": false, + "type": "", + "demo": "projects\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/api": { + "patch": { + "summary": "Update API status", + "operationId": "projectsUpdateApiStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateApiStatus", + "group": "projects", + "weight": 108, + "cookies": false, + "type": "", + "demo": "projects\/update-api-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatus" + }, + "methods": [ + { + "name": "updateApiStatus", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "api", + "status" + ], + "required": [ + "projectId", + "api", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "demo": "projects\/update-api-status.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatus" + } + }, + { + "name": "updateAPIStatus", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "api", + "status" + ], + "required": [ + "projectId", + "api", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "demo": "projects\/update-api-status.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "api": { + "type": "string", + "description": "API name.", + "default": null, + "x-example": "rest", + "enum": [ + "rest", + "graphql", + "realtime" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "status": { + "type": "boolean", + "description": "API status.", + "default": null, + "x-example": false + } + }, + "required": [ + "api", + "status" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/api\/all": { + "patch": { + "summary": "Update all API status", + "operationId": "projectsUpdateApiStatusAll", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateApiStatusAll", + "group": "projects", + "weight": 109, + "cookies": false, + "type": "", + "demo": "projects\/update-api-status-all.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status-all.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatusAll" + }, + "methods": [ + { + "name": "updateApiStatusAll", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "status" + ], + "required": [ + "projectId", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "demo": "projects\/update-api-status-all.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatusAll" + } + }, + { + "name": "updateAPIStatusAll", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "status" + ], + "required": [ + "projectId", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "demo": "projects\/update-api-status-all.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "API status.", + "default": null, + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/duration": { + "patch": { + "summary": "Update project authentication duration", + "operationId": "projectsUpdateAuthDuration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update how long sessions created within a project should stay active for.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthDuration", + "group": "auth", + "weight": 114, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-duration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-duration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "duration": { + "type": "integer", + "description": "Project session length in seconds. Max length: 31536000 seconds.", + "default": null, + "x-example": 0 + } + }, + "required": [ + "duration" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/limit": { + "patch": { + "summary": "Update project users limit", + "operationId": "projectsUpdateAuthLimit", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the maximum number of users allowed in this project. Set to 0 for unlimited users. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthLimit", + "group": "auth", + "weight": 113, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-limit.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-limit.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of users allowed in this project. Use 0 for unlimited.", + "default": null, + "x-example": 0 + } + }, + "required": [ + "limit" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/max-sessions": { + "patch": { + "summary": "Update project user sessions limit", + "operationId": "projectsUpdateAuthSessionsLimit", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthSessionsLimit", + "group": "auth", + "weight": 119, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-sessions-limit.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-sessions-limit.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10", + "default": null, + "x-example": 1 + } + }, + "required": [ + "limit" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/memberships-privacy": { + "patch": { + "summary": "Update project memberships privacy attributes", + "operationId": "projectsUpdateMembershipsPrivacy", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembershipsPrivacy", + "group": "auth", + "weight": 112, + "cookies": false, + "type": "", + "demo": "projects\/update-memberships-privacy.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-memberships-privacy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "boolean", + "description": "Set to true to show userName to members of a team.", + "default": null, + "x-example": false + }, + "userEmail": { + "type": "boolean", + "description": "Set to true to show email to members of a team.", + "default": null, + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Set to true to show mfa to members of a team.", + "default": null, + "x-example": false + } + }, + "required": [ + "userName", + "userEmail", + "mfa" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/mock-numbers": { + "patch": { + "summary": "Update the mock numbers for the project", + "operationId": "projectsUpdateMockNumbers", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMockNumbers", + "group": "auth", + "weight": 120, + "cookies": false, + "type": "", + "demo": "projects\/update-mock-numbers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-mock-numbers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "numbers": { + "type": "array", + "description": "An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "numbers" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/password-dictionary": { + "patch": { + "summary": "Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password", + "operationId": "projectsUpdateAuthPasswordDictionary", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthPasswordDictionary", + "group": "auth", + "weight": 117, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-password-dictionary.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-dictionary.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Set whether or not to enable checking user's password against most commonly used passwords. Default is false.", + "default": null, + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/password-history": { + "patch": { + "summary": "Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.", + "operationId": "projectsUpdateAuthPasswordHistory", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthPasswordHistory", + "group": "auth", + "weight": 116, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-password-history.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-history.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of passwords to store in user history. User can't choose a new password that is already stored in the password history list. Max number of passwords allowed in history is20. Default value is 0", + "default": null, + "x-example": 0 + } + }, + "required": [ + "limit" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/personal-data": { + "patch": { + "summary": "Update personal data check", + "operationId": "projectsUpdatePersonalDataCheck", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePersonalDataCheck", + "group": "auth", + "weight": 118, + "cookies": false, + "type": "", + "demo": "projects\/update-personal-data-check.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-personal-data-check.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Set whether or not to check a password for similarity with personal data. Default is false.", + "default": null, + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/session-alerts": { + "patch": { + "summary": "Update project sessions emails", + "operationId": "projectsUpdateSessionAlerts", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSessionAlerts", + "group": "auth", + "weight": 111, + "cookies": false, + "type": "", + "demo": "projects\/update-session-alerts.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-alerts.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "alerts": { + "type": "boolean", + "description": "Set to true to enable session emails.", + "default": null, + "x-example": false + } + }, + "required": [ + "alerts" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/session-invalidation": { + "patch": { + "summary": "Update invalidate session option of the project", + "operationId": "projectsUpdateSessionInvalidation", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Invalidate all existing sessions. An optional auth security setting for projects, and enabled by default for console project.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSessionInvalidation", + "group": "auth", + "weight": 147, + "cookies": false, + "type": "", + "demo": "projects\/update-session-invalidation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-invalidation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Update authentication session invalidation status. Use this endpoint to enable or disable session invalidation on password change", + "default": null, + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/{method}": { + "patch": { + "summary": "Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.", + "operationId": "projectsUpdateAuthStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateAuthStatus", + "group": "auth", + "weight": 115, + "cookies": false, + "type": "", + "demo": "projects\/update-auth-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "method", + "description": "Auth Method. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone", + "required": true, + "type": "string", + "x-example": "email-password", + "enum": [ + "email-password", + "magic-url", + "email-otp", + "anonymous", + "invites", + "jwt", + "phone" + ], + "x-enum-name": "AuthMethod", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "Set the status of this auth method.", + "default": null, + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/dev-keys": { + "get": { + "summary": "List dev keys", + "operationId": "projectsListDevKeys", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "List all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "responses": { + "200": { + "description": "Dev Keys List", + "schema": { + "$ref": "#\/definitions\/devKeyList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listDevKeys", + "group": "devKeys", + "weight": 434, + "cookies": false, + "type": "", + "demo": "projects\/list-dev-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: accessedAt, expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create dev key", + "operationId": "projectsCreateDevKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "responses": { + "201": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDevKey", + "group": "devKeys", + "weight": 431, + "cookies": false, + "type": "", + "demo": "projects\/create-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/dev-keys\/{keyId}": { + "get": { + "summary": "Get dev key", + "operationId": "projectsGetDevKey", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "responses": { + "200": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDevKey", + "group": "devKeys", + "weight": 433, + "cookies": false, + "type": "", + "demo": "projects\/get-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update dev key", + "operationId": "projectsUpdateDevKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "responses": { + "200": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDevKey", + "group": "devKeys", + "weight": 432, + "cookies": false, + "type": "", + "demo": "projects\/update-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + ] + }, + "delete": { + "summary": "Delete dev key", + "operationId": "projectsDeleteDevKey", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "Delete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteDevKey", + "group": "devKeys", + "weight": 435, + "cookies": false, + "type": "", + "demo": "projects\/delete-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "projectsCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. ", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "auth", + "weight": 133, + "cookies": false, + "type": "", + "demo": "projects\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "scopes": { + "type": "array", + "description": "List of scopes allowed for JWT key. Maximum of 100 scopes are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "default": 900, + "x-example": 0 + } + }, + "required": [ + "scopes" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/keys": { + "get": { + "summary": "List keys", + "operationId": "projectsListKeys", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a list of all API keys from the current project. ", + "responses": { + "200": { + "description": "API Keys List", + "schema": { + "$ref": "#\/definitions\/keyList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listKeys", + "group": "keys", + "weight": 129, + "cookies": false, + "type": "", + "demo": "projects\/list-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-keys.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create key", + "operationId": "projectsCreateKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.", + "responses": { + "201": { + "description": "Key", + "schema": { + "$ref": "#\/definitions\/key" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createKey", + "group": "keys", + "weight": 128, + "cookies": false, + "type": "", + "demo": "projects\/create-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "scopes": { + "type": "array", + "description": "Key scopes list. Maximum of 100 scopes are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "scopes" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/keys\/{keyId}": { + "get": { + "summary": "Get key", + "operationId": "projectsGetKey", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.", + "responses": { + "200": { + "description": "Key", + "schema": { + "$ref": "#\/definitions\/key" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getKey", + "group": "keys", + "weight": 130, + "cookies": false, + "type": "", + "demo": "projects\/get-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update key", + "operationId": "projectsUpdateKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. ", + "responses": { + "200": { + "description": "Key", + "schema": { + "$ref": "#\/definitions\/key" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateKey", + "group": "keys", + "weight": 131, + "cookies": false, + "type": "", + "demo": "projects\/update-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "scopes": { + "type": "array", + "description": "Key scopes list. Maximum of 100 events are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "scopes" + ] + } + } + ] + }, + "delete": { + "summary": "Delete key", + "operationId": "projectsDeleteKey", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteKey", + "group": "keys", + "weight": 132, + "cookies": false, + "type": "", + "demo": "projects\/delete-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/oauth2": { + "patch": { + "summary": "Update project OAuth2", + "operationId": "projectsUpdateOAuth2", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable\/disable providers. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateOAuth2", + "group": "auth", + "weight": 110, + "cookies": false, + "type": "", + "demo": "projects\/update-o-auth-2.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-oauth2.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "Provider Name", + "default": null, + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "appId": { + "type": "string", + "description": "Provider app ID. Max length: 256 chars.", + "default": null, + "x-example": "<APP_ID>" + }, + "secret": { + "type": "string", + "description": "Provider secret key. Max length: 512 chars.", + "default": null, + "x-example": "<SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Provider status. Set to 'false' to disable new session creation.", + "default": null, + "x-example": false + } + }, + "required": [ + "provider" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/platforms": { + "get": { + "summary": "List platforms", + "operationId": "projectsListPlatforms", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. ", + "responses": { + "200": { + "description": "Platforms List", + "schema": { + "$ref": "#\/definitions\/platformList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listPlatforms", + "group": "platforms", + "weight": 135, + "cookies": false, + "type": "", + "demo": "projects\/list-platforms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-platforms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create platform", + "operationId": "projectsCreatePlatform", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform", + "schema": { + "$ref": "#\/definitions\/platform" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPlatform", + "group": "platforms", + "weight": 134, + "cookies": false, + "type": "", + "demo": "projects\/create-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Platform type.", + "default": null, + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "flutter-linux", + "flutter-macos", + "flutter-windows", + "apple-ios", + "apple-macos", + "apple-watchos", + "apple-tvos", + "android", + "unity", + "react-native-ios", + "react-native-android" + ], + "x-enum-name": "PlatformType", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "Platform name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "key": { + "type": "string", + "description": "Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.", + "default": "", + "x-example": "<KEY>" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID. Max length: 256 chars.", + "default": "", + "x-example": "<STORE>" + }, + "hostname": { + "type": "string", + "description": "Platform client hostname. Max length: 256 chars.", + "default": "", + "x-example": null + } + }, + "required": [ + "type", + "name" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/platforms\/{platformId}": { + "get": { + "summary": "Get platform", + "operationId": "projectsGetPlatform", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ", + "responses": { + "200": { + "description": "Platform", + "schema": { + "$ref": "#\/definitions\/platform" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPlatform", + "group": "platforms", + "weight": 136, + "cookies": false, + "type": "", + "demo": "projects\/get-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "platformId", + "description": "Platform unique ID.", + "required": true, + "type": "string", + "x-example": "<PLATFORM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update platform", + "operationId": "projectsUpdatePlatform", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. ", + "responses": { + "200": { + "description": "Platform", + "schema": { + "$ref": "#\/definitions\/platform" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePlatform", + "group": "platforms", + "weight": 137, + "cookies": false, + "type": "", + "demo": "projects\/update-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "platformId", + "description": "Platform unique ID.", + "required": true, + "type": "string", + "x-example": "<PLATFORM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Platform name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "key": { + "type": "string", + "description": "Package name for android or bundle ID for iOS. Max length: 256 chars.", + "default": "", + "x-example": "<KEY>" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID. Max length: 256 chars.", + "default": "", + "x-example": "<STORE>" + }, + "hostname": { + "type": "string", + "description": "Platform client URL. Max length: 256 chars.", + "default": "", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete platform", + "operationId": "projectsDeletePlatform", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deletePlatform", + "group": "platforms", + "weight": 138, + "cookies": false, + "type": "", + "demo": "projects\/delete-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "platformId", + "description": "Platform unique ID.", + "required": true, + "type": "string", + "x-example": "<PLATFORM_ID>", + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/service": { + "patch": { + "summary": "Update service status", + "operationId": "projectsUpdateServiceStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the status of a specific service. Use this endpoint to enable or disable a service in your project. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateServiceStatus", + "group": "projects", + "weight": 106, + "cookies": false, + "type": "", + "demo": "projects\/update-service-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "service": { + "type": "string", + "description": "Service name.", + "default": null, + "x-example": "account", + "enum": [ + "account", + "avatars", + "databases", + "tablesdb", + "locale", + "health", + "storage", + "teams", + "users", + "sites", + "functions", + "graphql", + "messaging" + ], + "x-enum-name": "ApiService", + "x-enum-keys": [] + }, + "status": { + "type": "boolean", + "description": "Service status.", + "default": null, + "x-example": false + } + }, + "required": [ + "service", + "status" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/service\/all": { + "patch": { + "summary": "Update all service status", + "operationId": "projectsUpdateServiceStatusAll", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the status of all services. Use this endpoint to enable or disable all optional services at once. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateServiceStatusAll", + "group": "projects", + "weight": 107, + "cookies": false, + "type": "", + "demo": "projects\/update-service-status-all.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status-all.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "Service status.", + "default": null, + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/smtp": { + "patch": { + "summary": "Update SMTP", + "operationId": "projectsUpdateSmtp", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSmtp", + "group": "templates", + "weight": 139, + "cookies": false, + "type": "", + "demo": "projects\/update-smtp.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-smtp.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMTP" + }, + "methods": [ + { + "name": "updateSmtp", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "enabled", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "enabled" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "demo": "projects\/update-smtp.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMTP" + } + }, + { + "name": "updateSMTP", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "enabled", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "enabled" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "demo": "projects\/update-smtp.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable custom SMTP service", + "default": null, + "x-example": false + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "default": "", + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "default": "", + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "default": "", + "x-example": "email@example.com" + }, + "host": { + "type": "string", + "description": "SMTP server host name", + "default": "", + "x-example": null + }, + "port": { + "type": "integer", + "description": "SMTP server port", + "default": 587, + "x-example": null + }, + "username": { + "type": "string", + "description": "SMTP server username", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "SMTP server password", + "default": "", + "x-example": "<PASSWORD>" + }, + "secure": { + "type": "string", + "description": "Does SMTP server use secure connection", + "default": "", + "x-example": "tls", + "enum": [ + "tls", + "ssl" + ], + "x-enum-name": "SMTPSecure", + "x-enum-keys": [] + } + }, + "required": [ + "enabled" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/smtp\/tests": { + "post": { + "summary": "Create SMTP test", + "operationId": "projectsCreateSmtpTest", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Send a test email to verify SMTP configuration. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSmtpTest", + "group": "templates", + "weight": 140, + "cookies": false, + "type": "", + "demo": "projects\/create-smtp-test.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-smtp-test.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.createSMTPTest" + }, + "methods": [ + { + "name": "createSmtpTest", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "host" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Send a test email to verify SMTP configuration. ", + "demo": "projects\/create-smtp-test.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.createSMTPTest" + } + }, + { + "name": "createSMTPTest", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "host" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Send a test email to verify SMTP configuration. ", + "demo": "projects\/create-smtp-test.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "emails": { + "type": "array", + "description": "Array of emails to send test email to. Maximum of 10 emails are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "default": null, + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "default": null, + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "default": "", + "x-example": "email@example.com" + }, + "host": { + "type": "string", + "description": "SMTP server host name", + "default": null, + "x-example": null + }, + "port": { + "type": "integer", + "description": "SMTP server port", + "default": 587, + "x-example": null + }, + "username": { + "type": "string", + "description": "SMTP server username", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "SMTP server password", + "default": "", + "x-example": "<PASSWORD>" + }, + "secure": { + "type": "string", + "description": "Does SMTP server use secure connection", + "default": "", + "x-example": "tls", + "enum": [ + "tls", + "ssl" + ], + "x-enum-name": "SMTPSecure", + "x-enum-keys": [] + } + }, + "required": [ + "emails", + "senderName", + "senderEmail", + "host" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/team": { + "patch": { + "summary": "Update project team", + "operationId": "projectsUpdateTeam", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the team ID of a project allowing for it to be transferred to another team.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTeam", + "group": "projects", + "weight": 105, + "cookies": false, + "type": "", + "demo": "projects\/update-team.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID of the team to transfer project to.", + "default": null, + "x-example": "<TEAM_ID>" + } + }, + "required": [ + "teamId" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/templates\/email\/{type}\/{locale}": { + "get": { + "summary": "Get custom email template", + "operationId": "projectsGetEmailTemplate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. ", + "responses": { + "200": { + "description": "EmailTemplate", + "schema": { + "$ref": "#\/definitions\/emailTemplate" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getEmailTemplate", + "group": "templates", + "weight": 142, + "cookies": false, + "type": "", + "demo": "projects\/get-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [], + "in": "path" + } + ] + }, + "patch": { + "summary": "Update custom email templates", + "operationId": "projectsUpdateEmailTemplate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.", + "responses": { + "200": { + "description": "EmailTemplate", + "schema": { + "$ref": "#\/definitions\/emailTemplate" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailTemplate", + "group": "templates", + "weight": 144, + "cookies": false, + "type": "", + "demo": "projects\/update-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Email Subject", + "default": null, + "x-example": "<SUBJECT>" + }, + "message": { + "type": "string", + "description": "Template message", + "default": null, + "x-example": "<MESSAGE>" + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "default": "", + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "default": "", + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "default": "", + "x-example": "email@example.com" + } + }, + "required": [ + "subject", + "message" + ] + } + } + ] + }, + "delete": { + "summary": "Delete custom email template", + "operationId": "projectsDeleteEmailTemplate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. ", + "responses": { + "200": { + "description": "EmailTemplate", + "schema": { + "$ref": "#\/definitions\/emailTemplate" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteEmailTemplate", + "group": "templates", + "weight": 146, + "cookies": false, + "type": "", + "demo": "projects\/delete-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/templates\/sms\/{type}\/{locale}": { + "get": { + "summary": "Get custom SMS template", + "operationId": "projectsGetSmsTemplate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "responses": { + "200": { + "description": "SmsTemplate", + "schema": { + "$ref": "#\/definitions\/smsTemplate" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getSmsTemplate", + "group": "templates", + "weight": 141, + "cookies": false, + "type": "", + "demo": "projects\/get-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.getSMSTemplate" + }, + "methods": [ + { + "name": "getSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "demo": "projects\/get-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.getSMSTemplate" + } + }, + { + "name": "getSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "demo": "projects\/get-sms-template.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [], + "in": "path" + } + ] + }, + "patch": { + "summary": "Update custom SMS template", + "operationId": "projectsUpdateSmsTemplate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "responses": { + "200": { + "description": "SmsTemplate", + "schema": { + "$ref": "#\/definitions\/smsTemplate" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSmsTemplate", + "group": "templates", + "weight": 143, + "cookies": false, + "type": "", + "demo": "projects\/update-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMSTemplate" + }, + "methods": [ + { + "name": "updateSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale", + "message" + ], + "required": [ + "projectId", + "type", + "locale", + "message" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "demo": "projects\/update-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMSTemplate" + } + }, + { + "name": "updateSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale", + "message" + ], + "required": [ + "projectId", + "type", + "locale", + "message" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "demo": "projects\/update-sms-template.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Template message", + "default": null, + "x-example": "<MESSAGE>" + } + }, + "required": [ + "message" + ] + } + } + ] + }, + "delete": { + "summary": "Reset custom SMS template", + "operationId": "projectsDeleteSmsTemplate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "responses": { + "200": { + "description": "SmsTemplate", + "schema": { + "$ref": "#\/definitions\/smsTemplate" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteSmsTemplate", + "group": "templates", + "weight": 145, + "cookies": false, + "type": "", + "demo": "projects\/delete-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.deleteSMSTemplate" + }, + "methods": [ + { + "name": "deleteSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "demo": "projects\/delete-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.deleteSMSTemplate" + } + }, + { + "name": "deleteSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "demo": "projects\/delete-sms-template.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/webhooks": { + "get": { + "summary": "List webhooks", + "operationId": "projectsListWebhooks", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a list of all webhooks belonging to the project. You can use the query params to filter your results. ", + "responses": { + "200": { + "description": "Webhooks List", + "schema": { + "$ref": "#\/definitions\/webhookList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listWebhooks", + "group": "webhooks", + "weight": 123, + "cookies": false, + "type": "", + "demo": "projects\/list-webhooks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-webhooks.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create webhook", + "operationId": "projectsCreateWebhook", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. ", + "responses": { + "201": { + "description": "Webhook", + "schema": { + "$ref": "#\/definitions\/webhook" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createWebhook", + "group": "webhooks", + "weight": 122, + "cookies": false, + "type": "", + "demo": "projects\/create-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Webhook name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Enable or disable a webhook.", + "default": true, + "x-example": false + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "Webhook URL.", + "default": null, + "x-example": null + }, + "security": { + "type": "boolean", + "description": "Certificate verification, false for disabled or true for enabled.", + "default": null, + "x-example": false + }, + "httpUser": { + "type": "string", + "description": "Webhook HTTP user. Max length: 256 chars.", + "default": "", + "x-example": "<HTTP_USER>" + }, + "httpPass": { + "type": "string", + "description": "Webhook HTTP password. Max length: 256 chars.", + "default": "", + "x-example": "<HTTP_PASS>" + } + }, + "required": [ + "name", + "events", + "url", + "security" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/webhooks\/{webhookId}": { + "get": { + "summary": "Get webhook", + "operationId": "projectsGetWebhook", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. ", + "responses": { + "200": { + "description": "Webhook", + "schema": { + "$ref": "#\/definitions\/webhook" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getWebhook", + "group": "webhooks", + "weight": 124, + "cookies": false, + "type": "", + "demo": "projects\/get-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "type": "string", + "x-example": "<WEBHOOK_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update webhook", + "operationId": "projectsUpdateWebhook", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. ", + "responses": { + "200": { + "description": "Webhook", + "schema": { + "$ref": "#\/definitions\/webhook" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateWebhook", + "group": "webhooks", + "weight": 125, + "cookies": false, + "type": "", + "demo": "projects\/update-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "type": "string", + "x-example": "<WEBHOOK_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Webhook name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Enable or disable a webhook.", + "default": true, + "x-example": false + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "Webhook URL.", + "default": null, + "x-example": null + }, + "security": { + "type": "boolean", + "description": "Certificate verification, false for disabled or true for enabled.", + "default": null, + "x-example": false + }, + "httpUser": { + "type": "string", + "description": "Webhook HTTP user. Max length: 256 chars.", + "default": "", + "x-example": "<HTTP_USER>" + }, + "httpPass": { + "type": "string", + "description": "Webhook HTTP password. Max length: 256 chars.", + "default": "", + "x-example": "<HTTP_PASS>" + } + }, + "required": [ + "name", + "events", + "url", + "security" + ] + } + } + ] + }, + "delete": { + "summary": "Delete webhook", + "operationId": "projectsDeleteWebhook", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. ", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteWebhook", + "group": "webhooks", + "weight": 127, + "cookies": false, + "type": "", + "demo": "projects\/delete-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "type": "string", + "x-example": "<WEBHOOK_ID>", + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/webhooks\/{webhookId}\/signature": { + "patch": { + "summary": "Update webhook signature key", + "operationId": "projectsUpdateWebhookSignature", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. ", + "responses": { + "200": { + "description": "Webhook", + "schema": { + "$ref": "#\/definitions\/webhook" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateWebhookSignature", + "group": "webhooks", + "weight": 126, + "cookies": false, + "type": "", + "demo": "projects\/update-webhook-signature.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook-signature.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "type": "string", + "x-example": "<WEBHOOK_ID>", + "in": "path" + } + ] + } + }, + "\/proxy\/rules": { + "get": { + "summary": "List rules", + "operationId": "proxyListRules", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Get a list of all the proxy rules. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rule List", + "schema": { + "$ref": "#\/definitions\/proxyRuleList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRules", + "group": null, + "weight": 502, + "cookies": false, + "type": "", + "demo": "proxy\/list-rules.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the proxy rules. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/proxy\/rules\/api": { + "post": { + "summary": "Create API rule", + "operationId": "proxyCreateAPIRule", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite's API on custom domain.", + "responses": { + "201": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createAPIRule", + "group": null, + "weight": 497, + "cookies": false, + "type": "", + "demo": "proxy\/create-api-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite's API on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "default": null, + "x-example": null + } + }, + "required": [ + "domain" + ] + } + } + ] + } + }, + "\/proxy\/rules\/function": { + "post": { + "summary": "Create function rule", + "operationId": "proxyCreateFunctionRule", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for executing Appwrite Function on custom domain.", + "responses": { + "201": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFunctionRule", + "group": null, + "weight": 499, + "cookies": false, + "type": "", + "demo": "proxy\/create-function-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for executing Appwrite Function on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "default": null, + "x-example": null + }, + "functionId": { + "type": "string", + "description": "ID of function to be executed.", + "default": null, + "x-example": "<FUNCTION_ID>" + }, + "branch": { + "type": "string", + "description": "Name of VCS branch to deploy changes automatically", + "default": "", + "x-example": "<BRANCH>" + } + }, + "required": [ + "domain", + "functionId" + ] + } + } + ] + } + }, + "\/proxy\/rules\/redirect": { + "post": { + "summary": "Create Redirect rule", + "operationId": "proxyCreateRedirectRule", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for to redirect from custom domain to another domain.", + "responses": { + "201": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRedirectRule", + "group": null, + "weight": 500, + "cookies": false, + "type": "", + "demo": "proxy\/create-redirect-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for to redirect from custom domain to another domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "default": null, + "x-example": null + }, + "url": { + "type": "string", + "description": "Target URL of redirection", + "default": null, + "x-example": "https:\/\/example.com" + }, + "statusCode": { + "type": "string", + "description": "Status code of redirection", + "default": null, + "x-example": "301", + "enum": [ + "301", + "302", + "307", + "308" + ], + "x-enum-name": null, + "x-enum-keys": [ + "Moved Permanently 301", + "Found 302", + "Temporary Redirect 307", + "Permanent Redirect 308" + ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "default": null, + "x-example": "<RESOURCE_ID>" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "default": null, + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] + } + }, + "required": [ + "domain", + "url", + "statusCode", + "resourceId", + "resourceType" + ] + } + } + ] + } + }, + "\/proxy\/rules\/site": { + "post": { + "summary": "Create site rule", + "operationId": "proxyCreateSiteRule", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite Site on custom domain.", + "responses": { + "201": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSiteRule", + "group": null, + "weight": 498, + "cookies": false, + "type": "", + "demo": "proxy\/create-site-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite Site on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "default": null, + "x-example": null + }, + "siteId": { + "type": "string", + "description": "ID of site to be executed.", + "default": null, + "x-example": "<SITE_ID>" + }, + "branch": { + "type": "string", + "description": "Name of VCS branch to deploy changes automatically", + "default": "", + "x-example": "<BRANCH>" + } + }, + "required": [ + "domain", + "siteId" + ] + } + } + ] + } + }, + "\/proxy\/rules\/{ruleId}": { + "get": { + "summary": "Get rule", + "operationId": "proxyGetRule", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Get a proxy rule by its unique ID.", + "responses": { + "200": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRule", + "group": null, + "weight": 501, + "cookies": false, + "type": "", + "demo": "proxy\/get-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a proxy rule by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "type": "string", + "x-example": "<RULE_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete rule", + "operationId": "proxyDeleteRule", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "proxy" + ], + "description": "Delete a proxy rule by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRule", + "group": null, + "weight": 503, + "cookies": false, + "type": "", + "demo": "proxy\/delete-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a proxy rule by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "type": "string", + "x-example": "<RULE_ID>", + "in": "path" + } + ] + } + }, + "\/proxy\/rules\/{ruleId}\/verification": { + "patch": { + "summary": "Update rule verification status", + "operationId": "proxyUpdateRuleVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", + "responses": { + "200": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRuleVerification", + "group": null, + "weight": 504, + "cookies": false, + "type": "", + "demo": "proxy\/update-rule-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterRetry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "type": "string", + "x-example": "<RULE_ID>", + "in": "path" + } + ] + } + }, + "\/sites": { + "get": { + "summary": "List sites", + "operationId": "sitesList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Sites List", + "schema": { + "$ref": "#\/definitions\/siteList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "sites", + "weight": 469, + "cookies": false, + "type": "", + "demo": "sites\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create site", + "operationId": "sitesCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site.", + "responses": { + "201": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "sites", + "weight": 467, + "cookies": false, + "type": "", + "demo": "sites\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "siteId": { + "type": "string", + "description": "Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<SITE_ID>" + }, + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "default": null, + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "default": 30, + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "default": "", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "default": "", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "default": "", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "default": null, + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "default": "", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "default": "", + "x-example": "<FALLBACK_FILE>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "siteId", + "name", + "framework", + "buildRuntime" + ] + } + } + ] + } + }, + "\/sites\/frameworks": { + "get": { + "summary": "List frameworks", + "operationId": "sitesListFrameworks", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all frameworks that are currently available on the server instance.", + "responses": { + "200": { + "description": "Frameworks List", + "schema": { + "$ref": "#\/definitions\/frameworkList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listFrameworks", + "group": "frameworks", + "weight": 472, + "cookies": false, + "type": "", + "demo": "sites\/list-frameworks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "sitesListSpecifications", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "List allowed site specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "schema": { + "$ref": "#\/definitions\/specificationList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSpecifications", + "group": "frameworks", + "weight": 495, + "cookies": false, + "type": "", + "demo": "sites\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/templates": { + "get": { + "summary": "List templates", + "operationId": "sitesListTemplates", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "List available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "responses": { + "200": { + "description": "Site Templates List", + "schema": { + "$ref": "#\/definitions\/templateSiteList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTemplates", + "group": "templates", + "weight": 491, + "cookies": false, + "type": "", + "demo": "sites\/list-templates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "frameworks", + "description": "List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "useCases", + "description": "List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "limit", + "description": "Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 25, + "in": "query" + }, + { + "name": "offset", + "description": "Offset the list of returned templates. Maximum offset is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + } + ] + } + }, + "\/sites\/templates\/{templateId}": { + "get": { + "summary": "Get site template", + "operationId": "sitesGetTemplate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "responses": { + "200": { + "description": "Template Site", + "schema": { + "$ref": "#\/definitions\/templateSite" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTemplate", + "group": "templates", + "weight": 492, + "cookies": false, + "type": "", + "demo": "sites\/get-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Template ID.", + "required": true, + "type": "string", + "x-example": "<TEMPLATE_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/usage": { + "get": { + "summary": "Get sites usage", + "operationId": "sitesListUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageSites", + "schema": { + "$ref": "#\/definitions\/usageSites" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 493, + "cookies": false, + "type": "", + "demo": "sites\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}": { + "get": { + "summary": "Get site", + "operationId": "sitesGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "sites", + "weight": 468, + "cookies": false, + "type": "", + "demo": "sites\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update site", + "operationId": "sitesUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "sites", + "weight": 470, + "cookies": false, + "type": "", + "demo": "sites\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "default": null, + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "default": 30, + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "default": "", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "default": "", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "default": "", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "default": "", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "default": "", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "default": "", + "x-example": "<FALLBACK_FILE>" + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "name", + "framework" + ] + } + } + ] + }, + "delete": { + "summary": "Delete site", + "operationId": "sitesDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a site by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "sites", + "weight": 471, + "cookies": false, + "type": "", + "demo": "sites\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployment": { + "patch": { + "summary": "Update site's deployment", + "operationId": "sitesUpdateSiteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSiteDeployment", + "group": "sites", + "weight": 478, + "cookies": false, + "type": "", + "demo": "sites\/update-site-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "sitesListDeployments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "schema": { + "$ref": "#\/definitions\/deploymentList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 477, + "cookies": false, + "type": "", + "demo": "sites\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "sitesCreateDeployment", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 473, + "cookies": false, + "type": "upload", + "demo": "sites\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "installCommand", + "description": "Install Commands.", + "required": false, + "type": "string", + "x-example": "<INSTALL_COMMAND>", + "in": "formData" + }, + { + "name": "buildCommand", + "description": "Build Commands.", + "required": false, + "type": "string", + "x-example": "<BUILD_COMMAND>", + "in": "formData" + }, + { + "name": "outputDirectory", + "description": "Output Directory.", + "required": false, + "type": "string", + "x-example": "<OUTPUT_DIRECTORY>", + "in": "formData" + }, + { + "name": "code", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "activate", + "description": "Automatically activate the deployment when it is finished building.", + "required": true, + "type": "boolean", + "x-example": false, + "in": "formData" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "sitesCreateDuplicateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 481, + "cookies": false, + "type": "", + "demo": "sites\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "sitesCreateTemplateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 474, + "cookies": false, + "type": "", + "demo": "sites\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "default": null, + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "default": null, + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to site code in the template repo.", + "default": null, + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the site template.", + "default": null, + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "sitesCreateVcsDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 475, + "cookies": false, + "type": "", + "demo": "sites\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "default": null, + "x-example": "branch", + "enum": [ + "branch", + "commit", + "tag" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "default": null, + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "sitesGetDeployment", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 476, + "cookies": false, + "type": "", + "demo": "sites\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "sitesDeleteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a site deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 479, + "cookies": false, + "type": "", + "demo": "sites\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "sitesGetDeploymentDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "sites" + ], + "description": "Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 480, + "cookies": false, + "type": "location", + "demo": "sites\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source", + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "sitesUpdateDeploymentStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 482, + "cookies": false, + "type": "", + "demo": "sites\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all site logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 484, + "cookies": false, + "type": "", + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site request log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getLog", + "group": "logs", + "weight": 483, + "cookies": false, + "type": "", + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "<LOG_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Delete a site log by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteLog", + "group": "logs", + "weight": 485, + "cookies": false, + "type": "", + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "<LOG_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/usage": { + "get": { + "summary": "Get site usage", + "operationId": "sitesGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageSite", + "schema": { + "$ref": "#\/definitions\/usageSite" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 494, + "cookies": false, + "type": "", + "demo": "sites\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "sitesListVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all variables of a specific site.", + "responses": { + "200": { + "description": "Variables List", + "schema": { + "$ref": "#\/definitions\/variableList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 488, + "cookies": false, + "type": "", + "demo": "sites\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "sitesCreateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "responses": { + "201": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 486, + "cookies": false, + "type": "", + "demo": "sites\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "default": true, + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "sitesGetVariable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 487, + "cookies": false, + "type": "", + "demo": "sites\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "sitesUpdateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 489, + "cookies": false, + "type": "", + "demo": "sites\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "default": null, + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + ] + }, + "delete": { + "summary": "Delete variable", + "operationId": "sitesDeleteVariable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 490, + "cookies": false, + "type": "", + "demo": "sites\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets": { + "get": { + "summary": "List buckets", + "operationId": "storageListBuckets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Buckets List", + "schema": { + "$ref": "#\/definitions\/bucketList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listBuckets", + "group": "buckets", + "weight": 155, + "cookies": false, + "type": "", + "demo": "storage\/list-buckets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create bucket", + "operationId": "storageCreateBucket", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Create a new storage bucket.", + "responses": { + "201": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBucket", + "group": "buckets", + "weight": 154, + "cookies": false, + "type": "", + "demo": "storage\/create-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<BUCKET_ID>" + }, + "name": { + "type": "string", + "description": "Bucket name", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "default": true, + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "default": {}, + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "default": "none", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "default": true, + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "default": true, + "x-example": false + } + }, + "required": [ + "bucketId", + "name" + ] + } + } + ] + } + }, + "\/storage\/buckets\/{bucketId}": { + "get": { + "summary": "Get bucket", + "operationId": "storageGetBucket", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", + "responses": { + "200": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBucket", + "group": "buckets", + "weight": 156, + "cookies": false, + "type": "", + "demo": "storage\/get-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update bucket", + "operationId": "storageUpdateBucket", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Update a storage bucket by its unique ID.", + "responses": { + "200": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBucket", + "group": "buckets", + "weight": 157, + "cookies": false, + "type": "", + "demo": "storage\/update-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Bucket name", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "default": true, + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "default": {}, + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "default": "none", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "default": true, + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete bucket", + "operationId": "storageDeleteBucket", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "storage" + ], + "description": "Delete a storage bucket by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteBucket", + "group": "buckets", + "weight": 158, + "cookies": false, + "type": "", + "demo": "storage\/delete-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "schema": { + "$ref": "#\/definitions\/fileList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 160, + "cookies": false, + "type": "", + "demo": "storage\/list-files.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 159, + "cookies": false, + "type": "upload", + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "x-upload-id": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "formData" + }, + { + "name": "file", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "permissions", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "x-example": "[\"read(\"any\")\"]", + "in": "formData" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 161, + "cookies": false, + "type": "", + "demo": "storage\/get-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 166, + "cookies": false, + "type": "", + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 167, + "cookies": false, + "type": "", + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 163, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 162, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-preview.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center", + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "type": "string", + "default": "", + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "type": "number", + "format": "float", + "x-example": 0, + "default": 1, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0, + "in": "query" + }, + { + "name": "background", + "description": "Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.", + "required": false, + "type": "string", + "default": "", + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "type": "string", + "x-example": "jpg", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "", + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 164, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-view.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/usage": { + "get": { + "summary": "Get storage usage stats", + "operationId": "storageGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "StorageUsage", + "schema": { + "$ref": "#\/definitions\/usageStorage" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 168, + "cookies": false, + "type": "", + "demo": "storage\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/storage\/{bucketId}\/usage": { + "get": { + "summary": "Get bucket usage stats", + "operationId": "storageGetBucketUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "UsageBuckets", + "schema": { + "$ref": "#\/definitions\/usageBuckets" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBucketUsage", + "group": null, + "weight": 169, + "cookies": false, + "type": "", + "demo": "storage\/get-bucket-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/tablesdb": { + "get": { + "summary": "List databases", + "operationId": "tablesDBList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "schema": { + "$ref": "#\/definitions\/databaseList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "tablesdb", + "weight": 376, + "cookies": false, + "type": "", + "demo": "tablesdb\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "tablesDBCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "tablesdb", + "weight": 372, + "cookies": false, + "type": "", + "demo": "tablesdb\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + ] + } + }, + "\/tablesdb\/usage": { + "get": { + "summary": "Get TablesDB usage stats", + "operationId": "tablesDBListUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabases", + "schema": { + "$ref": "#\/definitions\/usageDatabases" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 378, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "methods": [ + { + "name": "listUsage", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "range" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/usageDatabases" + } + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "tablesdb\/list-usage.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "tablesDBGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tablesdb", + "weight": 373, + "cookies": false, + "type": "", + "demo": "tablesdb\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "tablesDBUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tablesdb", + "weight": 374, + "cookies": false, + "type": "", + "demo": "tablesdb\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete database", + "operationId": "tablesDBDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tablesdb", + "weight": 375, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables": { + "get": { + "summary": "List tables", + "operationId": "tablesDBListTables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Tables List", + "schema": { + "$ref": "#\/definitions\/tableList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTables", + "group": "tables", + "weight": 383, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-tables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-tables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create table", + "operationId": "tablesDBCreateTable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTable", + "group": "tables", + "weight": 379, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "tableId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TABLE_ID>" + }, + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "tableId", + "name" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}": { + "get": { + "summary": "Get table", + "operationId": "tablesDBGetTable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.", + "responses": { + "200": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTable", + "group": "tables", + "weight": 380, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update table", + "operationId": "tablesDBUpdateTable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a table by its unique ID.", + "responses": { + "200": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTable", + "group": "tables", + "weight": 381, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete table", + "operationId": "tablesDBDeleteTable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a table by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTable", + "group": "tables", + "weight": 382, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns": { + "get": { + "summary": "List columns", + "operationId": "tablesDBListColumns", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "List columns in the table.", + "responses": { + "200": { + "description": "Columns List", + "schema": { + "$ref": "#\/definitions\/columnList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listColumns", + "group": "columns", + "weight": 388, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-columns.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-columns.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean": { + "post": { + "summary": "Create boolean column", + "operationId": "tablesDBCreateBooleanColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a boolean column.\n", + "responses": { + "202": { + "description": "ColumnBoolean", + "schema": { + "$ref": "#\/definitions\/columnBoolean" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBooleanColumn", + "group": "columns", + "weight": 389, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean\/{key}": { + "patch": { + "summary": "Update boolean column", + "operationId": "tablesDBUpdateBooleanColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a boolean column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnBoolean", + "schema": { + "$ref": "#\/definitions\/columnBoolean" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBooleanColumn", + "group": "columns", + "weight": 390, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime": { + "post": { + "summary": "Create datetime column", + "operationId": "tablesDBCreateDatetimeColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a date time column according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "ColumnDatetime", + "schema": { + "$ref": "#\/definitions\/columnDatetime" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDatetimeColumn", + "group": "columns", + "weight": 391, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime column", + "operationId": "tablesDBUpdateDatetimeColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a date time column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnDatetime", + "schema": { + "$ref": "#\/definitions\/columnDatetime" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDatetimeColumn", + "group": "columns", + "weight": 392, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email": { + "post": { + "summary": "Create email column", + "operationId": "tablesDBCreateEmailColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an email column.\n", + "responses": { + "202": { + "description": "ColumnEmail", + "schema": { + "$ref": "#\/definitions\/columnEmail" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailColumn", + "group": "columns", + "weight": 393, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email\/{key}": { + "patch": { + "summary": "Update email column", + "operationId": "tablesDBUpdateEmailColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an email column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEmail", + "schema": { + "$ref": "#\/definitions\/columnEmail" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailColumn", + "group": "columns", + "weight": 394, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum": { + "post": { + "summary": "Create enum column", + "operationId": "tablesDBCreateEnumColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column.", + "responses": { + "202": { + "description": "ColumnEnum", + "schema": { + "$ref": "#\/definitions\/columnEnum" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEnumColumn", + "group": "columns", + "weight": 395, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum\/{key}": { + "patch": { + "summary": "Update enum column", + "operationId": "tablesDBUpdateEnumColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an enum column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEnum", + "schema": { + "$ref": "#\/definitions\/columnEnum" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEnumColumn", + "group": "columns", + "weight": 396, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float": { + "post": { + "summary": "Create float column", + "operationId": "tablesDBCreateFloatColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a float column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnFloat", + "schema": { + "$ref": "#\/definitions\/columnFloat" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFloatColumn", + "group": "columns", + "weight": 397, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float\/{key}": { + "patch": { + "summary": "Update float column", + "operationId": "tablesDBUpdateFloatColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a float column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnFloat", + "schema": { + "$ref": "#\/definitions\/columnFloat" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFloatColumn", + "group": "columns", + "weight": 398, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer": { + "post": { + "summary": "Create integer column", + "operationId": "tablesDBCreateIntegerColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an integer column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnInteger", + "schema": { + "$ref": "#\/definitions\/columnInteger" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIntegerColumn", + "group": "columns", + "weight": 399, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer\/{key}": { + "patch": { + "summary": "Update integer column", + "operationId": "tablesDBUpdateIntegerColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an integer column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnInteger", + "schema": { + "$ref": "#\/definitions\/columnInteger" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIntegerColumn", + "group": "columns", + "weight": 400, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip": { + "post": { + "summary": "Create IP address column", + "operationId": "tablesDBCreateIpColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create IP address column.\n", + "responses": { + "202": { + "description": "ColumnIP", + "schema": { + "$ref": "#\/definitions\/columnIp" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIpColumn", + "group": "columns", + "weight": 401, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip\/{key}": { + "patch": { + "summary": "Update IP address column", + "operationId": "tablesDBUpdateIpColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an ip column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnIP", + "schema": { + "$ref": "#\/definitions\/columnIp" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIpColumn", + "group": "columns", + "weight": 402, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line column.", + "responses": { + "202": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 403, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 404, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point column.", + "responses": { + "202": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 405, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 406, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon column.", + "responses": { + "202": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 407, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { + "post": { + "summary": "Create relationship column", + "operationId": "tablesDBCreateRelationshipColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "202": { + "description": "ColumnRelationship", + "schema": { + "$ref": "#\/definitions\/columnRelationship" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRelationshipColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "relatedTableId": { + "type": "string", + "description": "Related Table ID.", + "default": null, + "x-example": "<RELATED_TABLE_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "default": null, + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "default": false, + "x-example": false + }, + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Column Key.", + "default": null, + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": "restrict", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedTableId", + "type" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string": { + "post": { + "summary": "Create string column", + "operationId": "tablesDBCreateStringColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a string column.\n", + "responses": { + "202": { + "description": "ColumnString", + "schema": { + "$ref": "#\/definitions\/columnString" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createStringColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "size": { + "type": "integer", + "description": "Column size for text columns, in number of characters.", + "default": null, + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string\/{key}": { + "patch": { + "summary": "Update string column", + "operationId": "tablesDBUpdateStringColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a string column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnString", + "schema": { + "$ref": "#\/definitions\/columnString" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStringColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string column.", + "default": null, + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url": { + "post": { + "summary": "Create URL column", + "operationId": "tablesDBCreateUrlColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a URL column.\n", + "responses": { + "202": { + "description": "ColumnURL", + "schema": { + "$ref": "#\/definitions\/columnUrl" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createUrlColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url\/{key}": { + "patch": { + "summary": "Update URL column", + "operationId": "tablesDBUpdateUrlColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an url column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnURL", + "schema": { + "$ref": "#\/definitions\/columnUrl" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateUrlColumn", + "group": "columns", + "weight": 414, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}": { + "get": { + "summary": "Get column", + "operationId": "tablesDBGetColumn", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get column by ID.", + "responses": { + "200": { + "description": "ColumnBoolean, or ColumnInteger, or ColumnFloat, or ColumnEmail, or ColumnEnum, or ColumnURL, or ColumnIP, or ColumnDatetime, or ColumnRelationship, or ColumnString", + "schema": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getColumn", + "group": "columns", + "weight": 386, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete column", + "operationId": "tablesDBDeleteColumn", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Deletes a column.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteColumn", + "group": "columns", + "weight": 387, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}\/relationship": { + "patch": { + "summary": "Update relationship column", + "operationId": "tablesDBUpdateRelationshipColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "200": { + "description": "ColumnRelationship", + "schema": { + "$ref": "#\/definitions\/columnRelationship" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRelationshipColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": null, + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "tablesDBListIndexes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "List indexes on the table.", + "responses": { + "200": { + "description": "Column Indexes List", + "schema": { + "$ref": "#\/definitions\/columnIndexList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 418, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "tablesDBCreateIndex", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Creates an index on the columns listed. Your index should include all the columns you will query in a single request.\nType can be `key`, `fulltext`, or `unique`.", + "responses": { + "202": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/columnIndex" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 415, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "default": null, + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "default": null, + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "columns": { + "type": "array", + "description": "Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "default": [], + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "columns" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "tablesDBGetIndex", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/columnIndex" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 416, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "tablesDBDeleteIndex", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 417, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/logs": { + "get": { + "summary": "List table logs", + "operationId": "tablesDBListTableLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get the table activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTableLogs", + "group": "tables", + "weight": 384, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-table-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + }, + { + "name": "createRows", + "namespace": "tablesDB", + "desc": "Create rows", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/rowList" + } + ], + "description": "Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-rows.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<ROW_ID>" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "default": [], + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + }, + "put": { + "summary": "Upsert rows", + "operationId": "tablesDBUpsertRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRows", + "group": "rows", + "weight": 424, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRows", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/rowList" + } + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "demo": "tablesdb\/upsert-rows.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "description": "Array of row data as JSON objects. May contain partial rows.", + "default": null, + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "rows" + ] + } + } + ] + }, + "patch": { + "summary": "Update rows", + "operationId": "tablesDBUpdateRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRows", + "group": "rows", + "weight": 422, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only column and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete rows", + "operationId": "tablesDBDeleteRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Bulk delete rows using queries, if no queries are passed then all rows are deleted.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRows", + "group": "rows", + "weight": 426, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-rows.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/logs": { + "get": { + "summary": "List row logs", + "operationId": "tablesDBListRowLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get the row activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRowLogs", + "group": "logs", + "weight": 428, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-row-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/usage": { + "get": { + "summary": "Get table usage stats", + "operationId": "tablesDBGetTableUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get usage metrics and statistics for a table. Returning the total number of rows. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageTable", + "schema": { + "$ref": "#\/definitions\/usageTable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTableUsage", + "group": null, + "weight": 385, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/usage": { + "get": { + "summary": "Get TablesDB usage stats", + "operationId": "tablesDBGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabase", + "schema": { + "$ref": "#\/definitions\/usageDatabase" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 377, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-database-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "methods": [ + { + "name": "getUsage", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "range" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/usageDatabase" + } + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "tablesdb\/get-usage.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "schema": { + "$ref": "#\/definitions\/teamList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 171, + "cookies": false, + "type": "", + "demo": "teams\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 170, + "cookies": false, + "type": "", + "demo": "teams\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TEAM_ID>" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": [ + "owner" + ], + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + ] + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 172, + "cookies": false, + "type": "", + "demo": "teams\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 174, + "cookies": false, + "type": "", + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 176, + "cookies": false, + "type": "", + "demo": "teams\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/logs": { + "get": { + "summary": "List team logs", + "operationId": "teamsListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get the team activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 183, + "cookies": false, + "type": "", + "demo": "teams\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { + "$ref": "#\/definitions\/membershipList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 178, + "cookies": false, + "type": "", + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 177, + "cookies": false, + "type": "", + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "default": "", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "default": "", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 179, + "cookies": false, + "type": "", + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 180, + "cookies": false, + "type": "", + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "teams" + ], + "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 182, + "cookies": false, + "type": "", + "demo": "teams\/delete-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 181, + "cookies": false, + "type": "", + "demo": "teams\/update-membership-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 173, + "cookies": false, + "type": "", + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 175, + "cookies": false, + "type": "", + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "schema": { + "$ref": "#\/definitions\/resourceTokenList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "files", + "weight": 507, + "cookies": false, + "type": "", + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFileToken", + "group": "files", + "weight": 505, + "cookies": false, + "type": "", + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + } + } + } + } + ] + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tokens", + "weight": 506, + "cookies": false, + "type": "", + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tokens", + "weight": 508, + "cookies": false, + "type": "", + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + } + } + } + } + ] + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tokens", + "weight": 509, + "cookies": false, + "type": "", + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, + "\/users": { + "get": { + "summary": "List users", + "operationId": "usersList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a list of all the project's users. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Users List", + "schema": { + "$ref": "#\/definitions\/userList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "users", + "weight": 193, + "cookies": false, + "type": "", + "demo": "users\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create user", + "operationId": "usersCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "users", + "weight": 184, + "cookies": false, + "type": "", + "demo": "users\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "Plain text user password. Must be at least 8 chars.", + "default": "", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId" + ] + } + } + ] + } + }, + "\/users\/argon2": { + "post": { + "summary": "Create user with Argon2 password", + "operationId": "usersCreateArgon2User", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createArgon2User", + "group": "users", + "weight": 187, + "cookies": false, + "type": "", + "demo": "users\/create-argon-2-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Argon2.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/bcrypt": { + "post": { + "summary": "Create user with bcrypt password", + "operationId": "usersCreateBcryptUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBcryptUser", + "group": "users", + "weight": 185, + "cookies": false, + "type": "", + "demo": "users\/create-bcrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Bcrypt.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/identities": { + "get": { + "summary": "List identities", + "operationId": "usersListIdentities", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get identities for all users.", + "responses": { + "200": { + "description": "Identities List", + "schema": { + "$ref": "#\/definitions\/identityList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 201, + "cookies": false, + "type": "", + "demo": "users\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/users\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "usersDeleteIdentity", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 224, + "cookies": false, + "type": "", + "demo": "users\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "type": "string", + "x-example": "<IDENTITY_ID>", + "in": "path" + } + ] + } + }, + "\/users\/md5": { + "post": { + "summary": "Create user with MD5 password", + "operationId": "usersCreateMD5User", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMD5User", + "group": "users", + "weight": 186, + "cookies": false, + "type": "", + "demo": "users\/create-md-5-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using MD5.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/phpass": { + "post": { + "summary": "Create user with PHPass password", + "operationId": "usersCreatePHPassUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPHPassUser", + "group": "users", + "weight": 189, + "cookies": false, + "type": "", + "demo": "users\/create-ph-pass-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using PHPass.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/scrypt": { + "post": { + "summary": "Create user with Scrypt password", + "operationId": "usersCreateScryptUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createScryptUser", + "group": "users", + "weight": 190, + "cookies": false, + "type": "", + "demo": "users\/create-scrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt.", + "default": null, + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Optional salt used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT>" + }, + "passwordCpu": { + "type": "integer", + "description": "Optional CPU cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordMemory": { + "type": "integer", + "description": "Optional memory cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordParallel": { + "type": "integer", + "description": "Optional parallelization cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordLength": { + "type": "integer", + "description": "Optional hash length used to hash password.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordCpu", + "passwordMemory", + "passwordParallel", + "passwordLength" + ] + } + } + ] + } + }, + "\/users\/scrypt-modified": { + "post": { + "summary": "Create user with Scrypt modified password", + "operationId": "usersCreateScryptModifiedUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createScryptModifiedUser", + "group": "users", + "weight": 191, + "cookies": false, + "type": "", + "demo": "users\/create-scrypt-modified-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt Modified.", + "default": null, + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Salt used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT>" + }, + "passwordSaltSeparator": { + "type": "string", + "description": "Salt separator used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT_SEPARATOR>" + }, + "passwordSignerKey": { + "type": "string", + "description": "Signer key used to hash password.", + "default": null, + "x-example": "<PASSWORD_SIGNER_KEY>" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordSaltSeparator", + "passwordSignerKey" + ] + } + } + ] + } + }, + "\/users\/sha": { + "post": { + "summary": "Create user with SHA password", + "operationId": "usersCreateSHAUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSHAUser", + "group": "users", + "weight": 188, + "cookies": false, + "type": "", + "demo": "users\/create-sha-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using SHA.", + "default": null, + "x-example": "password" + }, + "passwordVersion": { + "type": "string", + "description": "Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'", + "default": "", + "x-example": "sha1", + "enum": [ + "sha1", + "sha224", + "sha256", + "sha384", + "sha512\/224", + "sha512\/256", + "sha512", + "sha3-224", + "sha3-256", + "sha3-384", + "sha3-512" + ], + "x-enum-name": "PasswordHash", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/usage": { + "get": { + "summary": "Get users usage stats", + "operationId": "usersGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "UsageUsers", + "schema": { + "$ref": "#\/definitions\/usageUsers" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 226, + "cookies": false, + "type": "", + "demo": "users\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/users\/{userId}": { + "get": { + "summary": "Get user", + "operationId": "usersGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a user by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "users", + "weight": 194, + "cookies": false, + "type": "", + "demo": "users\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user", + "operationId": "usersDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https:\/\/appwrite.io\/docs\/server\/users#usersUpdateStatus) endpoint instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "users", + "weight": 222, + "cookies": false, + "type": "", + "demo": "users\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/email": { + "patch": { + "summary": "Update email", + "operationId": "usersUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user email by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "users", + "weight": 207, + "cookies": false, + "type": "", + "demo": "users\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + } + }, + "required": [ + "email" + ] + } + } + ] + } + }, + "\/users\/{userId}\/jwts": { + "post": { + "summary": "Create user JWT", + "operationId": "usersCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "sessions", + "weight": 225, + "cookies": false, + "type": "", + "demo": "users\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "sessionId": { + "type": "string", + "description": "Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.", + "default": "", + "x-example": "<SESSION_ID>" + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "default": 900, + "x-example": 0 + } + } + } + } + ] + } + }, + "\/users\/{userId}\/labels": { + "put": { + "summary": "Update user labels", + "operationId": "usersUpdateLabels", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLabels", + "group": "users", + "weight": 203, + "cookies": false, + "type": "", + "demo": "users\/update-labels.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "labels": { + "type": "array", + "description": "Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + ] + } + }, + "\/users\/{userId}\/logs": { + "get": { + "summary": "List user logs", + "operationId": "usersListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 199, + "cookies": false, + "type": "", + "demo": "users\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/memberships": { + "get": { + "summary": "List user memberships", + "operationId": "usersListMemberships", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user membership list by its unique ID.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { + "$ref": "#\/definitions\/membershipList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 198, + "cookies": false, + "type": "", + "demo": "users\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfa", + "group": "users", + "weight": 212, + "cookies": false, + "type": "", + "demo": "users\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + }, + "methods": [ + { + "name": "updateMfa", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + } + }, + { + "name": "updateMFA", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "default": null, + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + ] + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 217, + "cookies": false, + "type": "", + "demo": "users\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "schema": { + "$ref": "#\/definitions\/mfaFactors" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 213, + "cookies": false, + "type": "", + "demo": "users\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 214, + "cookies": false, + "type": "", + "demo": "users\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 216, + "cookies": false, + "type": "", + "demo": "users\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 215, + "cookies": false, + "type": "", + "demo": "users\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/name": { + "patch": { + "summary": "Update name", + "operationId": "usersUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user name by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "users", + "weight": 205, + "cookies": false, + "type": "", + "demo": "users\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + } + }, + "\/users\/{userId}\/password": { + "patch": { + "summary": "Update password", + "operationId": "usersUpdatePassword", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user password by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePassword", + "group": "users", + "weight": 206, + "cookies": false, + "type": "", + "demo": "users\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": null + } + }, + "required": [ + "password" + ] + } + } + ] + } + }, + "\/users\/{userId}\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "usersUpdatePhone", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user phone by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhone", + "group": "users", + "weight": 208, + "cookies": false, + "type": "", + "demo": "users\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "User phone number.", + "default": null, + "x-example": "+12065550100" + } + }, + "required": [ + "number" + ] + } + } + ] + } + }, + "\/users\/{userId}\/prefs": { + "get": { + "summary": "Get user preferences", + "operationId": "usersGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user preferences by its unique ID.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "users", + "weight": 195, + "cookies": false, + "type": "", + "demo": "users\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user preferences", + "operationId": "usersUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "users", + "weight": 210, + "cookies": false, + "type": "", + "demo": "users\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/users\/{userId}\/sessions": { + "get": { + "summary": "List user sessions", + "operationId": "usersListSessions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user sessions list by its unique ID.", + "responses": { + "200": { + "description": "Sessions List", + "schema": { + "$ref": "#\/definitions\/sessionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 197, + "cookies": false, + "type": "", + "demo": "users\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create session", + "operationId": "usersCreateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 218, + "cookies": false, + "type": "", + "demo": "users\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user sessions", + "operationId": "usersDeleteSessions", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete all user's sessions by using the user's unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 221, + "cookies": false, + "type": "", + "demo": "users\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/sessions\/{sessionId}": { + "delete": { + "summary": "Delete user session", + "operationId": "usersDeleteSession", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a user sessions by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 220, + "cookies": false, + "type": "", + "demo": "users\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "sessionId", + "description": "Session ID.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/status": { + "patch": { + "summary": "Update user status", + "operationId": "usersUpdateStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStatus", + "group": "users", + "weight": 202, + "cookies": false, + "type": "", + "demo": "users\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", + "default": null, + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + ] + } + }, + "\/users\/{userId}\/targets": { + "get": { + "summary": "List user targets", + "operationId": "usersListTargets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "List the messaging targets that are associated with a user.", + "responses": { + "200": { + "description": "Target list", + "schema": { + "$ref": "#\/definitions\/targetList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTargets", + "group": "targets", + "weight": 200, + "cookies": false, + "type": "", + "demo": "users\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create user target", + "operationId": "usersCreateTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a messaging target.", + "responses": { + "201": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTarget", + "group": "targets", + "weight": 192, + "cookies": false, + "type": "", + "demo": "users\/create-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TARGET_ID>" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "default": null, + "x-example": "email", + "enum": [ + "email", + "sms", + "push" + ], + "x-enum-name": "MessagingProviderType", + "x-enum-keys": [] + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "targetId", + "providerType", + "identifier" + ] + } + } + ] + } + }, + "\/users\/{userId}\/targets\/{targetId}": { + "get": { + "summary": "Get user target", + "operationId": "usersGetTarget", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a user's push notification target by ID.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTarget", + "group": "targets", + "weight": 196, + "cookies": false, + "type": "", + "demo": "users\/get-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user target", + "operationId": "usersUpdateTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update a messaging target.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTarget", + "group": "targets", + "weight": 211, + "cookies": false, + "type": "", + "demo": "users\/update-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": "", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "default": "", + "x-example": "<NAME>" + } + } + } + } + ] + }, + "delete": { + "summary": "Delete user target", + "operationId": "usersDeleteTarget", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a messaging target.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTarget", + "group": "targets", + "weight": 223, + "cookies": false, + "type": "", + "demo": "users\/delete-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/tokens": { + "post": { + "summary": "Create token", + "operationId": "usersCreateToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createToken", + "group": "sessions", + "weight": 219, + "cookies": false, + "type": "", + "demo": "users\/create-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "length": { + "type": "integer", + "description": "Token length in characters. The default length is 6 characters", + "default": 6, + "x-example": 4 + }, + "expire": { + "type": "integer", + "description": "Token expiration period in seconds. The default expiration is 15 minutes.", + "default": 900, + "x-example": 60 + } + } + } + } + ] + } + }, + "\/users\/{userId}\/verification": { + "patch": { + "summary": "Update email verification", + "operationId": "usersUpdateEmailVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user email verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailVerification", + "group": "users", + "weight": 209, + "cookies": false, + "type": "", + "demo": "users\/update-email-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "emailVerification": { + "type": "boolean", + "description": "User email verification status.", + "default": null, + "x-example": false + } + }, + "required": [ + "emailVerification" + ] + } + } + ] + } + }, + "\/users\/{userId}\/verification\/phone": { + "patch": { + "summary": "Update phone verification", + "operationId": "usersUpdatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user phone verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "users", + "weight": 204, + "cookies": false, + "type": "", + "demo": "users\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "phoneVerification": { + "type": "boolean", + "description": "User phone verification status.", + "default": null, + "x-example": false + } + }, + "required": [ + "phoneVerification" + ] + } + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/detections": { + "post": { + "summary": "Create repository detection", + "operationId": "vcsCreateRepositoryDetection", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", + "responses": { + "200": { + "description": "DetectionFramework", + "schema": { + "$ref": "#\/definitions\/detectionFramework" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRepositoryDetection", + "group": "repositories", + "weight": 230, + "cookies": false, + "type": "", + "demo": "vcs\/create-repository-detection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository-detection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerRepositoryId": { + "type": "string", + "description": "Repository Id", + "default": null, + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "type": { + "type": "string", + "description": "Detector type. Must be one of the following: runtime, framework", + "default": null, + "x-example": "runtime", + "enum": [ + "runtime", + "framework" + ], + "x-enum-name": "VCSDetectionType", + "x-enum-keys": [] + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to Root Directory", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + } + }, + "required": [ + "providerRepositoryId", + "type" + ] + } + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories": { + "get": { + "summary": "List repositories", + "operationId": "vcsListRepositories", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.", + "responses": { + "200": { + "description": "Framework Provider Repositories List", + "schema": { + "$ref": "#\/definitions\/providerRepositoryFrameworkList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRepositories", + "group": "repositories", + "weight": 231, + "cookies": false, + "type": "", + "demo": "vcs\/list-repositories.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repositories.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Detector type. Must be one of the following: runtime, framework", + "required": true, + "type": "string", + "x-example": "runtime", + "enum": [ + "runtime", + "framework" + ], + "x-enum-name": "VCSDetectionType", + "x-enum-keys": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create repository", + "operationId": "vcsCreateRepository", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation.", + "responses": { + "200": { + "description": "ProviderRepository", + "schema": { + "$ref": "#\/definitions\/providerRepository" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRepository", + "group": "repositories", + "weight": 232, + "cookies": false, + "type": "", + "demo": "vcs\/create-repository.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name (slug)", + "default": null, + "x-example": "<NAME>" + }, + "private": { + "type": "boolean", + "description": "Mark repository public or private", + "default": null, + "x-example": false + } + }, + "required": [ + "name", + "private" + ] + } + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}": { + "get": { + "summary": "Get repository", + "operationId": "vcsGetRepository", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.", + "responses": { + "200": { + "description": "ProviderRepository", + "schema": { + "$ref": "#\/definitions\/providerRepository" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRepository", + "group": "repositories", + "weight": 233, + "cookies": false, + "type": "", + "demo": "vcs\/get-repository.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>", + "in": "path" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}\/branches": { + "get": { + "summary": "List repository branches", + "operationId": "vcsListRepositoryBranches", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.\n", + "responses": { + "200": { + "description": "Branches List", + "schema": { + "$ref": "#\/definitions\/branchList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRepositoryBranches", + "group": "repositories", + "weight": 234, + "cookies": false, + "type": "", + "demo": "vcs\/list-repository-branches.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repository-branches.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>", + "in": "path" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}\/contents": { + "get": { + "summary": "Get files and directories of a VCS repository", + "operationId": "vcsGetRepositoryContents", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", + "responses": { + "200": { + "description": "VCS Content List", + "schema": { + "$ref": "#\/definitions\/vcsContentList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRepositoryContents", + "group": "repositories", + "weight": 229, + "cookies": false, + "type": "", + "demo": "vcs\/get-repository-contents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository-contents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>", + "in": "path" + }, + { + "name": "providerRootDirectory", + "description": "Path to get contents of nested directory", + "required": false, + "type": "string", + "x-example": "<PROVIDER_ROOT_DIRECTORY>", + "default": "", + "in": "query" + }, + { + "name": "providerReference", + "description": "Git reference (branch, tag, commit) to get contents from", + "required": false, + "type": "string", + "x-example": "<PROVIDER_REFERENCE>", + "default": "", + "in": "query" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/repositories\/{repositoryId}": { + "patch": { + "summary": "Update external deployment (authorize)", + "operationId": "vcsUpdateExternalDeployments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateExternalDeployments", + "group": "repositories", + "weight": 239, + "cookies": false, + "type": "", + "demo": "vcs\/update-external-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/update-external-deployments.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "repositoryId", + "description": "VCS Repository Id", + "required": true, + "type": "string", + "x-example": "<REPOSITORY_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerPullRequestId": { + "type": "string", + "description": "GitHub Pull Request Id", + "default": null, + "x-example": "<PROVIDER_PULL_REQUEST_ID>" + } + }, + "required": [ + "providerPullRequestId" + ] + } + } + ] + } + }, + "\/vcs\/installations": { + "get": { + "summary": "List installations", + "operationId": "vcsListInstallations", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details.\n", + "responses": { + "200": { + "description": "Installations List", + "schema": { + "$ref": "#\/definitions\/installationList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listInstallations", + "group": "installations", + "weight": 236, + "cookies": false, + "type": "", + "demo": "vcs\/list-installations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-installations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: provider, organization", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/vcs\/installations\/{installationId}": { + "get": { + "summary": "Get installation", + "operationId": "vcsGetInstallation", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Get a VCS installation by its unique ID. This endpoint returns the installation's details including its provider, organization, and configuration. ", + "responses": { + "200": { + "description": "Installation", + "schema": { + "$ref": "#\/definitions\/installation" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getInstallation", + "group": "installations", + "weight": 237, + "cookies": false, + "type": "", + "demo": "vcs\/get-installation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-installation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete installation", + "operationId": "vcsDeleteInstallation", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "vcs" + ], + "description": "Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteInstallation", + "group": "installations", + "weight": 238, + "cookies": false, + "type": "", + "demo": "vcs\/delete-installation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/delete-installation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + } + ] + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "definitions": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true, + "example": [] + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "type": "object", + "$ref": "#\/definitions\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ], + "example": { + "total": 5, + "documents": "" + } + }, + "tableList": { + "description": "Tables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tables": { + "type": "array", + "description": "List of tables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/table" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tables" + ], + "example": { + "total": 5, + "tables": "" + } + }, + "collectionList": { + "description": "Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections that matched your query.", + "x-example": 5, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "type": "object", + "$ref": "#\/definitions\/collection" + }, + "x-example": "" + } + }, + "required": [ + "total", + "collections" + ], + "example": { + "total": 5, + "collections": "" + } + }, + "databaseList": { + "description": "Databases List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of databases that matched your query.", + "x-example": 5, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "List of databases.", + "items": { + "type": "object", + "$ref": "#\/definitions\/database" + }, + "x-example": "" + } + }, + "required": [ + "total", + "databases" + ], + "example": { + "total": 5, + "databases": "" + } + }, + "indexList": { + "description": "Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/index" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "columnIndexList": { + "description": "Column Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/columnIndex" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "userList": { + "description": "Users List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of users that matched your query.", + "x-example": 5, + "format": "int32" + }, + "users": { + "type": "array", + "description": "List of users.", + "items": { + "type": "object", + "$ref": "#\/definitions\/user" + }, + "x-example": "" + } + }, + "required": [ + "total", + "users" + ], + "example": { + "total": 5, + "users": "" + } + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ], + "example": { + "total": 5, + "sessions": "" + } + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "type": "object", + "$ref": "#\/definitions\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ], + "example": { + "total": 5, + "identities": "" + } + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "type": "object", + "$ref": "#\/definitions\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ], + "example": { + "total": 5, + "logs": "" + } + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "type": "object", + "$ref": "#\/definitions\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ], + "example": { + "total": 5, + "files": "" + } + }, + "bucketList": { + "description": "Buckets List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of buckets that matched your query.", + "x-example": 5, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "List of buckets.", + "items": { + "type": "object", + "$ref": "#\/definitions\/bucket" + }, + "x-example": "" + } + }, + "required": [ + "total", + "buckets" + ], + "example": { + "total": 5, + "buckets": "" + } + }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "type": "object", + "$ref": "#\/definitions\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ], + "example": { + "total": 5, + "tokens": "" + } + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "type": "object", + "$ref": "#\/definitions\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ], + "example": { + "total": 5, + "teams": "" + } + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "type": "object", + "$ref": "#\/definitions\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ], + "example": { + "total": 5, + "memberships": "" + } + }, + "siteList": { + "description": "Sites List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sites that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "List of sites.", + "items": { + "type": "object", + "$ref": "#\/definitions\/site" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sites" + ], + "example": { + "total": 5, + "sites": "" + } + }, + "templateSiteList": { + "description": "Site Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates that matched your query.", + "x-example": 5, + "format": "int32" + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateSite" + }, + "x-example": "" + } + }, + "required": [ + "total", + "templates" + ], + "example": { + "total": 5, + "templates": "" + } + }, + "functionList": { + "description": "Functions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of functions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "List of functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/function" + }, + "x-example": "" + } + }, + "required": [ + "total", + "functions" + ], + "example": { + "total": 5, + "functions": "" + } + }, + "templateFunctionList": { + "description": "Function Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates that matched your query.", + "x-example": 5, + "format": "int32" + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateFunction" + }, + "x-example": "" + } + }, + "required": [ + "total", + "templates" + ], + "example": { + "total": 5, + "templates": "" + } + }, + "installationList": { + "description": "Installations List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of installations that matched your query.", + "x-example": 5, + "format": "int32" + }, + "installations": { + "type": "array", + "description": "List of installations.", + "items": { + "type": "object", + "$ref": "#\/definitions\/installation" + }, + "x-example": "" + } + }, + "required": [ + "total", + "installations" + ], + "example": { + "total": 5, + "installations": "" + } + }, + "providerRepositoryFrameworkList": { + "description": "Framework Provider Repositories List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworkProviderRepositories that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworkProviderRepositories": { + "type": "array", + "description": "List of frameworkProviderRepositories.", + "items": { + "type": "object", + "$ref": "#\/definitions\/providerRepositoryFramework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworkProviderRepositories" + ], + "example": { + "total": 5, + "frameworkProviderRepositories": "" + } + }, + "providerRepositoryRuntimeList": { + "description": "Runtime Provider Repositories List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimeProviderRepositories that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimeProviderRepositories": { + "type": "array", + "description": "List of runtimeProviderRepositories.", + "items": { + "type": "object", + "$ref": "#\/definitions\/providerRepositoryRuntime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimeProviderRepositories" + ], + "example": { + "total": 5, + "runtimeProviderRepositories": "" + } + }, + "branchList": { + "description": "Branches List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of branches that matched your query.", + "x-example": 5, + "format": "int32" + }, + "branches": { + "type": "array", + "description": "List of branches.", + "items": { + "type": "object", + "$ref": "#\/definitions\/branch" + }, + "x-example": "" + } + }, + "required": [ + "total", + "branches" + ], + "example": { + "total": 5, + "branches": "" + } + }, + "frameworkList": { + "description": "Frameworks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworks that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks.", + "items": { + "type": "object", + "$ref": "#\/definitions\/framework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworks" + ], + "example": { + "total": 5, + "frameworks": "" + } + }, + "runtimeList": { + "description": "Runtimes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/runtime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimes" + ], + "example": { + "total": 5, + "runtimes": "" + } + }, + "deploymentList": { + "description": "Deployments List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of deployments that matched your query.", + "x-example": 5, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "List of deployments.", + "items": { + "type": "object", + "$ref": "#\/definitions\/deployment" + }, + "x-example": "" + } + }, + "required": [ + "total", + "deployments" + ], + "example": { + "total": 5, + "deployments": "" + } + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ], + "example": { + "total": 5, + "executions": "" + } + }, + "projectList": { + "description": "Projects List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of projects that matched your query.", + "x-example": 5, + "format": "int32" + }, + "projects": { + "type": "array", + "description": "List of projects.", + "items": { + "type": "object", + "$ref": "#\/definitions\/project" + }, + "x-example": "" + } + }, + "required": [ + "total", + "projects" + ], + "example": { + "total": 5, + "projects": "" + } + }, + "webhookList": { + "description": "Webhooks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of webhooks that matched your query.", + "x-example": 5, + "format": "int32" + }, + "webhooks": { + "type": "array", + "description": "List of webhooks.", + "items": { + "type": "object", + "$ref": "#\/definitions\/webhook" + }, + "x-example": "" + } + }, + "required": [ + "total", + "webhooks" + ], + "example": { + "total": 5, + "webhooks": "" + } + }, + "keyList": { + "description": "API Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of keys that matched your query.", + "x-example": 5, + "format": "int32" + }, + "keys": { + "type": "array", + "description": "List of keys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/key" + }, + "x-example": "" + } + }, + "required": [ + "total", + "keys" + ], + "example": { + "total": 5, + "keys": "" + } + }, + "devKeyList": { + "description": "Dev Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of devKeys that matched your query.", + "x-example": 5, + "format": "int32" + }, + "devKeys": { + "type": "array", + "description": "List of devKeys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/devKey" + }, + "x-example": "" + } + }, + "required": [ + "total", + "devKeys" + ], + "example": { + "total": 5, + "devKeys": "" + } + }, + "platformList": { + "description": "Platforms List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of platforms that matched your query.", + "x-example": 5, + "format": "int32" + }, + "platforms": { + "type": "array", + "description": "List of platforms.", + "items": { + "type": "object", + "$ref": "#\/definitions\/platform" + }, + "x-example": "" + } + }, + "required": [ + "total", + "platforms" + ], + "example": { + "total": 5, + "platforms": "" + } + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "type": "object", + "$ref": "#\/definitions\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ], + "example": { + "total": 5, + "countries": "" + } + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ], + "example": { + "total": 5, + "continents": "" + } + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "type": "object", + "$ref": "#\/definitions\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ], + "example": { + "total": 5, + "languages": "" + } + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "type": "object", + "$ref": "#\/definitions\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ], + "example": { + "total": 5, + "currencies": "" + } + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "type": "object", + "$ref": "#\/definitions\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ], + "example": { + "total": 5, + "phones": "" + } + }, + "variableList": { + "description": "Variables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of variables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "variables": { + "type": "array", + "description": "List of variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": "" + } + }, + "required": [ + "total", + "variables" + ], + "example": { + "total": 5, + "variables": "" + } + }, + "proxyRuleList": { + "description": "Rule List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rules that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rules": { + "type": "array", + "description": "List of rules.", + "items": { + "type": "object", + "$ref": "#\/definitions\/proxyRule" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rules" + ], + "example": { + "total": 5, + "rules": "" + } + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ], + "example": { + "total": 5, + "localeCodes": "" + } + }, + "providerList": { + "description": "Provider list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of providers that matched your query.", + "x-example": 5, + "format": "int32" + }, + "providers": { + "type": "array", + "description": "List of providers.", + "items": { + "type": "object", + "$ref": "#\/definitions\/provider" + }, + "x-example": "" + } + }, + "required": [ + "total", + "providers" + ], + "example": { + "total": 5, + "providers": "" + } + }, + "messageList": { + "description": "Message list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of messages that matched your query.", + "x-example": 5, + "format": "int32" + }, + "messages": { + "type": "array", + "description": "List of messages.", + "items": { + "type": "object", + "$ref": "#\/definitions\/message" + }, + "x-example": "" + } + }, + "required": [ + "total", + "messages" + ], + "example": { + "total": 5, + "messages": "" + } + }, + "topicList": { + "description": "Topic list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of topics that matched your query.", + "x-example": 5, + "format": "int32" + }, + "topics": { + "type": "array", + "description": "List of topics.", + "items": { + "type": "object", + "$ref": "#\/definitions\/topic" + }, + "x-example": "" + } + }, + "required": [ + "total", + "topics" + ], + "example": { + "total": 5, + "topics": "" + } + }, + "subscriberList": { + "description": "Subscriber list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of subscribers that matched your query.", + "x-example": 5, + "format": "int32" + }, + "subscribers": { + "type": "array", + "description": "List of subscribers.", + "items": { + "type": "object", + "$ref": "#\/definitions\/subscriber" + }, + "x-example": "" + } + }, + "required": [ + "total", + "subscribers" + ], + "example": { + "total": 5, + "subscribers": "" + } + }, + "targetList": { + "description": "Target list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of targets that matched your query.", + "x-example": 5, + "format": "int32" + }, + "targets": { + "type": "array", + "description": "List of targets.", + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + }, + "x-example": "" + } + }, + "required": [ + "total", + "targets" + ], + "example": { + "total": 5, + "targets": "" + } + }, + "migrationList": { + "description": "Migrations List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of migrations that matched your query.", + "x-example": 5, + "format": "int32" + }, + "migrations": { + "type": "array", + "description": "List of migrations.", + "items": { + "type": "object", + "$ref": "#\/definitions\/migration" + }, + "x-example": "" + } + }, + "required": [ + "total", + "migrations" + ], + "example": { + "total": 5, + "migrations": "" + } + }, + "specificationList": { + "description": "Specifications List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of specifications that matched your query.", + "x-example": 5, + "format": "int32" + }, + "specifications": { + "type": "array", + "description": "List of specifications.", + "items": { + "type": "object", + "$ref": "#\/definitions\/specification" + }, + "x-example": "" + } + }, + "required": [ + "total", + "specifications" + ], + "example": { + "total": 5, + "specifications": "" + } + }, + "vcsContentList": { + "description": "VCS Content List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of contents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "contents": { + "type": "array", + "description": "List of contents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/vcsContent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "contents" + ], + "example": { + "total": 5, + "contents": "" + } + }, + "database": { + "description": "Database", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Database name.", + "x-example": "My Database" + }, + "$createdAt": { + "type": "string", + "description": "Database creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Database update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "enabled": { + "type": "boolean", + "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "type": { + "type": "string", + "description": "Database type.", + "x-example": "legacy" + } + }, + "required": [ + "$id", + "name", + "$createdAt", + "$updatedAt", + "enabled", + "type" + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false, + "type": "legacy" + } + }, + "collection": { + "description": "Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "x-example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/index" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } + }, + "attributeList": { + "description": "Attributes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of attributes in the given collection.", + "x-example": 5, + "format": "int32" + }, + "attributes": { + "type": "array", + "description": "List of attributes.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "attributes" + ], + "example": { + "total": 5, + "attributes": "" + } + }, + "attributeString": { + "description": "AttributeString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default", + "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "attributeInteger": { + "description": "AttributeInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "x-nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 10, + "format": "int32", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "attributeFloat": { + "description": "AttributeFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "x-nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "x-nullable": true + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 2.5, + "format": "double", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "attributeBoolean": { + "description": "AttributeBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "attributeEmail": { + "description": "AttributeEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default@example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "attributeEnum": { + "description": "AttributeEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "element", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "attributeIp": { + "description": "AttributeIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "192.0.2.0", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "attributeUrl": { + "description": "AttributeURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "http:\/\/example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } + }, + "attributeDatetime": { + "description": "AttributeDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "attributeRelationship": { + "description": "AttributeRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedCollection": { + "type": "string", + "description": "The ID of the related collection.", + "x-example": "collection" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedCollection", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + 0, + 0 + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "table": { + "description": "Table", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Table creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Table update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Table permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Table name.", + "x-example": "My Table" + }, + "enabled": { + "type": "boolean", + "description": "Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "rowSecurity": { + "type": "boolean", + "description": "Whether row-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "columns": { + "type": "array", + "description": "Table columns.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Table indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/columnIndex" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "rowSecurity", + "columns", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Table", + "enabled": false, + "rowSecurity": true, + "columns": {}, + "indexes": {} + } + }, + "columnList": { + "description": "Columns List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of columns in the given table.", + "x-example": 5, + "format": "int32" + }, + "columns": { + "type": "array", + "description": "List of columns.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "columns" + ], + "example": { + "total": 5, + "columns": "" + } + }, + "columnString": { + "description": "ColumnString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default", + "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnInteger": { + "description": "ColumnInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "x-nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 10, + "format": "int32", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnFloat": { + "description": "ColumnFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "x-nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "x-nullable": true + }, + "default": { + "type": "number", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 2.5, + "format": "double", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "columnBoolean": { + "description": "ColumnBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "columnEmail": { + "description": "ColumnEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default@example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "columnEnum": { + "description": "ColumnEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "element", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "columnIp": { + "description": "ColumnIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "192.0.2.0", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "columnUrl": { + "description": "ColumnURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "https:\/\/example.com" + } + }, + "columnDatetime": { + "description": "ColumnDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "columnRelationship": { + "description": "ColumnRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedTable": { + "type": "string", + "description": "The ID of the related table.", + "x-example": "table" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedTable", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedTable": "table", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + 0, + 0 + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "index": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "attributes": { + "type": "array", + "description": "Index attributes.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index attributes length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "attributes", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [] + } + }, + "columnIndex": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "columns": { + "type": "array", + "description": "Index columns.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index columns length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "columns", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "columns": [], + "lengths": [], + "orders": [] + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "x-nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "x-nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/algoArgon2" + }, + { + "$ref": "#\/definitions\/algoScrypt" + }, + { + "$ref": "#\/definitions\/algoScryptModified" + }, + { + "$ref": "#\/definitions\/algoBcrypt" + }, + { + "$ref": "#\/definitions\/algoPhpass" + }, + { + "$ref": "#\/definitions\/algoSha" + }, + { + "$ref": "#\/definitions\/algoMd5" + } + ] + }, + "x-nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ], + "example": { + "type": "md5" + } + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ], + "example": { + "type": "sha" + } + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ], + "example": { + "type": "phpass" + } + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ], + "example": { + "type": "bcrypt" + } + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "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.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "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.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ], + "example": { + "code": "en-us", + "name": "US" + } + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } + }, + "bucket": { + "description": "Bucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Bucket creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Bucket update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Bucket permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "fileSecurity": { + "type": "boolean", + "description": "Whether file-level security is enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "name": { + "type": "string", + "description": "Bucket name.", + "x-example": "Documents" + }, + "enabled": { + "type": "boolean", + "description": "Bucket enabled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size supported.", + "x-example": 100, + "format": "int32" + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions.", + "items": { + "type": "string" + }, + "x-example": [ + "jpg", + "png" + ] + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" + }, + "encryption": { + "type": "boolean", + "description": "Bucket is encrypted.", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Virus scanning is enabled.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "fileSecurity", + "name", + "enabled", + "maximumFileSize", + "allowedFileExtensions", + "compression", + "encryption", + "antivirus" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } + }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "files" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceType", + "expire", + "secret", + "accessedAt" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } + }, + "site": { + "description": "Site", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Site ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Site creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Site update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Site name.", + "x-example": "My Site" + }, + "enabled": { + "type": "boolean", + "description": "Site enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "framework": { + "type": "string", + "description": "Site framework.", + "x-example": "react" + }, + "deploymentId": { + "type": "string", + "description": "Site's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "deploymentScreenshotLight": { + "type": "string", + "description": "Screenshot of active deployment with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentScreenshotDark": { + "type": "string", + "description": "Screenshot of active deployment with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentId": { + "type": "string", + "description": "Site's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "vars": { + "type": "array", + "description": "Site variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": [] + }, + "timeout": { + "type": "integer", + "description": "Site request timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the site dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the site.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The directory where the site build output is located.", + "x-example": "build" + }, + "installationId": { + "type": "string", + "description": "Site VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": "sites\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + }, + "buildRuntime": { + "type": "string", + "description": "Site build runtime.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework adapter.", + "x-example": "static" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "enabled", + "live", + "logging", + "framework", + "deploymentId", + "deploymentCreatedAt", + "deploymentScreenshotLight", + "deploymentScreenshotDark", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "vars", + "timeout", + "installCommand", + "buildCommand", + "outputDirectory", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification", + "buildRuntime", + "adapter", + "fallbackFile" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } + }, + "templateSite": { + "description": "Template Site", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Site Template ID.", + "x-example": "starter" + }, + "name": { + "type": "string", + "description": "Site Template Name.", + "x-example": "Starter site" + }, + "tagline": { + "type": "string", + "description": "Short description of template", + "x-example": "Minimal web app integrating with Appwrite." + }, + "demoUrl": { + "type": "string", + "description": "URL hosting a template demo.", + "x-example": "https:\/\/nextjs-starter.appwrite.network\/" + }, + "screenshotDark": { + "type": "string", + "description": "File URL with preview screenshot in dark theme preference.", + "x-example": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png" + }, + "screenshotLight": { + "type": "string", + "description": "File URL with preview screenshot in light theme preference.", + "x-example": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png" + }, + "useCases": { + "type": "array", + "description": "Site use cases.", + "items": { + "type": "string" + }, + "x-example": "Starter" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks that can be used with this template.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateFramework" + }, + "x-example": [] + }, + "vcsProvider": { + "type": "string", + "description": "VCS (Version Control System) Provider.", + "x-example": "github" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "templates" + }, + "providerOwner": { + "type": "string", + "description": "VCS (Version Control System) Owner.", + "x-example": "appwrite" + }, + "providerVersion": { + "type": "string", + "description": "VCS (Version Control System) branch version (tag).", + "x-example": "main" + }, + "variables": { + "type": "array", + "description": "Site variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateVariable" + }, + "x-example": [] + } + }, + "required": [ + "key", + "name", + "tagline", + "demoUrl", + "screenshotDark", + "screenshotLight", + "useCases", + "frameworks", + "vcsProvider", + "providerRepositoryId", + "providerOwner", + "providerVersion", + "variables" + ], + "example": { + "key": "starter", + "name": "Starter site", + "tagline": "Minimal web app integrating with Appwrite.", + "demoUrl": "https:\/\/nextjs-starter.appwrite.network\/", + "screenshotDark": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png", + "screenshotLight": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png", + "useCases": "Starter", + "frameworks": [], + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [] + } + }, + "templateFramework": { + "description": "Template Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Parent framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The output directory to store the build output.", + "x-example": ".\/build" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": ".\/svelte-kit\/starter" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime used during build step of template.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework runtime", + "x-example": "ssr" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for SPA. Only relevant for static serve runtime.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "name", + "installCommand", + "buildCommand", + "outputDirectory", + "providerRootDirectory", + "buildRuntime", + "adapter", + "fallbackFile" + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/build", + "providerRootDirectory": ".\/svelte-kit\/starter", + "buildRuntime": "node-22", + "adapter": "ssr", + "fallbackFile": "index.html" + } + }, + "function": { + "description": "Function", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "execute": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + }, + "name": { + "type": "string", + "description": "Function name.", + "x-example": "My Function" + }, + "enabled": { + "type": "boolean", + "description": "Function enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "runtime": { + "type": "string", + "description": "Function execution and build runtime.", + "x-example": "python-3.8" + }, + "deploymentId": { + "type": "string", + "description": "Function's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentId": { + "type": "string", + "description": "Function's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "vars": { + "type": "array", + "description": "Function variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": [] + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "schedule": { + "type": "string", + "description": "Function execution schedule in CRON format.", + "x-example": "5 4 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "version": { + "type": "string", + "description": "Version of Open Runtimes used for the function.", + "x-example": "v2" + }, + "installationId": { + "type": "string", + "description": "Function VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "functions\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "execute", + "name", + "enabled", + "live", + "logging", + "runtime", + "deploymentId", + "deploymentCreatedAt", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "events", + "schedule", + "timeout", + "entrypoint", + "commands", + "version", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } + }, + "templateFunction": { + "description": "Template Function", + "type": "object", + "properties": { + "icon": { + "type": "string", + "description": "Function Template Icon.", + "x-example": "icon-lightning-bolt" + }, + "id": { + "type": "string", + "description": "Function Template ID.", + "x-example": "starter" + }, + "name": { + "type": "string", + "description": "Function Template Name.", + "x-example": "Starter function" + }, + "tagline": { + "type": "string", + "description": "Function Template Tagline.", + "x-example": "A simple function to get started." + }, + "permissions": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "any" + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "cron": { + "type": "string", + "description": "Function execution schedult in CRON format.", + "x-example": "0 0 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "useCases": { + "type": "array", + "description": "Function use cases.", + "items": { + "type": "string" + }, + "x-example": "Starter" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes that can be used with this template.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateRuntime" + }, + "x-example": [] + }, + "instructions": { + "type": "string", + "description": "Function Template Instructions.", + "x-example": "For documentation and instructions check out <link>." + }, + "vcsProvider": { + "type": "string", + "description": "VCS (Version Control System) Provider.", + "x-example": "github" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "templates" + }, + "providerOwner": { + "type": "string", + "description": "VCS (Version Control System) Owner.", + "x-example": "appwrite" + }, + "providerVersion": { + "type": "string", + "description": "VCS (Version Control System) branch version (tag).", + "x-example": "main" + }, + "variables": { + "type": "array", + "description": "Function variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateVariable" + }, + "x-example": [] + }, + "scopes": { + "type": "array", + "description": "Function scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + } + }, + "required": [ + "icon", + "id", + "name", + "tagline", + "permissions", + "events", + "cron", + "timeout", + "useCases", + "runtimes", + "instructions", + "vcsProvider", + "providerRepositoryId", + "providerOwner", + "providerVersion", + "variables", + "scopes" + ], + "example": { + "icon": "icon-lightning-bolt", + "id": "starter", + "name": "Starter function", + "tagline": "A simple function to get started.", + "permissions": "any", + "events": "account.create", + "cron": "0 0 * * *", + "timeout": 300, + "useCases": "Starter", + "runtimes": [], + "instructions": "For documentation and instructions check out <link>.", + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [], + "scopes": "users.read" + } + }, + "templateRuntime": { + "description": "Template Runtime", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "node-19.0" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "node\/starter" + } + }, + "required": [ + "name", + "commands", + "entrypoint", + "providerRootDirectory" + ], + "example": { + "name": "node-19.0", + "commands": "npm install", + "entrypoint": "index.js", + "providerRootDirectory": "node\/starter" + } + }, + "templateVariable": { + "description": "Template Variable", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Variable Name.", + "x-example": "APPWRITE_DATABASE_ID" + }, + "description": { + "type": "string", + "description": "Variable Description.", + "x-example": "The ID of the Appwrite database that contains the collection to sync." + }, + "value": { + "type": "string", + "description": "Variable Value.", + "x-example": "512" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "placeholder": { + "type": "string", + "description": "Variable Placeholder.", + "x-example": "64a55...7b912" + }, + "required": { + "type": "boolean", + "description": "Is the variable required?", + "x-example": false + }, + "type": { + "type": "string", + "description": "Variable Type.", + "x-example": "password" + } + }, + "required": [ + "name", + "description", + "value", + "secret", + "placeholder", + "required", + "type" + ], + "example": { + "name": "APPWRITE_DATABASE_ID", + "description": "The ID of the Appwrite database that contains the collection to sync.", + "value": "512", + "secret": false, + "placeholder": "64a55...7b912", + "required": false, + "type": "password" + } + }, + "installation": { + "description": "Installation", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name.", + "x-example": "appwrite" + }, + "providerInstallationId": { + "type": "string", + "description": "VCS (Version Control System) installation ID.", + "x-example": "5322" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "provider", + "organization", + "providerInstallationId" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "provider": "github", + "organization": "appwrite", + "providerInstallationId": "5322" + } + }, + "providerRepository": { + "description": "ProviderRepository", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "defaultBranch", + "pushedAt" + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime" + } + }, + "providerRepositoryFramework": { + "description": "ProviderRepositoryFramework", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + }, + "framework": { + "type": "string", + "description": "Auto-detected framework. Empty if type is not \"framework\".", + "x-example": "nextjs" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "defaultBranch", + "pushedAt", + "framework" + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "framework": "nextjs" + } + }, + "providerRepositoryRuntime": { + "description": "ProviderRepositoryRuntime", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + }, + "runtime": { + "type": "string", + "description": "Auto-detected runtime. Empty if type is not \"runtime\".", + "x-example": "node-22" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "defaultBranch", + "pushedAt", + "runtime" + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "runtime": "node-22" + } + }, + "detectionFramework": { + "description": "DetectionFramework", + "type": "object", + "properties": { + "framework": { + "type": "string", + "description": "Framework", + "x-example": "nuxt" + }, + "installCommand": { + "type": "string", + "description": "Site Install Command", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Site Build Command", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Site Output Directory", + "x-example": "dist" + } + }, + "required": [ + "framework", + "installCommand", + "buildCommand", + "outputDirectory" + ], + "example": { + "framework": "nuxt", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" + } + }, + "detectionRuntime": { + "description": "DetectionRuntime", + "type": "object", + "properties": { + "runtime": { + "type": "string", + "description": "Runtime", + "x-example": "node" + }, + "entrypoint": { + "type": "string", + "description": "Function Entrypoint", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "Function install and build commands", + "x-example": "npm install && npm run build" + } + }, + "required": [ + "runtime", + "entrypoint", + "commands" + ], + "example": { + "runtime": "node", + "entrypoint": "index.js", + "commands": "npm install && npm run build" + } + }, + "vcsContent": { + "description": "VcsContents", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Content size in bytes. Only files have size, and for directories, 0 is returned.", + "x-example": 1523, + "format": "int32", + "x-nullable": true + }, + "isDirectory": { + "type": "boolean", + "description": "If a content is a directory. Directories can be used to check nested contents.", + "x-example": true, + "x-nullable": true + }, + "name": { + "type": "string", + "description": "Name of directory or file.", + "x-example": "Main.java" + } + }, + "required": [ + "name" + ], + "example": { + "size": 1523, + "isDirectory": true, + "name": "Main.java" + } + }, + "branch": { + "description": "Branch", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Branch Name.", + "x-example": "main" + } + }, + "required": [ + "name" + ], + "example": { + "name": "main" + } + }, + "runtime": { + "description": "Runtime", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Runtime ID.", + "x-example": "python-3.8" + }, + "key": { + "type": "string", + "description": "Parent runtime key.", + "x-example": "python" + }, + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "Python" + }, + "version": { + "type": "string", + "description": "Runtime version.", + "x-example": "3.8" + }, + "base": { + "type": "string", + "description": "Base Docker image used to build the runtime.", + "x-example": "python:3.8-alpine" + }, + "image": { + "type": "string", + "description": "Image name of Docker Hub.", + "x-example": "appwrite\\\/runtime-for-python:3.8" + }, + "logo": { + "type": "string", + "description": "Name of the logo image.", + "x-example": "python.png" + }, + "supports": { + "type": "array", + "description": "List of supported architectures.", + "items": { + "type": "string" + }, + "x-example": "amd64" + } + }, + "required": [ + "$id", + "key", + "name", + "version", + "base", + "image", + "logo", + "supports" + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } + }, + "framework": { + "description": "Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, + "runtimes": { + "type": "array", + "description": "List of supported runtime versions.", + "items": { + "type": "string" + }, + "x-example": [ + "static-1", + "node-22" + ] + }, + "adapters": { + "type": "array", + "description": "List of supported adapters.", + "items": { + "type": "object", + "$ref": "#\/definitions\/frameworkAdapter" + }, + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "buildRuntime", + "runtimes", + "adapters" + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Adapter key.", + "x-example": "static" + }, + "installCommand": { + "type": "string", + "description": "Default command to download dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Default command to build site into output directory.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Default output directory of build.", + "x-example": ".\/dist" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "installCommand", + "buildCommand", + "outputDirectory", + "fallbackFile" + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } + }, + "deployment": { + "description": "Deployment", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Deployment update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "type": { + "type": "string", + "description": "Type of deployment.", + "x-example": "vcs" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea6g16897e" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "functions" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file to use to execute the deployment code.", + "x-example": "index.js" + }, + "sourceSize": { + "type": "integer", + "description": "The code size in bytes.", + "x-example": 128, + "format": "int32" + }, + "buildSize": { + "type": "integer", + "description": "The build output size in bytes.", + "x-example": 128, + "format": "int32" + }, + "totalSize": { + "type": "integer", + "description": "The total size in bytes (source and build output).", + "x-example": 128, + "format": "int32" + }, + "buildId": { + "type": "string", + "description": "The current build ID.", + "x-example": "5e5ea5c16897e" + }, + "activate": { + "type": "boolean", + "description": "Whether the deployment should be automatically activated.", + "x-example": true + }, + "screenshotLight": { + "type": "string", + "description": "Screenshot with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "screenshotDark": { + "type": "string", + "description": "Screenshot with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "status": { + "type": "string", + "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] + }, + "buildLogs": { + "type": "string", + "description": "The build logs.", + "x-example": "Compiling source files..." + }, + "buildDuration": { + "type": "integer", + "description": "The current build time in seconds.", + "x-example": 128, + "format": "int32" + }, + "providerRepositoryName": { + "type": "string", + "description": "The name of the vcs provider repository", + "x-example": "database" + }, + "providerRepositoryOwner": { + "type": "string", + "description": "The name of the vcs provider repository owner", + "x-example": "utopia" + }, + "providerRepositoryUrl": { + "type": "string", + "description": "The url of the vcs provider repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" + }, + "providerCommitHash": { + "type": "string", + "description": "The commit hash of the vcs commit", + "x-example": "7c3f25d" + }, + "providerCommitAuthorUrl": { + "type": "string", + "description": "The url of vcs commit author", + "x-example": "https:\/\/github.com\/vermakhushboo" + }, + "providerCommitAuthor": { + "type": "string", + "description": "The name of vcs commit author", + "x-example": "Khushboo Verma" + }, + "providerCommitMessage": { + "type": "string", + "description": "The commit message", + "x-example": "Update index.js" + }, + "providerCommitUrl": { + "type": "string", + "description": "The url of the vcs commit", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" + }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, + "providerBranchUrl": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "type", + "resourceId", + "resourceType", + "entrypoint", + "sourceSize", + "buildSize", + "totalSize", + "buildId", + "activate", + "screenshotLight", + "screenshotDark", + "status", + "buildLogs", + "buildDuration", + "providerRepositoryName", + "providerRepositoryOwner", + "providerRepositoryUrl", + "providerCommitHash", + "providerCommitAuthorUrl", + "providerCommitAuthor", + "providerCommitMessage", + "providerCommitUrl", + "providerBranch", + "providerBranchUrl" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "deploymentId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "project": { + "description": "Project", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Project ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Project creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Project update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Project name.", + "x-example": "New Project" + }, + "description": { + "type": "string", + "description": "Project description.", + "x-example": "This is a new project." + }, + "teamId": { + "type": "string", + "description": "Project team ID.", + "x-example": "1592981250" + }, + "logo": { + "type": "string", + "description": "Project logo file ID.", + "x-example": "5f5c451b403cb" + }, + "url": { + "type": "string", + "description": "Project website URL.", + "x-example": "5f5c451b403cb" + }, + "legalName": { + "type": "string", + "description": "Company legal name.", + "x-example": "Company LTD." + }, + "legalCountry": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format.", + "x-example": "US" + }, + "legalState": { + "type": "string", + "description": "State name.", + "x-example": "New York" + }, + "legalCity": { + "type": "string", + "description": "City name.", + "x-example": "New York City." + }, + "legalAddress": { + "type": "string", + "description": "Company Address.", + "x-example": "620 Eighth Avenue, New York, NY 10018" + }, + "legalTaxId": { + "type": "string", + "description": "Company Tax ID.", + "x-example": "131102020" + }, + "authDuration": { + "type": "integer", + "description": "Session duration in seconds.", + "x-example": 60, + "format": "int32" + }, + "authLimit": { + "type": "integer", + "description": "Max users allowed. 0 is unlimited.", + "x-example": 100, + "format": "int32" + }, + "authSessionsLimit": { + "type": "integer", + "description": "Max sessions allowed per user. 100 maximum.", + "x-example": 10, + "format": "int32" + }, + "authPasswordHistory": { + "type": "integer", + "description": "Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history.", + "x-example": 5, + "format": "int32" + }, + "authPasswordDictionary": { + "type": "boolean", + "description": "Whether or not to check user's password against most commonly used passwords.", + "x-example": true + }, + "authPersonalDataCheck": { + "type": "boolean", + "description": "Whether or not to check the user password for similarity with their personal data.", + "x-example": true + }, + "authMockNumbers": { + "type": "array", + "description": "An array of mock numbers and their corresponding verification codes (OTPs).", + "items": { + "type": "object", + "$ref": "#\/definitions\/mockNumber" + }, + "x-example": [ + {} + ] + }, + "authSessionAlerts": { + "type": "boolean", + "description": "Whether or not to send session alert emails to users.", + "x-example": true + }, + "authMembershipsUserName": { + "type": "boolean", + "description": "Whether or not to show user names in the teams membership response.", + "x-example": true + }, + "authMembershipsUserEmail": { + "type": "boolean", + "description": "Whether or not to show user emails in the teams membership response.", + "x-example": true + }, + "authMembershipsMfa": { + "type": "boolean", + "description": "Whether or not to show user MFA status in the teams membership response.", + "x-example": true + }, + "authInvalidateSessions": { + "type": "boolean", + "description": "Whether or not all existing sessions should be invalidated on password change", + "x-example": true + }, + "oAuthProviders": { + "type": "array", + "description": "List of Auth Providers.", + "items": { + "type": "object", + "$ref": "#\/definitions\/authProvider" + }, + "x-example": [ + {} + ] + }, + "platforms": { + "type": "array", + "description": "List of Platforms.", + "items": { + "type": "object", + "$ref": "#\/definitions\/platform" + }, + "x-example": {} + }, + "webhooks": { + "type": "array", + "description": "List of Webhooks.", + "items": { + "type": "object", + "$ref": "#\/definitions\/webhook" + }, + "x-example": {} + }, + "keys": { + "type": "array", + "description": "List of API Keys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/key" + }, + "x-example": {} + }, + "devKeys": { + "type": "array", + "description": "List of dev keys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/devKey" + }, + "x-example": {} + }, + "smtpEnabled": { + "type": "boolean", + "description": "Status for custom SMTP", + "x-example": false + }, + "smtpSenderName": { + "type": "string", + "description": "SMTP sender name", + "x-example": "John Appwrite" + }, + "smtpSenderEmail": { + "type": "string", + "description": "SMTP sender email", + "x-example": "john@appwrite.io" + }, + "smtpReplyTo": { + "type": "string", + "description": "SMTP reply to email", + "x-example": "support@appwrite.io" + }, + "smtpHost": { + "type": "string", + "description": "SMTP server host name", + "x-example": "mail.appwrite.io" + }, + "smtpPort": { + "type": "integer", + "description": "SMTP server port", + "x-example": 25, + "format": "int32" + }, + "smtpUsername": { + "type": "string", + "description": "SMTP server username", + "x-example": "emailuser" + }, + "smtpPassword": { + "type": "string", + "description": "SMTP server password", + "x-example": "securepassword" + }, + "smtpSecure": { + "type": "string", + "description": "SMTP server secure protocol", + "x-example": "tls" + }, + "pingCount": { + "type": "integer", + "description": "Number of times the ping was received for this project.", + "x-example": 1, + "format": "int32" + }, + "pingedAt": { + "type": "string", + "description": "Last ping datetime in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "authEmailPassword": { + "type": "boolean", + "description": "Email\/Password auth method status", + "x-example": true + }, + "authUsersAuthMagicURL": { + "type": "boolean", + "description": "Magic URL auth method status", + "x-example": true + }, + "authEmailOtp": { + "type": "boolean", + "description": "Email (OTP) auth method status", + "x-example": true + }, + "authAnonymous": { + "type": "boolean", + "description": "Anonymous auth method status", + "x-example": true + }, + "authInvites": { + "type": "boolean", + "description": "Invites auth method status", + "x-example": true + }, + "authJWT": { + "type": "boolean", + "description": "JWT auth method status", + "x-example": true + }, + "authPhone": { + "type": "boolean", + "description": "Phone auth method status", + "x-example": true + }, + "serviceStatusForAccount": { + "type": "boolean", + "description": "Account service status", + "x-example": true + }, + "serviceStatusForAvatars": { + "type": "boolean", + "description": "Avatars service status", + "x-example": true + }, + "serviceStatusForDatabases": { + "type": "boolean", + "description": "Databases (legacy) service status", + "x-example": true + }, + "serviceStatusForTablesdb": { + "type": "boolean", + "description": "TablesDB service status", + "x-example": true + }, + "serviceStatusForLocale": { + "type": "boolean", + "description": "Locale service status", + "x-example": true + }, + "serviceStatusForHealth": { + "type": "boolean", + "description": "Health service status", + "x-example": true + }, + "serviceStatusForStorage": { + "type": "boolean", + "description": "Storage service status", + "x-example": true + }, + "serviceStatusForTeams": { + "type": "boolean", + "description": "Teams service status", + "x-example": true + }, + "serviceStatusForUsers": { + "type": "boolean", + "description": "Users service status", + "x-example": true + }, + "serviceStatusForSites": { + "type": "boolean", + "description": "Sites service status", + "x-example": true + }, + "serviceStatusForFunctions": { + "type": "boolean", + "description": "Functions service status", + "x-example": true + }, + "serviceStatusForGraphql": { + "type": "boolean", + "description": "GraphQL service status", + "x-example": true + }, + "serviceStatusForMessaging": { + "type": "boolean", + "description": "Messaging service status", + "x-example": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "description", + "teamId", + "logo", + "url", + "legalName", + "legalCountry", + "legalState", + "legalCity", + "legalAddress", + "legalTaxId", + "authDuration", + "authLimit", + "authSessionsLimit", + "authPasswordHistory", + "authPasswordDictionary", + "authPersonalDataCheck", + "authMockNumbers", + "authSessionAlerts", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", + "authInvalidateSessions", + "oAuthProviders", + "platforms", + "webhooks", + "keys", + "devKeys", + "smtpEnabled", + "smtpSenderName", + "smtpSenderEmail", + "smtpReplyTo", + "smtpHost", + "smtpPort", + "smtpUsername", + "smtpPassword", + "smtpSecure", + "pingCount", + "pingedAt", + "authEmailPassword", + "authUsersAuthMagicURL", + "authEmailOtp", + "authAnonymous", + "authInvites", + "authJWT", + "authPhone", + "serviceStatusForAccount", + "serviceStatusForAvatars", + "serviceStatusForDatabases", + "serviceStatusForTablesdb", + "serviceStatusForLocale", + "serviceStatusForHealth", + "serviceStatusForStorage", + "serviceStatusForTeams", + "serviceStatusForUsers", + "serviceStatusForSites", + "serviceStatusForFunctions", + "serviceStatusForGraphql", + "serviceStatusForMessaging" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "description": "This is a new project.", + "teamId": "1592981250", + "logo": "5f5c451b403cb", + "url": "5f5c451b403cb", + "legalName": "Company LTD.", + "legalCountry": "US", + "legalState": "New York", + "legalCity": "New York City.", + "legalAddress": "620 Eighth Avenue, New York, NY 10018", + "legalTaxId": "131102020", + "authDuration": 60, + "authLimit": 100, + "authSessionsLimit": 10, + "authPasswordHistory": 5, + "authPasswordDictionary": true, + "authPersonalDataCheck": true, + "authMockNumbers": [ + {} + ], + "authSessionAlerts": true, + "authMembershipsUserName": true, + "authMembershipsUserEmail": true, + "authMembershipsMfa": true, + "authInvalidateSessions": true, + "oAuthProviders": [ + {} + ], + "platforms": {}, + "webhooks": {}, + "keys": {}, + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyTo": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "securepassword", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "authEmailPassword": true, + "authUsersAuthMagicURL": true, + "authEmailOtp": true, + "authAnonymous": true, + "authInvites": true, + "authJWT": true, + "authPhone": true, + "serviceStatusForAccount": true, + "serviceStatusForAvatars": true, + "serviceStatusForDatabases": true, + "serviceStatusForTablesdb": true, + "serviceStatusForLocale": true, + "serviceStatusForHealth": true, + "serviceStatusForStorage": true, + "serviceStatusForTeams": true, + "serviceStatusForUsers": true, + "serviceStatusForSites": true, + "serviceStatusForFunctions": true, + "serviceStatusForGraphql": true, + "serviceStatusForMessaging": true + } + }, + "webhook": { + "description": "Webhook", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Webhook ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Webhook creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Webhook update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Webhook name.", + "x-example": "My Webhook" + }, + "url": { + "type": "string", + "description": "Webhook URL endpoint.", + "x-example": "https:\/\/example.com\/webhook" + }, + "events": { + "type": "array", + "description": "Webhook trigger events.", + "items": { + "type": "string" + }, + "x-example": [ + "databases.tables.update", + "databases.collections.update" + ] + }, + "security": { + "type": "boolean", + "description": "Indicated if SSL \/ TLS Certificate verification is enabled.", + "x-example": true + }, + "httpUser": { + "type": "string", + "description": "HTTP basic authentication username.", + "x-example": "username" + }, + "httpPass": { + "type": "string", + "description": "HTTP basic authentication password.", + "x-example": "password" + }, + "signatureKey": { + "type": "string", + "description": "Signature key which can be used to validated incoming", + "x-example": "ad3d581ca230e2b7059c545e5a" + }, + "enabled": { + "type": "boolean", + "description": "Indicates if this webhook is enabled.", + "x-example": true + }, + "logs": { + "type": "string", + "description": "Webhook error logs from the most recent failure.", + "x-example": "Failed to connect to remote server." + }, + "attempts": { + "type": "integer", + "description": "Number of consecutive failed webhook attempts.", + "x-example": 10, + "format": "int32" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "url", + "events", + "security", + "httpUser", + "httpPass", + "signatureKey", + "enabled", + "logs", + "attempts" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": [ + "databases.tables.update", + "databases.collections.update" + ], + "security": true, + "httpUser": "username", + "httpPass": "password", + "signatureKey": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } + }, + "key": { + "description": "Key", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "My API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "scopes", + "secret", + "accessedAt", + "sdks" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } + }, + "devKey": { + "description": "DevKey", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "Dev API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "secret", + "accessedAt", + "sdks" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } + }, + "mockNumber": { + "description": "Mock Number", + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS.", + "x-example": "+1612842323" + }, + "otp": { + "type": "string", + "description": "Mock OTP for the number. ", + "x-example": "123456" + } + }, + "required": [ + "phone", + "otp" + ], + "example": { + "phone": "+1612842323", + "otp": "123456" + } + }, + "authProvider": { + "description": "AuthProvider", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Auth Provider.", + "x-example": "github" + }, + "name": { + "type": "string", + "description": "Auth Provider name.", + "x-example": "GitHub" + }, + "appId": { + "type": "string", + "description": "OAuth 2.0 application ID.", + "x-example": "259125845563242502" + }, + "secret": { + "type": "string", + "description": "OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration.", + "x-example": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ" + }, + "enabled": { + "type": "boolean", + "description": "Auth Provider is active and can be used to create session.", + "x-example": "" + } + }, + "required": [ + "key", + "name", + "appId", + "secret", + "enabled" + ], + "example": { + "key": "github", + "name": "GitHub", + "appId": "259125845563242502", + "secret": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ", + "enabled": "" + } + }, + "platform": { + "description": "Platform", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "x-example": "My Web App" + }, + "type": { + "type": "string", + "description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.", + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "ios", + "android", + "unity" + ] + }, + "key": { + "type": "string", + "description": "Platform Key. iOS bundle ID or Android package name. Empty string for other platforms.", + "x-example": "com.company.appname" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID.", + "x-example": "" + }, + "hostname": { + "type": "string", + "description": "Web app hostname. Empty string for other platforms.", + "x-example": "app.example.com" + }, + "httpUser": { + "type": "string", + "description": "HTTP basic authentication username.", + "x-example": "username" + }, + "httpPass": { + "type": "string", + "description": "HTTP basic authentication password.", + "x-example": "password" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "key", + "store", + "hostname", + "httpUser", + "httpPass" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "key": "com.company.appname", + "store": "", + "hostname": "app.example.com", + "httpUser": "username", + "httpPass": "password" + } + }, + "variable": { + "description": "Variable", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Variable ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Variable key.", + "x-example": "API_KEY" + }, + "value": { + "type": "string", + "description": "Variable value.", + "x-example": "myPa$$word1" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "resourceType": { + "type": "string", + "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", + "x-example": "function" + }, + "resourceId": { + "type": "string", + "description": "ID of resource to which the variable belongs. If resourceType is \"project\", it is empty. If resourceType is \"function\", it is ID of the function.", + "x-example": "myAwesomeFunction" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "value", + "secret", + "resourceType", + "resourceId" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "United States", + "code": "US" + } + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "Europe", + "code": "EU" + } + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } + }, + "healthAntivirus": { + "description": "Health Antivirus", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Antivirus version.", + "x-example": "1.0.0" + }, + "status": { + "type": "string", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] + } + }, + "required": [ + "version", + "status" + ], + "example": { + "version": "1.0.0", + "status": "online" + } + }, + "healthQueue": { + "description": "Health Queue", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Amount of actions in the queue.", + "x-example": 8, + "format": "int32" + } + }, + "required": [ + "size" + ], + "example": { + "size": 8 + } + }, + "healthStatus": { + "description": "Health Status", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the service.", + "x-example": "database" + }, + "ping": { + "type": "integer", + "description": "Duration in milliseconds how long the health check took.", + "x-example": 128, + "format": "int32" + }, + "status": { + "type": "string", + "description": "Service status. Possible values are: `pass`, `fail`", + "x-example": "pass", + "enum": [ + "pass", + "fail" + ], + "x-enum-name": "HealthCheckStatus" + } + }, + "required": [ + "name", + "ping", + "status" + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } + }, + "healthCertificate": { + "description": "Health Certificate", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Certificate name", + "x-example": "\/CN=www.google.com" + }, + "subjectSN": { + "type": "string", + "description": "Subject SN", + "x-example": "" + }, + "issuerOrganisation": { + "type": "string", + "description": "Issuer organisation", + "x-example": "" + }, + "validFrom": { + "type": "string", + "description": "Valid from", + "x-example": "1704200998" + }, + "validTo": { + "type": "string", + "description": "Valid to", + "x-example": "1711458597" + }, + "signatureTypeSN": { + "type": "string", + "description": "Signature type SN", + "x-example": "RSA-SHA256" + } + }, + "required": [ + "name", + "subjectSN", + "issuerOrganisation", + "validFrom", + "validTo", + "signatureTypeSN" + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } + }, + "healthTime": { + "description": "Health Time", + "type": "object", + "properties": { + "remoteTime": { + "type": "integer", + "description": "Current unix timestamp on trustful remote server.", + "x-example": 1639490751, + "format": "int32" + }, + "localTime": { + "type": "integer", + "description": "Current unix timestamp of local server where Appwrite runs.", + "x-example": 1639490844, + "format": "int32" + }, + "diff": { + "type": "integer", + "description": "Difference of unix remote and local timestamps in milliseconds.", + "x-example": 93, + "format": "int32" + } + }, + "required": [ + "remoteTime", + "localTime", + "diff" + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } + }, + "metric": { + "description": "Metric", + "type": "object", + "properties": { + "value": { + "type": "integer", + "description": "The value of this metric at the timestamp.", + "x-example": 1, + "format": "int32" + }, + "date": { + "type": "string", + "description": "The date at which this metric was aggregated in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "value", + "date" + ], + "example": { + "value": 1, + "date": "2020-10-15T06:38:00.000+00:00" + } + }, + "metricBreakdown": { + "description": "Metric Breakdown", + "type": "object", + "properties": { + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c16897e", + "x-nullable": true + }, + "name": { + "type": "string", + "description": "Resource name.", + "x-example": "Documents" + }, + "value": { + "type": "integer", + "description": "The value of this metric at the timestamp.", + "x-example": 1, + "format": "int32" + }, + "estimate": { + "type": "number", + "description": "The estimated value of this metric at the end of the period.", + "x-example": 1, + "format": "double", + "x-nullable": true + } + }, + "required": [ + "name", + "value" + ], + "example": { + "resourceId": "5e5ea5c16897e", + "name": "Documents", + "value": 1, + "estimate": 1 + } + }, + "usageDatabases": { + "description": "UsageDatabases", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "databasesTotal": { + "type": "integer", + "description": "Total aggregated number of databases.", + "x-example": 0, + "format": "int32" + }, + "collectionsTotal": { + "type": "integer", + "description": "Total aggregated number of collections.", + "x-example": 0, + "format": "int32" + }, + "tablesTotal": { + "type": "integer", + "description": "Total aggregated number of tables.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, + "storageTotal": { + "type": "integer", + "description": "Total aggregated number of total databases storage in bytes.", + "x-example": 0, + "format": "int32" + }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "Aggregated number of databases per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "collections": { + "type": "array", + "description": "Aggregated number of collections per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "tables": { + "type": "array", + "description": "Aggregated number of tables per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "An array of the aggregated number of databases storage in bytes per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "databasesTotal", + "collectionsTotal", + "tablesTotal", + "documentsTotal", + "rowsTotal", + "storageTotal", + "databasesReadsTotal", + "databasesWritesTotal", + "databases", + "collections", + "tables", + "documents", + "rows", + "storage", + "databasesReads", + "databasesWrites" + ], + "example": { + "range": "30d", + "databasesTotal": 0, + "collectionsTotal": 0, + "tablesTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "storageTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "databases": [], + "collections": [], + "tables": [], + "documents": [], + "rows": [], + "storage": [], + "databasesReads": [], + "databasesWrites": [] + } + }, + "usageDatabase": { + "description": "UsageDatabase", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "collectionsTotal": { + "type": "integer", + "description": "Total aggregated number of collections.", + "x-example": 0, + "format": "int32" + }, + "tablesTotal": { + "type": "integer", + "description": "Total aggregated number of tables.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, + "storageTotal": { + "type": "integer", + "description": "Total aggregated number of total storage used in bytes.", + "x-example": 0, + "format": "int32" + }, + "databaseReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databaseWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "Aggregated number of collections per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "tables": { + "type": "array", + "description": "Aggregated number of tables per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated storage used in bytes per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databaseReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databaseWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "collectionsTotal", + "tablesTotal", + "documentsTotal", + "rowsTotal", + "storageTotal", + "databaseReadsTotal", + "databaseWritesTotal", + "collections", + "tables", + "documents", + "rows", + "storage", + "databaseReads", + "databaseWrites" + ], + "example": { + "range": "30d", + "collectionsTotal": 0, + "tablesTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "storageTotal": 0, + "databaseReadsTotal": 0, + "databaseWritesTotal": 0, + "collections": [], + "tables": [], + "documents": [], + "rows": [], + "storage": [], + "databaseReads": [], + "databaseWrites": [] + } + }, + "usageTable": { + "description": "UsageTable", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of of rows.", + "x-example": 0, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "rowsTotal", + "rows" + ], + "example": { + "range": "30d", + "rowsTotal": 0, + "rows": [] + } + }, + "usageCollection": { + "description": "UsageCollection", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of of documents.", + "x-example": 0, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "documentsTotal", + "documents" + ], + "example": { + "range": "30d", + "documentsTotal": 0, + "documents": [] + } + }, + "usageUsers": { + "description": "UsageUsers", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "usersTotal": { + "type": "integer", + "description": "Total aggregated number of statistics of users.", + "x-example": 0, + "format": "int32" + }, + "sessionsTotal": { + "type": "integer", + "description": "Total aggregated number of active sessions.", + "x-example": 0, + "format": "int32" + }, + "users": { + "type": "array", + "description": "Aggregated number of users per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "sessions": { + "type": "array", + "description": "Aggregated number of active sessions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "usersTotal", + "sessionsTotal", + "users", + "sessions" + ], + "example": { + "range": "30d", + "usersTotal": 0, + "sessionsTotal": 0, + "users": [], + "sessions": [] + } + }, + "usageStorage": { + "description": "StorageUsage", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "bucketsTotal": { + "type": "integer", + "description": "Total aggregated number of buckets", + "x-example": 0, + "format": "int32" + }, + "filesTotal": { + "type": "integer", + "description": "Total aggregated number of files.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated number of files storage (in bytes).", + "x-example": 0, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "Aggregated number of buckets per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "files": { + "type": "array", + "description": "Aggregated number of files per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated number of files storage (in bytes) per period .", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "bucketsTotal", + "filesTotal", + "filesStorageTotal", + "buckets", + "files", + "storage" + ], + "example": { + "range": "30d", + "bucketsTotal": 0, + "filesTotal": 0, + "filesStorageTotal": 0, + "buckets": [], + "files": [], + "storage": [] + } + }, + "usageBuckets": { + "description": "UsageBuckets", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "filesTotal": { + "type": "integer", + "description": "Total aggregated number of bucket files.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated number of bucket files storage (in bytes).", + "x-example": 0, + "format": "int32" + }, + "files": { + "type": "array", + "description": "Aggregated number of bucket files per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated number of bucket storage files (in bytes) per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "imageTransformations": { + "type": "array", + "description": "Aggregated number of files transformations per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "imageTransformationsTotal": { + "type": "integer", + "description": "Total aggregated number of files transformations.", + "x-example": 0, + "format": "int32" + } + }, + "required": [ + "range", + "filesTotal", + "filesStorageTotal", + "files", + "storage", + "imageTransformations", + "imageTransformationsTotal" + ], + "example": { + "range": "30d", + "filesTotal": 0, + "filesStorageTotal": 0, + "files": [], + "storage": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } + }, + "usageFunctions": { + "description": "UsageFunctions", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "functionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions.", + "x-example": 0, + "format": "int32" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of functions deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions deployment storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of functions build.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of functions build storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions execution.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "Aggregated number of functions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": 0 + }, + "deployments": { + "type": "array", + "description": "Aggregated number of functions deployment per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of functions deployment storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "builds": { + "type": "array", + "description": "Aggregated number of functions build per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of functions build storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of functions build compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated sum of functions build mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of functions execution per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of functions execution compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of functions mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "functionsTotal", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "functions", + "deployments", + "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" + ], + "example": { + "range": "30d", + "functionsTotal": 0, + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "functions": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } + }, + "usageFunction": { + "description": "UsageFunction", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of function deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of function deployments storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of function builds storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of function deployments per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of function deployments storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "builds": { + "type": "array", + "description": "Aggregated number of function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of function builds storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of function builds compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } + }, + "usageSites": { + "description": "UsageSites", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of functions deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions deployment storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of functions build.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of functions build storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions execution.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of functions deployment per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of functions deployment storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "builds": { + "type": "array", + "description": "Aggregated number of functions build per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of functions build storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of functions build compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated sum of functions build mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of functions execution per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of functions execution compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of functions mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "sitesTotal": { + "type": "integer", + "description": "Total aggregated number of sites.", + "x-example": 0, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "Aggregated number of sites per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "sitesTotal", + "sites", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "sitesTotal": 0, + "sites": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } + }, + "usageSite": { + "description": "UsageSite", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of function deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of function deployments storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of function builds storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of function deployments per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of function deployments storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "builds": { + "type": "array", + "description": "Aggregated number of function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of function builds storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of function builds compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } + }, + "usageProject": { + "description": "UsageProject", + "type": "object", + "properties": { + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, + "databasesTotal": { + "type": "integer", + "description": "Total aggregated number of databases.", + "x-example": 0, + "format": "int32" + }, + "databasesStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of databases storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "usersTotal": { + "type": "integer", + "description": "Total aggregated number of users.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of files storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "functionsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of builds storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of deployments storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "bucketsTotal": { + "type": "integer", + "description": "Total aggregated number of buckets.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "network": { + "type": "array", + "description": "Aggregated number of consumed bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "users": { + "type": "array", + "description": "Aggregated number of users per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of executions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of executions by functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "bucketsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of usage by buckets.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "databasesStorageBreakdown": { + "type": "array", + "description": "An array of the aggregated breakdown of storage usage by databases.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "executionsMbSecondsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of execution mbSeconds by functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "buildsMbSecondsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of build mbSeconds by functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "functionsStorageBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of functions storage size (in bytes).", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "authPhoneTotal": { + "type": "integer", + "description": "Total aggregated number of phone auth.", + "x-example": 0, + "format": "int32" + }, + "authPhoneEstimate": { + "type": "number", + "description": "Estimated total aggregated cost of phone auth.", + "x-example": 0, + "format": "double" + }, + "authPhoneCountryBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of phone auth by country.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "imageTransformations": { + "type": "array", + "description": "An array of aggregated number of image transformations.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "imageTransformationsTotal": { + "type": "integer", + "description": "Total aggregated number of image transformations.", + "x-example": 0, + "format": "int32" + } + }, + "required": [ + "executionsTotal", + "documentsTotal", + "rowsTotal", + "databasesTotal", + "databasesStorageTotal", + "usersTotal", + "filesStorageTotal", + "functionsStorageTotal", + "buildsStorageTotal", + "deploymentsStorageTotal", + "bucketsTotal", + "executionsMbSecondsTotal", + "buildsMbSecondsTotal", + "databasesReadsTotal", + "databasesWritesTotal", + "requests", + "network", + "users", + "executions", + "executionsBreakdown", + "bucketsBreakdown", + "databasesStorageBreakdown", + "executionsMbSecondsBreakdown", + "buildsMbSecondsBreakdown", + "functionsStorageBreakdown", + "authPhoneTotal", + "authPhoneEstimate", + "authPhoneCountryBreakdown", + "databasesReads", + "databasesWrites", + "imageTransformations", + "imageTransformationsTotal" + ], + "example": { + "executionsTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "databasesTotal": 0, + "databasesStorageTotal": 0, + "usersTotal": 0, + "filesStorageTotal": 0, + "functionsStorageTotal": 0, + "buildsStorageTotal": 0, + "deploymentsStorageTotal": 0, + "bucketsTotal": 0, + "executionsMbSecondsTotal": 0, + "buildsMbSecondsTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "requests": [], + "network": [], + "users": [], + "executions": [], + "executionsBreakdown": [], + "bucketsBreakdown": [], + "databasesStorageBreakdown": [], + "executionsMbSecondsBreakdown": [], + "buildsMbSecondsBreakdown": [], + "functionsStorageBreakdown": [], + "authPhoneTotal": 0, + "authPhoneEstimate": 0, + "authPhoneCountryBreakdown": [], + "databasesReads": [], + "databasesWrites": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } + }, + "specification": { + "description": "Specification", + "type": "object", + "properties": { + "memory": { + "type": "integer", + "description": "Memory size in MB.", + "x-example": 512, + "format": "int32" + }, + "cpus": { + "type": "number", + "description": "Number of CPUs.", + "x-example": 1, + "format": "double" + }, + "enabled": { + "type": "boolean", + "description": "Is size enabled.", + "x-example": true + }, + "slug": { + "type": "string", + "description": "Size slug.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "memory", + "cpus", + "enabled", + "slug" + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } + }, + "proxyRule": { + "description": "Rule", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Rule ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Rule creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Rule update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": "appwrite.company.com" + }, + "type": { + "type": "string", + "description": "Action definition for the rule. Possible values are \"api\", \"deployment\", or \"redirect\"", + "x-example": "deployment" + }, + "trigger": { + "type": "string", + "description": "Defines how the rule was created. Possible values are \"manual\" or \"deployment\"", + "x-example": "manual" + }, + "redirectUrl": { + "type": "string", + "description": "URL to redirect to. Used if type is \"redirect\"", + "x-example": "https:\/\/appwrite.io\/docs" + }, + "redirectStatusCode": { + "type": "integer", + "description": "Status code to apply during redirect. Used if type is \"redirect\"", + "x-example": 301, + "format": "int32" + }, + "deploymentId": { + "type": "string", + "description": "ID of deployment. Used if type is \"deployment\"", + "x-example": "n3u9feiwmf" + }, + "deploymentResourceType": { + "type": "string", + "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", + "x-example": "function", + "enum": [ + "function", + "site" + ] + }, + "deploymentResourceId": { + "type": "string", + "description": "ID deployment's resource. Used if type is \"deployment\"", + "x-example": "n3u9feiwmf" + }, + "deploymentVcsProviderBranch": { + "type": "string", + "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", + "x-example": "main" + }, + "status": { + "type": "string", + "description": "Domain verification status. Possible values are \"created\", \"verifying\", \"verified\" and \"unverified\"", + "x-example": "verified", + "enum": [ + "created", + "verifying", + "verified", + "unverified" + ] + }, + "logs": { + "type": "string", + "description": "Certificate generation logs. This will return an empty string if generation did not run, or succeeded.", + "x-example": "HTTP challegne failed." + }, + "renewAt": { + "type": "string", + "description": "Certificate auto-renewal date in ISO 8601 format.", + "x-example": "datetime" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "domain", + "type", + "trigger", + "redirectUrl", + "redirectStatusCode", + "deploymentId", + "deploymentResourceType", + "deploymentResourceId", + "deploymentVcsProviderBranch", + "status", + "logs", + "renewAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "main", + "status": "verified", + "logs": "HTTP challegne failed.", + "renewAt": "datetime" + } + }, + "smsTemplate": { + "description": "SmsTemplate", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Template type", + "x-example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "x-example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "Click on the link to verify your account." + } + }, + "required": [ + "type", + "locale", + "message" + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account." + } + }, + "emailTemplate": { + "description": "EmailTemplate", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Template type", + "x-example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "x-example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "Click on the link to verify your account." + }, + "senderName": { + "type": "string", + "description": "Name of the sender", + "x-example": "My User" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "x-example": "mail@appwrite.io" + }, + "replyTo": { + "type": "string", + "description": "Reply to email address", + "x-example": "emails@appwrite.io" + }, + "subject": { + "type": "string", + "description": "Email subject", + "x-example": "Please verify your email address" + } + }, + "required": [ + "type", + "locale", + "message", + "senderName", + "senderEmail", + "replyTo", + "subject" + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyTo": "emails@appwrite.io", + "subject": "Please verify your email address" + } + }, + "consoleVariables": { + "description": "Console Variables", + "type": "object", + "properties": { + "_APP_DOMAIN_TARGET_CNAME": { + "type": "string", + "description": "CNAME target for your Appwrite custom domains.", + "x-example": "appwrite.io" + }, + "_APP_DOMAIN_TARGET_A": { + "type": "string", + "description": "A target for your Appwrite custom domains.", + "x-example": "127.0.0.1" + }, + "_APP_DOMAIN_TARGET_AAAA": { + "type": "string", + "description": "AAAA target for your Appwrite custom domains.", + "x-example": "::1" + }, + "_APP_DOMAIN_TARGET_CAA": { + "type": "string", + "description": "CAA target for your Appwrite custom domains.", + "x-example": "digicert.com" + }, + "_APP_STORAGE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for file upload in bytes.", + "x-example": "30000000", + "format": "int32" + }, + "_APP_COMPUTE_SIZE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for deployment in bytes.", + "x-example": "30000000", + "format": "int32" + }, + "_APP_USAGE_STATS": { + "type": "string", + "description": "Defines if usage stats are enabled. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'.", + "x-example": "enabled" + }, + "_APP_VCS_ENABLED": { + "type": "boolean", + "description": "Defines if VCS (Version Control System) is enabled.", + "x-example": true + }, + "_APP_DOMAIN_ENABLED": { + "type": "boolean", + "description": "Defines if main domain is configured. If so, custom domains can be created.", + "x-example": true + }, + "_APP_ASSISTANT_ENABLED": { + "type": "boolean", + "description": "Defines if AI assistant is enabled.", + "x-example": true + }, + "_APP_DOMAIN_SITES": { + "type": "string", + "description": "A domain to use for site URLs.", + "x-example": "sites.localhost" + }, + "_APP_DOMAIN_FUNCTIONS": { + "type": "string", + "description": "A domain to use for function URLs.", + "x-example": "functions.localhost" + }, + "_APP_OPTIONS_FORCE_HTTPS": { + "type": "string", + "description": "Defines if HTTPS is enforced for all requests.", + "x-example": "enabled" + }, + "_APP_DOMAINS_NAMESERVERS": { + "type": "string", + "description": "Comma-separated list of nameservers.", + "x-example": "ns1.example.com,ns2.example.com" + } + }, + "required": [ + "_APP_DOMAIN_TARGET_CNAME", + "_APP_DOMAIN_TARGET_A", + "_APP_DOMAIN_TARGET_AAAA", + "_APP_DOMAIN_TARGET_CAA", + "_APP_STORAGE_LIMIT", + "_APP_COMPUTE_SIZE_LIMIT", + "_APP_USAGE_STATS", + "_APP_VCS_ENABLED", + "_APP_DOMAIN_ENABLED", + "_APP_ASSISTANT_ENABLED", + "_APP_DOMAIN_SITES", + "_APP_DOMAIN_FUNCTIONS", + "_APP_OPTIONS_FORCE_HTTPS", + "_APP_DOMAINS_NAMESERVERS" + ], + "example": { + "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", + "_APP_DOMAIN_TARGET_A": "127.0.0.1", + "_APP_DOMAIN_TARGET_AAAA": "::1", + "_APP_DOMAIN_TARGET_CAA": "digicert.com", + "_APP_STORAGE_LIMIT": "30000000", + "_APP_COMPUTE_SIZE_LIMIT": "30000000", + "_APP_USAGE_STATS": "enabled", + "_APP_VCS_ENABLED": true, + "_APP_DOMAIN_ENABLED": true, + "_APP_ASSISTANT_ENABLED": true, + "_APP_DOMAIN_SITES": "sites.localhost", + "_APP_DOMAIN_FUNCTIONS": "functions.localhost", + "_APP_OPTIONS_FORCE_HTTPS": "enabled", + "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com" + } + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ], + "example": { + "secret": true, + "uri": true + } + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } + }, + "provider": { + "description": "Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Provider ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Provider creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Provider update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name for the provider instance.", + "x-example": "Mailgun" + }, + "provider": { + "type": "string", + "description": "The name of the provider service.", + "x-example": "mailgun" + }, + "enabled": { + "type": "boolean", + "description": "Is provider enabled?", + "x-example": true + }, + "type": { + "type": "string", + "description": "Type of provider.", + "x-example": "sms" + }, + "credentials": { + "type": "object", + "additionalProperties": true, + "description": "Provider credentials.", + "x-example": { + "key": "123456789" + } + }, + "options": { + "type": "object", + "additionalProperties": true, + "description": "Provider options.", + "x-example": { + "from": "sender-email@mydomain" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "provider", + "enabled", + "type", + "credentials" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } + }, + "message": { + "description": "Message", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Message ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Message creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Message update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerType": { + "type": "string", + "description": "Message provider type.", + "x-example": "email" + }, + "topics": { + "type": "array", + "description": "Topic IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "users": { + "type": "array", + "description": "User IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "targets": { + "type": "array", + "description": "Target IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for message.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + }, + "deliveredAt": { + "type": "string", + "description": "The time when the message was delivered.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + }, + "deliveryErrors": { + "type": "array", + "description": "Delivery errors if any.", + "items": { + "type": "string" + }, + "x-example": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "x-nullable": true + }, + "deliveredTotal": { + "type": "integer", + "description": "Number of recipients the message was delivered to.", + "x-example": 1, + "format": "int32" + }, + "data": { + "type": "object", + "additionalProperties": true, + "description": "Data of the message.", + "x-example": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + } + }, + "status": { + "type": "string", + "description": "Status of delivery.", + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "providerType", + "topics", + "users", + "targets", + "deliveredTotal", + "data", + "status" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } + }, + "topic": { + "description": "Topic", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Topic creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Topic update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name of the topic.", + "x-example": "events" + }, + "emailTotal": { + "type": "integer", + "description": "Total count of email subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "smsTotal": { + "type": "integer", + "description": "Total count of SMS subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "pushTotal": { + "type": "integer", + "description": "Total count of push subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "subscribe": { + "type": "array", + "description": "Subscribe permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "emailTotal", + "smsTotal", + "pushTotal", + "subscribe" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "x-nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } + }, + "migration": { + "description": "Migration", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Migration ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Migration creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "string", + "description": "Migration status ( pending, processing, failed, completed ) ", + "x-example": "pending" + }, + "stage": { + "type": "string", + "description": "Migration stage ( init, processing, source-check, destination-check, migrating, finished )", + "x-example": "init" + }, + "source": { + "type": "string", + "description": "A string containing the type of source of the migration.", + "x-example": "Appwrite" + }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "x-example": "Appwrite" + }, + "resources": { + "type": "array", + "description": "Resources to migrate.", + "items": { + "type": "string" + }, + "x-example": [ + "user" + ] + }, + "resourceId": { + "type": "string", + "description": "Id of the resource to migrate.", + "x-example": "databaseId:collectionId" + }, + "statusCounters": { + "type": "object", + "additionalProperties": true, + "description": "A group of counters that represent the total progress of the migration.", + "x-example": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}" + }, + "resourceData": { + "type": "object", + "additionalProperties": true, + "description": "An array of objects containing the report data of the resources that were migrated.", + "x-example": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]" + }, + "errors": { + "type": "array", + "description": "All errors that occurred during the migration process.", + "items": { + "type": "string" + }, + "x-example": [] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "status", + "stage", + "source", + "destination", + "resources", + "resourceId", + "statusCounters", + "resourceData", + "errors" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "stage": "init", + "source": "Appwrite", + "destination": "Appwrite", + "resources": [ + "user" + ], + "resourceId": "databaseId:collectionId", + "statusCounters": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}", + "resourceData": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]", + "errors": [] + } + }, + "migrationReport": { + "description": "Migration Report", + "type": "object", + "properties": { + "user": { + "type": "integer", + "description": "Number of users to be migrated.", + "x-example": 20, + "format": "int32" + }, + "team": { + "type": "integer", + "description": "Number of teams to be migrated.", + "x-example": 20, + "format": "int32" + }, + "database": { + "type": "integer", + "description": "Number of databases to be migrated.", + "x-example": 20, + "format": "int32" + }, + "row": { + "type": "integer", + "description": "Number of rows to be migrated.", + "x-example": 20, + "format": "int32" + }, + "file": { + "type": "integer", + "description": "Number of files to be migrated.", + "x-example": 20, + "format": "int32" + }, + "bucket": { + "type": "integer", + "description": "Number of buckets to be migrated.", + "x-example": 20, + "format": "int32" + }, + "function": { + "type": "integer", + "description": "Number of functions to be migrated.", + "x-example": 20, + "format": "int32" + }, + "size": { + "type": "integer", + "description": "Size of files to be migrated in mb.", + "x-example": 30000, + "format": "int32" + }, + "version": { + "type": "string", + "description": "Version of the Appwrite instance to be migrated.", + "x-example": "1.4.0" + } + }, + "required": [ + "user", + "team", + "database", + "row", + "file", + "bucket", + "function", + "size", + "version" + ], + "example": { + "user": 20, + "team": 20, + "database": 20, + "row": 20, + "file": 20, + "bucket": 20, + "function": 20, + "size": 30000, + "version": "1.4.0" + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/swagger2-1.8.x-server.json b/app/config/specs/swagger2-1.8.x-server.json new file mode 100644 index 0000000000..0a5fc8fe95 --- /dev/null +++ b/app/config/specs/swagger2-1.8.x-server.json @@ -0,0 +1,41799 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.8.0", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "host": "cloud.appwrite.io", + "x-host-docs": "<REGION>.cloud.appwrite.io", + "basePath": "\/v1", + "schemes": [ + "https" + ], + "consumes": [ + "application\/json", + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "securityDefinitions": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "Key": { + "type": "apiKey", + "name": "X-Appwrite-Key", + "description": "Your secret API key", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_API_KEY>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_JWT>" + } + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Session": { + "type": "apiKey", + "name": "X-Appwrite-Session", + "description": "The user session to authenticate with", + "in": "header" + }, + "ForwardedUserAgent": { + "type": "apiKey", + "name": "X-Forwarded-User-Agent", + "description": "The user agent string of the client that made the request", + "in": "header" + } + }, + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "demo": "account\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "demo": "account\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "demo": "account\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "schema": { + "$ref": "#\/definitions\/identityList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "type": "string", + "x-example": "<IDENTITY_ID>", + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "demo": "account\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "demo": "account\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "default": null, + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + ] + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "schema": { + "$ref": "#\/definitions\/mfaType" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + ] + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "schema": { + "$ref": "#\/definitions\/mfaChallenge" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "default": null, + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + ] + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "default": null, + "x-example": "<CHALLENGE_ID>" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + ] + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "schema": { + "$ref": "#\/definitions\/mfaFactors" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "demo": "account\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "default": "", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + ] + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + ] + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "demo": "account\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "demo": "account\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "demo": "account\/create-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "demo": "account\/update-recovery.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "default": null, + "x-example": "<SECRET>" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "schema": { + "$ref": "#\/definitions\/sessionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "demo": "account\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "demo": "account\/update-magic-url-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "demo": "account\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "demo": "account\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "demo": "account\/create-magic-url-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "consumes": [], + "produces": [ + "text\/html" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "demo": "account\/create-o-auth-2-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "", + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "required": false, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "", + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", + "default": null, + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + ] + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "demo": "avatars\/get-browser.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ], + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "demo": "avatars\/get-credit-card.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", + "required": true, + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "unionpay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ], + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "demo": "avatars\/get-favicon.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "demo": "avatars\/get-flag.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ], + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 100, + "in": "query" + }, + { + "name": "quality", + "description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "demo": "avatars\/get-image.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "in": "query" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "demo": "avatars\/get-initials.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "type": "string", + "x-example": "<NAME>", + "default": "", + "in": "query" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500, + "in": "query" + }, + { + "name": "height", + "description": "Image height. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500, + "in": "query" + }, + { + "name": "background", + "description": "Changes background color. By default a random color will be picked and stay will persistent to the given name.", + "required": false, + "type": "string", + "default": "", + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "demo": "avatars\/get-qr.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "type": "string", + "x-example": "<TEXT>", + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 400, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 1, + "in": "query" + }, + { + "name": "download", + "description": "Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.", + "required": false, + "type": "boolean", + "x-example": false, + "default": false, + "in": "query" + } + ] + } + }, + "\/databases": { + "get": { + "summary": "List databases", + "operationId": "databasesList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "schema": { + "$ref": "#\/definitions\/databaseList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "list", + "group": "databases", + "weight": 316, + "cookies": false, + "type": "", + "demo": "databases\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + }, + "methods": [ + { + "name": "list", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "queries", + "search" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/databaseList" + } + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "demo": "databases\/list.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "databasesCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "create", + "group": "databases", + "weight": 312, + "cookies": false, + "type": "", + "demo": "databases\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + }, + "methods": [ + { + "name": "create", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/database" + } + ], + "description": "Create a new Database.\n", + "demo": "databases\/create.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "databasesGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "get", + "group": "databases", + "weight": 313, + "cookies": false, + "type": "", + "demo": "databases\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + }, + "methods": [ + { + "name": "get", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/database" + } + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "demo": "databases\/get.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "databasesUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "update", + "group": "databases", + "weight": 314, + "cookies": false, + "type": "", + "demo": "databases\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + }, + "methods": [ + { + "name": "update", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/database" + } + ], + "description": "Update a database by its unique ID.", + "demo": "databases\/update.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete database", + "operationId": "databasesDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "delete", + "group": "databases", + "weight": 315, + "cookies": false, + "type": "", + "demo": "databases\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + }, + "methods": [ + { + "name": "delete", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "demo": "databases\/delete.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "databasesListCollections", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "schema": { + "$ref": "#\/definitions\/collectionList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listCollections", + "group": "collections", + "weight": 324, + "cookies": false, + "type": "", + "demo": "databases\/list-collections.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTables" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create collections", + "operationId": "databasesCreateCollection", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createCollection", + "group": "collections", + "weight": 320, + "cookies": false, + "type": "", + "demo": "databases\/create-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "collectionId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<COLLECTION_ID>" + }, + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "databasesGetCollection", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getCollection", + "group": "collections", + "weight": 321, + "cookies": false, + "type": "", + "demo": "databases\/get-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "databasesUpdateCollection", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateCollection", + "group": "collections", + "weight": 322, + "cookies": false, + "type": "", + "demo": "databases\/update-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete collection", + "operationId": "databasesDeleteCollection", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteCollection", + "group": "collections", + "weight": 323, + "cookies": false, + "type": "", + "demo": "databases\/delete-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTable" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes": { + "get": { + "summary": "List attributes", + "operationId": "databasesListAttributes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "List attributes in the collection.", + "responses": { + "200": { + "description": "Attributes List", + "schema": { + "$ref": "#\/definitions\/attributeList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listAttributes", + "group": "attributes", + "weight": 341, + "cookies": false, + "type": "", + "demo": "databases\/list-attributes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listColumns" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean": { + "post": { + "summary": "Create boolean attribute", + "operationId": "databasesCreateBooleanAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a boolean attribute.\n", + "responses": { + "202": { + "description": "AttributeBoolean", + "schema": { + "$ref": "#\/definitions\/attributeBoolean" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createBooleanAttribute", + "group": "attributes", + "weight": 342, + "cookies": false, + "type": "", + "demo": "databases\/create-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBooleanColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean\/{key}": { + "patch": { + "summary": "Update boolean attribute", + "operationId": "databasesUpdateBooleanAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a boolean attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeBoolean", + "schema": { + "$ref": "#\/definitions\/attributeBoolean" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateBooleanAttribute", + "group": "attributes", + "weight": 343, + "cookies": false, + "type": "", + "demo": "databases\/update-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBooleanColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime": { + "post": { + "summary": "Create datetime attribute", + "operationId": "databasesCreateDatetimeAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a date time attribute according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "AttributeDatetime", + "schema": { + "$ref": "#\/definitions\/attributeDatetime" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createDatetimeAttribute", + "group": "attributes", + "weight": 344, + "cookies": false, + "type": "", + "demo": "databases\/create-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createDatetimeColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { + "patch": { + "summary": "Update datetime attribute", + "operationId": "databasesUpdateDatetimeAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a date time attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeDatetime", + "schema": { + "$ref": "#\/definitions\/attributeDatetime" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDatetimeAttribute", + "group": "attributes", + "weight": 345, + "cookies": false, + "type": "", + "demo": "databases\/update-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateDatetimeColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email": { + "post": { + "summary": "Create email attribute", + "operationId": "databasesCreateEmailAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an email attribute.\n", + "responses": { + "202": { + "description": "AttributeEmail", + "schema": { + "$ref": "#\/definitions\/attributeEmail" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createEmailAttribute", + "group": "attributes", + "weight": 346, + "cookies": false, + "type": "", + "demo": "databases\/create-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEmailColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email\/{key}": { + "patch": { + "summary": "Update email attribute", + "operationId": "databasesUpdateEmailAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEmail", + "schema": { + "$ref": "#\/definitions\/attributeEmail" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateEmailAttribute", + "group": "attributes", + "weight": 347, + "cookies": false, + "type": "", + "demo": "databases\/update-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEmailColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum": { + "post": { + "summary": "Create enum attribute", + "operationId": "databasesCreateEnumAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "responses": { + "202": { + "description": "AttributeEnum", + "schema": { + "$ref": "#\/definitions\/attributeEnum" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createEnumAttribute", + "group": "attributes", + "weight": 348, + "cookies": false, + "type": "", + "demo": "databases\/create-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEnumColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum\/{key}": { + "patch": { + "summary": "Update enum attribute", + "operationId": "databasesUpdateEnumAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEnum", + "schema": { + "$ref": "#\/definitions\/attributeEnum" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateEnumAttribute", + "group": "attributes", + "weight": 349, + "cookies": false, + "type": "", + "demo": "databases\/update-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEnumColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float": { + "post": { + "summary": "Create float attribute", + "operationId": "databasesCreateFloatAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeFloat", + "schema": { + "$ref": "#\/definitions\/attributeFloat" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createFloatAttribute", + "group": "attributes", + "weight": 350, + "cookies": false, + "type": "", + "demo": "databases\/create-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createFloatColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value.", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value.", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float\/{key}": { + "patch": { + "summary": "Update float attribute", + "operationId": "databasesUpdateFloatAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeFloat", + "schema": { + "$ref": "#\/definitions\/attributeFloat" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateFloatAttribute", + "group": "attributes", + "weight": 351, + "cookies": false, + "type": "", + "demo": "databases\/update-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateFloatColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value.", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value.", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer": { + "post": { + "summary": "Create integer attribute", + "operationId": "databasesCreateIntegerAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeInteger", + "schema": { + "$ref": "#\/definitions\/attributeInteger" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIntegerAttribute", + "group": "attributes", + "weight": 352, + "cookies": false, + "type": "", + "demo": "databases\/create-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIntegerColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer\/{key}": { + "patch": { + "summary": "Update integer attribute", + "operationId": "databasesUpdateIntegerAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeInteger", + "schema": { + "$ref": "#\/definitions\/attributeInteger" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIntegerAttribute", + "group": "attributes", + "weight": 353, + "cookies": false, + "type": "", + "demo": "databases\/update-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIntegerColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip": { + "post": { + "summary": "Create IP address attribute", + "operationId": "databasesCreateIpAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create IP address attribute.\n", + "responses": { + "202": { + "description": "AttributeIP", + "schema": { + "$ref": "#\/definitions\/attributeIp" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIpAttribute", + "group": "attributes", + "weight": 354, + "cookies": false, + "type": "", + "demo": "databases\/create-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIpColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "schema": { + "$ref": "#\/definitions\/attributeIp" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 355, + "cookies": false, + "type": "", + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIpColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 356, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 357, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 358, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 359, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 360, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "schema": { + "$ref": "#\/definitions\/attributeRelationship" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createRelationshipAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/create-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRelationshipColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "relatedCollectionId": { + "type": "string", + "description": "Related Collection ID.", + "default": null, + "x-example": "<RELATED_COLLECTION_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "default": null, + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "default": false, + "x-example": false + }, + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Attribute Key.", + "default": null, + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": "restrict", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedCollectionId", + "type" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string": { + "post": { + "summary": "Create string attribute", + "operationId": "databasesCreateStringAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a string attribute.\n", + "responses": { + "202": { + "description": "AttributeString", + "schema": { + "$ref": "#\/definitions\/attributeString" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createStringAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/create-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createStringColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "size": { + "type": "integer", + "description": "Attribute size for text attributes, in number of characters.", + "default": null, + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string\/{key}": { + "patch": { + "summary": "Update string attribute", + "operationId": "databasesUpdateStringAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeString", + "schema": { + "$ref": "#\/definitions\/attributeString" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateStringAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/update-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateStringColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string attribute.", + "default": null, + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url": { + "post": { + "summary": "Create URL attribute", + "operationId": "databasesCreateUrlAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a URL attribute.\n", + "responses": { + "202": { + "description": "AttributeURL", + "schema": { + "$ref": "#\/definitions\/attributeUrl" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createUrlAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/create-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createUrlColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url\/{key}": { + "patch": { + "summary": "Update URL attribute", + "operationId": "databasesUpdateUrlAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeURL", + "schema": { + "$ref": "#\/definitions\/attributeUrl" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateUrlAttribute", + "group": "attributes", + "weight": 367, + "cookies": false, + "type": "", + "demo": "databases\/update-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateUrlColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}": { + "get": { + "summary": "Get attribute", + "operationId": "databasesGetAttribute", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get attribute by ID.", + "responses": { + "200": { + "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeRelationship, or AttributeString", + "schema": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getAttribute", + "group": "attributes", + "weight": 339, + "cookies": false, + "type": "", + "demo": "databases\/get-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete attribute", + "operationId": "databasesDeleteAttribute", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Deletes an attribute.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteAttribute", + "group": "attributes", + "weight": 340, + "cookies": false, + "type": "", + "demo": "databases\/delete-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}\/relationship": { + "patch": { + "summary": "Update relationship attribute", + "operationId": "databasesUpdateRelationshipAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "200": { + "description": "AttributeRelationship", + "schema": { + "$ref": "#\/definitions\/attributeRelationship" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateRelationshipAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/update-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRelationshipColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": null, + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 335, + "cookies": false, + "type": "", + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 327, + "cookies": false, + "type": "", + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, + "methods": [ + { + "name": "createDocument", + "namespace": "databases", + "desc": "Create document", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + }, + { + "name": "createDocuments", + "namespace": "databases", + "desc": "Create documents", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRows" + } + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<DOCUMENT_ID>" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + }, + "put": { + "summary": "Upsert documents", + "operationId": "databasesUpsertDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 332, + "cookies": false, + "type": "", + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + }, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "demo": "databases\/upsert-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + } + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documents": { + "type": "array", + "description": "Array of document data as JSON objects. May contain partial documents.", + "default": null, + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "documents" + ] + } + } + ] + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDocuments", + "group": "documents", + "weight": 330, + "cookies": false, + "type": "", + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRows" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteDocuments", + "group": "documents", + "weight": 334, + "cookies": false, + "type": "", + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRows" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 328, + "cookies": false, + "type": "", + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a document", + "operationId": "databasesUpsertDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 331, + "cookies": false, + "type": "", + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "default": {}, + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + ] + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 329, + "cookies": false, + "type": "", + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 333, + "cookies": false, + "type": "", + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "databasesListIndexes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "schema": { + "$ref": "#\/definitions\/indexList" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 371, + "cookies": false, + "type": "", + "demo": "databases\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listIndexes" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "databasesCreateIndex", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/index" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 368, + "cookies": false, + "type": "", + "demo": "databases\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIndex" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "default": null, + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "default": null, + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "attributes": { + "type": "array", + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "default": [], + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "databasesGetIndex", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/index" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 369, + "cookies": false, + "type": "", + "demo": "databases\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getIndex" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "databasesDeleteIndex", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 370, + "cookies": false, + "type": "", + "demo": "databases\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteIndex" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/functions": { + "get": { + "summary": "List functions", + "operationId": "functionsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Functions List", + "schema": { + "$ref": "#\/definitions\/functionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "functions", + "weight": 440, + "cookies": false, + "type": "", + "demo": "functions\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create function", + "operationId": "functionsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "responses": { + "201": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "functions", + "weight": 437, + "cookies": false, + "type": "", + "demo": "functions\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "functionId": { + "type": "string", + "description": "Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<FUNCTION_ID>" + }, + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "default": null, + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "default": "", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Function maximum execution time in seconds.", + "default": 15, + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "default": true, + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "default": "", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "default": "", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "functionId", + "name", + "runtime" + ] + } + } + ] + } + }, + "\/functions\/runtimes": { + "get": { + "summary": "List runtimes", + "operationId": "functionsListRuntimes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all runtimes that are currently active on your instance.", + "responses": { + "200": { + "description": "Runtimes List", + "schema": { + "$ref": "#\/definitions\/runtimeList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRuntimes", + "group": "runtimes", + "weight": 442, + "cookies": false, + "type": "", + "demo": "functions\/list-runtimes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "functionsListSpecifications", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "List allowed function specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "schema": { + "$ref": "#\/definitions\/specificationList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSpecifications", + "group": "runtimes", + "weight": 443, + "cookies": false, + "type": "", + "demo": "functions\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/{functionId}": { + "get": { + "summary": "Get function", + "operationId": "functionsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "functions", + "weight": 438, + "cookies": false, + "type": "", + "demo": "functions\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update function", + "operationId": "functionsUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "functions", + "weight": 439, + "cookies": false, + "type": "", + "demo": "functions\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "default": "", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "default": "", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Maximum execution time in seconds.", + "default": 15, + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "default": true, + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "default": "", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "default": "", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Controle System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function", + "default": null, + "x-example": "<PROVIDER_REPOSITORY_ID>", + "x-nullable": true + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete function", + "operationId": "functionsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a function by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "functions", + "weight": 441, + "cookies": false, + "type": "", + "demo": "functions\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployment": { + "patch": { + "summary": "Update function's deployment", + "operationId": "functionsUpdateFunctionDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFunctionDeployment", + "group": "functions", + "weight": 446, + "cookies": false, + "type": "", + "demo": "functions\/update-function-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "functionsListDeployments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "schema": { + "$ref": "#\/definitions\/deploymentList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 447, + "cookies": false, + "type": "", + "demo": "functions\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "functionsCreateDeployment", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 444, + "cookies": false, + "type": "upload", + "demo": "functions\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "entrypoint", + "description": "Entrypoint File.", + "required": false, + "type": "string", + "x-example": "<ENTRYPOINT>", + "in": "formData" + }, + { + "name": "commands", + "description": "Build Commands.", + "required": false, + "type": "string", + "x-example": "<COMMANDS>", + "in": "formData" + }, + { + "name": "code", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "activate", + "description": "Automatically activate the deployment when it is finished building.", + "required": true, + "type": "boolean", + "x-example": false, + "in": "formData" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "functionsCreateDuplicateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 452, + "cookies": false, + "type": "", + "demo": "functions\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + }, + "buildId": { + "type": "string", + "description": "Build unique ID.", + "default": "", + "x-example": "<BUILD_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "functionsCreateTemplateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 449, + "cookies": false, + "type": "", + "demo": "functions\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "default": null, + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "default": null, + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to function code in the template repo.", + "default": null, + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the function template.", + "default": null, + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "functionsCreateVcsDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 450, + "cookies": false, + "type": "", + "demo": "functions\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "default": null, + "x-example": "branch", + "enum": [ + "branch", + "commit" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "default": null, + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "functionsGetDeployment", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 445, + "cookies": false, + "type": "", + "demo": "functions\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "functionsDeleteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a code deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 448, + "cookies": false, + "type": "", + "demo": "functions\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "functionsGetDeploymentDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "functions" + ], + "description": "Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 451, + "cookies": false, + "type": "location", + "demo": "functions\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source", + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "functionsUpdateDeploymentStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 453, + "cookies": false, + "type": "", + "demo": "functions\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 456, + "cookies": false, + "type": "", + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "consumes": [ + "application\/json" + ], + "produces": [ + "multipart\/form-data" + ], + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 454, + "cookies": false, + "type": "", + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "<BODY>" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "<PATH>" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is POST.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS", + "HEAD" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": "<SCHEDULED_AT>" + } + } + } + } + ] + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 455, + "cookies": false, + "type": "", + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "type": "string", + "x-example": "<EXECUTION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete execution", + "operationId": "functionsDeleteExecution", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a function execution by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteExecution", + "group": "executions", + "weight": 457, + "cookies": false, + "type": "", + "demo": "functions\/delete-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "type": "string", + "x-example": "<EXECUTION_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "functionsListVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all variables of a specific function.", + "responses": { + "200": { + "description": "Variables List", + "schema": { + "$ref": "#\/definitions\/variableList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 462, + "cookies": false, + "type": "", + "demo": "functions\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "functionsCreateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "responses": { + "201": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 460, + "cookies": false, + "type": "", + "demo": "functions\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "default": true, + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "functionsGetVariable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 461, + "cookies": false, + "type": "", + "demo": "functions\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "functionsUpdateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 463, + "cookies": false, + "type": "", + "demo": "functions\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "default": null, + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + ] + }, + "delete": { + "summary": "Delete variable", + "operationId": "functionsDeleteVariable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 464, + "cookies": false, + "type": "", + "demo": "functions\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 250, + "cookies": false, + "type": "graphql", + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 249, + "cookies": false, + "type": "graphql", + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/health": { + "get": { + "summary": "Get HTTP", + "operationId": "healthGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite HTTP server is up and responsive.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "health", + "weight": 78, + "cookies": false, + "type": "", + "demo": "health\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/anti-virus": { + "get": { + "summary": "Get antivirus", + "operationId": "healthGetAntivirus", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite Antivirus server is up and connection is successful.", + "responses": { + "200": { + "description": "Health Antivirus", + "schema": { + "$ref": "#\/definitions\/healthAntivirus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getAntivirus", + "group": "health", + "weight": 99, + "cookies": false, + "type": "", + "demo": "health\/get-antivirus.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/cache": { + "get": { + "summary": "Get cache", + "operationId": "healthGetCache", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite in-memory cache servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCache", + "group": "health", + "weight": 81, + "cookies": false, + "type": "", + "demo": "health\/get-cache.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/certificate": { + "get": { + "summary": "Get the SSL certificate for a domain", + "operationId": "healthGetCertificate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the SSL certificate for a domain", + "responses": { + "200": { + "description": "Health Certificate", + "schema": { + "$ref": "#\/definitions\/healthCertificate" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getCertificate", + "group": "health", + "weight": 86, + "cookies": false, + "type": "", + "demo": "health\/get-certificate.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "domain", + "description": "string", + "required": false, + "type": "string", + "in": "query" + } + ] + } + }, + "\/health\/db": { + "get": { + "summary": "Get DB", + "operationId": "healthGetDB", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite database servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDB", + "group": "health", + "weight": 80, + "cookies": false, + "type": "", + "demo": "health\/get-db.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/pubsub": { + "get": { + "summary": "Get pubsub", + "operationId": "healthGetPubSub", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite pub-sub servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPubSub", + "group": "health", + "weight": 82, + "cookies": false, + "type": "", + "demo": "health\/get-pub-sub.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/queue\/builds": { + "get": { + "summary": "Get builds queue", + "operationId": "healthGetQueueBuilds", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of builds that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueBuilds", + "group": "queue", + "weight": 88, + "cookies": false, + "type": "", + "demo": "health\/get-queue-builds.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/certificates": { + "get": { + "summary": "Get certificates queue", + "operationId": "healthGetQueueCertificates", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueCertificates", + "group": "queue", + "weight": 87, + "cookies": false, + "type": "", + "demo": "health\/get-queue-certificates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/databases": { + "get": { + "summary": "Get databases queue", + "operationId": "healthGetQueueDatabases", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueDatabases", + "group": "queue", + "weight": 89, + "cookies": false, + "type": "", + "demo": "health\/get-queue-databases.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Queue name for which to check the queue size", + "required": false, + "type": "string", + "x-example": "<NAME>", + "default": "database_db_main", + "in": "query" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/deletes": { + "get": { + "summary": "Get deletes queue", + "operationId": "healthGetQueueDeletes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueDeletes", + "group": "queue", + "weight": 90, + "cookies": false, + "type": "", + "demo": "health\/get-queue-deletes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/failed\/{name}": { + "get": { + "summary": "Get number of failed queue jobs", + "operationId": "healthGetFailedJobs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Returns the amount of failed jobs in a given queue.\n", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFailedJobs", + "group": "queue", + "weight": 100, + "cookies": false, + "type": "", + "demo": "health\/get-failed-jobs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "The name of the queue", + "required": true, + "type": "string", + "x-example": "v1-database", + "enum": [ + "v1-database", + "v1-deletes", + "v1-audits", + "v1-mails", + "v1-functions", + "v1-stats-resources", + "v1-stats-usage", + "v1-webhooks", + "v1-certificates", + "v1-builds", + "v1-messaging", + "v1-migrations" + ], + "x-enum-name": null, + "x-enum-keys": [], + "in": "path" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/functions": { + "get": { + "summary": "Get functions queue", + "operationId": "healthGetQueueFunctions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueFunctions", + "group": "queue", + "weight": 94, + "cookies": false, + "type": "", + "demo": "health\/get-queue-functions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/logs": { + "get": { + "summary": "Get logs queue", + "operationId": "healthGetQueueLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueLogs", + "group": "queue", + "weight": 85, + "cookies": false, + "type": "", + "demo": "health\/get-queue-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/mails": { + "get": { + "summary": "Get mails queue", + "operationId": "healthGetQueueMails", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of mails that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMails", + "group": "queue", + "weight": 91, + "cookies": false, + "type": "", + "demo": "health\/get-queue-mails.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/messaging": { + "get": { + "summary": "Get messaging queue", + "operationId": "healthGetQueueMessaging", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of messages that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMessaging", + "group": "queue", + "weight": 92, + "cookies": false, + "type": "", + "demo": "health\/get-queue-messaging.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/migrations": { + "get": { + "summary": "Get migrations queue", + "operationId": "healthGetQueueMigrations", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueMigrations", + "group": "queue", + "weight": 93, + "cookies": false, + "type": "", + "demo": "health\/get-queue-migrations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-resources": { + "get": { + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueStatsResources", + "group": "queue", + "weight": 95, + "cookies": false, + "type": "", + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueUsage", + "group": "queue", + "weight": 96, + "cookies": false, + "type": "", + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/webhooks": { + "get": { + "summary": "Get webhooks queue", + "operationId": "healthGetQueueWebhooks", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getQueueWebhooks", + "group": "queue", + "weight": 84, + "cookies": false, + "type": "", + "demo": "health\/get-queue-webhooks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/storage": { + "get": { + "summary": "Get storage", + "operationId": "healthGetStorage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getStorage", + "group": "storage", + "weight": 98, + "cookies": false, + "type": "", + "demo": "health\/get-storage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/storage\/local": { + "get": { + "summary": "Get local storage", + "operationId": "healthGetStorageLocal", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite local storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getStorageLocal", + "group": "storage", + "weight": 97, + "cookies": false, + "type": "", + "demo": "health\/get-storage-local.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/time": { + "get": { + "summary": "Get time", + "operationId": "healthGetTime", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.", + "responses": { + "200": { + "description": "Health Time", + "schema": { + "$ref": "#\/definitions\/healthTime" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTime", + "group": "health", + "weight": 83, + "cookies": false, + "type": "", + "demo": "health\/get-time.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "responses": { + "200": { + "description": "Locale", + "schema": { + "$ref": "#\/definitions\/locale" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 70, + "cookies": false, + "type": "", + "demo": "locale\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "schema": { + "$ref": "#\/definitions\/localeCodeList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 71, + "cookies": false, + "type": "", + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "schema": { + "$ref": "#\/definitions\/continentList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 75, + "cookies": false, + "type": "", + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 72, + "cookies": false, + "type": "", + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 73, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-eu.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "schema": { + "$ref": "#\/definitions\/phoneList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 74, + "cookies": false, + "type": "", + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Currencies List", + "schema": { + "$ref": "#\/definitions\/currencyList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 76, + "cookies": false, + "type": "", + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.", + "responses": { + "200": { + "description": "Languages List", + "schema": { + "$ref": "#\/definitions\/languageList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 77, + "cookies": false, + "type": "", + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages": { + "get": { + "summary": "List messages", + "operationId": "messagingListMessages", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all messages from the current Appwrite project.", + "responses": { + "200": { + "description": "Message list", + "schema": { + "$ref": "#\/definitions\/messageList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMessages", + "group": "messages", + "weight": 304, + "cookies": false, + "type": "", + "demo": "messaging\/list-messages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/email": { + "post": { + "summary": "Create email", + "operationId": "messagingCreateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new email message.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmail", + "group": "messages", + "weight": 301, + "cookies": false, + "type": "", + "demo": "messaging\/create-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "default": null, + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + }, + "required": [ + "messageId", + "subject", + "content" + ] + } + } + ] + } + }, + "\/messaging\/messages\/email\/{messageId}": { + "patch": { + "summary": "Update email", + "operationId": "messagingUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "messages", + "weight": 308, + "cookies": false, + "type": "", + "demo": "messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "default": null, + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "default": null, + "x-example": false + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/messaging\/messages\/push": { + "post": { + "summary": "Create push notification", + "operationId": "messagingCreatePush", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new push notification.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPush", + "group": "messages", + "weight": 303, + "cookies": false, + "type": "", + "demo": "messaging\/create-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "default": "", + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "default": "", + "x-example": "<BODY>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "data": { + "type": "object", + "description": "Additional key-value pair data for push notification.", + "default": {}, + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "default": "", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": "", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web Platform.", + "default": "", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS Platform.", + "default": "", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android Platform.", + "default": "", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android Platform.", + "default": "", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "default": -1, + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "default": "high", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + }, + "required": [ + "messageId" + ] + } + } + ] + } + }, + "\/messaging\/messages\/push\/{messageId}": { + "patch": { + "summary": "Update push notification", + "operationId": "messagingUpdatePush", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePush", + "group": "messages", + "weight": 310, + "cookies": false, + "type": "", + "demo": "messaging\/update-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "default": null, + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "default": null, + "x-example": "<BODY>" + }, + "data": { + "type": "object", + "description": "Additional Data for push notification.", + "default": {}, + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "default": null, + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": null, + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web platforms.", + "default": null, + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS platforms.", + "default": null, + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android platforms.", + "default": null, + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android platforms.", + "default": null, + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS platforms.", + "default": null, + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "default": null, + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + } + } + } + ] + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSms", + "group": "messages", + "weight": 302, + "cookies": false, + "type": "", + "demo": "messaging\/create-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + }, + "methods": [ + { + "name": "createSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + } + }, + { + "name": "createSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "content": { + "type": "string", + "description": "SMS Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + }, + "required": [ + "messageId", + "content" + ] + } + } + ] + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSms", + "group": "messages", + "weight": 309, + "cookies": false, + "type": "", + "demo": "messaging\/update-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + }, + "methods": [ + { + "name": "updateSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + } + }, + { + "name": "updateSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/messaging\/messages\/{messageId}": { + "get": { + "summary": "Get message", + "operationId": "messagingGetMessage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a message by its unique ID.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getMessage", + "group": "messages", + "weight": 307, + "cookies": false, + "type": "", + "demo": "messaging\/get-message.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete message", + "operationId": "messagingDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "messages", + "weight": 311, + "cookies": false, + "type": "", + "demo": "messaging\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/logs": { + "get": { + "summary": "List message logs", + "operationId": "messagingListMessageLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the message activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMessageLogs", + "group": "logs", + "weight": 305, + "cookies": false, + "type": "", + "demo": "messaging\/list-message-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/targets": { + "get": { + "summary": "List message targets", + "operationId": "messagingListTargets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of the targets associated with a message.", + "responses": { + "200": { + "description": "Target list", + "schema": { + "$ref": "#\/definitions\/targetList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTargets", + "group": "messages", + "weight": 306, + "cookies": false, + "type": "", + "demo": "messaging\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/providers": { + "get": { + "summary": "List providers", + "operationId": "messagingListProviders", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all providers from the current Appwrite project.", + "responses": { + "200": { + "description": "Provider list", + "schema": { + "$ref": "#\/definitions\/providerList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listProviders", + "group": "providers", + "weight": 276, + "cookies": false, + "type": "", + "demo": "messaging\/list-providers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createApnsProvider", + "group": "providers", + "weight": 275, + "cookies": false, + "type": "", + "demo": "messaging\/create-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + }, + "methods": [ + { + "name": "createApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + } + }, + { + "name": "createAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "default": "", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "default": "", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "default": "", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateApnsProvider", + "group": "providers", + "weight": 288, + "cookies": false, + "type": "", + "demo": "messaging\/update-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + }, + "methods": [ + { + "name": "updateApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + } + }, + { + "name": "updateAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "default": "", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "default": "", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "default": "", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "default": null, + "x-example": false + } + } + } + } + ] + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createFcmProvider", + "group": "providers", + "weight": 274, + "cookies": false, + "type": "", + "demo": "messaging\/create-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + }, + "methods": [ + { + "name": "createFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + } + }, + { + "name": "createFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "default": {}, + "x-example": "{}" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateFcmProvider", + "group": "providers", + "weight": 287, + "cookies": false, + "type": "", + "demo": "messaging\/update-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + }, + "methods": [ + { + "name": "updateFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + } + }, + { + "name": "updateFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "default": {}, + "x-example": "{}" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/mailgun": { + "post": { + "summary": "Create Mailgun provider", + "operationId": "messagingCreateMailgunProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Mailgun provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMailgunProvider", + "group": "providers", + "weight": 266, + "cookies": false, + "type": "", + "demo": "messaging\/create-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "default": "", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "default": "", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "default": null, + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/mailgun\/{providerId}": { + "patch": { + "summary": "Update Mailgun provider", + "operationId": "messagingUpdateMailgunProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Mailgun provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMailgunProvider", + "group": "providers", + "weight": 279, + "cookies": false, + "type": "", + "demo": "messaging\/update-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "default": "", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "default": "", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "default": null, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/msg91": { + "post": { + "summary": "Create Msg91 provider", + "operationId": "messagingCreateMsg91Provider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new MSG91 provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMsg91Provider", + "group": "providers", + "weight": 269, + "cookies": false, + "type": "", + "demo": "messaging\/create-msg-91-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID", + "default": "", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "default": "", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/msg91\/{providerId}": { + "patch": { + "summary": "Update Msg91 provider", + "operationId": "messagingUpdateMsg91Provider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a MSG91 provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMsg91Provider", + "group": "providers", + "weight": 282, + "cookies": false, + "type": "", + "demo": "messaging\/update-msg-91-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID.", + "default": "", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "default": "", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "default": "", + "x-example": "<AUTH_KEY>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/sendgrid": { + "post": { + "summary": "Create Sendgrid provider", + "operationId": "messagingCreateSendgridProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Sendgrid provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSendgridProvider", + "group": "providers", + "weight": 267, + "cookies": false, + "type": "", + "demo": "messaging\/create-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/sendgrid\/{providerId}": { + "patch": { + "summary": "Update Sendgrid provider", + "operationId": "messagingUpdateSendgridProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Sendgrid provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSendgridProvider", + "group": "providers", + "weight": 280, + "cookies": false, + "type": "", + "demo": "messaging\/update-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSmtpProvider", + "group": "providers", + "weight": 268, + "cookies": false, + "type": "", + "demo": "messaging\/create-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + }, + "methods": [ + { + "name": "createSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + } + }, + { + "name": "createSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "default": null, + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "The default SMTP server port.", + "default": 587, + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "default": "", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "default": "", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "default": true, + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "default": "", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + ] + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSmtpProvider", + "group": "providers", + "weight": 281, + "cookies": false, + "type": "", + "demo": "messaging\/update-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + }, + "methods": [ + { + "name": "updateSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + } + }, + { + "name": "updateSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "default": "", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "SMTP port.", + "default": null, + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "default": "", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be 'ssl' or 'tls'", + "default": "", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "default": null, + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "default": "", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + } + } + } + ] + } + }, + "\/messaging\/providers\/telesign": { + "post": { + "summary": "Create Telesign provider", + "operationId": "messagingCreateTelesignProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Telesign provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTelesignProvider", + "group": "providers", + "weight": 270, + "cookies": false, + "type": "", + "demo": "messaging\/create-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "default": "", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/telesign\/{providerId}": { + "patch": { + "summary": "Update Telesign provider", + "operationId": "messagingUpdateTelesignProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Telesign provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTelesignProvider", + "group": "providers", + "weight": 283, + "cookies": false, + "type": "", + "demo": "messaging\/update-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "default": "", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/textmagic": { + "post": { + "summary": "Create Textmagic provider", + "operationId": "messagingCreateTextmagicProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Textmagic provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTextmagicProvider", + "group": "providers", + "weight": 271, + "cookies": false, + "type": "", + "demo": "messaging\/create-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "default": "", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "default": "", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/textmagic\/{providerId}": { + "patch": { + "summary": "Update Textmagic provider", + "operationId": "messagingUpdateTextmagicProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Textmagic provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTextmagicProvider", + "group": "providers", + "weight": 284, + "cookies": false, + "type": "", + "demo": "messaging\/update-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "default": "", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "default": "", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/twilio": { + "post": { + "summary": "Create Twilio provider", + "operationId": "messagingCreateTwilioProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Twilio provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTwilioProvider", + "group": "providers", + "weight": 272, + "cookies": false, + "type": "", + "demo": "messaging\/create-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "default": "", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "default": "", + "x-example": "<AUTH_TOKEN>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/twilio\/{providerId}": { + "patch": { + "summary": "Update Twilio provider", + "operationId": "messagingUpdateTwilioProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Twilio provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTwilioProvider", + "group": "providers", + "weight": 285, + "cookies": false, + "type": "", + "demo": "messaging\/update-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "default": "", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "default": "", + "x-example": "<AUTH_TOKEN>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/vonage": { + "post": { + "summary": "Create Vonage provider", + "operationId": "messagingCreateVonageProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Vonage provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVonageProvider", + "group": "providers", + "weight": 273, + "cookies": false, + "type": "", + "demo": "messaging\/create-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "default": "", + "x-example": "<API_SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/vonage\/{providerId}": { + "patch": { + "summary": "Update Vonage provider", + "operationId": "messagingUpdateVonageProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Vonage provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVonageProvider", + "group": "providers", + "weight": 286, + "cookies": false, + "type": "", + "demo": "messaging\/update-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "default": "", + "x-example": "<API_SECRET>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/{providerId}": { + "get": { + "summary": "Get provider", + "operationId": "messagingGetProvider", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a provider by its unique ID.\n", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getProvider", + "group": "providers", + "weight": 278, + "cookies": false, + "type": "", + "demo": "messaging\/get-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete provider", + "operationId": "messagingDeleteProvider", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a provider by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteProvider", + "group": "providers", + "weight": 289, + "cookies": false, + "type": "", + "demo": "messaging\/delete-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/providers\/{providerId}\/logs": { + "get": { + "summary": "List provider logs", + "operationId": "messagingListProviderLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the provider activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listProviderLogs", + "group": "providers", + "weight": 277, + "cookies": false, + "type": "", + "demo": "messaging\/list-provider-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/subscribers\/{subscriberId}\/logs": { + "get": { + "summary": "List subscriber logs", + "operationId": "messagingListSubscriberLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the subscriber activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSubscriberLogs", + "group": "subscribers", + "weight": 298, + "cookies": false, + "type": "", + "demo": "messaging\/list-subscriber-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/topics": { + "get": { + "summary": "List topics", + "operationId": "messagingListTopics", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all topics from the current Appwrite project.", + "responses": { + "200": { + "description": "Topic list", + "schema": { + "$ref": "#\/definitions\/topicList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTopics", + "group": "topics", + "weight": 291, + "cookies": false, + "type": "", + "demo": "messaging\/list-topics.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create topic", + "operationId": "messagingCreateTopic", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new topic.", + "responses": { + "201": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTopic", + "group": "topics", + "weight": 290, + "cookies": false, + "type": "", + "demo": "messaging\/create-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topicId": { + "type": "string", + "description": "Topic ID. Choose a custom Topic ID or a new Topic ID.", + "default": null, + "x-example": "<TOPIC_ID>" + }, + "name": { + "type": "string", + "description": "Topic Name.", + "default": null, + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [ + "users" + ], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "topicId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/topics\/{topicId}": { + "get": { + "summary": "Get topic", + "operationId": "messagingGetTopic", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTopic", + "group": "topics", + "weight": 293, + "cookies": false, + "type": "", + "demo": "messaging\/get-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update topic", + "operationId": "messagingUpdateTopic", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTopic", + "group": "topics", + "weight": 294, + "cookies": false, + "type": "", + "demo": "messaging\/update-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Topic Name.", + "default": null, + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": null, + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete topic", + "operationId": "messagingDeleteTopic", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a topic by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTopic", + "group": "topics", + "weight": 295, + "cookies": false, + "type": "", + "demo": "messaging\/delete-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/logs": { + "get": { + "summary": "List topic logs", + "operationId": "messagingListTopicLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the topic activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTopicLogs", + "group": "topics", + "weight": 292, + "cookies": false, + "type": "", + "demo": "messaging\/list-topic-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "get": { + "summary": "List subscribers", + "operationId": "messagingListSubscribers", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all subscribers from the current Appwrite project.", + "responses": { + "200": { + "description": "Subscriber list", + "schema": { + "$ref": "#\/definitions\/subscriberList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSubscribers", + "group": "subscribers", + "weight": 297, + "cookies": false, + "type": "", + "demo": "messaging\/list-subscribers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "schema": { + "$ref": "#\/definitions\/subscriber" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 296, + "cookies": false, + "type": "", + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "JWT": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "default": null, + "x-example": "<SUBSCRIBER_ID>" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "default": null, + "x-example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "get": { + "summary": "Get subscriber", + "operationId": "messagingGetSubscriber", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a subscriber by its unique ID.\n", + "responses": { + "200": { + "description": "Subscriber", + "schema": { + "$ref": "#\/definitions\/subscriber" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getSubscriber", + "group": "subscribers", + "weight": 299, + "cookies": false, + "type": "", + "demo": "messaging\/get-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 300, + "cookies": false, + "type": "", + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "JWT": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + } + ] + } + }, + "\/sites": { + "get": { + "summary": "List sites", + "operationId": "sitesList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Sites List", + "schema": { + "$ref": "#\/definitions\/siteList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "sites", + "weight": 469, + "cookies": false, + "type": "", + "demo": "sites\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create site", + "operationId": "sitesCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site.", + "responses": { + "201": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "sites", + "weight": 467, + "cookies": false, + "type": "", + "demo": "sites\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "siteId": { + "type": "string", + "description": "Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<SITE_ID>" + }, + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "default": null, + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "default": 30, + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "default": "", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "default": "", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "default": "", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "default": null, + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "default": "", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "default": "", + "x-example": "<FALLBACK_FILE>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "siteId", + "name", + "framework", + "buildRuntime" + ] + } + } + ] + } + }, + "\/sites\/frameworks": { + "get": { + "summary": "List frameworks", + "operationId": "sitesListFrameworks", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all frameworks that are currently available on the server instance.", + "responses": { + "200": { + "description": "Frameworks List", + "schema": { + "$ref": "#\/definitions\/frameworkList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listFrameworks", + "group": "frameworks", + "weight": 472, + "cookies": false, + "type": "", + "demo": "sites\/list-frameworks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "sitesListSpecifications", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "List allowed site specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "schema": { + "$ref": "#\/definitions\/specificationList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSpecifications", + "group": "frameworks", + "weight": 495, + "cookies": false, + "type": "", + "demo": "sites\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/{siteId}": { + "get": { + "summary": "Get site", + "operationId": "sitesGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "sites", + "weight": 468, + "cookies": false, + "type": "", + "demo": "sites\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update site", + "operationId": "sitesUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "sites", + "weight": 470, + "cookies": false, + "type": "", + "demo": "sites\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "default": null, + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "default": 30, + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "default": "", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "default": "", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "default": "", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "default": "", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "default": "", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "default": "", + "x-example": "<FALLBACK_FILE>" + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "name", + "framework" + ] + } + } + ] + }, + "delete": { + "summary": "Delete site", + "operationId": "sitesDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a site by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "sites", + "weight": 471, + "cookies": false, + "type": "", + "demo": "sites\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployment": { + "patch": { + "summary": "Update site's deployment", + "operationId": "sitesUpdateSiteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSiteDeployment", + "group": "sites", + "weight": 478, + "cookies": false, + "type": "", + "demo": "sites\/update-site-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "sitesListDeployments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "schema": { + "$ref": "#\/definitions\/deploymentList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 477, + "cookies": false, + "type": "", + "demo": "sites\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "sitesCreateDeployment", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 473, + "cookies": false, + "type": "upload", + "demo": "sites\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "installCommand", + "description": "Install Commands.", + "required": false, + "type": "string", + "x-example": "<INSTALL_COMMAND>", + "in": "formData" + }, + { + "name": "buildCommand", + "description": "Build Commands.", + "required": false, + "type": "string", + "x-example": "<BUILD_COMMAND>", + "in": "formData" + }, + { + "name": "outputDirectory", + "description": "Output Directory.", + "required": false, + "type": "string", + "x-example": "<OUTPUT_DIRECTORY>", + "in": "formData" + }, + { + "name": "code", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "activate", + "description": "Automatically activate the deployment when it is finished building.", + "required": true, + "type": "boolean", + "x-example": false, + "in": "formData" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "sitesCreateDuplicateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 481, + "cookies": false, + "type": "", + "demo": "sites\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "sitesCreateTemplateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 474, + "cookies": false, + "type": "", + "demo": "sites\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "default": null, + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "default": null, + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to site code in the template repo.", + "default": null, + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the site template.", + "default": null, + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "sitesCreateVcsDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 475, + "cookies": false, + "type": "", + "demo": "sites\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "default": null, + "x-example": "branch", + "enum": [ + "branch", + "commit", + "tag" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "default": null, + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "sitesGetDeployment", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 476, + "cookies": false, + "type": "", + "demo": "sites\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "sitesDeleteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a site deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 479, + "cookies": false, + "type": "", + "demo": "sites\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "sitesGetDeploymentDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "sites" + ], + "description": "Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 480, + "cookies": false, + "type": "location", + "demo": "sites\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source", + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "sitesUpdateDeploymentStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 482, + "cookies": false, + "type": "", + "demo": "sites\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all site logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 484, + "cookies": false, + "type": "", + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site request log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getLog", + "group": "logs", + "weight": 483, + "cookies": false, + "type": "", + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "<LOG_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Delete a site log by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteLog", + "group": "logs", + "weight": 485, + "cookies": false, + "type": "", + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "<LOG_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "sitesListVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all variables of a specific site.", + "responses": { + "200": { + "description": "Variables List", + "schema": { + "$ref": "#\/definitions\/variableList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 488, + "cookies": false, + "type": "", + "demo": "sites\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "sitesCreateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "responses": { + "201": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 486, + "cookies": false, + "type": "", + "demo": "sites\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "default": true, + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "sitesGetVariable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 487, + "cookies": false, + "type": "", + "demo": "sites\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "sitesUpdateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 489, + "cookies": false, + "type": "", + "demo": "sites\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "default": null, + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + ] + }, + "delete": { + "summary": "Delete variable", + "operationId": "sitesDeleteVariable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 490, + "cookies": false, + "type": "", + "demo": "sites\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets": { + "get": { + "summary": "List buckets", + "operationId": "storageListBuckets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Buckets List", + "schema": { + "$ref": "#\/definitions\/bucketList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listBuckets", + "group": "buckets", + "weight": 155, + "cookies": false, + "type": "", + "demo": "storage\/list-buckets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create bucket", + "operationId": "storageCreateBucket", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Create a new storage bucket.", + "responses": { + "201": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBucket", + "group": "buckets", + "weight": 154, + "cookies": false, + "type": "", + "demo": "storage\/create-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<BUCKET_ID>" + }, + "name": { + "type": "string", + "description": "Bucket name", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "default": true, + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "default": {}, + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "default": "none", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "default": true, + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "default": true, + "x-example": false + } + }, + "required": [ + "bucketId", + "name" + ] + } + } + ] + } + }, + "\/storage\/buckets\/{bucketId}": { + "get": { + "summary": "Get bucket", + "operationId": "storageGetBucket", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", + "responses": { + "200": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getBucket", + "group": "buckets", + "weight": 156, + "cookies": false, + "type": "", + "demo": "storage\/get-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update bucket", + "operationId": "storageUpdateBucket", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Update a storage bucket by its unique ID.", + "responses": { + "200": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBucket", + "group": "buckets", + "weight": 157, + "cookies": false, + "type": "", + "demo": "storage\/update-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Bucket name", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "default": true, + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "default": {}, + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "default": "none", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "default": true, + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete bucket", + "operationId": "storageDeleteBucket", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "storage" + ], + "description": "Delete a storage bucket by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteBucket", + "group": "buckets", + "weight": 158, + "cookies": false, + "type": "", + "demo": "storage\/delete-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "schema": { + "$ref": "#\/definitions\/fileList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 160, + "cookies": false, + "type": "", + "demo": "storage\/list-files.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 159, + "cookies": false, + "type": "upload", + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "x-upload-id": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "formData" + }, + { + "name": "file", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "permissions", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "x-example": "[\"read(\"any\")\"]", + "in": "formData" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 161, + "cookies": false, + "type": "", + "demo": "storage\/get-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 166, + "cookies": false, + "type": "", + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 167, + "cookies": false, + "type": "", + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 163, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 162, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-preview.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center", + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "type": "string", + "default": "", + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "type": "number", + "format": "float", + "x-example": 0, + "default": 1, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0, + "in": "query" + }, + { + "name": "background", + "description": "Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.", + "required": false, + "type": "string", + "default": "", + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "type": "string", + "x-example": "jpg", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "", + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 164, + "cookies": false, + "type": "location", + "demo": "storage\/get-file-view.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/tablesdb": { + "get": { + "summary": "List databases", + "operationId": "tablesDBList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "schema": { + "$ref": "#\/definitions\/databaseList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "tablesdb", + "weight": 376, + "cookies": false, + "type": "", + "demo": "tablesdb\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "tablesDBCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "tablesdb", + "weight": 372, + "cookies": false, + "type": "", + "demo": "tablesdb\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "tablesDBGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tablesdb", + "weight": 373, + "cookies": false, + "type": "", + "demo": "tablesdb\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "tablesDBUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tablesdb", + "weight": 374, + "cookies": false, + "type": "", + "demo": "tablesdb\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete database", + "operationId": "tablesDBDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tablesdb", + "weight": 375, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables": { + "get": { + "summary": "List tables", + "operationId": "tablesDBListTables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Tables List", + "schema": { + "$ref": "#\/definitions\/tableList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTables", + "group": "tables", + "weight": 383, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-tables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-tables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create table", + "operationId": "tablesDBCreateTable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTable", + "group": "tables", + "weight": 379, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "tableId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TABLE_ID>" + }, + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "tableId", + "name" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}": { + "get": { + "summary": "Get table", + "operationId": "tablesDBGetTable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.", + "responses": { + "200": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTable", + "group": "tables", + "weight": 380, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update table", + "operationId": "tablesDBUpdateTable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a table by its unique ID.", + "responses": { + "200": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTable", + "group": "tables", + "weight": 381, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete table", + "operationId": "tablesDBDeleteTable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a table by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTable", + "group": "tables", + "weight": 382, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns": { + "get": { + "summary": "List columns", + "operationId": "tablesDBListColumns", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "List columns in the table.", + "responses": { + "200": { + "description": "Columns List", + "schema": { + "$ref": "#\/definitions\/columnList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listColumns", + "group": "columns", + "weight": 388, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-columns.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-columns.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean": { + "post": { + "summary": "Create boolean column", + "operationId": "tablesDBCreateBooleanColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a boolean column.\n", + "responses": { + "202": { + "description": "ColumnBoolean", + "schema": { + "$ref": "#\/definitions\/columnBoolean" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBooleanColumn", + "group": "columns", + "weight": 389, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean\/{key}": { + "patch": { + "summary": "Update boolean column", + "operationId": "tablesDBUpdateBooleanColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a boolean column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnBoolean", + "schema": { + "$ref": "#\/definitions\/columnBoolean" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBooleanColumn", + "group": "columns", + "weight": 390, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime": { + "post": { + "summary": "Create datetime column", + "operationId": "tablesDBCreateDatetimeColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a date time column according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "ColumnDatetime", + "schema": { + "$ref": "#\/definitions\/columnDatetime" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDatetimeColumn", + "group": "columns", + "weight": 391, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime column", + "operationId": "tablesDBUpdateDatetimeColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a date time column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnDatetime", + "schema": { + "$ref": "#\/definitions\/columnDatetime" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDatetimeColumn", + "group": "columns", + "weight": 392, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email": { + "post": { + "summary": "Create email column", + "operationId": "tablesDBCreateEmailColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an email column.\n", + "responses": { + "202": { + "description": "ColumnEmail", + "schema": { + "$ref": "#\/definitions\/columnEmail" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailColumn", + "group": "columns", + "weight": 393, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email\/{key}": { + "patch": { + "summary": "Update email column", + "operationId": "tablesDBUpdateEmailColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an email column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEmail", + "schema": { + "$ref": "#\/definitions\/columnEmail" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailColumn", + "group": "columns", + "weight": 394, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum": { + "post": { + "summary": "Create enum column", + "operationId": "tablesDBCreateEnumColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column.", + "responses": { + "202": { + "description": "ColumnEnum", + "schema": { + "$ref": "#\/definitions\/columnEnum" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEnumColumn", + "group": "columns", + "weight": 395, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum\/{key}": { + "patch": { + "summary": "Update enum column", + "operationId": "tablesDBUpdateEnumColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an enum column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEnum", + "schema": { + "$ref": "#\/definitions\/columnEnum" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEnumColumn", + "group": "columns", + "weight": 396, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float": { + "post": { + "summary": "Create float column", + "operationId": "tablesDBCreateFloatColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a float column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnFloat", + "schema": { + "$ref": "#\/definitions\/columnFloat" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFloatColumn", + "group": "columns", + "weight": 397, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float\/{key}": { + "patch": { + "summary": "Update float column", + "operationId": "tablesDBUpdateFloatColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a float column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnFloat", + "schema": { + "$ref": "#\/definitions\/columnFloat" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFloatColumn", + "group": "columns", + "weight": 398, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer": { + "post": { + "summary": "Create integer column", + "operationId": "tablesDBCreateIntegerColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an integer column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnInteger", + "schema": { + "$ref": "#\/definitions\/columnInteger" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIntegerColumn", + "group": "columns", + "weight": 399, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer\/{key}": { + "patch": { + "summary": "Update integer column", + "operationId": "tablesDBUpdateIntegerColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an integer column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnInteger", + "schema": { + "$ref": "#\/definitions\/columnInteger" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIntegerColumn", + "group": "columns", + "weight": 400, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip": { + "post": { + "summary": "Create IP address column", + "operationId": "tablesDBCreateIpColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create IP address column.\n", + "responses": { + "202": { + "description": "ColumnIP", + "schema": { + "$ref": "#\/definitions\/columnIp" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIpColumn", + "group": "columns", + "weight": 401, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip\/{key}": { + "patch": { + "summary": "Update IP address column", + "operationId": "tablesDBUpdateIpColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an ip column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnIP", + "schema": { + "$ref": "#\/definitions\/columnIp" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIpColumn", + "group": "columns", + "weight": 402, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line column.", + "responses": { + "202": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 403, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 404, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point column.", + "responses": { + "202": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 405, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 406, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon column.", + "responses": { + "202": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 407, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { + "post": { + "summary": "Create relationship column", + "operationId": "tablesDBCreateRelationshipColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "202": { + "description": "ColumnRelationship", + "schema": { + "$ref": "#\/definitions\/columnRelationship" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRelationshipColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "relatedTableId": { + "type": "string", + "description": "Related Table ID.", + "default": null, + "x-example": "<RELATED_TABLE_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "default": null, + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "default": false, + "x-example": false + }, + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Column Key.", + "default": null, + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": "restrict", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedTableId", + "type" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string": { + "post": { + "summary": "Create string column", + "operationId": "tablesDBCreateStringColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a string column.\n", + "responses": { + "202": { + "description": "ColumnString", + "schema": { + "$ref": "#\/definitions\/columnString" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createStringColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "size": { + "type": "integer", + "description": "Column size for text columns, in number of characters.", + "default": null, + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string\/{key}": { + "patch": { + "summary": "Update string column", + "operationId": "tablesDBUpdateStringColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a string column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnString", + "schema": { + "$ref": "#\/definitions\/columnString" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStringColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string column.", + "default": null, + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url": { + "post": { + "summary": "Create URL column", + "operationId": "tablesDBCreateUrlColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a URL column.\n", + "responses": { + "202": { + "description": "ColumnURL", + "schema": { + "$ref": "#\/definitions\/columnUrl" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createUrlColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url\/{key}": { + "patch": { + "summary": "Update URL column", + "operationId": "tablesDBUpdateUrlColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an url column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnURL", + "schema": { + "$ref": "#\/definitions\/columnUrl" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateUrlColumn", + "group": "columns", + "weight": 414, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}": { + "get": { + "summary": "Get column", + "operationId": "tablesDBGetColumn", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get column by ID.", + "responses": { + "200": { + "description": "ColumnBoolean, or ColumnInteger, or ColumnFloat, or ColumnEmail, or ColumnEnum, or ColumnURL, or ColumnIP, or ColumnDatetime, or ColumnRelationship, or ColumnString", + "schema": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getColumn", + "group": "columns", + "weight": 386, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete column", + "operationId": "tablesDBDeleteColumn", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Deletes a column.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteColumn", + "group": "columns", + "weight": 387, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}\/relationship": { + "patch": { + "summary": "Update relationship column", + "operationId": "tablesDBUpdateRelationshipColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "200": { + "description": "ColumnRelationship", + "schema": { + "$ref": "#\/definitions\/columnRelationship" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRelationshipColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": null, + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "tablesDBListIndexes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "List indexes on the table.", + "responses": { + "200": { + "description": "Column Indexes List", + "schema": { + "$ref": "#\/definitions\/columnIndexList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 418, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "tablesDBCreateIndex", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Creates an index on the columns listed. Your index should include all the columns you will query in a single request.\nType can be `key`, `fulltext`, or `unique`.", + "responses": { + "202": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/columnIndex" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 415, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "default": null, + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "default": null, + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "columns": { + "type": "array", + "description": "Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "default": [], + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "columns" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "tablesDBGetIndex", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/columnIndex" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 416, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "tablesDBDeleteIndex", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 417, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + }, + { + "name": "createRows", + "namespace": "tablesDB", + "desc": "Create rows", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/rowList" + } + ], + "description": "Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-rows.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<ROW_ID>" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "default": [], + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + }, + "put": { + "summary": "Upsert rows", + "operationId": "tablesDBUpsertRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRows", + "group": "rows", + "weight": 424, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRows", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/rowList" + } + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "demo": "tablesdb\/upsert-rows.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "description": "Array of row data as JSON objects. May contain partial rows.", + "default": null, + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "rows" + ] + } + } + ] + }, + "patch": { + "summary": "Update rows", + "operationId": "tablesDBUpdateRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRows", + "group": "rows", + "weight": 422, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only column and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete rows", + "operationId": "tablesDBDeleteRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Bulk delete rows using queries, if no queries are passed then all rows are deleted.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRows", + "group": "rows", + "weight": 426, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-rows.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "schema": { + "$ref": "#\/definitions\/teamList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 171, + "cookies": false, + "type": "", + "demo": "teams\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 170, + "cookies": false, + "type": "", + "demo": "teams\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TEAM_ID>" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": [ + "owner" + ], + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + ] + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 172, + "cookies": false, + "type": "", + "demo": "teams\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 174, + "cookies": false, + "type": "", + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 176, + "cookies": false, + "type": "", + "demo": "teams\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { + "$ref": "#\/definitions\/membershipList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 178, + "cookies": false, + "type": "", + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 177, + "cookies": false, + "type": "", + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "default": "", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "default": "", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 179, + "cookies": false, + "type": "", + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 180, + "cookies": false, + "type": "", + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "teams" + ], + "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 182, + "cookies": false, + "type": "", + "demo": "teams\/delete-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 181, + "cookies": false, + "type": "", + "demo": "teams\/update-membership-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 173, + "cookies": false, + "type": "", + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 175, + "cookies": false, + "type": "", + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "schema": { + "$ref": "#\/definitions\/resourceTokenList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "files", + "weight": 507, + "cookies": false, + "type": "", + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFileToken", + "group": "files", + "weight": 505, + "cookies": false, + "type": "", + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + } + } + } + } + ] + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tokens", + "weight": 506, + "cookies": false, + "type": "", + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tokens", + "weight": 508, + "cookies": false, + "type": "", + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + } + } + } + } + ] + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tokens", + "weight": 509, + "cookies": false, + "type": "", + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, + "\/users": { + "get": { + "summary": "List users", + "operationId": "usersList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a list of all the project's users. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Users List", + "schema": { + "$ref": "#\/definitions\/userList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "users", + "weight": 193, + "cookies": false, + "type": "", + "demo": "users\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create user", + "operationId": "usersCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "users", + "weight": 184, + "cookies": false, + "type": "", + "demo": "users\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "Plain text user password. Must be at least 8 chars.", + "default": "", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId" + ] + } + } + ] + } + }, + "\/users\/argon2": { + "post": { + "summary": "Create user with Argon2 password", + "operationId": "usersCreateArgon2User", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createArgon2User", + "group": "users", + "weight": 187, + "cookies": false, + "type": "", + "demo": "users\/create-argon-2-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Argon2.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/bcrypt": { + "post": { + "summary": "Create user with bcrypt password", + "operationId": "usersCreateBcryptUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBcryptUser", + "group": "users", + "weight": 185, + "cookies": false, + "type": "", + "demo": "users\/create-bcrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Bcrypt.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/identities": { + "get": { + "summary": "List identities", + "operationId": "usersListIdentities", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get identities for all users.", + "responses": { + "200": { + "description": "Identities List", + "schema": { + "$ref": "#\/definitions\/identityList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 201, + "cookies": false, + "type": "", + "demo": "users\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/users\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "usersDeleteIdentity", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 224, + "cookies": false, + "type": "", + "demo": "users\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "type": "string", + "x-example": "<IDENTITY_ID>", + "in": "path" + } + ] + } + }, + "\/users\/md5": { + "post": { + "summary": "Create user with MD5 password", + "operationId": "usersCreateMD5User", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMD5User", + "group": "users", + "weight": 186, + "cookies": false, + "type": "", + "demo": "users\/create-md-5-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using MD5.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/phpass": { + "post": { + "summary": "Create user with PHPass password", + "operationId": "usersCreatePHPassUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPHPassUser", + "group": "users", + "weight": 189, + "cookies": false, + "type": "", + "demo": "users\/create-ph-pass-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using PHPass.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/scrypt": { + "post": { + "summary": "Create user with Scrypt password", + "operationId": "usersCreateScryptUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createScryptUser", + "group": "users", + "weight": 190, + "cookies": false, + "type": "", + "demo": "users\/create-scrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt.", + "default": null, + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Optional salt used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT>" + }, + "passwordCpu": { + "type": "integer", + "description": "Optional CPU cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordMemory": { + "type": "integer", + "description": "Optional memory cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordParallel": { + "type": "integer", + "description": "Optional parallelization cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordLength": { + "type": "integer", + "description": "Optional hash length used to hash password.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordCpu", + "passwordMemory", + "passwordParallel", + "passwordLength" + ] + } + } + ] + } + }, + "\/users\/scrypt-modified": { + "post": { + "summary": "Create user with Scrypt modified password", + "operationId": "usersCreateScryptModifiedUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createScryptModifiedUser", + "group": "users", + "weight": 191, + "cookies": false, + "type": "", + "demo": "users\/create-scrypt-modified-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt Modified.", + "default": null, + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Salt used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT>" + }, + "passwordSaltSeparator": { + "type": "string", + "description": "Salt separator used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT_SEPARATOR>" + }, + "passwordSignerKey": { + "type": "string", + "description": "Signer key used to hash password.", + "default": null, + "x-example": "<PASSWORD_SIGNER_KEY>" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordSaltSeparator", + "passwordSignerKey" + ] + } + } + ] + } + }, + "\/users\/sha": { + "post": { + "summary": "Create user with SHA password", + "operationId": "usersCreateSHAUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSHAUser", + "group": "users", + "weight": 188, + "cookies": false, + "type": "", + "demo": "users\/create-sha-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using SHA.", + "default": null, + "x-example": "password" + }, + "passwordVersion": { + "type": "string", + "description": "Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'", + "default": "", + "x-example": "sha1", + "enum": [ + "sha1", + "sha224", + "sha256", + "sha384", + "sha512\/224", + "sha512\/256", + "sha512", + "sha3-224", + "sha3-256", + "sha3-384", + "sha3-512" + ], + "x-enum-name": "PasswordHash", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/{userId}": { + "get": { + "summary": "Get user", + "operationId": "usersGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a user by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "users", + "weight": 194, + "cookies": false, + "type": "", + "demo": "users\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user", + "operationId": "usersDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https:\/\/appwrite.io\/docs\/server\/users#usersUpdateStatus) endpoint instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "users", + "weight": 222, + "cookies": false, + "type": "", + "demo": "users\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/email": { + "patch": { + "summary": "Update email", + "operationId": "usersUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user email by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmail", + "group": "users", + "weight": 207, + "cookies": false, + "type": "", + "demo": "users\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + } + }, + "required": [ + "email" + ] + } + } + ] + } + }, + "\/users\/{userId}\/jwts": { + "post": { + "summary": "Create user JWT", + "operationId": "usersCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createJWT", + "group": "sessions", + "weight": 225, + "cookies": false, + "type": "", + "demo": "users\/create-jwt.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "sessionId": { + "type": "string", + "description": "Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.", + "default": "", + "x-example": "<SESSION_ID>" + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "default": 900, + "x-example": 0 + } + } + } + } + ] + } + }, + "\/users\/{userId}\/labels": { + "put": { + "summary": "Update user labels", + "operationId": "usersUpdateLabels", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLabels", + "group": "users", + "weight": 203, + "cookies": false, + "type": "", + "demo": "users\/update-labels.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "labels": { + "type": "array", + "description": "Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + ] + } + }, + "\/users\/{userId}\/logs": { + "get": { + "summary": "List user logs", + "operationId": "usersListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 199, + "cookies": false, + "type": "", + "demo": "users\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/memberships": { + "get": { + "summary": "List user memberships", + "operationId": "usersListMemberships", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user membership list by its unique ID.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { + "$ref": "#\/definitions\/membershipList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 198, + "cookies": false, + "type": "", + "demo": "users\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfa", + "group": "users", + "weight": 212, + "cookies": false, + "type": "", + "demo": "users\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + }, + "methods": [ + { + "name": "updateMfa", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + } + }, + { + "name": "updateMFA", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "default": null, + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + ] + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 217, + "cookies": false, + "type": "", + "demo": "users\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "schema": { + "$ref": "#\/definitions\/mfaFactors" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 213, + "cookies": false, + "type": "", + "demo": "users\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 214, + "cookies": false, + "type": "", + "demo": "users\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 216, + "cookies": false, + "type": "", + "demo": "users\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 215, + "cookies": false, + "type": "", + "demo": "users\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/name": { + "patch": { + "summary": "Update name", + "operationId": "usersUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user name by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateName", + "group": "users", + "weight": 205, + "cookies": false, + "type": "", + "demo": "users\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + } + }, + "\/users\/{userId}\/password": { + "patch": { + "summary": "Update password", + "operationId": "usersUpdatePassword", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user password by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePassword", + "group": "users", + "weight": 206, + "cookies": false, + "type": "", + "demo": "users\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": null + } + }, + "required": [ + "password" + ] + } + } + ] + } + }, + "\/users\/{userId}\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "usersUpdatePhone", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user phone by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhone", + "group": "users", + "weight": 208, + "cookies": false, + "type": "", + "demo": "users\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "User phone number.", + "default": null, + "x-example": "+12065550100" + } + }, + "required": [ + "number" + ] + } + } + ] + } + }, + "\/users\/{userId}\/prefs": { + "get": { + "summary": "Get user preferences", + "operationId": "usersGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user preferences by its unique ID.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getPrefs", + "group": "users", + "weight": 195, + "cookies": false, + "type": "", + "demo": "users\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user preferences", + "operationId": "usersUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePrefs", + "group": "users", + "weight": 210, + "cookies": false, + "type": "", + "demo": "users\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/users\/{userId}\/sessions": { + "get": { + "summary": "List user sessions", + "operationId": "usersListSessions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user sessions list by its unique ID.", + "responses": { + "200": { + "description": "Sessions List", + "schema": { + "$ref": "#\/definitions\/sessionList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 197, + "cookies": false, + "type": "", + "demo": "users\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create session", + "operationId": "usersCreateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 218, + "cookies": false, + "type": "", + "demo": "users\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user sessions", + "operationId": "usersDeleteSessions", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete all user's sessions by using the user's unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 221, + "cookies": false, + "type": "", + "demo": "users\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/sessions\/{sessionId}": { + "delete": { + "summary": "Delete user session", + "operationId": "usersDeleteSession", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a user sessions by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 220, + "cookies": false, + "type": "", + "demo": "users\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "sessionId", + "description": "Session ID.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/status": { + "patch": { + "summary": "Update user status", + "operationId": "usersUpdateStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStatus", + "group": "users", + "weight": 202, + "cookies": false, + "type": "", + "demo": "users\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", + "default": null, + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + ] + } + }, + "\/users\/{userId}\/targets": { + "get": { + "summary": "List user targets", + "operationId": "usersListTargets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "List the messaging targets that are associated with a user.", + "responses": { + "200": { + "description": "Target list", + "schema": { + "$ref": "#\/definitions\/targetList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTargets", + "group": "targets", + "weight": 200, + "cookies": false, + "type": "", + "demo": "users\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create user target", + "operationId": "usersCreateTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a messaging target.", + "responses": { + "201": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTarget", + "group": "targets", + "weight": 192, + "cookies": false, + "type": "", + "demo": "users\/create-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TARGET_ID>" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "default": null, + "x-example": "email", + "enum": [ + "email", + "sms", + "push" + ], + "x-enum-name": "MessagingProviderType", + "x-enum-keys": [] + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "targetId", + "providerType", + "identifier" + ] + } + } + ] + } + }, + "\/users\/{userId}\/targets\/{targetId}": { + "get": { + "summary": "Get user target", + "operationId": "usersGetTarget", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a user's push notification target by ID.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTarget", + "group": "targets", + "weight": 196, + "cookies": false, + "type": "", + "demo": "users\/get-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user target", + "operationId": "usersUpdateTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update a messaging target.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTarget", + "group": "targets", + "weight": 211, + "cookies": false, + "type": "", + "demo": "users\/update-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": "", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "default": "", + "x-example": "<NAME>" + } + } + } + } + ] + }, + "delete": { + "summary": "Delete user target", + "operationId": "usersDeleteTarget", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a messaging target.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTarget", + "group": "targets", + "weight": 223, + "cookies": false, + "type": "", + "demo": "users\/delete-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/tokens": { + "post": { + "summary": "Create token", + "operationId": "usersCreateToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createToken", + "group": "sessions", + "weight": 219, + "cookies": false, + "type": "", + "demo": "users\/create-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "length": { + "type": "integer", + "description": "Token length in characters. The default length is 6 characters", + "default": 6, + "x-example": 4 + }, + "expire": { + "type": "integer", + "description": "Token expiration period in seconds. The default expiration is 15 minutes.", + "default": 900, + "x-example": 60 + } + } + } + } + ] + } + }, + "\/users\/{userId}\/verification": { + "patch": { + "summary": "Update email verification", + "operationId": "usersUpdateEmailVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user email verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailVerification", + "group": "users", + "weight": 209, + "cookies": false, + "type": "", + "demo": "users\/update-email-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "emailVerification": { + "type": "boolean", + "description": "User email verification status.", + "default": null, + "x-example": false + } + }, + "required": [ + "emailVerification" + ] + } + } + ] + } + }, + "\/users\/{userId}\/verification\/phone": { + "patch": { + "summary": "Update phone verification", + "operationId": "usersUpdatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user phone verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "users", + "weight": 204, + "cookies": false, + "type": "", + "demo": "users\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "phoneVerification": { + "type": "boolean", + "description": "User phone verification status.", + "default": null, + "x-example": false + } + }, + "required": [ + "phoneVerification" + ] + } + } + ] + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "definitions": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true, + "example": [] + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "type": "object", + "$ref": "#\/definitions\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ], + "example": { + "total": 5, + "documents": "" + } + }, + "tableList": { + "description": "Tables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tables": { + "type": "array", + "description": "List of tables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/table" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tables" + ], + "example": { + "total": 5, + "tables": "" + } + }, + "collectionList": { + "description": "Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections that matched your query.", + "x-example": 5, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "type": "object", + "$ref": "#\/definitions\/collection" + }, + "x-example": "" + } + }, + "required": [ + "total", + "collections" + ], + "example": { + "total": 5, + "collections": "" + } + }, + "databaseList": { + "description": "Databases List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of databases that matched your query.", + "x-example": 5, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "List of databases.", + "items": { + "type": "object", + "$ref": "#\/definitions\/database" + }, + "x-example": "" + } + }, + "required": [ + "total", + "databases" + ], + "example": { + "total": 5, + "databases": "" + } + }, + "indexList": { + "description": "Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/index" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "columnIndexList": { + "description": "Column Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/columnIndex" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "userList": { + "description": "Users List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of users that matched your query.", + "x-example": 5, + "format": "int32" + }, + "users": { + "type": "array", + "description": "List of users.", + "items": { + "type": "object", + "$ref": "#\/definitions\/user" + }, + "x-example": "" + } + }, + "required": [ + "total", + "users" + ], + "example": { + "total": 5, + "users": "" + } + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ], + "example": { + "total": 5, + "sessions": "" + } + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "type": "object", + "$ref": "#\/definitions\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ], + "example": { + "total": 5, + "identities": "" + } + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "type": "object", + "$ref": "#\/definitions\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ], + "example": { + "total": 5, + "logs": "" + } + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "type": "object", + "$ref": "#\/definitions\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ], + "example": { + "total": 5, + "files": "" + } + }, + "bucketList": { + "description": "Buckets List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of buckets that matched your query.", + "x-example": 5, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "List of buckets.", + "items": { + "type": "object", + "$ref": "#\/definitions\/bucket" + }, + "x-example": "" + } + }, + "required": [ + "total", + "buckets" + ], + "example": { + "total": 5, + "buckets": "" + } + }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "type": "object", + "$ref": "#\/definitions\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ], + "example": { + "total": 5, + "tokens": "" + } + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "type": "object", + "$ref": "#\/definitions\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ], + "example": { + "total": 5, + "teams": "" + } + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "type": "object", + "$ref": "#\/definitions\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ], + "example": { + "total": 5, + "memberships": "" + } + }, + "siteList": { + "description": "Sites List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sites that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "List of sites.", + "items": { + "type": "object", + "$ref": "#\/definitions\/site" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sites" + ], + "example": { + "total": 5, + "sites": "" + } + }, + "functionList": { + "description": "Functions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of functions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "List of functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/function" + }, + "x-example": "" + } + }, + "required": [ + "total", + "functions" + ], + "example": { + "total": 5, + "functions": "" + } + }, + "frameworkList": { + "description": "Frameworks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworks that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks.", + "items": { + "type": "object", + "$ref": "#\/definitions\/framework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworks" + ], + "example": { + "total": 5, + "frameworks": "" + } + }, + "runtimeList": { + "description": "Runtimes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/runtime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimes" + ], + "example": { + "total": 5, + "runtimes": "" + } + }, + "deploymentList": { + "description": "Deployments List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of deployments that matched your query.", + "x-example": 5, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "List of deployments.", + "items": { + "type": "object", + "$ref": "#\/definitions\/deployment" + }, + "x-example": "" + } + }, + "required": [ + "total", + "deployments" + ], + "example": { + "total": 5, + "deployments": "" + } + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ], + "example": { + "total": 5, + "executions": "" + } + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "type": "object", + "$ref": "#\/definitions\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ], + "example": { + "total": 5, + "countries": "" + } + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ], + "example": { + "total": 5, + "continents": "" + } + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "type": "object", + "$ref": "#\/definitions\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ], + "example": { + "total": 5, + "languages": "" + } + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "type": "object", + "$ref": "#\/definitions\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ], + "example": { + "total": 5, + "currencies": "" + } + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "type": "object", + "$ref": "#\/definitions\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ], + "example": { + "total": 5, + "phones": "" + } + }, + "variableList": { + "description": "Variables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of variables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "variables": { + "type": "array", + "description": "List of variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": "" + } + }, + "required": [ + "total", + "variables" + ], + "example": { + "total": 5, + "variables": "" + } + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ], + "example": { + "total": 5, + "localeCodes": "" + } + }, + "providerList": { + "description": "Provider list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of providers that matched your query.", + "x-example": 5, + "format": "int32" + }, + "providers": { + "type": "array", + "description": "List of providers.", + "items": { + "type": "object", + "$ref": "#\/definitions\/provider" + }, + "x-example": "" + } + }, + "required": [ + "total", + "providers" + ], + "example": { + "total": 5, + "providers": "" + } + }, + "messageList": { + "description": "Message list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of messages that matched your query.", + "x-example": 5, + "format": "int32" + }, + "messages": { + "type": "array", + "description": "List of messages.", + "items": { + "type": "object", + "$ref": "#\/definitions\/message" + }, + "x-example": "" + } + }, + "required": [ + "total", + "messages" + ], + "example": { + "total": 5, + "messages": "" + } + }, + "topicList": { + "description": "Topic list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of topics that matched your query.", + "x-example": 5, + "format": "int32" + }, + "topics": { + "type": "array", + "description": "List of topics.", + "items": { + "type": "object", + "$ref": "#\/definitions\/topic" + }, + "x-example": "" + } + }, + "required": [ + "total", + "topics" + ], + "example": { + "total": 5, + "topics": "" + } + }, + "subscriberList": { + "description": "Subscriber list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of subscribers that matched your query.", + "x-example": 5, + "format": "int32" + }, + "subscribers": { + "type": "array", + "description": "List of subscribers.", + "items": { + "type": "object", + "$ref": "#\/definitions\/subscriber" + }, + "x-example": "" + } + }, + "required": [ + "total", + "subscribers" + ], + "example": { + "total": 5, + "subscribers": "" + } + }, + "targetList": { + "description": "Target list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of targets that matched your query.", + "x-example": 5, + "format": "int32" + }, + "targets": { + "type": "array", + "description": "List of targets.", + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + }, + "x-example": "" + } + }, + "required": [ + "total", + "targets" + ], + "example": { + "total": 5, + "targets": "" + } + }, + "specificationList": { + "description": "Specifications List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of specifications that matched your query.", + "x-example": 5, + "format": "int32" + }, + "specifications": { + "type": "array", + "description": "List of specifications.", + "items": { + "type": "object", + "$ref": "#\/definitions\/specification" + }, + "x-example": "" + } + }, + "required": [ + "total", + "specifications" + ], + "example": { + "total": 5, + "specifications": "" + } + }, + "database": { + "description": "Database", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Database name.", + "x-example": "My Database" + }, + "$createdAt": { + "type": "string", + "description": "Database creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Database update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "enabled": { + "type": "boolean", + "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "type": { + "type": "string", + "description": "Database type.", + "x-example": "legacy" + } + }, + "required": [ + "$id", + "name", + "$createdAt", + "$updatedAt", + "enabled", + "type" + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false, + "type": "legacy" + } + }, + "collection": { + "description": "Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "x-example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/index" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } + }, + "attributeList": { + "description": "Attributes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of attributes in the given collection.", + "x-example": 5, + "format": "int32" + }, + "attributes": { + "type": "array", + "description": "List of attributes.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "attributes" + ], + "example": { + "total": 5, + "attributes": "" + } + }, + "attributeString": { + "description": "AttributeString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default", + "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "attributeInteger": { + "description": "AttributeInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "x-nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 10, + "format": "int32", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "attributeFloat": { + "description": "AttributeFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "x-nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "x-nullable": true + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 2.5, + "format": "double", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "attributeBoolean": { + "description": "AttributeBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "attributeEmail": { + "description": "AttributeEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default@example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "attributeEnum": { + "description": "AttributeEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "element", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "attributeIp": { + "description": "AttributeIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "192.0.2.0", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "attributeUrl": { + "description": "AttributeURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "http:\/\/example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } + }, + "attributeDatetime": { + "description": "AttributeDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "attributeRelationship": { + "description": "AttributeRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedCollection": { + "type": "string", + "description": "The ID of the related collection.", + "x-example": "collection" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedCollection", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + 0, + 0 + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "table": { + "description": "Table", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Table creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Table update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Table permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Table name.", + "x-example": "My Table" + }, + "enabled": { + "type": "boolean", + "description": "Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "rowSecurity": { + "type": "boolean", + "description": "Whether row-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "columns": { + "type": "array", + "description": "Table columns.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Table indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/columnIndex" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "rowSecurity", + "columns", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Table", + "enabled": false, + "rowSecurity": true, + "columns": {}, + "indexes": {} + } + }, + "columnList": { + "description": "Columns List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of columns in the given table.", + "x-example": 5, + "format": "int32" + }, + "columns": { + "type": "array", + "description": "List of columns.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "columns" + ], + "example": { + "total": 5, + "columns": "" + } + }, + "columnString": { + "description": "ColumnString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default", + "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnInteger": { + "description": "ColumnInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "x-nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 10, + "format": "int32", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnFloat": { + "description": "ColumnFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "x-nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "x-nullable": true + }, + "default": { + "type": "number", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 2.5, + "format": "double", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "columnBoolean": { + "description": "ColumnBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "columnEmail": { + "description": "ColumnEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default@example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "columnEnum": { + "description": "ColumnEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "element", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "columnIp": { + "description": "ColumnIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "192.0.2.0", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "columnUrl": { + "description": "ColumnURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "https:\/\/example.com" + } + }, + "columnDatetime": { + "description": "ColumnDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "columnRelationship": { + "description": "ColumnRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedTable": { + "type": "string", + "description": "The ID of the related table.", + "x-example": "table" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedTable", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedTable": "table", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + 0, + 0 + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "index": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "attributes": { + "type": "array", + "description": "Index attributes.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index attributes length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "attributes", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [] + } + }, + "columnIndex": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "columns": { + "type": "array", + "description": "Index columns.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index columns length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "columns", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "columns": [], + "lengths": [], + "orders": [] + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "x-nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "x-nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/algoArgon2" + }, + { + "$ref": "#\/definitions\/algoScrypt" + }, + { + "$ref": "#\/definitions\/algoScryptModified" + }, + { + "$ref": "#\/definitions\/algoBcrypt" + }, + { + "$ref": "#\/definitions\/algoPhpass" + }, + { + "$ref": "#\/definitions\/algoSha" + }, + { + "$ref": "#\/definitions\/algoMd5" + } + ] + }, + "x-nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ], + "example": { + "type": "md5" + } + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ], + "example": { + "type": "sha" + } + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ], + "example": { + "type": "phpass" + } + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ], + "example": { + "type": "bcrypt" + } + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "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.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "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.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ], + "example": { + "code": "en-us", + "name": "US" + } + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } + }, + "bucket": { + "description": "Bucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Bucket creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Bucket update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Bucket permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "fileSecurity": { + "type": "boolean", + "description": "Whether file-level security is enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "name": { + "type": "string", + "description": "Bucket name.", + "x-example": "Documents" + }, + "enabled": { + "type": "boolean", + "description": "Bucket enabled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size supported.", + "x-example": 100, + "format": "int32" + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions.", + "items": { + "type": "string" + }, + "x-example": [ + "jpg", + "png" + ] + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" + }, + "encryption": { + "type": "boolean", + "description": "Bucket is encrypted.", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Virus scanning is enabled.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "fileSecurity", + "name", + "enabled", + "maximumFileSize", + "allowedFileExtensions", + "compression", + "encryption", + "antivirus" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } + }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "files" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceType", + "expire", + "secret", + "accessedAt" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } + }, + "site": { + "description": "Site", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Site ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Site creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Site update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Site name.", + "x-example": "My Site" + }, + "enabled": { + "type": "boolean", + "description": "Site enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "framework": { + "type": "string", + "description": "Site framework.", + "x-example": "react" + }, + "deploymentId": { + "type": "string", + "description": "Site's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "deploymentScreenshotLight": { + "type": "string", + "description": "Screenshot of active deployment with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentScreenshotDark": { + "type": "string", + "description": "Screenshot of active deployment with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentId": { + "type": "string", + "description": "Site's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "vars": { + "type": "array", + "description": "Site variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": [] + }, + "timeout": { + "type": "integer", + "description": "Site request timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the site dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the site.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The directory where the site build output is located.", + "x-example": "build" + }, + "installationId": { + "type": "string", + "description": "Site VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": "sites\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + }, + "buildRuntime": { + "type": "string", + "description": "Site build runtime.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework adapter.", + "x-example": "static" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "enabled", + "live", + "logging", + "framework", + "deploymentId", + "deploymentCreatedAt", + "deploymentScreenshotLight", + "deploymentScreenshotDark", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "vars", + "timeout", + "installCommand", + "buildCommand", + "outputDirectory", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification", + "buildRuntime", + "adapter", + "fallbackFile" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } + }, + "function": { + "description": "Function", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "execute": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + }, + "name": { + "type": "string", + "description": "Function name.", + "x-example": "My Function" + }, + "enabled": { + "type": "boolean", + "description": "Function enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "runtime": { + "type": "string", + "description": "Function execution and build runtime.", + "x-example": "python-3.8" + }, + "deploymentId": { + "type": "string", + "description": "Function's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentId": { + "type": "string", + "description": "Function's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "vars": { + "type": "array", + "description": "Function variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": [] + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "schedule": { + "type": "string", + "description": "Function execution schedule in CRON format.", + "x-example": "5 4 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "version": { + "type": "string", + "description": "Version of Open Runtimes used for the function.", + "x-example": "v2" + }, + "installationId": { + "type": "string", + "description": "Function VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "functions\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "execute", + "name", + "enabled", + "live", + "logging", + "runtime", + "deploymentId", + "deploymentCreatedAt", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "events", + "schedule", + "timeout", + "entrypoint", + "commands", + "version", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } + }, + "runtime": { + "description": "Runtime", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Runtime ID.", + "x-example": "python-3.8" + }, + "key": { + "type": "string", + "description": "Parent runtime key.", + "x-example": "python" + }, + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "Python" + }, + "version": { + "type": "string", + "description": "Runtime version.", + "x-example": "3.8" + }, + "base": { + "type": "string", + "description": "Base Docker image used to build the runtime.", + "x-example": "python:3.8-alpine" + }, + "image": { + "type": "string", + "description": "Image name of Docker Hub.", + "x-example": "appwrite\\\/runtime-for-python:3.8" + }, + "logo": { + "type": "string", + "description": "Name of the logo image.", + "x-example": "python.png" + }, + "supports": { + "type": "array", + "description": "List of supported architectures.", + "items": { + "type": "string" + }, + "x-example": "amd64" + } + }, + "required": [ + "$id", + "key", + "name", + "version", + "base", + "image", + "logo", + "supports" + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } + }, + "framework": { + "description": "Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, + "runtimes": { + "type": "array", + "description": "List of supported runtime versions.", + "items": { + "type": "string" + }, + "x-example": [ + "static-1", + "node-22" + ] + }, + "adapters": { + "type": "array", + "description": "List of supported adapters.", + "items": { + "type": "object", + "$ref": "#\/definitions\/frameworkAdapter" + }, + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "buildRuntime", + "runtimes", + "adapters" + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Adapter key.", + "x-example": "static" + }, + "installCommand": { + "type": "string", + "description": "Default command to download dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Default command to build site into output directory.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Default output directory of build.", + "x-example": ".\/dist" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "installCommand", + "buildCommand", + "outputDirectory", + "fallbackFile" + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } + }, + "deployment": { + "description": "Deployment", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Deployment update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "type": { + "type": "string", + "description": "Type of deployment.", + "x-example": "vcs" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea6g16897e" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "functions" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file to use to execute the deployment code.", + "x-example": "index.js" + }, + "sourceSize": { + "type": "integer", + "description": "The code size in bytes.", + "x-example": 128, + "format": "int32" + }, + "buildSize": { + "type": "integer", + "description": "The build output size in bytes.", + "x-example": 128, + "format": "int32" + }, + "totalSize": { + "type": "integer", + "description": "The total size in bytes (source and build output).", + "x-example": 128, + "format": "int32" + }, + "buildId": { + "type": "string", + "description": "The current build ID.", + "x-example": "5e5ea5c16897e" + }, + "activate": { + "type": "boolean", + "description": "Whether the deployment should be automatically activated.", + "x-example": true + }, + "screenshotLight": { + "type": "string", + "description": "Screenshot with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "screenshotDark": { + "type": "string", + "description": "Screenshot with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "status": { + "type": "string", + "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] + }, + "buildLogs": { + "type": "string", + "description": "The build logs.", + "x-example": "Compiling source files..." + }, + "buildDuration": { + "type": "integer", + "description": "The current build time in seconds.", + "x-example": 128, + "format": "int32" + }, + "providerRepositoryName": { + "type": "string", + "description": "The name of the vcs provider repository", + "x-example": "database" + }, + "providerRepositoryOwner": { + "type": "string", + "description": "The name of the vcs provider repository owner", + "x-example": "utopia" + }, + "providerRepositoryUrl": { + "type": "string", + "description": "The url of the vcs provider repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" + }, + "providerCommitHash": { + "type": "string", + "description": "The commit hash of the vcs commit", + "x-example": "7c3f25d" + }, + "providerCommitAuthorUrl": { + "type": "string", + "description": "The url of vcs commit author", + "x-example": "https:\/\/github.com\/vermakhushboo" + }, + "providerCommitAuthor": { + "type": "string", + "description": "The name of vcs commit author", + "x-example": "Khushboo Verma" + }, + "providerCommitMessage": { + "type": "string", + "description": "The commit message", + "x-example": "Update index.js" + }, + "providerCommitUrl": { + "type": "string", + "description": "The url of the vcs commit", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" + }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, + "providerBranchUrl": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "type", + "resourceId", + "resourceType", + "entrypoint", + "sourceSize", + "buildSize", + "totalSize", + "buildId", + "activate", + "screenshotLight", + "screenshotDark", + "status", + "buildLogs", + "buildDuration", + "providerRepositoryName", + "providerRepositoryOwner", + "providerRepositoryUrl", + "providerCommitHash", + "providerCommitAuthorUrl", + "providerCommitAuthor", + "providerCommitMessage", + "providerCommitUrl", + "providerBranch", + "providerBranchUrl" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "deploymentId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } + }, + "variable": { + "description": "Variable", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Variable ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Variable key.", + "x-example": "API_KEY" + }, + "value": { + "type": "string", + "description": "Variable value.", + "x-example": "myPa$$word1" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "resourceType": { + "type": "string", + "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", + "x-example": "function" + }, + "resourceId": { + "type": "string", + "description": "ID of resource to which the variable belongs. If resourceType is \"project\", it is empty. If resourceType is \"function\", it is ID of the function.", + "x-example": "myAwesomeFunction" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "value", + "secret", + "resourceType", + "resourceId" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "United States", + "code": "US" + } + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ], + "example": { + "name": "Europe", + "code": "EU" + } + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } + }, + "healthAntivirus": { + "description": "Health Antivirus", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Antivirus version.", + "x-example": "1.0.0" + }, + "status": { + "type": "string", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] + } + }, + "required": [ + "version", + "status" + ], + "example": { + "version": "1.0.0", + "status": "online" + } + }, + "healthQueue": { + "description": "Health Queue", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Amount of actions in the queue.", + "x-example": 8, + "format": "int32" + } + }, + "required": [ + "size" + ], + "example": { + "size": 8 + } + }, + "healthStatus": { + "description": "Health Status", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the service.", + "x-example": "database" + }, + "ping": { + "type": "integer", + "description": "Duration in milliseconds how long the health check took.", + "x-example": 128, + "format": "int32" + }, + "status": { + "type": "string", + "description": "Service status. Possible values are: `pass`, `fail`", + "x-example": "pass", + "enum": [ + "pass", + "fail" + ], + "x-enum-name": "HealthCheckStatus" + } + }, + "required": [ + "name", + "ping", + "status" + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } + }, + "healthCertificate": { + "description": "Health Certificate", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Certificate name", + "x-example": "\/CN=www.google.com" + }, + "subjectSN": { + "type": "string", + "description": "Subject SN", + "x-example": "" + }, + "issuerOrganisation": { + "type": "string", + "description": "Issuer organisation", + "x-example": "" + }, + "validFrom": { + "type": "string", + "description": "Valid from", + "x-example": "1704200998" + }, + "validTo": { + "type": "string", + "description": "Valid to", + "x-example": "1711458597" + }, + "signatureTypeSN": { + "type": "string", + "description": "Signature type SN", + "x-example": "RSA-SHA256" + } + }, + "required": [ + "name", + "subjectSN", + "issuerOrganisation", + "validFrom", + "validTo", + "signatureTypeSN" + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } + }, + "healthTime": { + "description": "Health Time", + "type": "object", + "properties": { + "remoteTime": { + "type": "integer", + "description": "Current unix timestamp on trustful remote server.", + "x-example": 1639490751, + "format": "int32" + }, + "localTime": { + "type": "integer", + "description": "Current unix timestamp of local server where Appwrite runs.", + "x-example": 1639490844, + "format": "int32" + }, + "diff": { + "type": "integer", + "description": "Difference of unix remote and local timestamps in milliseconds.", + "x-example": 93, + "format": "int32" + } + }, + "required": [ + "remoteTime", + "localTime", + "diff" + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } + }, + "specification": { + "description": "Specification", + "type": "object", + "properties": { + "memory": { + "type": "integer", + "description": "Memory size in MB.", + "x-example": 512, + "format": "int32" + }, + "cpus": { + "type": "number", + "description": "Number of CPUs.", + "x-example": 1, + "format": "double" + }, + "enabled": { + "type": "boolean", + "description": "Is size enabled.", + "x-example": true + }, + "slug": { + "type": "string", + "description": "Size slug.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "memory", + "cpus", + "enabled", + "slug" + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ], + "example": { + "secret": true, + "uri": true + } + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } + }, + "provider": { + "description": "Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Provider ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Provider creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Provider update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name for the provider instance.", + "x-example": "Mailgun" + }, + "provider": { + "type": "string", + "description": "The name of the provider service.", + "x-example": "mailgun" + }, + "enabled": { + "type": "boolean", + "description": "Is provider enabled?", + "x-example": true + }, + "type": { + "type": "string", + "description": "Type of provider.", + "x-example": "sms" + }, + "credentials": { + "type": "object", + "additionalProperties": true, + "description": "Provider credentials.", + "x-example": { + "key": "123456789" + } + }, + "options": { + "type": "object", + "additionalProperties": true, + "description": "Provider options.", + "x-example": { + "from": "sender-email@mydomain" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "provider", + "enabled", + "type", + "credentials" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } + }, + "message": { + "description": "Message", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Message ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Message creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Message update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerType": { + "type": "string", + "description": "Message provider type.", + "x-example": "email" + }, + "topics": { + "type": "array", + "description": "Topic IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "users": { + "type": "array", + "description": "User IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "targets": { + "type": "array", + "description": "Target IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for message.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + }, + "deliveredAt": { + "type": "string", + "description": "The time when the message was delivered.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + }, + "deliveryErrors": { + "type": "array", + "description": "Delivery errors if any.", + "items": { + "type": "string" + }, + "x-example": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "x-nullable": true + }, + "deliveredTotal": { + "type": "integer", + "description": "Number of recipients the message was delivered to.", + "x-example": 1, + "format": "int32" + }, + "data": { + "type": "object", + "additionalProperties": true, + "description": "Data of the message.", + "x-example": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + } + }, + "status": { + "type": "string", + "description": "Status of delivery.", + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "providerType", + "topics", + "users", + "targets", + "deliveredTotal", + "data", + "status" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } + }, + "topic": { + "description": "Topic", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Topic creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Topic update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name of the topic.", + "x-example": "events" + }, + "emailTotal": { + "type": "integer", + "description": "Total count of email subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "smsTotal": { + "type": "integer", + "description": "Total count of SMS subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "pushTotal": { + "type": "integer", + "description": "Total count of push subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "subscribe": { + "type": "array", + "description": "Subscribe permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "emailTotal", + "smsTotal", + "pushTotal", + "subscribe" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "x-nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 5c1b764e1e..c2628533d0 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.7.0", + "version": "1.8.0", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -90,13 +90,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "account", "weight": 10, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", "rate-limit": 0, @@ -141,13 +141,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "account", "weight": 9, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", "rate-limit": 10, @@ -232,13 +232,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "account", "weight": 35, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", "rate-limit": 0, @@ -310,13 +310,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listIdentities", "group": "identities", "weight": 58, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-identities.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", "rate-limit": 0, @@ -372,13 +372,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteIdentity", "group": "identities", "weight": 59, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-identity.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", "rate-limit": 0, @@ -435,14 +435,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "tokens", "weight": 30, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-j-w-t.md", + "demo": "account\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", "rate-limit": 100, "rate-time": 3600, @@ -484,13 +484,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", "weight": 32, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", "rate-limit": 0, @@ -551,14 +551,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMFA", "group": "mfa", "weight": 45, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/update-m-f-a.md", + "demo": "account\/update-mfa.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", "rate-limit": 0, "rate-time": 3600, @@ -624,13 +624,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", "weight": 47, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", "rate-limit": 0, @@ -642,6 +642,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -690,13 +744,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", "weight": 48, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", "rate-limit": 0, @@ -708,6 +762,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -769,13 +881,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", "weight": 52, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", "rate-limit": 0, @@ -787,6 +899,58 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -837,13 +1001,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", "weight": 53, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", "rate-limit": 10, @@ -855,6 +1019,60 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], "auth": { "Project": [] } @@ -914,13 +1132,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", "weight": 54, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", "rate-limit": 10, @@ -932,6 +1150,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], "auth": { "Project": [] } @@ -992,13 +1268,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listMfaFactors", "group": "mfa", "weight": 46, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-mfa-factors.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", "rate-limit": 0, @@ -1010,6 +1286,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], "auth": { "Project": [] } @@ -1043,13 +1365,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", "weight": 51, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", "rate-limit": 0, @@ -1061,6 +1383,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1094,13 +1462,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", "weight": 49, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", "rate-limit": 0, @@ -1112,6 +1480,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1145,13 +1559,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", "weight": 50, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", "rate-limit": 0, @@ -1163,6 +1577,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1198,13 +1658,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "account", "weight": 33, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", "rate-limit": 0, @@ -1271,13 +1731,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePassword", "group": "account", "weight": 34, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-password.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", "rate-limit": 10, @@ -1350,13 +1810,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhone", "group": "account", "weight": 36, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", "rate-limit": 0, @@ -1428,13 +1888,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "account", "weight": 31, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", "rate-limit": 0, @@ -1479,13 +1939,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "account", "weight": 37, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", "rate-limit": 0, @@ -1519,7 +1979,7 @@ "type": "object", "description": "Prefs key-value JSON object.", "default": {}, - "x-example": "{}" + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" } }, "required": [ @@ -1552,13 +2012,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRecovery", "group": "recovery", "weight": 39, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", "rate-limit": 10, @@ -1633,13 +2093,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateRecovery", "group": "recovery", "weight": 40, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", "rate-limit": 10, @@ -1718,13 +2178,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSessions", "group": "sessions", "weight": 12, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", "rate-limit": 0, @@ -1764,13 +2224,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSessions", "group": "sessions", "weight": 13, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", "rate-limit": 100, @@ -1817,13 +2277,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createAnonymousSession", "group": "sessions", "weight": 18, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-anonymous-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", "rate-limit": 50, @@ -1868,13 +2328,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailPasswordSession", "group": "sessions", "weight": 17, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-password-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", "rate-limit": 10, @@ -1946,14 +2406,14 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMagicURLSession", "group": "sessions", "weight": 27, "cookies": false, "type": "", - "deprecated": true, - "demo": "account\/update-magic-u-r-l-session.md", + "demo": "account\/update-magic-url-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, "rate-time": 3600, @@ -1964,6 +2424,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -2019,14 +2483,14 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "createOAuth2Session", "group": "sessions", "weight": 20, "cookies": false, "type": "webAuth", - "deprecated": false, - "demo": "account\/create-o-auth2session.md", + "demo": "account\/create-o-auth-2-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md", "rate-limit": 50, "rate-time": 3600, @@ -2156,13 +2620,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updatePhoneSession", "group": "sessions", "weight": 28, "cookies": false, "type": "", - "deprecated": true, "demo": "account\/update-phone-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -2174,6 +2638,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -2234,13 +2702,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSession", "group": "sessions", "weight": 19, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -2310,13 +2778,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSession", "group": "sessions", "weight": 14, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", "rate-limit": 0, @@ -2371,13 +2839,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSession", "group": "sessions", "weight": 16, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", "rate-limit": 10, @@ -2427,13 +2895,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSession", "group": "sessions", "weight": 15, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", "rate-limit": 100, @@ -2490,13 +2958,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateStatus", "group": "account", "weight": 38, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", "rate-limit": 0, @@ -2543,13 +3011,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPushTarget", "group": "pushTargets", "weight": 55, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, @@ -2627,13 +3095,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePushTarget", "group": "pushTargets", "weight": 56, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, @@ -2699,13 +3167,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deletePushTarget", "group": "pushTargets", "weight": 57, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, @@ -2751,7 +3219,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2760,13 +3228,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailToken", "group": "tokens", "weight": 26, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, @@ -2799,7 +3267,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -2847,14 +3315,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMagicURLToken", "group": "tokens", "weight": 25, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-magic-u-r-l-token.md", + "demo": "account\/create-magic-url-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", "rate-limit": 60, "rate-time": 3600, @@ -2886,7 +3354,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -2935,14 +3403,14 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "createOAuth2Token", "group": "tokens", "weight": 24, "cookies": false, "type": "webAuth", - "deprecated": false, - "demo": "account\/create-o-auth2token.md", + "demo": "account\/create-o-auth-2-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", "rate-limit": 50, "rate-time": 3600, @@ -3072,13 +3540,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneToken", "group": "tokens", "weight": 29, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", "rate-limit": 10, @@ -3111,7 +3579,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -3153,13 +3621,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVerification", "group": "verification", "weight": 41, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", "rate-limit": 10, @@ -3224,13 +3692,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVerification", "group": "verification", "weight": 42, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", "rate-limit": 10, @@ -3304,13 +3772,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneVerification", "group": "verification", "weight": 43, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", "rate-limit": 10, @@ -3358,13 +3826,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhoneVerification", "group": "verification", "weight": 44, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", "rate-limit": 10, @@ -3436,13 +3904,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getBrowser", "group": null, "weight": 61, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-browser.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", "rate-limit": 0, @@ -3451,7 +3919,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3561,13 +4028,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getCreditCard", "group": null, "weight": 60, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-credit-card.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", "rate-limit": 0, @@ -3576,7 +4043,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3594,7 +4060,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "type": "string", "x-example": "amex", @@ -3611,7 +4077,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3631,7 +4097,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -3692,13 +4158,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFavicon", "group": null, "weight": 64, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-favicon.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", "rate-limit": 0, @@ -3707,7 +4173,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3755,13 +4220,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFlag", "group": null, "weight": 62, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-flag.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", "rate-limit": 0, @@ -3770,7 +4235,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4242,13 +4706,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getImage", "group": null, "weight": 63, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-image.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", "rate-limit": 0, @@ -4257,7 +4721,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4325,13 +4788,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getInitials", "group": null, "weight": 66, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-initials.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", "rate-limit": 0, @@ -4340,7 +4803,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4416,14 +4878,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQR", "group": null, "weight": 65, "cookies": false, "type": "location", - "deprecated": false, - "demo": "avatars\/get-q-r.md", + "demo": "avatars\/get-qr.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", "rate-limit": 0, "rate-time": 3600, @@ -4431,7 +4893,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4507,13 +4968,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listDocuments", "group": "documents", - "weight": 110, + "weight": 335, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", "rate-limit": 0, @@ -4522,10 +4983,13 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, "auth": { "Project": [] } @@ -4589,13 +5053,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createDocument", "group": "documents", - "weight": 109, + "weight": 327, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", "rate-limit": 120, @@ -4604,17 +5068,20 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, "methods": [ { "name": "createDocument", + "namespace": "databases", + "desc": "Create document", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [] }, "parameters": [ "databaseId", @@ -4635,7 +5102,12 @@ "model": "#\/definitions\/document" } ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } } ], "auth": { @@ -4682,7 +5154,7 @@ "type": "object", "description": "Document data as JSON object.", "default": [], - "x-example": "{}" + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" }, "permissions": { "type": "array", @@ -4728,13 +5200,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getDocument", "group": "documents", - "weight": 111, + "weight": 328, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", "rate-limit": 0, @@ -4743,10 +5215,13 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, "auth": { "Project": [] } @@ -4798,7 +5273,7 @@ ] }, "put": { - "summary": "Upsert document", + "summary": "Upsert a document", "operationId": "databasesUpsertDocument", "consumes": [ "application\/json" @@ -4811,20 +5286,20 @@ ], "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { - "200": { + "201": { "description": "Document", "schema": { "$ref": "#\/definitions\/document" } } }, + "deprecated": true, "x-appwrite": { "method": "upsertDocument", "group": "documents", - "weight": 114, + "weight": 331, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/upsert-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", "rate-limit": 120, @@ -4833,10 +5308,48 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], "auth": { "Project": [] } @@ -4923,13 +5436,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDocument", "group": "documents", - "weight": 113, + "weight": 329, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", "rate-limit": 120, @@ -4938,10 +5451,13 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, "auth": { "Project": [] } @@ -5020,13 +5536,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 333, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", "rate-limit": 60, @@ -5035,10 +5551,13 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, "auth": { "Project": [] } @@ -5078,6 +5597,230 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/functions\/{functionId}\/executions": { "get": { "summary": "List executions", @@ -5098,13 +5841,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 456, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-executions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", "rate-limit": 0, @@ -5113,7 +5856,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5172,13 +5914,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 454, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "rate-limit": 0, @@ -5187,7 +5929,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5237,7 +5978,7 @@ }, "method": { "type": "string", - "description": "HTTP method of execution. Default value is GET.", + "description": "HTTP method of execution. Default value is POST.", "default": "POST", "x-example": "GET", "enum": [ @@ -5246,7 +5987,8 @@ "PUT", "PATCH", "DELETE", - "OPTIONS" + "OPTIONS", + "HEAD" ], "x-enum-name": "ExecutionMethod", "x-enum-keys": [] @@ -5261,7 +6003,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "<SCHEDULED_AT>" } } } @@ -5289,13 +6031,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 455, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", "rate-limit": 0, @@ -5304,7 +6046,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5361,13 +6102,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 250, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/query.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -5376,8 +6117,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -5435,13 +6175,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 249, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/mutation.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -5450,8 +6190,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -5507,13 +6246,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 70, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", "rate-limit": 0, @@ -5522,7 +6261,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5559,13 +6297,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 71, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", "rate-limit": 0, @@ -5574,7 +6312,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5611,13 +6348,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 75, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-continents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", "rate-limit": 0, @@ -5626,7 +6363,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5663,13 +6399,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 72, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", "rate-limit": 0, @@ -5678,7 +6414,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5715,14 +6450,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 73, "cookies": false, "type": "", - "deprecated": false, - "demo": "locale\/list-countries-e-u.md", + "demo": "locale\/list-countries-eu.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", "rate-limit": 0, "rate-time": 3600, @@ -5730,7 +6465,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5767,13 +6501,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 74, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries-phones.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", "rate-limit": 0, @@ -5782,7 +6516,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5819,13 +6552,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 76, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-currencies.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", "rate-limit": 0, @@ -5834,7 +6567,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5871,13 +6603,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 77, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-languages.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", "rate-limit": 0, @@ -5886,7 +6618,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5925,13 +6656,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 296, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", "rate-limit": 0, @@ -5941,8 +6672,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -6010,13 +6740,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 300, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", "rate-limit": 0, @@ -6026,8 +6756,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -6081,13 +6810,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 160, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/list-files.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", "rate-limit": 0, @@ -6096,7 +6825,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6164,13 +6892,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 159, "cookies": false, "type": "upload", - "deprecated": false, "demo": "storage\/create-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", "rate-limit": 60, @@ -6179,7 +6907,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6254,13 +6981,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 161, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", "rate-limit": 0, @@ -6269,7 +6996,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6324,13 +7050,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 166, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/update-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", "rate-limit": 60, @@ -6339,7 +7065,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6413,13 +7138,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 167, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/delete-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", "rate-limit": 60, @@ -6428,7 +7153,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6483,13 +7207,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 163, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", "rate-limit": 0, @@ -6498,7 +7222,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6562,13 +7285,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 162, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-preview.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", "rate-limit": 0, @@ -6577,7 +7300,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6729,7 +7451,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -6768,13 +7491,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 164, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-view.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", "rate-limit": 0, @@ -6783,7 +7506,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6827,6 +7549,859 @@ ] } }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<ROW_ID>" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "default": [], + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/teams": { "get": { "summary": "List teams", @@ -6847,13 +8422,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 171, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", "rate-limit": 0, @@ -6862,7 +8437,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6922,13 +8496,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 170, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", "rate-limit": 0, @@ -6937,7 +8511,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7012,13 +8585,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 172, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", "rate-limit": 0, @@ -7027,7 +8600,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7074,13 +8646,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 174, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", "rate-limit": 0, @@ -7089,7 +8661,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7149,13 +8720,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 176, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", "rate-limit": 0, @@ -7164,7 +8735,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7211,13 +8781,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 178, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list-memberships.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", "rate-limit": 0, @@ -7226,7 +8796,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7294,13 +8863,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 177, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", "rate-limit": 10, @@ -7309,7 +8878,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7407,13 +8975,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 179, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", "rate-limit": 0, @@ -7422,7 +8990,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7477,13 +9044,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 180, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", "rate-limit": 0, @@ -7492,7 +9059,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7563,13 +9129,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 182, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", "rate-limit": 0, @@ -7578,7 +9144,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7635,13 +9200,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 181, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", "rate-limit": 0, @@ -7729,13 +9294,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 173, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", "rate-limit": 0, @@ -7790,13 +9355,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 175, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", "rate-limit": 0, @@ -7863,6 +9428,10 @@ "name": "databases", "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, { "name": "locale", "description": "The Locale service allows you to customize your app based on your users' location." @@ -7924,7 +9493,37 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "type": "object", + "$ref": "#\/definitions\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } }, "documentList": { "description": "Documents List", @@ -7932,7 +9531,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of documents documents that matched your query.", + "description": "Total number of documents that matched your query.", "x-example": 5, "format": "int32" }, @@ -7949,7 +9548,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "sessionList": { "description": "Sessions List", @@ -7957,7 +9560,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of sessions documents that matched your query.", + "description": "Total number of sessions that matched your query.", "x-example": 5, "format": "int32" }, @@ -7974,7 +9577,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -7982,7 +9589,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of identities documents that matched your query.", + "description": "Total number of identities that matched your query.", "x-example": 5, "format": "int32" }, @@ -7999,7 +9606,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -8007,7 +9618,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of logs documents that matched your query.", + "description": "Total number of logs that matched your query.", "x-example": 5, "format": "int32" }, @@ -8024,7 +9635,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -8032,7 +9647,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of files documents that matched your query.", + "description": "Total number of files that matched your query.", "x-example": 5, "format": "int32" }, @@ -8049,7 +9664,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "teamList": { "description": "Teams List", @@ -8057,7 +9676,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of teams documents that matched your query.", + "description": "Total number of teams that matched your query.", "x-example": 5, "format": "int32" }, @@ -8074,7 +9693,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -8082,7 +9705,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of memberships documents that matched your query.", + "description": "Total number of memberships that matched your query.", "x-example": 5, "format": "int32" }, @@ -8099,7 +9722,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "executionList": { "description": "Executions List", @@ -8107,7 +9734,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of executions documents that matched your query.", + "description": "Total number of executions that matched your query.", "x-example": 5, "format": "int32" }, @@ -8124,7 +9751,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -8132,7 +9763,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of countries documents that matched your query.", + "description": "Total number of countries that matched your query.", "x-example": 5, "format": "int32" }, @@ -8149,7 +9780,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -8157,7 +9792,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of continents documents that matched your query.", + "description": "Total number of continents that matched your query.", "x-example": 5, "format": "int32" }, @@ -8174,7 +9809,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -8182,7 +9821,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of languages documents that matched your query.", + "description": "Total number of languages that matched your query.", "x-example": 5, "format": "int32" }, @@ -8199,7 +9838,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -8207,7 +9850,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of currencies documents that matched your query.", + "description": "Total number of currencies that matched your query.", "x-example": 5, "format": "int32" }, @@ -8224,7 +9867,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -8232,7 +9879,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of phones documents that matched your query.", + "description": "Total number of phones that matched your query.", "x-example": 5, "format": "int32" }, @@ -8249,7 +9896,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -8257,7 +9908,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of localeCodes documents that matched your query.", + "description": "Total number of localeCodes that matched your query.", "x-example": 5, "format": "int32" }, @@ -8274,7 +9925,82 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } }, "document": { "description": "Document", @@ -8285,15 +10011,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -8319,12 +10054,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -8458,7 +10210,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -8621,7 +10396,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -8635,7 +10436,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -8649,7 +10453,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -8663,7 +10470,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -8677,7 +10487,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -8719,7 +10532,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -8751,7 +10571,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -8786,12 +10612,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -8978,7 +10815,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -9046,7 +10916,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -9090,7 +10972,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -9104,7 +10994,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -9154,7 +11047,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -9174,7 +11076,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -9256,7 +11162,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "team": { "description": "Team", @@ -9308,7 +11229,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -9399,7 +11331,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "execution": { "description": "Execution", @@ -9417,7 +11366,7 @@ }, "$updatedAt": { "type": "string", - "description": "Execution upate date in ISO 8601 format.", + "description": "Execution update date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, "$permissions": { @@ -9435,15 +11384,31 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -9457,7 +11422,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "type": "object", "$ref": "#\/definitions\/headers" @@ -9521,6 +11486,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -9532,7 +11498,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "country": { "description": "Country", @@ -9552,7 +11548,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -9572,7 +11572,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -9598,7 +11602,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -9650,7 +11659,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -9676,7 +11694,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "headers": { "description": "Headers", @@ -9696,7 +11719,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -9728,7 +11755,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -9748,7 +11781,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -9768,7 +11807,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -9800,7 +11843,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "subscriber": { "description": "Subscriber", @@ -9875,7 +11924,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -9937,7 +12006,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "externalDocs": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 96705f3e61..e830f768be 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.7.0", + "version": "1.8.0", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -96,13 +96,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "account", "weight": 10, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", "rate-limit": 0, @@ -146,13 +146,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "account", "weight": 9, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", "rate-limit": 10, @@ -230,13 +230,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "account", "weight": 11, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md", "rate-limit": 0, @@ -280,13 +280,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "account", "weight": 35, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", "rate-limit": 0, @@ -357,13 +357,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listIdentities", "group": "identities", "weight": 58, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-identities.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", "rate-limit": 0, @@ -418,13 +418,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteIdentity", "group": "identities", "weight": 59, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-identity.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", "rate-limit": 0, @@ -480,14 +480,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "tokens", "weight": 30, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-j-w-t.md", + "demo": "account\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", "rate-limit": 100, "rate-time": 3600, @@ -529,13 +529,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", "weight": 32, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", "rate-limit": 0, @@ -595,14 +595,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMFA", "group": "mfa", "weight": 45, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/update-m-f-a.md", + "demo": "account\/update-mfa.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", "rate-limit": 0, "rate-time": 3600, @@ -667,13 +667,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", "weight": 47, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", "rate-limit": 0, @@ -685,6 +685,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -732,13 +786,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", "weight": 48, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", "rate-limit": 0, @@ -750,6 +804,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -810,13 +922,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", "weight": 52, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", "rate-limit": 0, @@ -828,6 +940,58 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -877,13 +1041,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", "weight": 53, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", "rate-limit": 10, @@ -895,6 +1059,60 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], "auth": { "Project": [] } @@ -954,13 +1172,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", "weight": 54, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", "rate-limit": 10, @@ -972,6 +1190,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], "auth": { "Project": [] } @@ -1031,13 +1307,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listMfaFactors", "group": "mfa", "weight": 46, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-mfa-factors.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", "rate-limit": 0, @@ -1049,6 +1325,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], "auth": { "Project": [] } @@ -1081,13 +1403,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", "weight": 51, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", "rate-limit": 0, @@ -1099,6 +1421,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1131,13 +1499,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", "weight": 49, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", "rate-limit": 0, @@ -1149,6 +1517,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1181,13 +1595,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", "weight": 50, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", "rate-limit": 0, @@ -1199,6 +1613,52 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -1233,13 +1693,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "account", "weight": 33, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", "rate-limit": 0, @@ -1305,13 +1765,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePassword", "group": "account", "weight": 34, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-password.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", "rate-limit": 10, @@ -1383,13 +1843,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhone", "group": "account", "weight": 36, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", "rate-limit": 0, @@ -1460,13 +1920,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "account", "weight": 31, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", "rate-limit": 0, @@ -1510,13 +1970,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "account", "weight": 37, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", "rate-limit": 0, @@ -1549,7 +2009,7 @@ "type": "object", "description": "Prefs key-value JSON object.", "default": {}, - "x-example": "{}" + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" } }, "required": [ @@ -1582,13 +2042,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRecovery", "group": "recovery", "weight": 39, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", "rate-limit": 10, @@ -1662,13 +2122,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateRecovery", "group": "recovery", "weight": 40, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", "rate-limit": 10, @@ -1746,13 +2206,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSessions", "group": "sessions", "weight": 12, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", "rate-limit": 0, @@ -1791,13 +2251,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSessions", "group": "sessions", "weight": 13, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", "rate-limit": 100, @@ -1843,13 +2303,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createAnonymousSession", "group": "sessions", "weight": 18, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-anonymous-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", "rate-limit": 50, @@ -1894,13 +2354,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailPasswordSession", "group": "sessions", "weight": 17, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-password-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", "rate-limit": 10, @@ -1972,14 +2432,14 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMagicURLSession", "group": "sessions", "weight": 27, "cookies": false, "type": "", - "deprecated": true, - "demo": "account\/update-magic-u-r-l-session.md", + "demo": "account\/update-magic-url-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, "rate-time": 3600, @@ -1990,6 +2450,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -2045,14 +2509,14 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "createOAuth2Session", "group": "sessions", "weight": 20, "cookies": false, "type": "webAuth", - "deprecated": false, - "demo": "account\/create-o-auth2session.md", + "demo": "account\/create-o-auth-2-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md", "rate-limit": 50, "rate-time": 3600, @@ -2182,13 +2646,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updatePhoneSession", "group": "sessions", "weight": 28, "cookies": false, "type": "", - "deprecated": true, "demo": "account\/update-phone-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -2200,6 +2664,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -2260,13 +2728,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSession", "group": "sessions", "weight": 19, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -2336,13 +2804,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSession", "group": "sessions", "weight": 14, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", "rate-limit": 0, @@ -2396,13 +2864,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSession", "group": "sessions", "weight": 16, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", "rate-limit": 10, @@ -2451,13 +2919,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSession", "group": "sessions", "weight": 15, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", "rate-limit": 100, @@ -2513,13 +2981,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateStatus", "group": "account", "weight": 38, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", "rate-limit": 0, @@ -2565,13 +3033,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPushTarget", "group": "pushTargets", "weight": 55, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, @@ -2648,13 +3116,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePushTarget", "group": "pushTargets", "weight": 56, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, @@ -2719,13 +3187,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deletePushTarget", "group": "pushTargets", "weight": 57, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-push-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, @@ -2770,7 +3238,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2779,13 +3247,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailToken", "group": "tokens", "weight": 26, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, @@ -2818,7 +3286,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -2866,14 +3334,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMagicURLToken", "group": "tokens", "weight": 25, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-magic-u-r-l-token.md", + "demo": "account\/create-magic-url-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", "rate-limit": 60, "rate-time": 3600, @@ -2905,7 +3373,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -2954,14 +3422,14 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "createOAuth2Token", "group": "tokens", "weight": 24, "cookies": false, "type": "webAuth", - "deprecated": false, - "demo": "account\/create-o-auth2token.md", + "demo": "account\/create-o-auth-2-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", "rate-limit": 50, "rate-time": 3600, @@ -3091,13 +3559,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneToken", "group": "tokens", "weight": 29, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", "rate-limit": 10, @@ -3130,7 +3598,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -3172,13 +3640,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVerification", "group": "verification", "weight": 41, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", "rate-limit": 10, @@ -3242,13 +3710,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVerification", "group": "verification", "weight": 42, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", "rate-limit": 10, @@ -3321,13 +3789,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneVerification", "group": "verification", "weight": 43, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", "rate-limit": 10, @@ -3374,13 +3842,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhoneVerification", "group": "verification", "weight": 44, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", "rate-limit": 10, @@ -3451,13 +3919,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getBrowser", "group": null, "weight": 61, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-browser.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", "rate-limit": 0, @@ -3466,7 +3934,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3576,13 +4043,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getCreditCard", "group": null, "weight": 60, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-credit-card.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", "rate-limit": 0, @@ -3591,7 +4058,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3609,7 +4075,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "type": "string", "x-example": "amex", @@ -3626,7 +4092,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3646,7 +4112,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -3707,13 +4173,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFavicon", "group": null, "weight": 64, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-favicon.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", "rate-limit": 0, @@ -3722,7 +4188,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3770,13 +4235,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFlag", "group": null, "weight": 62, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-flag.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", "rate-limit": 0, @@ -3785,7 +4250,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4257,13 +4721,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getImage", "group": null, "weight": 63, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-image.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", "rate-limit": 0, @@ -4272,7 +4736,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4340,13 +4803,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getInitials", "group": null, "weight": 66, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-initials.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", "rate-limit": 0, @@ -4355,7 +4818,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4431,14 +4893,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQR", "group": null, "weight": 65, "cookies": false, "type": "location", - "deprecated": false, - "demo": "avatars\/get-q-r.md", + "demo": "avatars\/get-qr.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", "rate-limit": 0, "rate-time": 3600, @@ -4446,7 +4908,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4524,13 +4985,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "chat", "group": "console", - "weight": 308, + "weight": 252, "cookies": false, "type": "", - "deprecated": false, "demo": "assistant\/chat.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/assistant\/chat.md", "rate-limit": 15, @@ -4587,13 +5048,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "getResource", "group": null, - "weight": 432, + "weight": 496, "cookies": false, "type": "", - "deprecated": false, "demo": "console\/get-resource.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCheck if a resource ID is available.", "rate-limit": 120, @@ -4658,13 +5119,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "variables", "group": "console", - "weight": 307, + "weight": 251, "cookies": false, "type": "", - "deprecated": false, "demo": "console\/variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/console\/variables.md", "rate-limit": 0, @@ -4706,13 +5167,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "list", "group": "databases", - "weight": 71, + "weight": 316, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", "rate-limit": 0, @@ -4723,6 +5184,37 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + }, + "methods": [ + { + "name": "list", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "queries", + "search" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/databaseList" + } + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "demo": "databases\/list.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + } + } + ], "auth": { "Project": [] } @@ -4778,13 +5270,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "create", "group": "databases", - "weight": 70, + "weight": 312, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", "rate-limit": 0, @@ -4795,6 +5287,41 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + }, + "methods": [ + { + "name": "create", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/database" + } + ], + "description": "Create a new Database.\n", + "demo": "databases\/create.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + } + } + ], "auth": { "Project": [] } @@ -4843,7 +5370,7 @@ "\/databases\/usage": { "get": { "summary": "Get databases usage stats", - "operationId": "databasesGetUsage", + "operationId": "databasesListUsage", "consumes": [], "produces": [ "application\/json" @@ -4851,7 +5378,7 @@ "tags": [ "databases" ], - "description": "Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageDatabases", @@ -4860,15 +5387,15 @@ } } }, + "deprecated": true, "x-appwrite": { - "method": "getUsage", + "method": "listUsage", "group": null, - "weight": 119, + "weight": 319, "cookies": false, "type": "", - "deprecated": false, - "demo": "databases\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", + "demo": "databases\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4877,6 +5404,36 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listUsage" + }, + "methods": [ + { + "name": "listUsage", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "range" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/usageDatabases" + } + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "databases\/list-usage.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listUsage" + } + } + ], "auth": { "Project": [] } @@ -4889,7 +5446,7 @@ "parameters": [ { "name": "range", - "description": "`Date range.", + "description": "Date range.", "required": false, "type": "string", "x-example": "24h", @@ -4898,7 +5455,7 @@ "30d", "90d" ], - "x-enum-name": "DatabaseUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -4930,13 +5487,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "get", "group": "databases", - "weight": 72, + "weight": 313, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", "rate-limit": 0, @@ -4947,6 +5504,38 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + }, + "methods": [ + { + "name": "get", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/database" + } + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "demo": "databases\/get.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + } + } + ], "auth": { "Project": [] } @@ -4989,13 +5578,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "update", "group": "databases", - "weight": 74, + "weight": 314, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", "rate-limit": 0, @@ -5006,6 +5595,41 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + }, + "methods": [ + { + "name": "update", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/database" + } + ], + "description": "Update a database by its unique ID.", + "demo": "databases\/update.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + } + } + ], "auth": { "Project": [] } @@ -5067,13 +5691,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "delete", "group": "databases", - "weight": 75, + "weight": 315, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", "rate-limit": 0, @@ -5084,6 +5708,37 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + }, + "methods": [ + { + "name": "delete", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "demo": "databases\/delete.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + } + } + ], "auth": { "Project": [] } @@ -5126,13 +5781,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listCollections", "group": "collections", - "weight": 77, + "weight": 324, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-collections.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", "rate-limit": 0, @@ -5143,6 +5798,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTables" + }, "auth": { "Project": [] } @@ -5186,7 +5845,7 @@ ] }, "post": { - "summary": "Create collection", + "summary": "Create collections", "operationId": "databasesCreateCollection", "consumes": [ "application\/json" @@ -5206,13 +5865,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createCollection", "group": "collections", - "weight": 76, + "weight": 320, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", "rate-limit": 0, @@ -5223,6 +5882,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTable" + }, "auth": { "Project": [] } @@ -5311,13 +5974,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getCollection", "group": "collections", - "weight": 78, + "weight": 321, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", "rate-limit": 0, @@ -5328,6 +5991,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTable" + }, "auth": { "Project": [] } @@ -5378,13 +6045,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateCollection", "group": "collections", - "weight": 80, + "weight": 322, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", "rate-limit": 0, @@ -5395,6 +6062,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTable" + }, "auth": { "Project": [] } @@ -5479,13 +6150,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteCollection", "group": "collections", - "weight": 81, + "weight": 323, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", "rate-limit": 0, @@ -5496,6 +6167,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTable" + }, "auth": { "Project": [] } @@ -5546,13 +6221,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listAttributes", "group": "attributes", - "weight": 92, + "weight": 341, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-attributes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", "rate-limit": 0, @@ -5563,6 +6238,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listColumns" + }, "auth": { "Project": [] } @@ -5584,7 +6263,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5627,13 +6306,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createBooleanAttribute", "group": "attributes", - "weight": 89, + "weight": 342, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-boolean-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", "rate-limit": 0, @@ -5644,6 +6323,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBooleanColumn" + }, "auth": { "Project": [] } @@ -5665,7 +6348,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5733,13 +6416,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateBooleanAttribute", "group": "attributes", - "weight": 101, + "weight": 343, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-boolean-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", "rate-limit": 0, @@ -5750,6 +6433,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBooleanColumn" + }, "auth": { "Project": [] } @@ -5771,7 +6458,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5841,13 +6528,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createDatetimeAttribute", "group": "attributes", - "weight": 90, + "weight": 344, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-datetime-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", "rate-limit": 0, @@ -5858,6 +6545,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createDatetimeColumn" + }, "auth": { "Project": [] } @@ -5879,7 +6570,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5927,7 +6618,7 @@ }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { "patch": { - "summary": "Update dateTime attribute", + "summary": "Update datetime attribute", "operationId": "databasesUpdateDatetimeAttribute", "consumes": [ "application\/json" @@ -5947,13 +6638,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDatetimeAttribute", "group": "attributes", - "weight": 102, + "weight": 345, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-datetime-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", "rate-limit": 0, @@ -5964,6 +6655,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateDatetimeColumn" + }, "auth": { "Project": [] } @@ -5985,7 +6680,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6055,13 +6750,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createEmailAttribute", "group": "attributes", - "weight": 83, + "weight": 346, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-email-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", "rate-limit": 0, @@ -6072,6 +6767,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEmailColumn" + }, "auth": { "Project": [] } @@ -6093,7 +6792,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6161,13 +6860,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateEmailAttribute", "group": "attributes", - "weight": 95, + "weight": 347, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-email-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", "rate-limit": 0, @@ -6178,6 +6877,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEmailColumn" + }, "auth": { "Project": [] } @@ -6199,7 +6902,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6233,7 +6936,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -6260,7 +6963,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "description": "Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -6269,15 +6972,15 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createEnumAttribute", "group": "attributes", - "weight": 84, + "weight": 348, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-enum-attribute.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-enum-attribute.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -6286,6 +6989,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEnumColumn" + }, "auth": { "Project": [] } @@ -6307,7 +7014,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6327,7 +7034,7 @@ }, "elements": { "type": "array", - "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "description": "Array of enum values.", "default": null, "x-example": null, "items": { @@ -6385,13 +7092,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateEnumAttribute", "group": "attributes", - "weight": 96, + "weight": 349, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-enum-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", "rate-limit": 0, @@ -6402,6 +7109,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEnumColumn" + }, "auth": { "Project": [] } @@ -6423,7 +7134,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6444,7 +7155,7 @@ "properties": { "elements": { "type": "array", - "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "description": "Updated list of enum values.", "default": null, "x-example": null, "items": { @@ -6466,7 +7177,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -6503,13 +7214,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createFloatAttribute", "group": "attributes", - "weight": 88, + "weight": 350, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-float-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", "rate-limit": 0, @@ -6520,6 +7231,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createFloatColumn" + }, "auth": { "Project": [] } @@ -6541,7 +7256,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6567,19 +7282,19 @@ }, "min": { "type": "number", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value.", "default": null, "x-example": null }, "max": { "type": "number", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value.", "default": null, "x-example": null }, "default": { "type": "number", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when required.", "default": null, "x-example": null }, @@ -6621,13 +7336,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateFloatAttribute", "group": "attributes", - "weight": 100, + "weight": 351, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-float-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", "rate-limit": 0, @@ -6638,6 +7353,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateFloatColumn" + }, "auth": { "Project": [] } @@ -6659,7 +7378,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6686,26 +7405,26 @@ }, "min": { "type": "number", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value.", "default": null, "x-example": null }, "max": { "type": "number", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value.", "default": null, "x-example": null }, "default": { "type": "number", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, "x-nullable": true }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -6741,13 +7460,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIntegerAttribute", "group": "attributes", - "weight": 87, + "weight": 352, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-integer-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", "rate-limit": 0, @@ -6758,6 +7477,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIntegerColumn" + }, "auth": { "Project": [] } @@ -6779,7 +7502,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6805,19 +7528,19 @@ }, "min": { "type": "integer", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value", "default": null, "x-example": null }, "max": { "type": "integer", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value", "default": null, "x-example": null }, "default": { "type": "integer", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null }, @@ -6859,13 +7582,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateIntegerAttribute", "group": "attributes", - "weight": 99, + "weight": 353, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-integer-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", "rate-limit": 0, @@ -6876,6 +7599,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIntegerColumn" + }, "auth": { "Project": [] } @@ -6897,7 +7624,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6924,26 +7651,26 @@ }, "min": { "type": "integer", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value", "default": null, "x-example": null }, "max": { "type": "integer", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value", "default": null, "x-example": null }, "default": { "type": "integer", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null, "x-nullable": true }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -6979,13 +7706,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIpAttribute", "group": "attributes", - "weight": 85, + "weight": 354, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-ip-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", "rate-limit": 0, @@ -6996,6 +7723,232 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIpColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "schema": { + "$ref": "#\/definitions\/attributeIp" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 355, + "cookies": false, + "type": "", + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIpColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 356, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, "auth": { "Project": [] } @@ -7042,16 +7995,11 @@ "x-example": false }, "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", "default": null, - "x-example": null - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "default": false, - "x-example": false + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true } }, "required": [ @@ -7063,10 +8011,10 @@ ] } }, - "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { "patch": { - "summary": "Update IP address attribute", - "operationId": "databasesUpdateIpAttribute", + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", "consumes": [ "application\/json" ], @@ -7076,24 +8024,24 @@ "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", "responses": { "200": { - "description": "AttributeIP", + "description": "AttributeLine", "schema": { - "$ref": "#\/definitions\/attributeIp" + "$ref": "#\/definitions\/attributeLine" } } }, + "deprecated": true, "x-appwrite": { - "method": "updateIpAttribute", + "method": "updateLineAttribute", "group": "attributes", - "weight": 97, + "weight": 357, "cookies": false, "type": "", - "deprecated": false, - "demo": "databases\/update-ip-attribute.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -7102,6 +8050,121 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 358, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, "auth": { "Project": [] } @@ -7129,6 +8192,111 @@ "x-example": "<COLLECTION_ID>", "in": "path" }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 359, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, { "name": "key", "description": "Attribute Key.", @@ -7149,10 +8317,10 @@ "x-example": false }, "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", "default": null, - "x-example": null, + "x-example": "[1, 2]", "x-nullable": true }, "newKey": { @@ -7163,8 +8331,223 @@ } }, "required": [ - "required", - "default" + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 360, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" ] } } @@ -7193,13 +8576,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createRelationshipAttribute", "group": "attributes", - "weight": 91, + "weight": 362, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-relationship-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", "rate-limit": 0, @@ -7210,6 +8593,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRelationshipColumn" + }, "auth": { "Project": [] } @@ -7231,7 +8618,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7245,7 +8632,7 @@ "properties": { "relatedCollectionId": { "type": "string", - "description": "Related Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Related Collection ID.", "default": null, "x-example": "<RELATED_COLLECTION_ID>" }, @@ -7326,13 +8713,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 82, + "weight": 364, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-string-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", "rate-limit": 0, @@ -7343,6 +8730,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createStringColumn" + }, "auth": { "Project": [] } @@ -7364,7 +8755,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7445,13 +8836,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 94, + "weight": 365, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-string-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", "rate-limit": 0, @@ -7462,6 +8853,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateStringColumn" + }, "auth": { "Project": [] } @@ -7483,7 +8878,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7523,7 +8918,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -7559,13 +8954,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 86, + "weight": 366, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-url-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", "rate-limit": 0, @@ -7576,6 +8971,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createUrlColumn" + }, "auth": { "Project": [] } @@ -7597,7 +8996,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7665,13 +9064,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 98, + "weight": 367, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-url-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", "rate-limit": 0, @@ -7682,6 +9081,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateUrlColumn" + }, "auth": { "Project": [] } @@ -7703,7 +9106,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7737,7 +9140,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -7802,13 +9205,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getAttribute", "group": "attributes", - "weight": 93, + "weight": 339, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", "rate-limit": 0, @@ -7819,6 +9222,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getColumn" + }, "auth": { "Project": [] } @@ -7840,7 +9247,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7871,13 +9278,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteAttribute", "group": "attributes", - "weight": 104, + "weight": 340, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", "rate-limit": 0, @@ -7888,6 +9295,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteColumn" + }, "auth": { "Project": [] } @@ -7909,7 +9320,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7947,13 +9358,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 103, + "weight": 363, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-relationship-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", "rate-limit": 0, @@ -7964,6 +9375,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRelationshipColumn" + }, "auth": { "Project": [] } @@ -7985,7 +9400,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -8019,7 +9434,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -8049,13 +9464,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listDocuments", "group": "documents", - "weight": 110, + "weight": 335, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", "rate-limit": 0, @@ -8064,10 +9479,13 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, "auth": { "Project": [] } @@ -8131,13 +9549,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createDocument", "group": "documents", - "weight": 109, + "weight": 327, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", "rate-limit": 120, @@ -8146,17 +9564,20 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, "methods": [ { "name": "createDocument", + "namespace": "databases", + "desc": "Create document", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [] }, "parameters": [ "databaseId", @@ -8177,7 +9598,42 @@ "model": "#\/definitions\/document" } ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + }, + { + "name": "createDocuments", + "namespace": "databases", + "desc": "Create documents", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRows" + } } ], "auth": { @@ -8224,7 +9680,7 @@ "type": "object", "description": "Document data as JSON object.", "default": [], - "x-example": "{}" + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" }, "permissions": { "type": "array", @@ -8250,7 +9706,7 @@ ] }, "put": { - "summary": "Create or update documents", + "summary": "Upsert documents", "operationId": "databasesUpsertDocuments", "consumes": [ "application\/json" @@ -8263,20 +9719,20 @@ ], "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", "responses": { - "200": { + "201": { "description": "Documents List", "schema": { "$ref": "#\/definitions\/documentList" } } }, + "deprecated": true, "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 332, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/upsert-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", "rate-limit": 120, @@ -8284,9 +9740,46 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + }, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "demo": "databases\/upsert-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + } + } + ], "auth": { "Project": [] } @@ -8323,13 +9816,16 @@ "documents": { "type": "array", "description": "Array of document data as JSON objects. May contain partial documents.", - "default": [], + "default": null, "x-example": null, "items": { "type": "object" } } - } + }, + "required": [ + "documents" + ] } } ] @@ -8355,13 +9851,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 330, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", "rate-limit": 120, @@ -8369,9 +9865,14 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRows" + }, "auth": { "Project": [] } @@ -8446,13 +9947,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 334, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", "rate-limit": 60, @@ -8460,9 +9961,14 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRows" + }, "auth": { "Project": [] } @@ -8531,13 +10037,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getDocument", "group": "documents", - "weight": 111, + "weight": 328, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", "rate-limit": 0, @@ -8546,10 +10052,13 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, "auth": { "Project": [] } @@ -8601,7 +10110,7 @@ ] }, "put": { - "summary": "Upsert document", + "summary": "Upsert a document", "operationId": "databasesUpsertDocument", "consumes": [ "application\/json" @@ -8614,20 +10123,20 @@ ], "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { - "200": { + "201": { "description": "Document", "schema": { "$ref": "#\/definitions\/document" } } }, + "deprecated": true, "x-appwrite": { "method": "upsertDocument", "group": "documents", - "weight": 114, + "weight": 331, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/upsert-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", "rate-limit": 120, @@ -8636,10 +10145,48 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], "auth": { "Project": [] } @@ -8726,13 +10273,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDocument", "group": "documents", - "weight": 113, + "weight": 329, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", "rate-limit": 120, @@ -8741,10 +10288,13 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, "auth": { "Project": [] } @@ -8823,13 +10373,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 333, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", "rate-limit": 60, @@ -8838,10 +10388,13 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, "auth": { "Project": [] } @@ -8901,13 +10454,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listDocumentLogs", "group": "logs", - "weight": 112, + "weight": 336, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-document-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md", "rate-limit": 0, @@ -8918,6 +10471,10 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRowLogs" + }, "auth": { "Project": [] } @@ -8967,6 +10524,230 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -8987,13 +10768,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 106, + "weight": 371, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-indexes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", "rate-limit": 0, @@ -9004,6 +10785,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listIndexes" + }, "auth": { "Project": [] } @@ -9066,13 +10851,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIndex", - "group": "collections", - "weight": 105, + "group": "indexes", + "weight": 368, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", "rate-limit": 0, @@ -9083,6 +10868,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIndex" + }, "auth": { "Project": [] } @@ -9130,7 +10919,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -9193,13 +10983,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 107, + "weight": 369, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", "rate-limit": 0, @@ -9210,6 +11000,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getIndex" + }, "auth": { "Project": [] } @@ -9262,13 +11056,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 108, + "weight": 370, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", "rate-limit": 0, @@ -9279,6 +11073,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteIndex" + }, "auth": { "Project": [] } @@ -9336,13 +11134,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listCollectionLogs", "group": "collections", - "weight": 79, + "weight": 325, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-collection-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md", "rate-limit": 0, @@ -9353,6 +11151,10 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTableLogs" + }, "auth": { "Project": [] } @@ -9414,13 +11216,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 121, + "weight": 326, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-collection-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", "rate-limit": 0, @@ -9431,6 +11233,10 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTableUsage" + }, "auth": { "Project": [] } @@ -9460,7 +11266,7 @@ "30d", "90d" ], - "x-enum-name": "DatabaseUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -9500,13 +11306,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 73, + "weight": 317, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-logs.md", "rate-limit": 0, @@ -9517,6 +11323,39 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listDatabaseLogs" + }, + "methods": [ + { + "name": "listLogs", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "queries" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/logList" + } + ], + "description": "Get the database activity logs list by its unique ID.", + "demo": "databases\/list-logs.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listDatabaseLogs" + } + } + ], "auth": { "Project": [] } @@ -9553,7 +11392,7 @@ "\/databases\/{databaseId}\/usage": { "get": { "summary": "Get database usage stats", - "operationId": "databasesGetDatabaseUsage", + "operationId": "databasesGetUsage", "consumes": [], "produces": [ "application\/json" @@ -9570,14 +11409,14 @@ } } }, + "deprecated": true, "x-appwrite": { - "method": "getDatabaseUsage", + "method": "getUsage", "group": null, - "weight": 120, + "weight": 318, "cookies": false, "type": "", - "deprecated": false, - "demo": "databases\/get-database-usage.md", + "demo": "databases\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", "rate-limit": 0, "rate-time": 3600, @@ -9587,6 +11426,39 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getUsage" + }, + "methods": [ + { + "name": "getUsage", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "range" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/usageDatabase" + } + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "databases\/get-usage.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getUsage" + } + } + ], "auth": { "Project": [] } @@ -9607,7 +11479,7 @@ }, { "name": "range", - "description": "`Date range.", + "description": "Date range.", "required": false, "type": "string", "x-example": "24h", @@ -9616,7 +11488,7 @@ "30d", "90d" ], - "x-enum-name": "DatabaseUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -9648,13 +11520,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 440, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", "rate-limit": 0, @@ -9720,13 +11592,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 437, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", "rate-limit": 0, @@ -9809,6 +11681,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9834,7 +11707,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9969,13 +11843,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 442, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-runtimes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", "rate-limit": 0, @@ -10018,13 +11892,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 443, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-specifications.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", "rate-limit": 0, @@ -10068,13 +11942,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 402, + "weight": 466, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-templates.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", "rate-limit": 0, @@ -10162,13 +12036,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 401, + "weight": 465, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", "rate-limit": 0, @@ -10220,13 +12094,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listUsage", "group": null, - "weight": 395, + "weight": 459, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "rate-limit": 0, @@ -10258,7 +12132,7 @@ "30d", "90d" ], - "x-enum-name": "FunctionUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -10290,13 +12164,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 438, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", "rate-limit": 0, @@ -10349,13 +12223,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 439, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", "rate-limit": 0, @@ -10440,6 +12314,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -10465,7 +12340,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -10594,13 +12470,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 441, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", "rate-limit": 0, @@ -10655,13 +12531,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 446, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-function-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", "rate-limit": 0, @@ -10732,13 +12608,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 447, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-deployments.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", "rate-limit": 0, @@ -10812,13 +12688,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 444, "cookies": false, "type": "upload", - "deprecated": false, "demo": "functions\/create-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "rate-limit": 0, @@ -10904,13 +12780,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 452, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-duplicate-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "rate-limit": 0, @@ -10989,13 +12865,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 449, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-template-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", "rate-limit": 0, @@ -11095,13 +12971,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 450, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-vcs-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "rate-limit": 0, @@ -11191,13 +13067,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 445, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", "rate-limit": 0, @@ -11253,13 +13129,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 448, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", "rate-limit": 0, @@ -11320,13 +13196,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 451, "cookies": false, "type": "location", - "deprecated": false, "demo": "functions\/get-deployment-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "rate-limit": 0, @@ -11334,7 +13210,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "functions.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -11406,13 +13281,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 453, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-deployment-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "rate-limit": 0, @@ -11473,13 +13348,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 456, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-executions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", "rate-limit": 0, @@ -11488,7 +13363,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11547,13 +13421,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 454, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "rate-limit": 0, @@ -11562,7 +13436,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11612,7 +13485,7 @@ }, "method": { "type": "string", - "description": "HTTP method of execution. Default value is GET.", + "description": "HTTP method of execution. Default value is POST.", "default": "POST", "x-example": "GET", "enum": [ @@ -11621,7 +13494,8 @@ "PUT", "PATCH", "DELETE", - "OPTIONS" + "OPTIONS", + "HEAD" ], "x-enum-name": "ExecutionMethod", "x-enum-keys": [] @@ -11636,7 +13510,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "<SCHEDULED_AT>" } } } @@ -11664,13 +13538,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 455, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", "rate-limit": 0, @@ -11679,7 +13553,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11729,13 +13602,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 457, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", "rate-limit": 0, @@ -11796,13 +13669,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getUsage", "group": null, - "weight": 394, + "weight": 458, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "rate-limit": 0, @@ -11842,7 +13715,7 @@ "30d", "90d" ], - "x-enum-name": "FunctionUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -11874,13 +13747,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 462, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", "rate-limit": 0, @@ -11933,13 +13806,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 460, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", "rate-limit": 0, @@ -12023,13 +13896,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 461, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", "rate-limit": 0, @@ -12090,13 +13963,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 463, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", "rate-limit": 0, @@ -12182,13 +14055,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 464, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", "rate-limit": 0, @@ -12251,13 +14124,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 250, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/query.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -12266,8 +14139,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -12325,13 +14197,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 249, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/mutation.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -12340,8 +14212,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -12397,13 +14268,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 78, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md", "rate-limit": 0, @@ -12446,13 +14317,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 99, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-antivirus.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md", "rate-limit": 0, @@ -12495,13 +14366,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 81, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-cache.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md", "rate-limit": 0, @@ -12544,13 +14415,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 86, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-certificate.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", "rate-limit": 0, @@ -12602,14 +14473,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 80, "cookies": false, "type": "", - "deprecated": false, - "demo": "health\/get-d-b.md", + "demo": "health\/get-db.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md", "rate-limit": 0, "rate-time": 3600, @@ -12651,13 +14522,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 82, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-pub-sub.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", "rate-limit": 0, @@ -12700,13 +14571,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 88, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-builds.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", "rate-limit": 0, @@ -12760,13 +14631,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 87, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-certificates.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md", "rate-limit": 0, @@ -12820,13 +14691,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 89, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-databases.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", "rate-limit": 0, @@ -12889,13 +14760,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 90, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-deletes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", "rate-limit": 0, @@ -12949,13 +14820,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 100, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-failed-jobs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", "rate-limit": 0, @@ -13033,13 +14904,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 94, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-functions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md", "rate-limit": 0, @@ -13093,13 +14964,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 85, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md", "rate-limit": 0, @@ -13153,13 +15024,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 91, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-mails.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", "rate-limit": 0, @@ -13213,13 +15084,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 92, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-messaging.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", "rate-limit": 0, @@ -13273,13 +15144,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 93, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-migrations.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", "rate-limit": 0, @@ -13315,7 +15186,7 @@ }, "\/health\/queue\/stats-resources": { "get": { - "summary": "Get stats resources queue", + "summary": "Get stats resources queue", "operationId": "healthGetQueueStatsResources", "consumes": [], "produces": [ @@ -13333,13 +15204,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 95, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-stats-resources.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", "rate-limit": 0, @@ -13393,13 +15264,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 96, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", "rate-limit": 0, @@ -13453,13 +15324,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 84, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-webhooks.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md", "rate-limit": 0, @@ -13513,13 +15384,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 98, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-storage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", "rate-limit": 0, @@ -13562,13 +15433,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 97, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-storage-local.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md", "rate-limit": 0, @@ -13611,13 +15482,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 83, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-time.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md", "rate-limit": 0, @@ -13660,13 +15531,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 70, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", "rate-limit": 0, @@ -13675,7 +15546,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13712,13 +15582,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 71, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", "rate-limit": 0, @@ -13727,7 +15597,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13764,13 +15633,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 75, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-continents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", "rate-limit": 0, @@ -13779,7 +15648,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13816,13 +15684,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 72, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", "rate-limit": 0, @@ -13831,7 +15699,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13868,14 +15735,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 73, "cookies": false, "type": "", - "deprecated": false, - "demo": "locale\/list-countries-e-u.md", + "demo": "locale\/list-countries-eu.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", "rate-limit": 0, "rate-time": 3600, @@ -13883,7 +15750,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13920,13 +15786,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 74, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries-phones.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", "rate-limit": 0, @@ -13935,7 +15801,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13972,13 +15837,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 76, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-currencies.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", "rate-limit": 0, @@ -13987,7 +15852,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -14024,13 +15888,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 77, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-languages.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", "rate-limit": 0, @@ -14039,7 +15903,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -14076,13 +15939,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 304, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-messages.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", "rate-limit": 0, @@ -14151,13 +16014,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 301, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", "rate-limit": 0, @@ -14309,13 +16172,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 308, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", "rate-limit": 0, @@ -14464,13 +16327,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 303, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-push.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", "rate-limit": 0, @@ -14659,13 +16522,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 310, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-push.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", "rate-limit": 0, @@ -14853,13 +16716,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 302, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-sms.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", "rate-limit": 0, @@ -14871,6 +16734,74 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + }, + "methods": [ + { + "name": "createSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + } + }, + { + "name": "createSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md" + } + ], "auth": { "Project": [] } @@ -14971,13 +16902,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 309, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-sms.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, @@ -14989,6 +16920,72 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + }, + "methods": [ + { + "name": "updateSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + } + }, + { + "name": "updateSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md" + } + ], "auth": { "Project": [] } @@ -15085,13 +17082,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 307, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-message.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", "rate-limit": 0, @@ -15140,13 +17137,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 311, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", "rate-limit": 0, @@ -15200,13 +17197,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 305, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-message-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", "rate-limit": 0, @@ -15272,13 +17269,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 306, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-targets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", "rate-limit": 0, @@ -15344,13 +17341,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 276, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-providers.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", "rate-limit": 0, @@ -15419,13 +17416,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 275, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-apns-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", "rate-limit": 0, @@ -15437,6 +17434,76 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + }, + "methods": [ + { + "name": "createApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + } + }, + { + "name": "createAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md" + } + ], "auth": { "Project": [] } @@ -15534,13 +17601,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 288, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-apns-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", "rate-limit": 0, @@ -15552,6 +17619,74 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + }, + "methods": [ + { + "name": "updateApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + } + }, + { + "name": "updateAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md" + } + ], "auth": { "Project": [] } @@ -15647,13 +17782,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 274, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-fcm-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", "rate-limit": 0, @@ -15665,6 +17800,68 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + }, + "methods": [ + { + "name": "createFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + } + }, + { + "name": "createFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md" + } + ], "auth": { "Project": [] } @@ -15738,13 +17935,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 287, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-fcm-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", "rate-limit": 0, @@ -15756,6 +17953,66 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + }, + "methods": [ + { + "name": "updateFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + } + }, + { + "name": "updateFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md" + } + ], "auth": { "Project": [] } @@ -15827,13 +18084,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 266, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-mailgun-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", "rate-limit": 0, @@ -15954,13 +18211,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 279, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-mailgun-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", "rate-limit": 0, @@ -16079,14 +18336,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 269, "cookies": false, "type": "", - "deprecated": false, - "demo": "messaging\/create-msg91provider.md", + "demo": "messaging\/create-msg-91-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", "rate-limit": 0, "rate-time": 3600, @@ -16182,14 +18439,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 282, "cookies": false, "type": "", - "deprecated": false, - "demo": "messaging\/update-msg91provider.md", + "demo": "messaging\/update-msg-91-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", "rate-limit": 0, "rate-time": 3600, @@ -16283,13 +18540,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 267, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-sendgrid-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", "rate-limit": 0, @@ -16398,13 +18655,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 280, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-sendgrid-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", "rate-limit": 0, @@ -16511,13 +18768,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 268, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-smtp-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", "rate-limit": 0, @@ -16529,6 +18786,90 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + }, + "methods": [ + { + "name": "createSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + } + }, + { + "name": "createSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md" + } + ], "auth": { "Project": [] } @@ -16670,13 +19011,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 281, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-smtp-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", "rate-limit": 0, @@ -16688,6 +19029,86 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + }, + "methods": [ + { + "name": "updateSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + } + }, + { + "name": "updateSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md" + } + ], "auth": { "Project": [] } @@ -16826,13 +19247,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 270, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-telesign-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", "rate-limit": 0, @@ -16929,13 +19350,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 283, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-telesign-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", "rate-limit": 0, @@ -17030,13 +19451,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 271, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-textmagic-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", "rate-limit": 0, @@ -17133,13 +19554,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 284, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-textmagic-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", "rate-limit": 0, @@ -17234,13 +19655,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 272, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-twilio-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", "rate-limit": 0, @@ -17337,13 +19758,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 285, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-twilio-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", "rate-limit": 0, @@ -17438,13 +19859,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 273, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-vonage-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", "rate-limit": 0, @@ -17541,13 +19962,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 286, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-vonage-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", "rate-limit": 0, @@ -17640,13 +20061,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 278, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", "rate-limit": 0, @@ -17695,13 +20116,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 289, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", "rate-limit": 0, @@ -17755,13 +20176,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 277, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-provider-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", "rate-limit": 0, @@ -17827,13 +20248,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 298, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-subscriber-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", "rate-limit": 0, @@ -17899,13 +20320,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 291, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-topics.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", "rate-limit": 0, @@ -17972,13 +20393,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 290, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", "rate-limit": 0, @@ -18060,13 +20481,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 293, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", "rate-limit": 0, @@ -18120,13 +20541,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 294, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", "rate-limit": 0, @@ -18199,13 +20620,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 295, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", "rate-limit": 0, @@ -18259,13 +20680,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 292, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-topic-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", "rate-limit": 0, @@ -18331,13 +20752,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 297, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-subscribers.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", "rate-limit": 0, @@ -18412,13 +20833,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 296, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", "rate-limit": 0, @@ -18428,8 +20849,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -18500,13 +20920,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 299, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", "rate-limit": 0, @@ -18563,13 +20983,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 300, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", "rate-limit": 0, @@ -18579,8 +20999,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -18634,13 +21053,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": null, - "weight": 314, + "weight": 258, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/list-migrations.md", "rate-limit": 0, @@ -18707,13 +21126,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 309, + "weight": 253, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/create-appwrite-migration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite.md", "rate-limit": 0, @@ -18799,13 +21218,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 316, + "weight": 260, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/get-appwrite-report.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite-report.md", "rate-limit": 0, @@ -18887,13 +21306,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createCsvMigration", "group": null, - "weight": 313, + "weight": 257, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/create-csv-migration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-csv.md", "rate-limit": 0, @@ -18937,6 +21356,12 @@ "description": "Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.", "default": null, "x-example": "[ID1:ID2]" + }, + "internalFile": { + "type": "boolean", + "description": "Is the file stored in an internal bucket?", + "default": false, + "x-example": false } }, "required": [ @@ -18971,13 +21396,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 310, + "weight": 254, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/create-firebase-migration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase.md", "rate-limit": 0, @@ -19049,13 +21474,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 317, + "weight": 261, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/get-firebase-report.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-report.md", "rate-limit": 0, @@ -19120,13 +21545,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 312, + "weight": 256, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/create-n-host-migration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost.md", "rate-limit": 0, @@ -19239,13 +21664,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 319, + "weight": 263, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/get-n-host-report.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost-report.md", "rate-limit": 0, @@ -19359,13 +21784,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 311, + "weight": 255, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/create-supabase-migration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase.md", "rate-limit": 0, @@ -19471,13 +21896,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 318, + "weight": 262, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/get-supabase-report.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase-report.md", "rate-limit": 0, @@ -19582,13 +22007,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": null, - "weight": 315, + "weight": 259, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/get-migration.md", "rate-limit": 0, @@ -19640,13 +22065,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "retry", "group": null, - "weight": 320, + "weight": 264, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/retry.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/retry-migration.md", "rate-limit": 0, @@ -19693,13 +22118,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": null, - "weight": 321, + "weight": 265, "cookies": false, "type": "", - "deprecated": false, "demo": "migrations\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/delete-migration.md", "rate-limit": 0, @@ -19751,13 +22176,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 148, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", "rate-limit": 0, @@ -19833,13 +22258,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listVariables", "group": null, - "weight": 202, + "weight": 150, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/list-variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/list-variables.md", "rate-limit": 0, @@ -19881,13 +22306,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVariable", "group": null, - "weight": 201, + "weight": 149, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/create-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/create-variable.md", "rate-limit": 0, @@ -19962,13 +22387,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getVariable", "group": null, - "weight": 203, + "weight": 151, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/get-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-variable.md", "rate-limit": 0, @@ -20020,13 +22445,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 204, + "weight": 152, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/update-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/update-variable.md", "rate-limit": 0, @@ -20103,13 +22528,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 205, + "weight": 153, "cookies": false, "type": "", - "deprecated": false, "demo": "project\/delete-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/delete-variable.md", "rate-limit": 0, @@ -20161,15 +22586,15 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "projects", - "weight": 155, + "weight": 436, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/list.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all projects. You can use the query params to filter your results. ", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20232,13 +22657,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "projects", - "weight": 154, + "weight": 102, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create.md", "rate-limit": 0, @@ -20379,13 +22804,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "projects", - "weight": 156, + "weight": 103, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get.md", "rate-limit": 0, @@ -20437,13 +22862,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "projects", - "weight": 157, + "weight": 104, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update.md", "rate-limit": 0, @@ -20562,13 +22987,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "projects", - "weight": 174, + "weight": 121, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete.md", "rate-limit": 0, @@ -20622,13 +23047,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 161, + "weight": 108, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-api-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status.md", "rate-limit": 0, @@ -20639,6 +23064,68 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatus" + }, + "methods": [ + { + "name": "updateApiStatus", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "api", + "status" + ], + "required": [ + "projectId", + "api", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "demo": "projects\/update-api-status.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatus" + } + }, + { + "name": "updateAPIStatus", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "api", + "status" + ], + "required": [ + "projectId", + "api", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "demo": "projects\/update-api-status.md" + } + ], "auth": { "Project": [] } @@ -20714,13 +23201,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 162, + "weight": 109, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-api-status-all.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status-all.md", "rate-limit": 0, @@ -20731,6 +23218,64 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatusAll" + }, + "methods": [ + { + "name": "updateApiStatusAll", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "status" + ], + "required": [ + "projectId", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "demo": "projects\/update-api-status-all.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateAPIStatusAll" + } + }, + { + "name": "updateAPIStatusAll", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "status" + ], + "required": [ + "projectId", + "status" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "demo": "projects\/update-api-status-all.md" + } + ], "auth": { "Project": [] } @@ -20792,13 +23337,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 167, + "weight": 114, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-duration.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-duration.md", "rate-limit": 0, @@ -20870,13 +23415,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 166, + "weight": 113, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-limit.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-limit.md", "rate-limit": 0, @@ -20948,13 +23493,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 172, + "weight": 119, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-sessions-limit.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-sessions-limit.md", "rate-limit": 0, @@ -21026,13 +23571,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 165, + "weight": 112, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-memberships-privacy.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-memberships-privacy.md", "rate-limit": 0, @@ -21118,13 +23663,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 173, + "weight": 120, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-mock-numbers.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-mock-numbers.md", "rate-limit": 0, @@ -21199,13 +23744,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 170, + "weight": 117, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-password-dictionary.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-dictionary.md", "rate-limit": 0, @@ -21277,13 +23822,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 169, + "weight": 116, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-password-history.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-history.md", "rate-limit": 0, @@ -21355,13 +23900,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 171, + "weight": 118, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-personal-data-check.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-personal-data-check.md", "rate-limit": 0, @@ -21433,13 +23978,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 164, + "weight": 111, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-session-alerts.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-alerts.md", "rate-limit": 0, @@ -21489,6 +24034,84 @@ ] } }, + "\/projects\/{projectId}\/auth\/session-invalidation": { + "patch": { + "summary": "Update invalidate session option of the project", + "operationId": "projectsUpdateSessionInvalidation", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Invalidate all existing sessions. An optional auth security setting for projects, and enabled by default for console project.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateSessionInvalidation", + "group": "auth", + "weight": 147, + "cookies": false, + "type": "", + "demo": "projects\/update-session-invalidation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-invalidation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Update authentication session invalidation status. Use this endpoint to enable or disable session invalidation on password change", + "default": null, + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + ] + } + }, "\/projects\/{projectId}\/auth\/{method}": { "patch": { "summary": "Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.", @@ -21511,13 +24134,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 168, + "weight": 115, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-auth-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-status.md", "rate-limit": 0, @@ -21606,13 +24229,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 371, + "weight": 434, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/list-dev-keys.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", "rate-limit": 0, @@ -21676,13 +24299,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 368, + "weight": 431, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create-dev-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", "rate-limit": 0, @@ -21759,13 +24382,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 370, + "weight": 433, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-dev-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", "rate-limit": 0, @@ -21825,13 +24448,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 369, + "weight": 432, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-dev-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", "rate-limit": 0, @@ -21911,13 +24534,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 372, + "weight": 435, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-dev-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", "rate-limit": 0, @@ -21979,14 +24602,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 186, + "weight": 133, "cookies": false, "type": "", - "deprecated": false, - "demo": "projects\/create-j-w-t.md", + "demo": "projects\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-jwt.md", "rate-limit": 0, "rate-time": 3600, @@ -22064,13 +24687,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 182, + "weight": 129, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/list-keys.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-keys.md", "rate-limit": 0, @@ -22122,13 +24745,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 181, + "weight": 128, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-key.md", "rate-limit": 0, @@ -22214,13 +24837,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 183, + "weight": 130, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-key.md", "rate-limit": 0, @@ -22280,13 +24903,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 184, + "weight": 131, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-key.md", "rate-limit": 0, @@ -22375,13 +24998,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 185, + "weight": 132, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-key.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-key.md", "rate-limit": 0, @@ -22443,14 +25066,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 163, + "weight": 110, "cookies": false, "type": "", - "deprecated": false, - "demo": "projects\/update-o-auth2.md", + "demo": "projects\/update-o-auth-2.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-oauth2.md", "rate-limit": 0, "rate-time": 3600, @@ -22581,13 +25204,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 188, + "weight": 135, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/list-platforms.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-platforms.md", "rate-limit": 0, @@ -22639,13 +25262,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 187, + "weight": 134, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create-platform.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-platform.md", "rate-limit": 0, @@ -22759,13 +25382,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 189, + "weight": 136, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-platform.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-platform.md", "rate-limit": 0, @@ -22825,13 +25448,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 190, + "weight": 137, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-platform.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-platform.md", "rate-limit": 0, @@ -22922,13 +25545,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 191, + "weight": 138, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-platform.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-platform.md", "rate-limit": 0, @@ -22990,13 +25613,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 159, + "weight": 106, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-service-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status.md", "rate-limit": 0, @@ -23040,6 +25663,7 @@ "account", "avatars", "databases", + "tablesdb", "locale", "health", "storage", @@ -23091,13 +25715,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 160, + "weight": 107, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-service-status-all.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status-all.md", "rate-limit": 0, @@ -23169,13 +25793,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 192, + "weight": 139, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-smtp.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-smtp.md", "rate-limit": 0, @@ -23186,6 +25810,80 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMTP" + }, + "methods": [ + { + "name": "updateSmtp", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "enabled", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "enabled" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "demo": "projects\/update-smtp.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMTP" + } + }, + { + "name": "updateSMTP", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "enabled", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "enabled" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/project" + } + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "demo": "projects\/update-smtp.md" + } + ], "auth": { "Project": [] } @@ -23298,13 +25996,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 193, + "weight": 140, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create-smtp-test.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-smtp-test.md", "rate-limit": 0, @@ -23315,6 +26013,84 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.createSMTPTest" + }, + "methods": [ + { + "name": "createSmtpTest", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "host" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Send a test email to verify SMTP configuration. ", + "demo": "projects\/create-smtp-test.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.createSMTPTest" + } + }, + { + "name": "createSMTPTest", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "replyTo", + "host", + "port", + "username", + "password", + "secure" + ], + "required": [ + "projectId", + "emails", + "senderName", + "senderEmail", + "host" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Send a test email to verify SMTP configuration. ", + "demo": "projects\/create-smtp-test.md" + } + ], "auth": { "Project": [] } @@ -23436,13 +26212,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 158, + "weight": 105, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-team.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-team.md", "rate-limit": 0, @@ -23512,13 +26288,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 195, + "weight": 142, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-email-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-email-template.md", "rate-limit": 0, @@ -23732,13 +26508,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 197, + "weight": 144, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-email-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-email-template.md", "rate-limit": 0, @@ -23995,13 +26771,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 199, + "weight": 146, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-email-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-email-template.md", "rate-limit": 0, @@ -24215,13 +26991,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 194, + "weight": 141, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-sms-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-sms-template.md", "rate-limit": 0, @@ -24232,6 +27008,68 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.getSMSTemplate" + }, + "methods": [ + { + "name": "getSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "demo": "projects\/get-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.getSMSTemplate" + } + }, + { + "name": "getSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "demo": "projects\/get-sms-template.md" + } + ], "auth": { "Project": [] } @@ -24432,13 +27270,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 196, + "weight": 143, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-sms-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-sms-template.md", "rate-limit": 0, @@ -24449,6 +27287,72 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMSTemplate" + }, + "methods": [ + { + "name": "updateSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale", + "message" + ], + "required": [ + "projectId", + "type", + "locale", + "message" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "demo": "projects\/update-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.updateSMSTemplate" + } + }, + { + "name": "updateSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale", + "message" + ], + "required": [ + "projectId", + "type", + "locale", + "message" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "demo": "projects\/update-sms-template.md" + } + ], "auth": { "Project": [] } @@ -24667,13 +27571,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 198, + "weight": 145, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-sms-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-sms-template.md", "rate-limit": 0, @@ -24684,6 +27588,68 @@ "console" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.deleteSMSTemplate" + }, + "methods": [ + { + "name": "deleteSmsTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "demo": "projects\/delete-sms-template.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "projects.deleteSMSTemplate" + } + }, + { + "name": "deleteSMSTemplate", + "namespace": "projects", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "projectId", + "type", + "locale" + ], + "required": [ + "projectId", + "type", + "locale" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/smsTemplate" + } + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "demo": "projects\/delete-sms-template.md" + } + ], "auth": { "Project": [] } @@ -24884,13 +27850,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 176, + "weight": 123, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/list-webhooks.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-webhooks.md", "rate-limit": 0, @@ -24942,13 +27908,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 175, + "weight": 122, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/create-webhook.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-webhook.md", "rate-limit": 0, @@ -25060,13 +28026,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 177, + "weight": 124, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/get-webhook.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-webhook.md", "rate-limit": 0, @@ -25126,13 +28092,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 178, + "weight": 125, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-webhook.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook.md", "rate-limit": 0, @@ -25247,13 +28213,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 180, + "weight": 127, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/delete-webhook.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-webhook.md", "rate-limit": 0, @@ -25315,13 +28281,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 179, + "weight": 126, "cookies": false, "type": "", - "deprecated": false, "demo": "projects\/update-webhook-signature.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook-signature.md", "rate-limit": 0, @@ -25381,15 +28347,15 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listRules", "group": null, - "weight": 292, + "weight": 502, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/list-rules.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/list-rules.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the proxy rules. You can use the query params to filter your results.", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25454,14 +28420,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 433, + "weight": 497, "cookies": false, "type": "", - "deprecated": false, - "demo": "proxy\/create-a-p-i-rule.md", + "demo": "proxy\/create-api-rule.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite's API on custom domain.", "rate-limit": 10, "rate-time": 60, @@ -25524,13 +28490,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 435, + "weight": 499, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/create-function-rule.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for executing Appwrite Function on custom domain.", "rate-limit": 10, @@ -25607,13 +28573,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 436, + "weight": 500, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/create-redirect-rule.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for to redirect from custom domain to another domain.", "rate-limit": 10, @@ -25670,12 +28636,35 @@ "Temporary Redirect 307", "Permanent Redirect 308" ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "default": null, + "x-example": "<RESOURCE_ID>" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "default": null, + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] } }, "required": [ "domain", "url", - "statusCode" + "statusCode", + "resourceId", + "resourceType" ] } } @@ -25704,13 +28693,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 434, + "weight": 498, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/create-site-rule.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite Site on custom domain.", "rate-limit": 10, @@ -25785,15 +28774,15 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getRule", "group": null, - "weight": 293, + "weight": 501, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/get-rule.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/get-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a proxy rule by its unique ID.", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25838,15 +28827,15 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 294, + "weight": 503, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/delete-rule.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/delete-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a proxy rule by its unique ID.", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25898,15 +28887,15 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 295, + "weight": 504, "cookies": false, "type": "", - "deprecated": false, "demo": "proxy\/update-rule-verification.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/update-rule-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterRetry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25956,13 +28945,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 469, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", "rate-limit": 0, @@ -26028,13 +29017,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 467, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", "rate-limit": 0, @@ -26177,6 +29166,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26202,7 +29192,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26293,13 +29284,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 472, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-frameworks.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", "rate-limit": 0, @@ -26342,13 +29333,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 495, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-specifications.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", "rate-limit": 0, @@ -26392,13 +29383,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 427, + "weight": 491, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-templates.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", "rate-limit": 0, @@ -26486,13 +29477,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 428, + "weight": 492, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-template.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", "rate-limit": 0, @@ -26544,13 +29535,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listUsage", "group": null, - "weight": 429, + "weight": 493, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "rate-limit": 0, @@ -26582,7 +29573,7 @@ "30d", "90d" ], - "x-enum-name": "SiteUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -26614,13 +29605,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 468, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", "rate-limit": 0, @@ -26673,13 +29664,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 470, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", "rate-limit": 0, @@ -26824,6 +29815,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26849,7 +29841,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26933,13 +29926,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 471, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", "rate-limit": 0, @@ -26994,13 +29987,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 478, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-site-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", "rate-limit": 0, @@ -27071,13 +30064,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 477, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-deployments.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", "rate-limit": 0, @@ -27151,13 +30144,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 473, "cookies": false, "type": "upload", - "deprecated": false, "demo": "sites\/create-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", "rate-limit": 0, @@ -27251,13 +30244,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 481, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-duplicate-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "rate-limit": 0, @@ -27330,13 +30323,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 474, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-template-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", "rate-limit": 0, @@ -27436,13 +30429,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 475, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-vcs-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "rate-limit": 0, @@ -27533,13 +30526,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 476, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", "rate-limit": 0, @@ -27595,13 +30588,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 479, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", "rate-limit": 0, @@ -27662,13 +30655,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 480, "cookies": false, "type": "location", - "deprecated": false, "demo": "sites\/get-deployment-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "rate-limit": 0, @@ -27676,7 +30669,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "sites.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -27748,13 +30740,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 482, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-deployment-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "rate-limit": 0, @@ -27815,13 +30807,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 484, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", "rate-limit": 0, @@ -27886,13 +30878,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 483, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-log.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", "rate-limit": 0, @@ -27950,13 +30942,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 485, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-log.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", "rate-limit": 0, @@ -28017,13 +31009,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getUsage", "group": null, - "weight": 430, + "weight": 494, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "rate-limit": 0, @@ -28063,7 +31055,7 @@ "30d", "90d" ], - "x-enum-name": "SiteUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -28095,13 +31087,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 488, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", "rate-limit": 0, @@ -28154,13 +31146,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 486, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", "rate-limit": 0, @@ -28244,13 +31236,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 487, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", "rate-limit": 0, @@ -28311,13 +31303,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 489, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", "rate-limit": 0, @@ -28403,13 +31395,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 490, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", "rate-limit": 0, @@ -28470,13 +31462,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 155, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/list-buckets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", "rate-limit": 0, @@ -28542,13 +31534,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 154, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/create-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", "rate-limit": 0, @@ -28679,13 +31671,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 156, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", "rate-limit": 0, @@ -28738,13 +31730,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 157, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/update-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", "rate-limit": 0, @@ -28871,13 +31863,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 158, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/delete-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", "rate-limit": 0, @@ -28930,13 +31922,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 160, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/list-files.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", "rate-limit": 0, @@ -28945,7 +31937,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29013,13 +32004,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 159, "cookies": false, "type": "upload", - "deprecated": false, "demo": "storage\/create-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", "rate-limit": 60, @@ -29028,7 +32019,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29103,13 +32093,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 161, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", "rate-limit": 0, @@ -29118,7 +32108,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29173,13 +32162,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 166, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/update-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", "rate-limit": 60, @@ -29188,7 +32177,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29262,13 +32250,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 167, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/delete-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", "rate-limit": 60, @@ -29277,7 +32265,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29332,13 +32319,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 163, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", "rate-limit": 0, @@ -29347,7 +32334,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29411,13 +32397,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 162, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-preview.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", "rate-limit": 0, @@ -29426,7 +32412,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29578,7 +32563,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -29617,13 +32603,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 164, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-view.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", "rate-limit": 0, @@ -29632,7 +32618,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29696,13 +32681,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getUsage", "group": null, - "weight": 220, + "weight": 168, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-usage.md", "rate-limit": 0, @@ -29734,7 +32719,7 @@ "30d", "90d" ], - "x-enum-name": "StorageUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -29766,13 +32751,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 221, + "weight": 169, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-bucket-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", "rate-limit": 0, @@ -29812,7 +32797,6011 @@ "30d", "90d" ], - "x-enum-name": "StorageUsageRange", + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/tablesdb": { + "get": { + "summary": "List databases", + "operationId": "tablesDBList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "schema": { + "$ref": "#\/definitions\/databaseList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "tablesdb", + "weight": 376, + "cookies": false, + "type": "", + "demo": "tablesdb\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "tablesDBCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "tablesdb", + "weight": 372, + "cookies": false, + "type": "", + "demo": "tablesdb\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + ] + } + }, + "\/tablesdb\/usage": { + "get": { + "summary": "Get TablesDB usage stats", + "operationId": "tablesDBListUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabases", + "schema": { + "$ref": "#\/definitions\/usageDatabases" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 378, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "methods": [ + { + "name": "listUsage", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "range" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/usageDatabases" + } + ], + "description": "List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "tablesdb\/list-usage.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "tablesDBGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tablesdb", + "weight": 373, + "cookies": false, + "type": "", + "demo": "tablesdb\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "tablesDBUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tablesdb", + "weight": 374, + "cookies": false, + "type": "", + "demo": "tablesdb\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete database", + "operationId": "tablesDBDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tablesdb", + "weight": 375, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables": { + "get": { + "summary": "List tables", + "operationId": "tablesDBListTables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Tables List", + "schema": { + "$ref": "#\/definitions\/tableList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTables", + "group": "tables", + "weight": 383, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-tables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-tables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create table", + "operationId": "tablesDBCreateTable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTable", + "group": "tables", + "weight": 379, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "tableId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TABLE_ID>" + }, + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "tableId", + "name" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}": { + "get": { + "summary": "Get table", + "operationId": "tablesDBGetTable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.", + "responses": { + "200": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTable", + "group": "tables", + "weight": 380, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update table", + "operationId": "tablesDBUpdateTable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a table by its unique ID.", + "responses": { + "200": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTable", + "group": "tables", + "weight": 381, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete table", + "operationId": "tablesDBDeleteTable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a table by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTable", + "group": "tables", + "weight": 382, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns": { + "get": { + "summary": "List columns", + "operationId": "tablesDBListColumns", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "List columns in the table.", + "responses": { + "200": { + "description": "Columns List", + "schema": { + "$ref": "#\/definitions\/columnList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listColumns", + "group": "columns", + "weight": 388, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-columns.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-columns.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean": { + "post": { + "summary": "Create boolean column", + "operationId": "tablesDBCreateBooleanColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a boolean column.\n", + "responses": { + "202": { + "description": "ColumnBoolean", + "schema": { + "$ref": "#\/definitions\/columnBoolean" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBooleanColumn", + "group": "columns", + "weight": 389, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean\/{key}": { + "patch": { + "summary": "Update boolean column", + "operationId": "tablesDBUpdateBooleanColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a boolean column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnBoolean", + "schema": { + "$ref": "#\/definitions\/columnBoolean" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBooleanColumn", + "group": "columns", + "weight": 390, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime": { + "post": { + "summary": "Create datetime column", + "operationId": "tablesDBCreateDatetimeColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a date time column according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "ColumnDatetime", + "schema": { + "$ref": "#\/definitions\/columnDatetime" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDatetimeColumn", + "group": "columns", + "weight": 391, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime column", + "operationId": "tablesDBUpdateDatetimeColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a date time column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnDatetime", + "schema": { + "$ref": "#\/definitions\/columnDatetime" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDatetimeColumn", + "group": "columns", + "weight": 392, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email": { + "post": { + "summary": "Create email column", + "operationId": "tablesDBCreateEmailColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an email column.\n", + "responses": { + "202": { + "description": "ColumnEmail", + "schema": { + "$ref": "#\/definitions\/columnEmail" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailColumn", + "group": "columns", + "weight": 393, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email\/{key}": { + "patch": { + "summary": "Update email column", + "operationId": "tablesDBUpdateEmailColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an email column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEmail", + "schema": { + "$ref": "#\/definitions\/columnEmail" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailColumn", + "group": "columns", + "weight": 394, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum": { + "post": { + "summary": "Create enum column", + "operationId": "tablesDBCreateEnumColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column.", + "responses": { + "202": { + "description": "ColumnEnum", + "schema": { + "$ref": "#\/definitions\/columnEnum" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEnumColumn", + "group": "columns", + "weight": 395, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum\/{key}": { + "patch": { + "summary": "Update enum column", + "operationId": "tablesDBUpdateEnumColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an enum column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEnum", + "schema": { + "$ref": "#\/definitions\/columnEnum" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEnumColumn", + "group": "columns", + "weight": 396, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float": { + "post": { + "summary": "Create float column", + "operationId": "tablesDBCreateFloatColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a float column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnFloat", + "schema": { + "$ref": "#\/definitions\/columnFloat" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFloatColumn", + "group": "columns", + "weight": 397, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float\/{key}": { + "patch": { + "summary": "Update float column", + "operationId": "tablesDBUpdateFloatColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a float column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnFloat", + "schema": { + "$ref": "#\/definitions\/columnFloat" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFloatColumn", + "group": "columns", + "weight": 398, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer": { + "post": { + "summary": "Create integer column", + "operationId": "tablesDBCreateIntegerColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an integer column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnInteger", + "schema": { + "$ref": "#\/definitions\/columnInteger" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIntegerColumn", + "group": "columns", + "weight": 399, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer\/{key}": { + "patch": { + "summary": "Update integer column", + "operationId": "tablesDBUpdateIntegerColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an integer column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnInteger", + "schema": { + "$ref": "#\/definitions\/columnInteger" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIntegerColumn", + "group": "columns", + "weight": 400, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip": { + "post": { + "summary": "Create IP address column", + "operationId": "tablesDBCreateIpColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create IP address column.\n", + "responses": { + "202": { + "description": "ColumnIP", + "schema": { + "$ref": "#\/definitions\/columnIp" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIpColumn", + "group": "columns", + "weight": 401, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip\/{key}": { + "patch": { + "summary": "Update IP address column", + "operationId": "tablesDBUpdateIpColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an ip column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnIP", + "schema": { + "$ref": "#\/definitions\/columnIp" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIpColumn", + "group": "columns", + "weight": 402, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line column.", + "responses": { + "202": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 403, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 404, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point column.", + "responses": { + "202": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 405, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 406, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon column.", + "responses": { + "202": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 407, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { + "post": { + "summary": "Create relationship column", + "operationId": "tablesDBCreateRelationshipColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "202": { + "description": "ColumnRelationship", + "schema": { + "$ref": "#\/definitions\/columnRelationship" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRelationshipColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "relatedTableId": { + "type": "string", + "description": "Related Table ID.", + "default": null, + "x-example": "<RELATED_TABLE_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "default": null, + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "default": false, + "x-example": false + }, + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Column Key.", + "default": null, + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": "restrict", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedTableId", + "type" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string": { + "post": { + "summary": "Create string column", + "operationId": "tablesDBCreateStringColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a string column.\n", + "responses": { + "202": { + "description": "ColumnString", + "schema": { + "$ref": "#\/definitions\/columnString" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createStringColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "size": { + "type": "integer", + "description": "Column size for text columns, in number of characters.", + "default": null, + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string\/{key}": { + "patch": { + "summary": "Update string column", + "operationId": "tablesDBUpdateStringColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a string column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnString", + "schema": { + "$ref": "#\/definitions\/columnString" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStringColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string column.", + "default": null, + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url": { + "post": { + "summary": "Create URL column", + "operationId": "tablesDBCreateUrlColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a URL column.\n", + "responses": { + "202": { + "description": "ColumnURL", + "schema": { + "$ref": "#\/definitions\/columnUrl" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createUrlColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url\/{key}": { + "patch": { + "summary": "Update URL column", + "operationId": "tablesDBUpdateUrlColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an url column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnURL", + "schema": { + "$ref": "#\/definitions\/columnUrl" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateUrlColumn", + "group": "columns", + "weight": 414, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}": { + "get": { + "summary": "Get column", + "operationId": "tablesDBGetColumn", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get column by ID.", + "responses": { + "200": { + "description": "ColumnBoolean, or ColumnInteger, or ColumnFloat, or ColumnEmail, or ColumnEnum, or ColumnURL, or ColumnIP, or ColumnDatetime, or ColumnRelationship, or ColumnString", + "schema": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getColumn", + "group": "columns", + "weight": 386, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete column", + "operationId": "tablesDBDeleteColumn", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Deletes a column.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteColumn", + "group": "columns", + "weight": 387, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}\/relationship": { + "patch": { + "summary": "Update relationship column", + "operationId": "tablesDBUpdateRelationshipColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "200": { + "description": "ColumnRelationship", + "schema": { + "$ref": "#\/definitions\/columnRelationship" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRelationshipColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": null, + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "tablesDBListIndexes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "List indexes on the table.", + "responses": { + "200": { + "description": "Column Indexes List", + "schema": { + "$ref": "#\/definitions\/columnIndexList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 418, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "tablesDBCreateIndex", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Creates an index on the columns listed. Your index should include all the columns you will query in a single request.\nType can be `key`, `fulltext`, or `unique`.", + "responses": { + "202": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/columnIndex" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 415, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "default": null, + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "default": null, + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "columns": { + "type": "array", + "description": "Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "default": [], + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "columns" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "tablesDBGetIndex", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/columnIndex" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 416, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "tablesDBDeleteIndex", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 417, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/logs": { + "get": { + "summary": "List table logs", + "operationId": "tablesDBListTableLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get the table activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTableLogs", + "group": "tables", + "weight": 384, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-table-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + }, + { + "name": "createRows", + "namespace": "tablesDB", + "desc": "Create rows", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/rowList" + } + ], + "description": "Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-rows.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<ROW_ID>" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "default": [], + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + }, + "put": { + "summary": "Upsert rows", + "operationId": "tablesDBUpsertRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRows", + "group": "rows", + "weight": 424, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRows", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/rowList" + } + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "demo": "tablesdb\/upsert-rows.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "description": "Array of row data as JSON objects. May contain partial rows.", + "default": null, + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "rows" + ] + } + } + ] + }, + "patch": { + "summary": "Update rows", + "operationId": "tablesDBUpdateRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRows", + "group": "rows", + "weight": 422, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only column and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete rows", + "operationId": "tablesDBDeleteRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Bulk delete rows using queries, if no queries are passed then all rows are deleted.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRows", + "group": "rows", + "weight": 426, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-rows.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/logs": { + "get": { + "summary": "List row logs", + "operationId": "tablesDBListRowLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get the row activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRowLogs", + "group": "logs", + "weight": 428, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-row-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/usage": { + "get": { + "summary": "Get table usage stats", + "operationId": "tablesDBGetTableUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get usage metrics and statistics for a table. Returning the total number of rows. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageTable", + "schema": { + "$ref": "#\/definitions\/usageTable" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTableUsage", + "group": null, + "weight": 385, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/usage": { + "get": { + "summary": "Get TablesDB usage stats", + "operationId": "tablesDBGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabase", + "schema": { + "$ref": "#\/definitions\/usageDatabase" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 377, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-database-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "console" + ], + "packaging": false, + "methods": [ + { + "name": "getUsage", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "databaseId", + "range" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/usageDatabase" + } + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "demo": "tablesdb\/get-usage.md" + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -29844,13 +38833,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 171, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", "rate-limit": 0, @@ -29859,7 +38848,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29919,13 +38907,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 170, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", "rate-limit": 0, @@ -29934,7 +38922,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30009,13 +38996,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 172, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", "rate-limit": 0, @@ -30024,7 +39011,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30071,13 +39057,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 174, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", "rate-limit": 0, @@ -30086,7 +39072,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30146,13 +39131,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 176, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", "rate-limit": 0, @@ -30161,7 +39146,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30208,13 +39192,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 235, + "weight": 183, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md", "rate-limit": 0, @@ -30278,13 +39262,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 178, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list-memberships.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", "rate-limit": 0, @@ -30293,7 +39277,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30361,13 +39344,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 177, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", "rate-limit": 10, @@ -30376,7 +39359,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30474,13 +39456,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 179, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", "rate-limit": 0, @@ -30489,7 +39471,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30544,13 +39525,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 180, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", "rate-limit": 0, @@ -30559,7 +39540,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30630,13 +39610,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 182, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", "rate-limit": 0, @@ -30645,7 +39625,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30702,13 +39681,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 181, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", "rate-limit": 0, @@ -30795,13 +39774,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 173, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", "rate-limit": 0, @@ -30855,13 +39834,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 175, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", "rate-limit": 0, @@ -30933,13 +39912,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 507, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", "rate-limit": 0, @@ -31013,13 +39992,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 505, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/create-file-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", "rate-limit": 60, @@ -31097,13 +40076,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 506, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", "rate-limit": 0, @@ -31157,13 +40136,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 508, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", "rate-limit": 60, @@ -31228,13 +40207,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 509, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", "rate-limit": 60, @@ -31288,13 +40267,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 193, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md", "rate-limit": 0, @@ -31360,13 +40339,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 184, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md", "rate-limit": 0, @@ -31455,14 +40434,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 187, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-argon2user.md", + "demo": "users\/create-argon-2-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", "rate-limit": 0, "rate-time": 3600, @@ -31546,13 +40525,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 185, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-bcrypt-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", "rate-limit": 0, @@ -31635,13 +40614,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 201, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-identities.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", "rate-limit": 0, @@ -31704,13 +40683,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 224, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-identity.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", "rate-limit": 0, @@ -31765,14 +40744,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 186, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-m-d5user.md", + "demo": "users\/create-md-5-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", "rate-limit": 0, "rate-time": 3600, @@ -31856,14 +40835,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 189, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-p-h-pass-user.md", + "demo": "users\/create-ph-pass-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", "rate-limit": 0, "rate-time": 3600, @@ -31947,13 +40926,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 190, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-scrypt-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", "rate-limit": 0, @@ -32073,13 +41052,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 191, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-scrypt-modified-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", "rate-limit": 0, @@ -32185,14 +41164,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 188, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-s-h-a-user.md", + "demo": "users\/create-sha-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", "rate-limit": 0, "rate-time": 3600, @@ -32295,13 +41274,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getUsage", "group": null, - "weight": 278, + "weight": 226, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-usage.md", "rate-limit": 0, @@ -32333,7 +41312,7 @@ "30d", "90d" ], - "x-enum-name": "UserUsageRange", + "x-enum-name": "UsageRange", "x-enum-keys": [ "Twenty Four Hours", "Thirty Days", @@ -32365,13 +41344,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 194, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md", "rate-limit": 0, @@ -32419,13 +41398,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 222, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", "rate-limit": 0, @@ -32480,13 +41459,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 207, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", "rate-limit": 0, @@ -32559,14 +41538,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 225, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-j-w-t.md", + "demo": "users\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", "rate-limit": 0, "rate-time": 3600, @@ -32641,13 +41620,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 203, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-labels.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", "rate-limit": 0, @@ -32721,13 +41700,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 199, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", "rate-limit": 0, @@ -32792,13 +41771,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 198, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-memberships.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", "rate-limit": 0, @@ -32874,13 +41853,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 212, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-mfa.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", "rate-limit": 0, @@ -32891,6 +41870,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + }, + "methods": [ + { + "name": "updateMfa", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + } + }, + { + "name": "updateMFA", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md" + } + ], "auth": { "Project": [] } @@ -32948,13 +41985,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 217, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", "rate-limit": 0, @@ -32965,6 +42002,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md" + } + ], "auth": { "Project": [] } @@ -33020,13 +42113,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 213, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-mfa-factors.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", "rate-limit": 0, @@ -33037,6 +42130,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md" + } + ], "auth": { "Project": [] } @@ -33079,13 +42226,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 214, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", "rate-limit": 0, @@ -33096,6 +42243,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -33138,13 +42339,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 216, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", "rate-limit": 0, @@ -33155,6 +42356,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -33197,13 +42452,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 215, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", "rate-limit": 0, @@ -33214,6 +42469,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md" + } + ], "auth": { "Project": [] } @@ -33258,13 +42567,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 205, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", "rate-limit": 0, @@ -33337,13 +42646,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 206, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-password.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", "rate-limit": 0, @@ -33416,13 +42725,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 208, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-phone.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", "rate-limit": 0, @@ -33493,13 +42802,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 195, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md", "rate-limit": 0, @@ -33552,13 +42861,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 210, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md", "rate-limit": 0, @@ -33629,13 +42938,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 197, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", "rate-limit": 0, @@ -33688,13 +42997,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 218, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", "rate-limit": 0, @@ -33742,13 +43051,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 221, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", "rate-limit": 0, @@ -33798,13 +43107,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 220, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", "rate-limit": 0, @@ -33867,13 +43176,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 202, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md", "rate-limit": 0, @@ -33944,13 +43253,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 200, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-targets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", "rate-limit": 0, @@ -33983,7 +43292,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "type": "array", "collectionFormat": "multi", @@ -34016,13 +43325,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 192, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", "rate-limit": 0, @@ -34127,13 +43436,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 196, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", "rate-limit": 0, @@ -34195,13 +43504,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 211, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", "rate-limit": 0, @@ -34285,13 +43594,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 223, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", "rate-limit": 0, @@ -34355,13 +43664,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 219, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", "rate-limit": 0, @@ -34437,13 +43746,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 209, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-email-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", "rate-limit": 0, @@ -34516,13 +43825,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 204, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", "rate-limit": 0, @@ -34595,13 +43904,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 282, + "weight": 230, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/create-repository-detection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository-detection.md", "rate-limit": 0, @@ -34690,13 +43999,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 283, + "weight": 231, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/list-repositories.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repositories.md", "rate-limit": 0, @@ -34771,13 +44080,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 284, + "weight": 232, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/create-repository.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository.md", "rate-limit": 0, @@ -34854,13 +44163,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 285, + "weight": 233, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/get-repository.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository.md", "rate-limit": 0, @@ -34920,13 +44229,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 286, + "weight": 234, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/list-repository-branches.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repository-branches.md", "rate-limit": 0, @@ -34977,7 +44286,7 @@ "tags": [ "vcs" ], - "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "VCS Content List", @@ -34986,13 +44295,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 281, + "weight": 229, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/get-repository-contents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository-contents.md", "rate-limit": 0, @@ -35037,6 +44346,15 @@ "x-example": "<PROVIDER_ROOT_DIRECTORY>", "default": "", "in": "query" + }, + { + "name": "providerReference", + "description": "Git reference (branch, tag, commit) to get contents from", + "required": false, + "type": "string", + "x-example": "<PROVIDER_REFERENCE>", + "default": "", + "in": "query" } ] } @@ -35060,13 +44378,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 291, + "weight": 239, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/update-external-deployments.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/update-external-deployments.md", "rate-limit": 0, @@ -35144,13 +44462,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 288, + "weight": 236, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/list-installations.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-installations.md", "rate-limit": 0, @@ -35215,13 +44533,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 289, + "weight": 237, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/get-installation.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-installation.md", "rate-limit": 0, @@ -35268,13 +44586,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 290, + "weight": 238, "cookies": false, "type": "", - "deprecated": false, "demo": "vcs\/delete-installation.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/delete-installation.md", "rate-limit": 0, @@ -35320,6 +44638,10 @@ "name": "databases", "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, { "name": "locale", "description": "The Locale service allows you to customize your app based on your users' location." @@ -35381,7 +44703,37 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "type": "object", + "$ref": "#\/definitions\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } }, "documentList": { "description": "Documents List", @@ -35389,7 +44741,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of documents documents that matched your query.", + "description": "Total number of documents that matched your query.", "x-example": 5, "format": "int32" }, @@ -35406,7 +44758,40 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } + }, + "tableList": { + "description": "Tables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tables": { + "type": "array", + "description": "List of tables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/table" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tables" + ], + "example": { + "total": 5, + "tables": "" + } }, "collectionList": { "description": "Collections List", @@ -35414,7 +44799,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of collections documents that matched your query.", + "description": "Total number of collections that matched your query.", "x-example": 5, "format": "int32" }, @@ -35431,7 +44816,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -35439,7 +44828,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of databases documents that matched your query.", + "description": "Total number of databases that matched your query.", "x-example": 5, "format": "int32" }, @@ -35456,7 +44845,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -35464,7 +44857,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of indexes documents that matched your query.", + "description": "Total number of indexes that matched your query.", "x-example": 5, "format": "int32" }, @@ -35481,7 +44874,40 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "columnIndexList": { + "description": "Column Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/columnIndex" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -35489,7 +44915,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of users documents that matched your query.", + "description": "Total number of users that matched your query.", "x-example": 5, "format": "int32" }, @@ -35506,7 +44932,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -35514,7 +44944,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of sessions documents that matched your query.", + "description": "Total number of sessions that matched your query.", "x-example": 5, "format": "int32" }, @@ -35531,7 +44961,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -35539,7 +44973,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of identities documents that matched your query.", + "description": "Total number of identities that matched your query.", "x-example": 5, "format": "int32" }, @@ -35556,7 +44990,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -35564,7 +45002,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of logs documents that matched your query.", + "description": "Total number of logs that matched your query.", "x-example": 5, "format": "int32" }, @@ -35581,7 +45019,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -35589,7 +45031,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of files documents that matched your query.", + "description": "Total number of files that matched your query.", "x-example": 5, "format": "int32" }, @@ -35606,7 +45048,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -35614,7 +45060,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of buckets documents that matched your query.", + "description": "Total number of buckets that matched your query.", "x-example": 5, "format": "int32" }, @@ -35631,7 +45077,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -35639,7 +45089,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of tokens documents that matched your query.", + "description": "Total number of tokens that matched your query.", "x-example": 5, "format": "int32" }, @@ -35656,7 +45106,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -35664,7 +45118,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of teams documents that matched your query.", + "description": "Total number of teams that matched your query.", "x-example": 5, "format": "int32" }, @@ -35681,7 +45135,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -35689,7 +45147,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of memberships documents that matched your query.", + "description": "Total number of memberships that matched your query.", "x-example": 5, "format": "int32" }, @@ -35706,7 +45164,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -35714,7 +45176,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of sites documents that matched your query.", + "description": "Total number of sites that matched your query.", "x-example": 5, "format": "int32" }, @@ -35731,7 +45193,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "templateSiteList": { "description": "Site Templates List", @@ -35739,7 +45205,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of templates documents that matched your query.", + "description": "Total number of templates that matched your query.", "x-example": 5, "format": "int32" }, @@ -35756,7 +45222,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "functionList": { "description": "Functions List", @@ -35764,7 +45234,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of functions documents that matched your query.", + "description": "Total number of functions that matched your query.", "x-example": 5, "format": "int32" }, @@ -35781,7 +45251,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "templateFunctionList": { "description": "Function Templates List", @@ -35789,7 +45263,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of templates documents that matched your query.", + "description": "Total number of templates that matched your query.", "x-example": 5, "format": "int32" }, @@ -35806,7 +45280,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "installationList": { "description": "Installations List", @@ -35814,7 +45292,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of installations documents that matched your query.", + "description": "Total number of installations that matched your query.", "x-example": 5, "format": "int32" }, @@ -35831,7 +45309,11 @@ "required": [ "total", "installations" - ] + ], + "example": { + "total": 5, + "installations": "" + } }, "providerRepositoryFrameworkList": { "description": "Framework Provider Repositories List", @@ -35839,7 +45321,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of frameworkProviderRepositories documents that matched your query.", + "description": "Total number of frameworkProviderRepositories that matched your query.", "x-example": 5, "format": "int32" }, @@ -35856,7 +45338,11 @@ "required": [ "total", "frameworkProviderRepositories" - ] + ], + "example": { + "total": 5, + "frameworkProviderRepositories": "" + } }, "providerRepositoryRuntimeList": { "description": "Runtime Provider Repositories List", @@ -35864,7 +45350,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of runtimeProviderRepositories documents that matched your query.", + "description": "Total number of runtimeProviderRepositories that matched your query.", "x-example": 5, "format": "int32" }, @@ -35881,7 +45367,11 @@ "required": [ "total", "runtimeProviderRepositories" - ] + ], + "example": { + "total": 5, + "runtimeProviderRepositories": "" + } }, "branchList": { "description": "Branches List", @@ -35889,7 +45379,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of branches documents that matched your query.", + "description": "Total number of branches that matched your query.", "x-example": 5, "format": "int32" }, @@ -35906,7 +45396,11 @@ "required": [ "total", "branches" - ] + ], + "example": { + "total": 5, + "branches": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -35914,7 +45408,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of frameworks documents that matched your query.", + "description": "Total number of frameworks that matched your query.", "x-example": 5, "format": "int32" }, @@ -35931,7 +45425,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -35939,7 +45437,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of runtimes documents that matched your query.", + "description": "Total number of runtimes that matched your query.", "x-example": 5, "format": "int32" }, @@ -35956,7 +45454,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -35964,7 +45466,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of deployments documents that matched your query.", + "description": "Total number of deployments that matched your query.", "x-example": 5, "format": "int32" }, @@ -35981,7 +45483,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -35989,7 +45495,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of executions documents that matched your query.", + "description": "Total number of executions that matched your query.", "x-example": 5, "format": "int32" }, @@ -36006,7 +45512,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "projectList": { "description": "Projects List", @@ -36014,7 +45524,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of projects documents that matched your query.", + "description": "Total number of projects that matched your query.", "x-example": 5, "format": "int32" }, @@ -36031,7 +45541,11 @@ "required": [ "total", "projects" - ] + ], + "example": { + "total": 5, + "projects": "" + } }, "webhookList": { "description": "Webhooks List", @@ -36039,7 +45553,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of webhooks documents that matched your query.", + "description": "Total number of webhooks that matched your query.", "x-example": 5, "format": "int32" }, @@ -36056,7 +45570,11 @@ "required": [ "total", "webhooks" - ] + ], + "example": { + "total": 5, + "webhooks": "" + } }, "keyList": { "description": "API Keys List", @@ -36064,7 +45582,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of keys documents that matched your query.", + "description": "Total number of keys that matched your query.", "x-example": 5, "format": "int32" }, @@ -36081,7 +45599,11 @@ "required": [ "total", "keys" - ] + ], + "example": { + "total": 5, + "keys": "" + } }, "devKeyList": { "description": "Dev Keys List", @@ -36089,7 +45611,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of devKeys documents that matched your query.", + "description": "Total number of devKeys that matched your query.", "x-example": 5, "format": "int32" }, @@ -36106,7 +45628,11 @@ "required": [ "total", "devKeys" - ] + ], + "example": { + "total": 5, + "devKeys": "" + } }, "platformList": { "description": "Platforms List", @@ -36114,7 +45640,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of platforms documents that matched your query.", + "description": "Total number of platforms that matched your query.", "x-example": 5, "format": "int32" }, @@ -36131,7 +45657,11 @@ "required": [ "total", "platforms" - ] + ], + "example": { + "total": 5, + "platforms": "" + } }, "countryList": { "description": "Countries List", @@ -36139,7 +45669,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of countries documents that matched your query.", + "description": "Total number of countries that matched your query.", "x-example": 5, "format": "int32" }, @@ -36156,7 +45686,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -36164,7 +45698,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of continents documents that matched your query.", + "description": "Total number of continents that matched your query.", "x-example": 5, "format": "int32" }, @@ -36181,7 +45715,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -36189,7 +45727,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of languages documents that matched your query.", + "description": "Total number of languages that matched your query.", "x-example": 5, "format": "int32" }, @@ -36206,7 +45744,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -36214,7 +45756,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of currencies documents that matched your query.", + "description": "Total number of currencies that matched your query.", "x-example": 5, "format": "int32" }, @@ -36231,7 +45773,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -36239,7 +45785,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of phones documents that matched your query.", + "description": "Total number of phones that matched your query.", "x-example": 5, "format": "int32" }, @@ -36256,7 +45802,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -36264,7 +45814,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of variables documents that matched your query.", + "description": "Total number of variables that matched your query.", "x-example": 5, "format": "int32" }, @@ -36281,7 +45831,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "proxyRuleList": { "description": "Rule List", @@ -36289,7 +45843,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of rules documents that matched your query.", + "description": "Total number of rules that matched your query.", "x-example": 5, "format": "int32" }, @@ -36306,7 +45860,11 @@ "required": [ "total", "rules" - ] + ], + "example": { + "total": 5, + "rules": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -36314,7 +45872,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of localeCodes documents that matched your query.", + "description": "Total number of localeCodes that matched your query.", "x-example": 5, "format": "int32" }, @@ -36331,7 +45889,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -36339,7 +45901,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of providers documents that matched your query.", + "description": "Total number of providers that matched your query.", "x-example": 5, "format": "int32" }, @@ -36356,7 +45918,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -36364,7 +45930,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of messages documents that matched your query.", + "description": "Total number of messages that matched your query.", "x-example": 5, "format": "int32" }, @@ -36381,7 +45947,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -36389,7 +45959,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of topics documents that matched your query.", + "description": "Total number of topics that matched your query.", "x-example": 5, "format": "int32" }, @@ -36406,7 +45976,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -36414,7 +45988,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of subscribers documents that matched your query.", + "description": "Total number of subscribers that matched your query.", "x-example": 5, "format": "int32" }, @@ -36431,7 +46005,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -36439,7 +46017,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of targets documents that matched your query.", + "description": "Total number of targets that matched your query.", "x-example": 5, "format": "int32" }, @@ -36456,7 +46034,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "migrationList": { "description": "Migrations List", @@ -36464,7 +46046,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of migrations documents that matched your query.", + "description": "Total number of migrations that matched your query.", "x-example": 5, "format": "int32" }, @@ -36481,7 +46063,11 @@ "required": [ "total", "migrations" - ] + ], + "example": { + "total": 5, + "migrations": "" + } }, "specificationList": { "description": "Specifications List", @@ -36489,7 +46075,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of specifications documents that matched your query.", + "description": "Total number of specifications that matched your query.", "x-example": 5, "format": "int32" }, @@ -36506,7 +46092,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "vcsContentList": { "description": "VCS Content List", @@ -36514,7 +46104,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of contents documents that matched your query.", + "description": "Total number of contents that matched your query.", "x-example": 5, "format": "int32" }, @@ -36531,7 +46121,11 @@ "required": [ "total", "contents" - ] + ], + "example": { + "total": 5, + "contents": "" + } }, "database": { "description": "Database", @@ -36561,6 +46155,11 @@ "type": "boolean", "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", "x-example": false + }, + "type": { + "type": "string", + "description": "Database type.", + "x-example": "legacy" } }, "required": [ @@ -36568,8 +46167,17 @@ "name", "$createdAt", "$updatedAt", - "enabled" - ] + "enabled", + "type" + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false, + "type": "legacy" + } }, "collection": { "description": "Collection", @@ -36652,6 +46260,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -36680,7 +46297,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -36724,6 +46355,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -36735,7 +46375,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -36754,7 +46398,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36793,6 +46445,12 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "default", "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "x-nullable": true } }, "required": [ @@ -36804,7 +46462,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -36823,7 +46494,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36881,7 +46560,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -36900,7 +46592,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36958,7 +46658,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -36977,7 +46690,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -37020,7 +46741,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -37039,7 +46771,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -37088,7 +46828,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -37107,7 +46859,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -37165,7 +46925,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -37184,7 +46957,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -37233,7 +47014,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -37252,7 +47045,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -37301,7 +47102,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -37320,7 +47133,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -37369,7 +47190,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -37388,7 +47221,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -37461,15 +47302,1701 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + 0, + 0 + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "table": { + "description": "Table", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Table creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Table update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Table permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Table name.", + "x-example": "My Table" + }, + "enabled": { + "type": "boolean", + "description": "Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "rowSecurity": { + "type": "boolean", + "description": "Whether row-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "columns": { + "type": "array", + "description": "Table columns.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Table indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/columnIndex" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "rowSecurity", + "columns", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Table", + "enabled": false, + "rowSecurity": true, + "columns": {}, + "indexes": {} + } + }, + "columnList": { + "description": "Columns List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of columns in the given table.", + "x-example": 5, + "format": "int32" + }, + "columns": { + "type": "array", + "description": "List of columns.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "columns" + ], + "example": { + "total": 5, + "columns": "" + } + }, + "columnString": { + "description": "ColumnString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default", + "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnInteger": { + "description": "ColumnInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "x-nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 10, + "format": "int32", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnFloat": { + "description": "ColumnFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "x-nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "x-nullable": true + }, + "default": { + "type": "number", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 2.5, + "format": "double", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "columnBoolean": { + "description": "ColumnBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "columnEmail": { + "description": "ColumnEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default@example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "columnEnum": { + "description": "ColumnEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "element", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "columnIp": { + "description": "ColumnIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "192.0.2.0", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "columnUrl": { + "description": "ColumnURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "https:\/\/example.com" + } + }, + "columnDatetime": { + "description": "ColumnDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "columnRelationship": { + "description": "ColumnRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedTable": { + "type": "string", + "description": "The ID of the related table.", + "x-example": "table" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedTable", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedTable": "table", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + 0, + 0 + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } }, "index": { "description": "Index", "type": "object", "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, "key": { "type": "string", - "description": "Index Key.", + "description": "Index key.", "x-example": "index1" }, "type": { @@ -37480,7 +49007,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -37512,6 +49046,40 @@ }, "x-example": [], "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "attributes", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [] + } + }, + "columnIndex": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" }, "$createdAt": { "type": "string", @@ -37522,18 +49090,148 @@ "type": "string", "description": "Index update date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "columns": { + "type": "array", + "description": "Index columns.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index columns length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "x-nullable": true } }, "required": [ + "$id", + "$createdAt", + "$updatedAt", "key", "type", "status", "error", - "attributes", - "lengths", + "columns", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "columns": [], + "lengths": [], + "orders": [] + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", "$createdAt", - "$updatedAt" - ] + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } }, "document": { "description": "Document", @@ -37544,15 +49242,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -37578,12 +49285,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -37717,7 +49441,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -37880,7 +49627,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -37894,7 +49667,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -37908,7 +49684,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -37922,7 +49701,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -37936,7 +49718,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -37978,7 +49763,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -38010,7 +49802,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -38045,12 +49843,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -38237,7 +50046,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -38305,7 +50147,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -38349,7 +50203,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -38363,7 +50225,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -38413,7 +50278,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -38433,7 +50307,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -38515,7 +50393,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -38607,7 +50500,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -38657,7 +50569,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -38709,7 +50630,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -38800,7 +50732,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -38987,7 +50936,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "templateSite": { "description": "Template Site", @@ -39084,7 +51064,22 @@ "providerOwner", "providerVersion", "variables" - ] + ], + "example": { + "key": "starter", + "name": "Starter site", + "tagline": "Minimal web app integrating with Appwrite.", + "demoUrl": "https:\/\/nextjs-starter.appwrite.network\/", + "screenshotDark": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png", + "screenshotLight": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png", + "useCases": "Starter", + "frameworks": [], + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [] + } }, "templateFramework": { "description": "Template Framework", @@ -39146,7 +51141,18 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/build", + "providerRootDirectory": ".\/svelte-kit\/starter", + "buildRuntime": "node-22", + "adapter": "ssr", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -39336,7 +51342,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "templateFunction": { "description": "Template Function", @@ -39467,7 +51503,26 @@ "providerVersion", "variables", "scopes" - ] + ], + "example": { + "icon": "icon-lightning-bolt", + "id": "starter", + "name": "Starter function", + "tagline": "A simple function to get started.", + "permissions": "any", + "events": "account.create", + "cron": "0 0 * * *", + "timeout": 300, + "useCases": "Starter", + "runtimes": [], + "instructions": "For documentation and instructions check out <link>.", + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [], + "scopes": "users.read" + } }, "templateRuntime": { "description": "Template Runtime", @@ -39499,7 +51554,13 @@ "commands", "entrypoint", "providerRootDirectory" - ] + ], + "example": { + "name": "node-19.0", + "commands": "npm install", + "entrypoint": "index.js", + "providerRootDirectory": "node\/starter" + } }, "templateVariable": { "description": "Template Variable", @@ -39549,7 +51610,16 @@ "placeholder", "required", "type" - ] + ], + "example": { + "name": "APPWRITE_DATABASE_ID", + "description": "The ID of the Appwrite database that contains the collection to sync.", + "value": "512", + "secret": false, + "placeholder": "64a55...7b912", + "required": false, + "type": "password" + } }, "installation": { "description": "Installation", @@ -39593,7 +51663,15 @@ "provider", "organization", "providerInstallationId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "provider": "github", + "organization": "appwrite", + "providerInstallationId": "5322" + } }, "providerRepository": { "description": "ProviderRepository", @@ -39624,6 +51702,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39636,8 +51719,18 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime" + } }, "providerRepositoryFramework": { "description": "ProviderRepositoryFramework", @@ -39668,6 +51761,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39685,9 +51783,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "framework" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "framework": "nextjs" + } }, "providerRepositoryRuntime": { "description": "ProviderRepositoryRuntime", @@ -39718,6 +51827,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39735,9 +51849,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "runtime" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "runtime": "node-22" + } }, "detectionFramework": { "description": "DetectionFramework", @@ -39769,7 +51894,13 @@ "installCommand", "buildCommand", "outputDirectory" - ] + ], + "example": { + "framework": "nuxt", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" + } }, "detectionRuntime": { "description": "DetectionRuntime", @@ -39795,7 +51926,12 @@ "runtime", "entrypoint", "commands" - ] + ], + "example": { + "runtime": "node", + "entrypoint": "index.js", + "commands": "npm install && npm run build" + } }, "vcsContent": { "description": "VcsContents", @@ -39822,7 +51958,12 @@ }, "required": [ "name" - ] + ], + "example": { + "size": 1523, + "isDirectory": true, + "name": "Main.java" + } }, "branch": { "description": "Branch", @@ -39836,7 +51977,10 @@ }, "required": [ "name" - ] + ], + "example": { + "name": "main" + } }, "runtime": { "description": "Runtime", @@ -39895,7 +52039,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -39951,7 +52105,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -39989,7 +52161,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -40071,7 +52250,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -40099,11 +52285,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -40129,6 +52310,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -40156,14 +52342,43 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -40181,7 +52396,7 @@ }, "$updatedAt": { "type": "string", - "description": "Execution upate date in ISO 8601 format.", + "description": "Execution update date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, "$permissions": { @@ -40199,15 +52414,31 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -40221,7 +52452,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "type": "object", "$ref": "#\/definitions\/headers" @@ -40285,6 +52516,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -40296,7 +52528,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "project": { "description": "Project", @@ -40437,6 +52699,11 @@ "description": "Whether or not to show user MFA status in the teams membership response.", "x-example": true }, + "authInvalidateSessions": { + "type": "boolean", + "description": "Whether or not all existing sessions should be invalidated on password change", + "x-example": true + }, "oAuthProviders": { "type": "array", "description": "List of Auth Providers.", @@ -40588,7 +52855,12 @@ }, "serviceStatusForDatabases": { "type": "boolean", - "description": "Databases service status", + "description": "Databases (legacy) service status", + "x-example": true + }, + "serviceStatusForTablesdb": { + "type": "boolean", + "description": "TablesDB service status", "x-example": true }, "serviceStatusForLocale": { @@ -40663,6 +52935,7 @@ "authMembershipsUserName", "authMembershipsUserEmail", "authMembershipsMfa", + "authInvalidateSessions", "oAuthProviders", "platforms", "webhooks", @@ -40689,6 +52962,7 @@ "serviceStatusForAccount", "serviceStatusForAvatars", "serviceStatusForDatabases", + "serviceStatusForTablesdb", "serviceStatusForLocale", "serviceStatusForHealth", "serviceStatusForStorage", @@ -40698,7 +52972,75 @@ "serviceStatusForFunctions", "serviceStatusForGraphql", "serviceStatusForMessaging" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "description": "This is a new project.", + "teamId": "1592981250", + "logo": "5f5c451b403cb", + "url": "5f5c451b403cb", + "legalName": "Company LTD.", + "legalCountry": "US", + "legalState": "New York", + "legalCity": "New York City.", + "legalAddress": "620 Eighth Avenue, New York, NY 10018", + "legalTaxId": "131102020", + "authDuration": 60, + "authLimit": 100, + "authSessionsLimit": 10, + "authPasswordHistory": 5, + "authPasswordDictionary": true, + "authPersonalDataCheck": true, + "authMockNumbers": [ + {} + ], + "authSessionAlerts": true, + "authMembershipsUserName": true, + "authMembershipsUserEmail": true, + "authMembershipsMfa": true, + "authInvalidateSessions": true, + "oAuthProviders": [ + {} + ], + "platforms": {}, + "webhooks": {}, + "keys": {}, + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyTo": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "securepassword", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "authEmailPassword": true, + "authUsersAuthMagicURL": true, + "authEmailOtp": true, + "authAnonymous": true, + "authInvites": true, + "authJWT": true, + "authPhone": true, + "serviceStatusForAccount": true, + "serviceStatusForAvatars": true, + "serviceStatusForDatabases": true, + "serviceStatusForTablesdb": true, + "serviceStatusForLocale": true, + "serviceStatusForHealth": true, + "serviceStatusForStorage": true, + "serviceStatusForTeams": true, + "serviceStatusForUsers": true, + "serviceStatusForSites": true, + "serviceStatusForFunctions": true, + "serviceStatusForGraphql": true, + "serviceStatusForMessaging": true + } }, "webhook": { "description": "Webhook", @@ -40735,7 +53077,10 @@ "items": { "type": "string" }, - "x-example": "database.collections.update" + "x-example": [ + "databases.tables.update", + "databases.collections.update" + ] }, "security": { "type": "boolean", @@ -40788,7 +53133,25 @@ "enabled", "logs", "attempts" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": [ + "databases.tables.update", + "databases.collections.update" + ], + "security": true, + "httpUser": "username", + "httpPass": "password", + "signatureKey": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } }, "key": { "description": "Key", @@ -40856,7 +53219,18 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "devKey": { "description": "DevKey", @@ -40915,7 +53289,17 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "mockNumber": { "description": "Mock Number", @@ -40935,7 +53319,11 @@ "required": [ "phone", "otp" - ] + ], + "example": { + "phone": "+1612842323", + "otp": "123456" + } }, "authProvider": { "description": "AuthProvider", @@ -40973,7 +53361,14 @@ "appId", "secret", "enabled" - ] + ], + "example": { + "key": "github", + "name": "GitHub", + "appId": "259125845563242502", + "secret": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ", + "enabled": "" + } }, "platform": { "description": "Platform", @@ -41002,7 +53397,16 @@ "type": { "type": "string", "description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.", - "x-example": "web" + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "ios", + "android", + "unity" + ] }, "key": { "type": "string", @@ -41017,7 +53421,7 @@ "hostname": { "type": "string", "description": "Web app hostname. Empty string for other platforms.", - "x-example": true + "x-example": "app.example.com" }, "httpUser": { "type": "string", @@ -41041,7 +53445,19 @@ "hostname", "httpUser", "httpPass" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "key": "com.company.appname", + "store": "", + "hostname": "app.example.com", + "httpUser": "username", + "httpPass": "password" + } }, "variable": { "description": "Variable", @@ -41097,7 +53513,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -41117,7 +53543,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -41137,7 +53567,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -41163,7 +53597,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -41215,7 +53654,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -41241,7 +53689,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -41254,14 +53707,23 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -41276,7 +53738,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -41295,15 +53760,25 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "description": "Service status. Possible values are: `pass`, `fail`", + "x-example": "pass", + "enum": [ + "pass", + "fail" + ], + "x-enum-name": "HealthCheckStatus" } }, "required": [ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -41347,7 +53822,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -41376,7 +53859,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "metric": { "description": "Metric", @@ -41397,7 +53885,11 @@ "required": [ "value", "date" - ] + ], + "example": { + "value": 1, + "date": "2020-10-15T06:38:00.000+00:00" + } }, "metricBreakdown": { "description": "Metric Breakdown", @@ -41431,7 +53923,13 @@ "required": [ "name", "value" - ] + ], + "example": { + "resourceId": "5e5ea5c16897e", + "name": "Documents", + "value": 1, + "estimate": 1 + } }, "usageDatabases": { "description": "UsageDatabases", @@ -41454,12 +53952,24 @@ "x-example": 0, "format": "int32" }, + "tablesTotal": { + "type": "integer", + "description": "Total aggregated number of tables.", + "x-example": 0, + "format": "int32" + }, "documentsTotal": { "type": "integer", "description": "Total aggregated number of documents.", "x-example": 0, "format": "int32" }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, "storageTotal": { "type": "integer", "description": "Total aggregated number of total databases storage in bytes.", @@ -41496,6 +54006,15 @@ }, "x-example": [] }, + "tables": { + "type": "array", + "description": "Aggregated number of tables per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, "documents": { "type": "array", "description": "Aggregated number of documents per period.", @@ -41505,6 +54024,15 @@ }, "x-example": [] }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, "storage": { "type": "array", "description": "An array of the aggregated number of databases storage in bytes per period.", @@ -41537,17 +54065,40 @@ "range", "databasesTotal", "collectionsTotal", + "tablesTotal", "documentsTotal", + "rowsTotal", "storageTotal", "databasesReadsTotal", "databasesWritesTotal", "databases", "collections", + "tables", "documents", + "rows", "storage", "databasesReads", "databasesWrites" - ] + ], + "example": { + "range": "30d", + "databasesTotal": 0, + "collectionsTotal": 0, + "tablesTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "storageTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "databases": [], + "collections": [], + "tables": [], + "documents": [], + "rows": [], + "storage": [], + "databasesReads": [], + "databasesWrites": [] + } }, "usageDatabase": { "description": "UsageDatabase", @@ -41564,12 +54115,24 @@ "x-example": 0, "format": "int32" }, + "tablesTotal": { + "type": "integer", + "description": "Total aggregated number of tables.", + "x-example": 0, + "format": "int32" + }, "documentsTotal": { "type": "integer", "description": "Total aggregated number of documents.", "x-example": 0, "format": "int32" }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, "storageTotal": { "type": "integer", "description": "Total aggregated number of total storage used in bytes.", @@ -41597,6 +54160,15 @@ }, "x-example": [] }, + "tables": { + "type": "array", + "description": "Aggregated number of tables per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, "documents": { "type": "array", "description": "Aggregated number of documents per period.", @@ -41606,6 +54178,15 @@ }, "x-example": [] }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, "storage": { "type": "array", "description": "Aggregated storage used in bytes per period.", @@ -41637,16 +54218,73 @@ "required": [ "range", "collectionsTotal", + "tablesTotal", "documentsTotal", + "rowsTotal", "storageTotal", "databaseReadsTotal", "databaseWritesTotal", "collections", + "tables", "documents", + "rows", "storage", "databaseReads", "databaseWrites" - ] + ], + "example": { + "range": "30d", + "collectionsTotal": 0, + "tablesTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "storageTotal": 0, + "databaseReadsTotal": 0, + "databaseWritesTotal": 0, + "collections": [], + "tables": [], + "documents": [], + "rows": [], + "storage": [], + "databaseReads": [], + "databaseWrites": [] + } + }, + "usageTable": { + "description": "UsageTable", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of of rows.", + "x-example": 0, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "Aggregated number of rows per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "rowsTotal", + "rows" + ], + "example": { + "range": "30d", + "rowsTotal": 0, + "rows": [] + } }, "usageCollection": { "description": "UsageCollection", @@ -41677,7 +54315,12 @@ "range", "documentsTotal", "documents" - ] + ], + "example": { + "range": "30d", + "documentsTotal": 0, + "documents": [] + } }, "usageUsers": { "description": "UsageUsers", @@ -41725,7 +54368,14 @@ "sessionsTotal", "users", "sessions" - ] + ], + "example": { + "range": "30d", + "usersTotal": 0, + "sessionsTotal": 0, + "users": [], + "sessions": [] + } }, "usageStorage": { "description": "StorageUsage", @@ -41790,7 +54440,16 @@ "buckets", "files", "storage" - ] + ], + "example": { + "range": "30d", + "bucketsTotal": 0, + "filesTotal": 0, + "filesStorageTotal": 0, + "buckets": [], + "files": [], + "storage": [] + } }, "usageBuckets": { "description": "UsageBuckets", @@ -41855,7 +54514,16 @@ "storage", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "range": "30d", + "filesTotal": 0, + "filesStorageTotal": 0, + "files": [], + "storage": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "usageFunctions": { "description": "UsageFunctions", @@ -42073,7 +54741,34 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "functionsTotal": 0, + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "functions": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageFunction": { "description": "UsageFunction", @@ -42281,7 +54976,33 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageSites": { "description": "UsageSites", @@ -42550,7 +55271,40 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "sitesTotal": 0, + "sites": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageSite": { "description": "UsageSite", @@ -42809,7 +55563,39 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageProject": { "description": "UsageProject", @@ -42827,6 +55613,12 @@ "x-example": 0, "format": "int32" }, + "rowsTotal": { + "type": "integer", + "description": "Total aggregated number of rows.", + "x-example": 0, + "format": "int32" + }, "databasesTotal": { "type": "integer", "description": "Total aggregated number of databases.", @@ -43047,6 +55839,7 @@ "required": [ "executionsTotal", "documentsTotal", + "rowsTotal", "databasesTotal", "databasesStorageTotal", "usersTotal", @@ -43076,7 +55869,41 @@ "databasesWrites", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "executionsTotal": 0, + "documentsTotal": 0, + "rowsTotal": 0, + "databasesTotal": 0, + "databasesStorageTotal": 0, + "usersTotal": 0, + "filesStorageTotal": 0, + "functionsStorageTotal": 0, + "buildsStorageTotal": 0, + "deploymentsStorageTotal": 0, + "bucketsTotal": 0, + "executionsMbSecondsTotal": 0, + "buildsMbSecondsTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "requests": [], + "network": [], + "users": [], + "executions": [], + "executionsBreakdown": [], + "bucketsBreakdown": [], + "databasesStorageBreakdown": [], + "executionsMbSecondsBreakdown": [], + "buildsMbSecondsBreakdown": [], + "functionsStorageBreakdown": [], + "authPhoneTotal": 0, + "authPhoneEstimate": 0, + "authPhoneCountryBreakdown": [], + "databasesReads": [], + "databasesWrites": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "headers": { "description": "Headers", @@ -43096,7 +55923,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -43130,7 +55961,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "proxyRule": { "description": "Rule", @@ -43185,7 +56022,11 @@ "deploymentResourceType": { "type": "string", "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", - "x-example": "function" + "x-example": "function", + "enum": [ + "function", + "site" + ] }, "deploymentResourceId": { "type": "string", @@ -43195,12 +56036,18 @@ "deploymentVcsProviderBranch": { "type": "string", "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", - "x-example": "function" + "x-example": "main" }, "status": { "type": "string", "description": "Domain verification status. Possible values are \"created\", \"verifying\", \"verified\" and \"unverified\"", - "x-example": "verified" + "x-example": "verified", + "enum": [ + "created", + "verifying", + "verified", + "unverified" + ] }, "logs": { "type": "string", @@ -43229,7 +56076,24 @@ "status", "logs", "renewAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "main", + "status": "verified", + "logs": "HTTP challegne failed.", + "renewAt": "datetime" + } }, "smsTemplate": { "description": "SmsTemplate", @@ -43255,7 +56119,12 @@ "type", "locale", "message" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account." + } }, "emailTemplate": { "description": "EmailTemplate", @@ -43305,7 +56174,16 @@ "senderEmail", "replyTo", "subject" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyTo": "emails@appwrite.io", + "subject": "Please verify your email address" + } }, "consoleVariables": { "description": "Console Variables", @@ -43326,6 +56204,11 @@ "description": "AAAA target for your Appwrite custom domains.", "x-example": "::1" }, + "_APP_DOMAIN_TARGET_CAA": { + "type": "string", + "description": "CAA target for your Appwrite custom domains.", + "x-example": "digicert.com" + }, "_APP_STORAGE_LIMIT": { "type": "integer", "description": "Maximum file size allowed for file upload in bytes.", @@ -43383,6 +56266,7 @@ "_APP_DOMAIN_TARGET_CNAME", "_APP_DOMAIN_TARGET_A", "_APP_DOMAIN_TARGET_AAAA", + "_APP_DOMAIN_TARGET_CAA", "_APP_STORAGE_LIMIT", "_APP_COMPUTE_SIZE_LIMIT", "_APP_USAGE_STATS", @@ -43393,7 +56277,23 @@ "_APP_DOMAIN_FUNCTIONS", "_APP_OPTIONS_FORCE_HTTPS", "_APP_DOMAINS_NAMESERVERS" - ] + ], + "example": { + "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", + "_APP_DOMAIN_TARGET_A": "127.0.0.1", + "_APP_DOMAIN_TARGET_AAAA": "::1", + "_APP_DOMAIN_TARGET_CAA": "digicert.com", + "_APP_STORAGE_LIMIT": "30000000", + "_APP_COMPUTE_SIZE_LIMIT": "30000000", + "_APP_USAGE_STATS": "enabled", + "_APP_VCS_ENABLED": true, + "_APP_DOMAIN_ENABLED": true, + "_APP_ASSISTANT_ENABLED": true, + "_APP_DOMAIN_SITES": "sites.localhost", + "_APP_DOMAIN_FUNCTIONS": "functions.localhost", + "_APP_OPTIONS_FORCE_HTTPS": "enabled", + "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -43425,7 +56325,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -43445,7 +56351,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -43465,7 +56377,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -43497,7 +56413,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -43564,7 +56486,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -43661,7 +56598,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ @@ -43675,7 +56619,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -43737,7 +56707,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -43812,7 +56792,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -43874,7 +56874,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } }, "migration": { "description": "Migration", @@ -43964,7 +56975,23 @@ "statusCounters", "resourceData", "errors" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "stage": "init", + "source": "Appwrite", + "destination": "Appwrite", + "resources": [ + "user" + ], + "resourceId": "databaseId:collectionId", + "statusCounters": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}", + "resourceData": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]", + "errors": [] + } }, "migrationReport": { "description": "Migration Report", @@ -43988,9 +57015,9 @@ "x-example": 20, "format": "int32" }, - "document": { + "row": { "type": "integer", - "description": "Number of documents to be migrated.", + "description": "Number of rows to be migrated.", "x-example": 20, "format": "int32" }, @@ -44028,13 +57055,24 @@ "user", "team", "database", - "document", + "row", "file", "bucket", "function", "size", "version" - ] + ], + "example": { + "user": 20, + "team": 20, + "database": 20, + "row": 20, + "file": 20, + "bucket": 20, + "function": 20, + "size": 30000, + "version": "1.4.0" + } } }, "externalDocs": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index c033008417..0a5fc8fe95 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.7.0", + "version": "1.8.0", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -99,13 +99,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "account", "weight": 10, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md", "rate-limit": 0, @@ -151,13 +151,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "account", "weight": 9, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md", "rate-limit": 10, @@ -242,13 +242,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "account", "weight": 35, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md", "rate-limit": 0, @@ -321,13 +321,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listIdentities", "group": "identities", "weight": 58, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-identities.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", "rate-limit": 0, @@ -384,13 +384,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteIdentity", "group": "identities", "weight": 59, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-identity.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", "rate-limit": 0, @@ -448,14 +448,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "tokens", "weight": 30, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-j-w-t.md", + "demo": "account\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", "rate-limit": 100, "rate-time": 3600, @@ -497,13 +497,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", "weight": 32, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", "rate-limit": 0, @@ -565,14 +565,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMFA", "group": "mfa", "weight": 45, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/update-m-f-a.md", + "demo": "account\/update-mfa.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", "rate-limit": 0, "rate-time": 3600, @@ -639,13 +639,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", "weight": 47, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", "rate-limit": 0, @@ -657,6 +657,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md" + } + ], "auth": { "Project": [], "Session": [] @@ -706,13 +762,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", "weight": 48, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", "rate-limit": 0, @@ -724,6 +780,66 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md" + } + ], "auth": { "Project": [], "Session": [] @@ -786,13 +902,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", "weight": 52, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", "rate-limit": 0, @@ -804,6 +920,60 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md" + } + ], "auth": { "Project": [], "Session": [] @@ -855,13 +1025,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", "weight": 53, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", "rate-limit": 10, @@ -873,6 +1043,60 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + }, + "methods": [ + { + "name": "createMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAChallenge" + } + }, + { + "name": "createMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [] + }, + "parameters": [ + "factor" + ], + "required": [ + "factor" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaChallenge" + } + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "demo": "account\/create-mfa-challenge.md" + } + ], "auth": { "Project": [] } @@ -932,13 +1156,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", "weight": 54, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-challenge.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", "rate-limit": 10, @@ -950,6 +1174,66 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + }, + "methods": [ + { + "name": "updateMfaChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAChallenge" + } + }, + { + "name": "updateMFAChallenge", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "challengeId", + "otp" + ], + "required": [ + "challengeId", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/session" + } + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/update-mfa-challenge.md" + } + ], "auth": { "Project": [], "Session": [] @@ -1011,13 +1295,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listMfaFactors", "group": "mfa", "weight": 46, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-mfa-factors.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", "rate-limit": 0, @@ -1029,6 +1313,54 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md" + } + ], "auth": { "Project": [], "Session": [] @@ -1063,13 +1395,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", "weight": 51, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", "rate-limit": 0, @@ -1081,6 +1413,54 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Session": [] @@ -1115,13 +1495,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", "weight": 49, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", "rate-limit": 0, @@ -1133,6 +1513,54 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Session": [] @@ -1167,13 +1595,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", "weight": 50, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", "rate-limit": 0, @@ -1185,6 +1613,54 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Session": [] @@ -1221,13 +1697,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "account", "weight": 33, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md", "rate-limit": 0, @@ -1295,13 +1771,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePassword", "group": "account", "weight": 34, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-password.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", "rate-limit": 10, @@ -1375,13 +1851,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhone", "group": "account", "weight": 36, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", "rate-limit": 0, @@ -1454,13 +1930,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "account", "weight": 31, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md", "rate-limit": 0, @@ -1506,13 +1982,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "account", "weight": 37, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md", "rate-limit": 0, @@ -1547,7 +2023,7 @@ "type": "object", "description": "Prefs key-value JSON object.", "default": {}, - "x-example": "{}" + "x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" } }, "required": [ @@ -1580,13 +2056,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createRecovery", "group": "recovery", "weight": 39, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md", "rate-limit": 10, @@ -1662,13 +2138,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateRecovery", "group": "recovery", "weight": 40, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-recovery.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md", "rate-limit": 10, @@ -1748,13 +2224,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSessions", "group": "sessions", "weight": 12, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/list-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", "rate-limit": 0, @@ -1795,13 +2271,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSessions", "group": "sessions", "weight": 13, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md", "rate-limit": 100, @@ -1849,13 +2325,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createAnonymousSession", "group": "sessions", "weight": 18, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-anonymous-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", "rate-limit": 50, @@ -1900,13 +2376,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailPasswordSession", "group": "sessions", "weight": 17, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-password-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", "rate-limit": 10, @@ -1978,14 +2454,14 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMagicURLSession", "group": "sessions", "weight": 27, "cookies": false, "type": "", - "deprecated": true, - "demo": "account\/update-magic-u-r-l-session.md", + "demo": "account\/update-magic-url-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, "rate-time": 3600, @@ -1996,6 +2472,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -2056,13 +2536,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updatePhoneSession", "group": "sessions", "weight": 28, "cookies": false, "type": "", - "deprecated": true, "demo": "account\/update-phone-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -2074,6 +2554,10 @@ "client" ], "packaging": false, + "deprecated": { + "since": "1.6.0", + "replaceWith": "account.createSession" + }, "auth": { "Project": [] } @@ -2134,13 +2618,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSession", "group": "sessions", "weight": 19, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", "rate-limit": 10, @@ -2210,13 +2694,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSession", "group": "sessions", "weight": 14, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/get-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", "rate-limit": 0, @@ -2272,13 +2756,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSession", "group": "sessions", "weight": 16, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", "rate-limit": 10, @@ -2329,13 +2813,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSession", "group": "sessions", "weight": 15, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/delete-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md", "rate-limit": 100, @@ -2393,13 +2877,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateStatus", "group": "account", "weight": 38, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", "rate-limit": 0, @@ -2438,7 +2922,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2447,13 +2931,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmailToken", "group": "tokens", "weight": 26, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-email-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, @@ -2486,7 +2970,7 @@ "properties": { "userId": { "type": "string", - "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -2534,14 +3018,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMagicURLToken", "group": "tokens", "weight": 25, "cookies": false, "type": "", - "deprecated": false, - "demo": "account\/create-magic-u-r-l-token.md", + "demo": "account\/create-magic-url-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", "rate-limit": 60, "rate-time": 3600, @@ -2573,7 +3057,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -2622,14 +3106,14 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "createOAuth2Token", "group": "tokens", "weight": 24, "cookies": false, "type": "webAuth", - "deprecated": false, - "demo": "account\/create-o-auth2token.md", + "demo": "account\/create-o-auth-2-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", "rate-limit": 50, "rate-time": 3600, @@ -2759,13 +3243,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneToken", "group": "tokens", "weight": 29, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", "rate-limit": 10, @@ -2798,7 +3282,7 @@ "properties": { "userId": { "type": "string", - "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.", "default": null, "x-example": "<USER_ID>" }, @@ -2840,13 +3324,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVerification", "group": "verification", "weight": 41, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", "rate-limit": 10, @@ -2912,13 +3396,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVerification", "group": "verification", "weight": 42, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", "rate-limit": 10, @@ -2993,13 +3477,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPhoneVerification", "group": "verification", "weight": 43, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/create-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", "rate-limit": 10, @@ -3048,13 +3532,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhoneVerification", "group": "verification", "weight": 44, "cookies": false, "type": "", - "deprecated": false, "demo": "account\/update-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", "rate-limit": 10, @@ -3127,13 +3611,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getBrowser", "group": null, "weight": 61, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-browser.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md", "rate-limit": 0, @@ -3142,7 +3626,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3254,13 +3737,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getCreditCard", "group": null, "weight": 60, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-credit-card.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md", "rate-limit": 0, @@ -3269,7 +3752,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3289,7 +3771,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.", "required": true, "type": "string", "x-example": "amex", @@ -3306,7 +3788,7 @@ "mastercard", "naranja", "targeta-shopping", - "union-china-pay", + "unionpay", "visa", "mir", "maestro", @@ -3326,7 +3808,7 @@ "Mastercard", "Naranja", "Tarjeta Shopping", - "Union China Pay", + "Union Pay", "Visa", "MIR", "Maestro", @@ -3387,13 +3869,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFavicon", "group": null, "weight": 64, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-favicon.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md", "rate-limit": 0, @@ -3402,7 +3884,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3452,13 +3933,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFlag", "group": null, "weight": 62, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-flag.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md", "rate-limit": 0, @@ -3467,7 +3948,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3941,13 +4421,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getImage", "group": null, "weight": 63, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-image.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md", "rate-limit": 0, @@ -3956,7 +4436,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4026,13 +4505,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getInitials", "group": null, "weight": 66, "cookies": false, "type": "location", - "deprecated": false, "demo": "avatars\/get-initials.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md", "rate-limit": 0, @@ -4041,7 +4520,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4119,14 +4597,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQR", "group": null, "weight": 65, "cookies": false, "type": "location", - "deprecated": false, - "demo": "avatars\/get-q-r.md", + "demo": "avatars\/get-qr.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md", "rate-limit": 0, "rate-time": 3600, @@ -4134,7 +4612,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4212,13 +4689,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "list", "group": "databases", - "weight": 71, + "weight": 316, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", "rate-limit": 0, @@ -4229,6 +4706,38 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + }, + "methods": [ + { + "name": "list", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "queries", + "search" + ], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/databaseList" + } + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "demo": "databases\/list.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.list" + } + } + ], "auth": { "Project": [], "Key": [] @@ -4285,13 +4794,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "create", "group": "databases", - "weight": 70, + "weight": 312, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", "rate-limit": 0, @@ -4302,6 +4811,42 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + }, + "methods": [ + { + "name": "create", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/database" + } + ], + "description": "Create a new Database.\n", + "demo": "databases\/create.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.create" + } + } + ], "auth": { "Project": [], "Key": [] @@ -4368,13 +4913,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "get", "group": "databases", - "weight": 72, + "weight": 313, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", "rate-limit": 0, @@ -4385,6 +4930,39 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + }, + "methods": [ + { + "name": "get", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/database" + } + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "demo": "databases\/get.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.get" + } + } + ], "auth": { "Project": [], "Key": [] @@ -4428,13 +5006,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "update", "group": "databases", - "weight": 74, + "weight": 314, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", "rate-limit": 0, @@ -4445,6 +5023,42 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + }, + "methods": [ + { + "name": "update", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "name", + "enabled" + ], + "required": [ + "databaseId", + "name" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/database" + } + ], + "description": "Update a database by its unique ID.", + "demo": "databases\/update.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.update" + } + } + ], "auth": { "Project": [], "Key": [] @@ -4507,13 +5121,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "delete", "group": "databases", - "weight": 75, + "weight": 315, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", "rate-limit": 0, @@ -4524,6 +5138,38 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + }, + "methods": [ + { + "name": "delete", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId" + ], + "required": [ + "databaseId" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "demo": "databases\/delete.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.delete" + } + } + ], "auth": { "Project": [], "Key": [] @@ -4567,13 +5213,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listCollections", "group": "collections", - "weight": 77, + "weight": 324, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-collections.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", "rate-limit": 0, @@ -4584,6 +5230,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTables" + }, "auth": { "Project": [], "Key": [] @@ -4628,7 +5278,7 @@ ] }, "post": { - "summary": "Create collection", + "summary": "Create collections", "operationId": "databasesCreateCollection", "consumes": [ "application\/json" @@ -4648,13 +5298,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createCollection", "group": "collections", - "weight": 76, + "weight": 320, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", "rate-limit": 0, @@ -4665,6 +5315,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTable" + }, "auth": { "Project": [], "Key": [] @@ -4754,13 +5408,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getCollection", "group": "collections", - "weight": 78, + "weight": 321, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", "rate-limit": 0, @@ -4771,6 +5425,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTable" + }, "auth": { "Project": [], "Key": [] @@ -4822,13 +5480,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateCollection", "group": "collections", - "weight": 80, + "weight": 322, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", "rate-limit": 0, @@ -4839,6 +5497,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTable" + }, "auth": { "Project": [], "Key": [] @@ -4924,13 +5586,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteCollection", "group": "collections", - "weight": 81, + "weight": 323, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-collection.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", "rate-limit": 0, @@ -4941,6 +5603,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTable" + }, "auth": { "Project": [], "Key": [] @@ -4992,13 +5658,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listAttributes", "group": "attributes", - "weight": 92, + "weight": 341, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-attributes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", "rate-limit": 0, @@ -5009,6 +5675,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listColumns" + }, "auth": { "Project": [], "Key": [] @@ -5031,7 +5701,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5074,13 +5744,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createBooleanAttribute", "group": "attributes", - "weight": 89, + "weight": 342, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-boolean-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", "rate-limit": 0, @@ -5091,6 +5761,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createBooleanColumn" + }, "auth": { "Project": [], "Key": [] @@ -5113,7 +5787,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5181,13 +5855,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateBooleanAttribute", "group": "attributes", - "weight": 101, + "weight": 343, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-boolean-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", "rate-limit": 0, @@ -5198,6 +5872,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateBooleanColumn" + }, "auth": { "Project": [], "Key": [] @@ -5220,7 +5898,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5290,13 +5968,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createDatetimeAttribute", "group": "attributes", - "weight": 90, + "weight": 344, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-datetime-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", "rate-limit": 0, @@ -5307,6 +5985,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createDatetimeColumn" + }, "auth": { "Project": [], "Key": [] @@ -5329,7 +6011,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5377,7 +6059,7 @@ }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { "patch": { - "summary": "Update dateTime attribute", + "summary": "Update datetime attribute", "operationId": "databasesUpdateDatetimeAttribute", "consumes": [ "application\/json" @@ -5397,13 +6079,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDatetimeAttribute", "group": "attributes", - "weight": 102, + "weight": 345, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-datetime-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", "rate-limit": 0, @@ -5414,6 +6096,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateDatetimeColumn" + }, "auth": { "Project": [], "Key": [] @@ -5436,7 +6122,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5506,13 +6192,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createEmailAttribute", "group": "attributes", - "weight": 83, + "weight": 346, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-email-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", "rate-limit": 0, @@ -5523,6 +6209,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEmailColumn" + }, "auth": { "Project": [], "Key": [] @@ -5545,7 +6235,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5613,13 +6303,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateEmailAttribute", "group": "attributes", - "weight": 95, + "weight": 347, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-email-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", "rate-limit": 0, @@ -5630,6 +6320,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEmailColumn" + }, "auth": { "Project": [], "Key": [] @@ -5652,7 +6346,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5686,7 +6380,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -5713,7 +6407,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "description": "Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -5722,15 +6416,15 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createEnumAttribute", "group": "attributes", - "weight": 84, + "weight": 348, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-enum-attribute.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-enum-attribute.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -5739,6 +6433,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createEnumColumn" + }, "auth": { "Project": [], "Key": [] @@ -5761,7 +6459,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5781,7 +6479,7 @@ }, "elements": { "type": "array", - "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "description": "Array of enum values.", "default": null, "x-example": null, "items": { @@ -5839,13 +6537,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateEnumAttribute", "group": "attributes", - "weight": 96, + "weight": 349, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-enum-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", "rate-limit": 0, @@ -5856,6 +6554,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateEnumColumn" + }, "auth": { "Project": [], "Key": [] @@ -5878,7 +6580,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -5899,7 +6601,7 @@ "properties": { "elements": { "type": "array", - "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "description": "Updated list of enum values.", "default": null, "x-example": null, "items": { @@ -5921,7 +6623,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -5958,13 +6660,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createFloatAttribute", "group": "attributes", - "weight": 88, + "weight": 350, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-float-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", "rate-limit": 0, @@ -5975,6 +6677,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createFloatColumn" + }, "auth": { "Project": [], "Key": [] @@ -5997,7 +6703,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6023,19 +6729,19 @@ }, "min": { "type": "number", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value.", "default": null, "x-example": null }, "max": { "type": "number", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value.", "default": null, "x-example": null }, "default": { "type": "number", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when required.", "default": null, "x-example": null }, @@ -6077,13 +6783,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateFloatAttribute", "group": "attributes", - "weight": 100, + "weight": 351, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-float-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", "rate-limit": 0, @@ -6094,6 +6800,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateFloatColumn" + }, "auth": { "Project": [], "Key": [] @@ -6116,7 +6826,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6143,26 +6853,26 @@ }, "min": { "type": "number", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value.", "default": null, "x-example": null }, "max": { "type": "number", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value.", "default": null, "x-example": null }, "default": { "type": "number", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, "x-nullable": true }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -6198,13 +6908,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIntegerAttribute", "group": "attributes", - "weight": 87, + "weight": 352, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-integer-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", "rate-limit": 0, @@ -6215,6 +6925,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIntegerColumn" + }, "auth": { "Project": [], "Key": [] @@ -6237,7 +6951,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6263,19 +6977,19 @@ }, "min": { "type": "integer", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value", "default": null, "x-example": null }, "max": { "type": "integer", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value", "default": null, "x-example": null }, "default": { "type": "integer", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null }, @@ -6317,13 +7031,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateIntegerAttribute", "group": "attributes", - "weight": 99, + "weight": 353, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-integer-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", "rate-limit": 0, @@ -6334,6 +7048,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIntegerColumn" + }, "auth": { "Project": [], "Key": [] @@ -6356,7 +7074,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6383,26 +7101,26 @@ }, "min": { "type": "integer", - "description": "Minimum value to enforce on new documents", + "description": "Minimum value", "default": null, "x-example": null }, "max": { "type": "integer", - "description": "Maximum value to enforce on new documents", + "description": "Maximum value", "default": null, "x-example": null }, "default": { "type": "integer", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null, "x-nullable": true }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -6438,13 +7156,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIpAttribute", "group": "attributes", - "weight": 85, + "weight": 354, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-ip-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", "rate-limit": 0, @@ -6455,6 +7173,234 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIpColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "schema": { + "$ref": "#\/definitions\/attributeIp" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 355, + "cookies": false, + "type": "", + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateIpColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 356, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, "auth": { "Project": [], "Key": [] @@ -6502,16 +7448,11 @@ "x-example": false }, "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", "default": null, - "x-example": null - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "default": false, - "x-example": false + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true } }, "required": [ @@ -6523,10 +7464,10 @@ ] } }, - "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { "patch": { - "summary": "Update IP address attribute", - "operationId": "databasesUpdateIpAttribute", + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", "consumes": [ "application\/json" ], @@ -6536,24 +7477,24 @@ "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", "responses": { "200": { - "description": "AttributeIP", + "description": "AttributeLine", "schema": { - "$ref": "#\/definitions\/attributeIp" + "$ref": "#\/definitions\/attributeLine" } } }, + "deprecated": true, "x-appwrite": { - "method": "updateIpAttribute", + "method": "updateLineAttribute", "group": "attributes", - "weight": 97, + "weight": 357, "cookies": false, "type": "", - "deprecated": false, - "demo": "databases\/update-ip-attribute.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -6562,6 +7503,122 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 358, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, "auth": { "Project": [], "Key": [] @@ -6590,6 +7647,112 @@ "x-example": "<COLLECTION_ID>", "in": "path" }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 359, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, { "name": "key", "description": "Attribute Key.", @@ -6610,10 +7773,10 @@ "x-example": false }, "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "type": "array", + "description": "Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.", "default": null, - "x-example": null, + "x-example": "[1, 2]", "x-nullable": true }, "newKey": { @@ -6624,8 +7787,225 @@ } }, "required": [ - "required", - "default" + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 360, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" ] } } @@ -6654,13 +8034,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createRelationshipAttribute", "group": "attributes", - "weight": 91, + "weight": 362, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-relationship-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", "rate-limit": 0, @@ -6671,6 +8051,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRelationshipColumn" + }, "auth": { "Project": [], "Key": [] @@ -6693,7 +8077,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6707,7 +8091,7 @@ "properties": { "relatedCollectionId": { "type": "string", - "description": "Related Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Related Collection ID.", "default": null, "x-example": "<RELATED_COLLECTION_ID>" }, @@ -6788,13 +8172,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 82, + "weight": 364, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-string-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", "rate-limit": 0, @@ -6805,6 +8189,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createStringColumn" + }, "auth": { "Project": [], "Key": [] @@ -6827,7 +8215,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6908,13 +8296,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 94, + "weight": 365, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-string-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", "rate-limit": 0, @@ -6925,6 +8313,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateStringColumn" + }, "auth": { "Project": [], "Key": [] @@ -6947,7 +8339,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -6987,7 +8379,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -7023,13 +8415,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 86, + "weight": 366, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-url-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", "rate-limit": 0, @@ -7040,6 +8432,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createUrlColumn" + }, "auth": { "Project": [], "Key": [] @@ -7062,7 +8458,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7130,13 +8526,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 98, + "weight": 367, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-url-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", "rate-limit": 0, @@ -7147,6 +8543,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateUrlColumn" + }, "auth": { "Project": [], "Key": [] @@ -7169,7 +8569,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7203,7 +8603,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -7268,13 +8668,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getAttribute", "group": "attributes", - "weight": 93, + "weight": 339, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", "rate-limit": 0, @@ -7285,6 +8685,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getColumn" + }, "auth": { "Project": [], "Key": [] @@ -7307,7 +8711,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7338,13 +8742,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteAttribute", "group": "attributes", - "weight": 104, + "weight": 340, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", "rate-limit": 0, @@ -7355,6 +8759,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteColumn" + }, "auth": { "Project": [], "Key": [] @@ -7377,7 +8785,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7415,13 +8823,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 103, + "weight": 363, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-relationship-attribute.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", "rate-limit": 0, @@ -7432,6 +8840,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRelationshipColumn" + }, "auth": { "Project": [], "Key": [] @@ -7454,7 +8866,7 @@ }, { "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "description": "Collection ID.", "required": true, "type": "string", "x-example": "<COLLECTION_ID>", @@ -7488,7 +8900,7 @@ }, "newKey": { "type": "string", - "description": "New attribute key.", + "description": "New Attribute Key.", "default": null, "x-example": null } @@ -7518,13 +8930,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listDocuments", "group": "documents", - "weight": 110, + "weight": 335, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", "rate-limit": 0, @@ -7533,10 +8945,13 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listRows" + }, "auth": { "Project": [], "Session": [] @@ -7602,13 +9017,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createDocument", "group": "documents", - "weight": 109, + "weight": 327, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", "rate-limit": 120, @@ -7617,17 +9032,21 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + }, "methods": [ { "name": "createDocument", + "namespace": "databases", + "desc": "Create document", "auth": { - "Session": [], - "Key": [], - "JWT": [] + "Project": [], + "Session": [] }, "parameters": [ "databaseId", @@ -7648,7 +9067,43 @@ "model": "#\/definitions\/document" } ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRow" + } + }, + { + "name": "createDocuments", + "namespace": "databases", + "desc": "Create documents", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/create-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createRows" + } } ], "auth": { @@ -7697,7 +9152,7 @@ "type": "object", "description": "Document data as JSON object.", "default": [], - "x-example": "{}" + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" }, "permissions": { "type": "array", @@ -7723,7 +9178,7 @@ ] }, "put": { - "summary": "Create or update documents", + "summary": "Upsert documents", "operationId": "databasesUpsertDocuments", "consumes": [ "application\/json" @@ -7736,20 +9191,20 @@ ], "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", "responses": { - "200": { + "201": { "description": "Documents List", "schema": { "$ref": "#\/definitions\/documentList" } } }, + "deprecated": true, "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 332, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/upsert-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", "rate-limit": 120, @@ -7757,9 +9212,47 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + }, + "methods": [ + { + "name": "upsertDocuments", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "demo": "databases\/upsert-documents.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRows" + } + } + ], "auth": { "Project": [], "Key": [] @@ -7797,13 +9290,16 @@ "documents": { "type": "array", "description": "Array of document data as JSON objects. May contain partial documents.", - "default": [], + "default": null, "x-example": null, "items": { "type": "object" } } - } + }, + "required": [ + "documents" + ] } } ] @@ -7829,13 +9325,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 330, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", "rate-limit": 120, @@ -7843,9 +9339,14 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRows" + }, "auth": { "Project": [], "Key": [] @@ -7921,13 +9422,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 334, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-documents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", "rate-limit": 60, @@ -7935,9 +9436,14 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRows" + }, "auth": { "Project": [], "Key": [] @@ -8007,13 +9513,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getDocument", "group": "documents", - "weight": 111, + "weight": 328, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", "rate-limit": 0, @@ -8022,10 +9528,13 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getRow" + }, "auth": { "Project": [], "Session": [] @@ -8079,7 +9588,7 @@ ] }, "put": { - "summary": "Upsert document", + "summary": "Upsert a document", "operationId": "databasesUpsertDocument", "consumes": [ "application\/json" @@ -8092,20 +9601,20 @@ ], "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { - "200": { + "201": { "description": "Document", "schema": { "$ref": "#\/definitions\/document" } } }, + "deprecated": true, "x-appwrite": { "method": "upsertDocument", "group": "documents", - "weight": 114, + "weight": 331, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/upsert-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", "rate-limit": 120, @@ -8114,10 +9623,49 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + }, + "methods": [ + { + "name": "upsertDocument", + "namespace": "databases", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "demo": "databases\/upsert-document.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.upsertRow" + } + } + ], "auth": { "Project": [], "Session": [] @@ -8206,13 +9754,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateDocument", "group": "documents", - "weight": 113, + "weight": 329, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/update-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", "rate-limit": 120, @@ -8221,10 +9769,13 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateRow" + }, "auth": { "Project": [], "Session": [] @@ -8305,13 +9856,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 333, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-document.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", "rate-limit": 60, @@ -8320,10 +9871,13 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteRow" + }, "auth": { "Project": [], "Session": [] @@ -8365,6 +9919,234 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 338, + "cookies": false, + "type": "", + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.decrementRowColumn" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 337, + "cookies": false, + "type": "", + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.incrementRowColumn" + }, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -8385,13 +10167,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 106, + "weight": 371, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/list-indexes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", "rate-limit": 0, @@ -8402,6 +10184,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listIndexes" + }, "auth": { "Project": [], "Key": [] @@ -8465,13 +10251,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createIndex", - "group": "collections", - "weight": 105, + "group": "indexes", + "weight": 368, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/create-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", "rate-limit": 0, @@ -8482,6 +10268,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createIndex" + }, "auth": { "Project": [], "Key": [] @@ -8530,7 +10320,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -8593,13 +10384,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 107, + "weight": 369, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/get-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", "rate-limit": 0, @@ -8610,6 +10401,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getIndex" + }, "auth": { "Project": [], "Key": [] @@ -8663,13 +10458,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 108, + "weight": 370, "cookies": false, "type": "", - "deprecated": false, "demo": "databases\/delete-index.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", "rate-limit": 0, @@ -8680,6 +10475,10 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteIndex" + }, "auth": { "Project": [], "Key": [] @@ -8738,13 +10537,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 440, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", "rate-limit": 0, @@ -8811,13 +10610,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 437, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", "rate-limit": 0, @@ -8901,6 +10700,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -8926,7 +10726,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9061,13 +10862,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 442, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-runtimes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", "rate-limit": 0, @@ -9111,13 +10912,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 443, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-specifications.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", "rate-limit": 0, @@ -9162,13 +10963,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 438, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", "rate-limit": 0, @@ -9222,13 +11023,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 439, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", "rate-limit": 0, @@ -9314,6 +11115,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9339,7 +11141,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9468,13 +11271,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 441, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", "rate-limit": 0, @@ -9530,13 +11333,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 446, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-function-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", "rate-limit": 0, @@ -9608,13 +11411,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 447, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-deployments.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", "rate-limit": 0, @@ -9689,13 +11492,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 444, "cookies": false, "type": "upload", - "deprecated": false, "demo": "functions\/create-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "rate-limit": 0, @@ -9782,13 +11585,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 452, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-duplicate-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "rate-limit": 0, @@ -9868,13 +11671,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 449, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-template-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", "rate-limit": 0, @@ -9975,13 +11778,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 450, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-vcs-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "rate-limit": 0, @@ -10072,13 +11875,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 445, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", "rate-limit": 0, @@ -10135,13 +11938,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 448, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", "rate-limit": 0, @@ -10203,13 +12006,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 451, "cookies": false, "type": "location", - "deprecated": false, "demo": "functions\/get-deployment-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "rate-limit": 0, @@ -10217,7 +12020,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "functions.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -10290,13 +12092,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 453, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-deployment-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "rate-limit": 0, @@ -10358,13 +12160,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 456, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-executions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", "rate-limit": 0, @@ -10373,7 +12175,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10434,13 +12235,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 454, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "rate-limit": 0, @@ -10449,7 +12250,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10501,7 +12301,7 @@ }, "method": { "type": "string", - "description": "HTTP method of execution. Default value is GET.", + "description": "HTTP method of execution. Default value is POST.", "default": "POST", "x-example": "GET", "enum": [ @@ -10510,7 +12310,8 @@ "PUT", "PATCH", "DELETE", - "OPTIONS" + "OPTIONS", + "HEAD" ], "x-enum-name": "ExecutionMethod", "x-enum-keys": [] @@ -10525,7 +12326,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "<SCHEDULED_AT>" } } } @@ -10553,13 +12354,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 455, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", "rate-limit": 0, @@ -10568,7 +12369,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10620,13 +12420,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 457, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-execution.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", "rate-limit": 0, @@ -10688,13 +12488,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 462, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/list-variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", "rate-limit": 0, @@ -10748,13 +12548,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 460, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/create-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", "rate-limit": 0, @@ -10839,13 +12639,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 461, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/get-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", "rate-limit": 0, @@ -10907,13 +12707,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 463, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/update-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", "rate-limit": 0, @@ -11000,13 +12800,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 464, "cookies": false, "type": "", - "deprecated": false, "demo": "functions\/delete-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", "rate-limit": 0, @@ -11070,13 +12870,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 250, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/query.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -11085,8 +12885,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -11146,13 +12945,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 249, "cookies": false, "type": "graphql", - "deprecated": false, "demo": "graphql\/mutation.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", "rate-limit": 60, @@ -11161,8 +12960,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -11220,13 +13018,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 78, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md", "rate-limit": 0, @@ -11270,13 +13068,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 99, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-antivirus.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md", "rate-limit": 0, @@ -11320,13 +13118,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 81, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-cache.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md", "rate-limit": 0, @@ -11370,13 +13168,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 86, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-certificate.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", "rate-limit": 0, @@ -11429,14 +13227,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 80, "cookies": false, "type": "", - "deprecated": false, - "demo": "health\/get-d-b.md", + "demo": "health\/get-db.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md", "rate-limit": 0, "rate-time": 3600, @@ -11479,13 +13277,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 82, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-pub-sub.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", "rate-limit": 0, @@ -11529,13 +13327,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 88, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-builds.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", "rate-limit": 0, @@ -11590,13 +13388,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 87, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-certificates.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md", "rate-limit": 0, @@ -11651,13 +13449,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 89, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-databases.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", "rate-limit": 0, @@ -11721,13 +13519,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 90, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-deletes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", "rate-limit": 0, @@ -11782,13 +13580,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 100, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-failed-jobs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", "rate-limit": 0, @@ -11867,13 +13665,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 94, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-functions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md", "rate-limit": 0, @@ -11928,13 +13726,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 85, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md", "rate-limit": 0, @@ -11989,13 +13787,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 91, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-mails.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", "rate-limit": 0, @@ -12050,13 +13848,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 92, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-messaging.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", "rate-limit": 0, @@ -12111,13 +13909,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 93, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-migrations.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", "rate-limit": 0, @@ -12154,7 +13952,7 @@ }, "\/health\/queue\/stats-resources": { "get": { - "summary": "Get stats resources queue", + "summary": "Get stats resources queue", "operationId": "healthGetQueueStatsResources", "consumes": [], "produces": [ @@ -12172,13 +13970,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 95, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-stats-resources.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", "rate-limit": 0, @@ -12233,13 +14031,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 96, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-usage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", "rate-limit": 0, @@ -12294,13 +14092,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 84, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-queue-webhooks.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md", "rate-limit": 0, @@ -12355,13 +14153,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 98, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-storage.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", "rate-limit": 0, @@ -12405,13 +14203,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 97, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-storage-local.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md", "rate-limit": 0, @@ -12455,13 +14253,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 83, "cookies": false, "type": "", - "deprecated": false, "demo": "health\/get-time.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md", "rate-limit": 0, @@ -12505,13 +14303,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 70, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md", "rate-limit": 0, @@ -12520,7 +14318,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12559,13 +14356,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 71, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", "rate-limit": 0, @@ -12574,7 +14371,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12613,13 +14409,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 75, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-continents.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", "rate-limit": 0, @@ -12628,7 +14424,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12667,13 +14462,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 72, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", "rate-limit": 0, @@ -12682,7 +14477,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12721,14 +14515,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 73, "cookies": false, "type": "", - "deprecated": false, - "demo": "locale\/list-countries-e-u.md", + "demo": "locale\/list-countries-eu.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", "rate-limit": 0, "rate-time": 3600, @@ -12736,7 +14530,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12775,13 +14568,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 74, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-countries-phones.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", "rate-limit": 0, @@ -12790,7 +14583,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12829,13 +14621,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 76, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-currencies.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", "rate-limit": 0, @@ -12844,7 +14636,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12883,13 +14674,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 77, "cookies": false, "type": "", - "deprecated": false, "demo": "locale\/list-languages.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", "rate-limit": 0, @@ -12898,7 +14689,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12937,13 +14727,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 304, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-messages.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", "rate-limit": 0, @@ -13013,13 +14803,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 301, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", "rate-limit": 0, @@ -13172,13 +14962,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 308, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", "rate-limit": 0, @@ -13328,13 +15118,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 303, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-push.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", "rate-limit": 0, @@ -13524,13 +15314,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 310, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-push.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", "rate-limit": 0, @@ -13719,13 +15509,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 302, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-sms.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", "rate-limit": 0, @@ -13737,6 +15527,76 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + }, + "methods": [ + { + "name": "createSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + } + }, + { + "name": "createSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md" + } + ], "auth": { "Project": [], "Key": [] @@ -13838,13 +15698,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 309, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-sms.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, @@ -13856,6 +15716,74 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + }, + "methods": [ + { + "name": "updateSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + } + }, + { + "name": "updateSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md" + } + ], "auth": { "Project": [], "Key": [] @@ -13953,13 +15881,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 307, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-message.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", "rate-limit": 0, @@ -14009,13 +15937,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 311, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", "rate-limit": 0, @@ -14070,13 +15998,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 305, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-message-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", "rate-limit": 0, @@ -14143,13 +16071,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 306, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-targets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", "rate-limit": 0, @@ -14216,13 +16144,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 276, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-providers.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", "rate-limit": 0, @@ -14292,13 +16220,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 275, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-apns-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", "rate-limit": 0, @@ -14310,6 +16238,78 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + }, + "methods": [ + { + "name": "createApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + } + }, + { + "name": "createAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -14408,13 +16408,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 288, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-apns-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", "rate-limit": 0, @@ -14426,6 +16426,76 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + }, + "methods": [ + { + "name": "updateApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + } + }, + { + "name": "updateAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -14522,13 +16592,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 274, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-fcm-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", "rate-limit": 0, @@ -14540,6 +16610,70 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + }, + "methods": [ + { + "name": "createFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + } + }, + { + "name": "createFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -14614,13 +16748,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 287, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-fcm-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", "rate-limit": 0, @@ -14632,6 +16766,68 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + }, + "methods": [ + { + "name": "updateFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + } + }, + { + "name": "updateFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -14704,13 +16900,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 266, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-mailgun-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", "rate-limit": 0, @@ -14832,13 +17028,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 279, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-mailgun-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", "rate-limit": 0, @@ -14958,14 +17154,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 269, "cookies": false, "type": "", - "deprecated": false, - "demo": "messaging\/create-msg91provider.md", + "demo": "messaging\/create-msg-91-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", "rate-limit": 0, "rate-time": 3600, @@ -15062,14 +17258,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 282, "cookies": false, "type": "", - "deprecated": false, - "demo": "messaging\/update-msg91provider.md", + "demo": "messaging\/update-msg-91-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", "rate-limit": 0, "rate-time": 3600, @@ -15164,13 +17360,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 267, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-sendgrid-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", "rate-limit": 0, @@ -15280,13 +17476,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 280, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-sendgrid-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", "rate-limit": 0, @@ -15394,13 +17590,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 268, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-smtp-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", "rate-limit": 0, @@ -15412,6 +17608,92 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + }, + "methods": [ + { + "name": "createSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + } + }, + { + "name": "createSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -15554,13 +17836,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 281, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-smtp-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", "rate-limit": 0, @@ -15572,6 +17854,88 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + }, + "methods": [ + { + "name": "updateSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + } + }, + { + "name": "updateSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md" + } + ], "auth": { "Project": [], "Key": [] @@ -15711,13 +18075,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 270, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-telesign-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", "rate-limit": 0, @@ -15815,13 +18179,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 283, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-telesign-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", "rate-limit": 0, @@ -15917,13 +18281,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 271, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-textmagic-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", "rate-limit": 0, @@ -16021,13 +18385,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 284, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-textmagic-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", "rate-limit": 0, @@ -16123,13 +18487,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 272, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-twilio-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", "rate-limit": 0, @@ -16227,13 +18591,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 285, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-twilio-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", "rate-limit": 0, @@ -16329,13 +18693,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 273, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-vonage-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", "rate-limit": 0, @@ -16433,13 +18797,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 286, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-vonage-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", "rate-limit": 0, @@ -16533,13 +18897,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 278, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", "rate-limit": 0, @@ -16589,13 +18953,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 289, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-provider.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", "rate-limit": 0, @@ -16650,13 +19014,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 277, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-provider-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", "rate-limit": 0, @@ -16723,13 +19087,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 298, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-subscriber-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", "rate-limit": 0, @@ -16796,13 +19160,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 291, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-topics.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", "rate-limit": 0, @@ -16870,13 +19234,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 290, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", "rate-limit": 0, @@ -16959,13 +19323,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 293, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", "rate-limit": 0, @@ -17020,13 +19384,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 294, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/update-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", "rate-limit": 0, @@ -17100,13 +19464,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 295, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-topic.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", "rate-limit": 0, @@ -17161,13 +19525,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 292, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-topic-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", "rate-limit": 0, @@ -17234,13 +19598,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 297, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/list-subscribers.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", "rate-limit": 0, @@ -17316,13 +19680,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 296, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/create-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", "rate-limit": 0, @@ -17332,8 +19696,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -17406,13 +19769,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 299, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/get-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", "rate-limit": 0, @@ -17470,13 +19833,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 300, "cookies": false, "type": "", - "deprecated": false, "demo": "messaging\/delete-subscriber.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", "rate-limit": 0, @@ -17486,8 +19849,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -17543,13 +19905,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 469, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", "rate-limit": 0, @@ -17616,13 +19978,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 467, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", "rate-limit": 0, @@ -17766,6 +20128,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17791,7 +20154,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -17882,13 +20246,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 472, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-frameworks.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", "rate-limit": 0, @@ -17932,13 +20296,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 495, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-specifications.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", "rate-limit": 0, @@ -17983,13 +20347,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 468, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", "rate-limit": 0, @@ -18043,13 +20407,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 470, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", "rate-limit": 0, @@ -18195,6 +20559,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -18220,7 +20585,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -18304,13 +20670,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 471, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", "rate-limit": 0, @@ -18366,13 +20732,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 478, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-site-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", "rate-limit": 0, @@ -18444,13 +20810,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 477, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-deployments.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", "rate-limit": 0, @@ -18525,13 +20891,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 473, "cookies": false, "type": "upload", - "deprecated": false, "demo": "sites\/create-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", "rate-limit": 0, @@ -18626,13 +20992,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 481, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-duplicate-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "rate-limit": 0, @@ -18706,13 +21072,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 474, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-template-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", "rate-limit": 0, @@ -18813,13 +21179,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 475, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-vcs-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "rate-limit": 0, @@ -18911,13 +21277,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 476, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", "rate-limit": 0, @@ -18974,13 +21340,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 479, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-deployment.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", "rate-limit": 0, @@ -19042,13 +21408,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 480, "cookies": false, "type": "location", - "deprecated": false, "demo": "sites\/get-deployment-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "rate-limit": 0, @@ -19056,7 +21422,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "sites.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -19129,13 +21494,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 482, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-deployment-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "rate-limit": 0, @@ -19197,13 +21562,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 484, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", "rate-limit": 0, @@ -19269,13 +21634,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 483, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-log.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", "rate-limit": 0, @@ -19334,13 +21699,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 485, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-log.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", "rate-limit": 0, @@ -19402,13 +21767,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 488, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/list-variables.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", "rate-limit": 0, @@ -19462,13 +21827,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 486, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/create-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", "rate-limit": 0, @@ -19553,13 +21918,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 487, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/get-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", "rate-limit": 0, @@ -19621,13 +21986,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 489, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/update-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", "rate-limit": 0, @@ -19714,13 +22079,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 490, "cookies": false, "type": "", - "deprecated": false, "demo": "sites\/delete-variable.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", "rate-limit": 0, @@ -19782,13 +22147,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 155, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/list-buckets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", "rate-limit": 0, @@ -19855,13 +22220,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 154, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/create-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", "rate-limit": 0, @@ -19993,13 +22358,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 156, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", "rate-limit": 0, @@ -20053,13 +22418,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 157, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/update-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", "rate-limit": 0, @@ -20187,13 +22552,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 158, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/delete-bucket.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", "rate-limit": 0, @@ -20247,13 +22612,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 160, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/list-files.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md", "rate-limit": 0, @@ -20262,7 +22627,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20332,13 +22696,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 159, "cookies": false, "type": "upload", - "deprecated": false, "demo": "storage\/create-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", "rate-limit": 60, @@ -20347,7 +22711,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20424,13 +22787,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 161, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/get-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md", "rate-limit": 0, @@ -20439,7 +22802,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20496,13 +22858,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 166, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/update-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", "rate-limit": 60, @@ -20511,7 +22873,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20587,13 +22948,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 167, "cookies": false, "type": "", - "deprecated": false, "demo": "storage\/delete-file.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", "rate-limit": 60, @@ -20602,7 +22963,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20659,13 +23019,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 163, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-download.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md", "rate-limit": 0, @@ -20674,7 +23034,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20740,13 +23099,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 162, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-preview.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md", "rate-limit": 0, @@ -20755,7 +23114,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20909,7 +23267,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -20948,13 +23307,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 164, "cookies": false, "type": "location", - "deprecated": false, "demo": "storage\/get-file-view.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md", "rate-limit": 0, @@ -20963,7 +23322,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21009,6 +23367,5616 @@ ] } }, + "\/tablesdb": { + "get": { + "summary": "List databases", + "operationId": "tablesDBList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "schema": { + "$ref": "#\/definitions\/databaseList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "list", + "group": "tablesdb", + "weight": 376, + "cookies": false, + "type": "", + "demo": "tablesdb\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "tablesDBCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "create", + "group": "tablesdb", + "weight": 372, + "cookies": false, + "type": "", + "demo": "tablesdb\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "tablesDBGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "get", + "group": "tablesdb", + "weight": 373, + "cookies": false, + "type": "", + "demo": "tablesdb\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "tablesDBUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "update", + "group": "tablesdb", + "weight": 374, + "cookies": false, + "type": "", + "demo": "tablesdb\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete database", + "operationId": "tablesDBDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "delete", + "group": "tablesdb", + "weight": 375, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables": { + "get": { + "summary": "List tables", + "operationId": "tablesDBListTables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Tables List", + "schema": { + "$ref": "#\/definitions\/tableList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTables", + "group": "tables", + "weight": 383, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-tables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-tables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create table", + "operationId": "tablesDBCreateTable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTable", + "group": "tables", + "weight": 379, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "tableId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TABLE_ID>" + }, + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "tableId", + "name" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}": { + "get": { + "summary": "Get table", + "operationId": "tablesDBGetTable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.", + "responses": { + "200": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTable", + "group": "tables", + "weight": 380, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update table", + "operationId": "tablesDBUpdateTable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a table by its unique ID.", + "responses": { + "200": { + "description": "Table", + "schema": { + "$ref": "#\/definitions\/table" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTable", + "group": "tables", + "weight": 381, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Table name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rowSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete table", + "operationId": "tablesDBDeleteTable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a table by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTable", + "group": "tables", + "weight": 382, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-table.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-table.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns": { + "get": { + "summary": "List columns", + "operationId": "tablesDBListColumns", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "List columns in the table.", + "responses": { + "200": { + "description": "Columns List", + "schema": { + "$ref": "#\/definitions\/columnList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listColumns", + "group": "columns", + "weight": 388, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-columns.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-columns.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean": { + "post": { + "summary": "Create boolean column", + "operationId": "tablesDBCreateBooleanColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a boolean column.\n", + "responses": { + "202": { + "description": "ColumnBoolean", + "schema": { + "$ref": "#\/definitions\/columnBoolean" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createBooleanColumn", + "group": "columns", + "weight": 389, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/boolean\/{key}": { + "patch": { + "summary": "Update boolean column", + "operationId": "tablesDBUpdateBooleanColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a boolean column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnBoolean", + "schema": { + "$ref": "#\/definitions\/columnBoolean" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateBooleanColumn", + "group": "columns", + "weight": 390, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-boolean-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-boolean-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime": { + "post": { + "summary": "Create datetime column", + "operationId": "tablesDBCreateDatetimeColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a date time column according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "ColumnDatetime", + "schema": { + "$ref": "#\/definitions\/columnDatetime" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createDatetimeColumn", + "group": "columns", + "weight": 391, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime column", + "operationId": "tablesDBUpdateDatetimeColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a date time column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnDatetime", + "schema": { + "$ref": "#\/definitions\/columnDatetime" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateDatetimeColumn", + "group": "columns", + "weight": 392, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-datetime-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-datetime-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email": { + "post": { + "summary": "Create email column", + "operationId": "tablesDBCreateEmailColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an email column.\n", + "responses": { + "202": { + "description": "ColumnEmail", + "schema": { + "$ref": "#\/definitions\/columnEmail" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEmailColumn", + "group": "columns", + "weight": 393, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/email\/{key}": { + "patch": { + "summary": "Update email column", + "operationId": "tablesDBUpdateEmailColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an email column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEmail", + "schema": { + "$ref": "#\/definitions\/columnEmail" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEmailColumn", + "group": "columns", + "weight": 394, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-email-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-email-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum": { + "post": { + "summary": "Create enum column", + "operationId": "tablesDBCreateEnumColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column.", + "responses": { + "202": { + "description": "ColumnEnum", + "schema": { + "$ref": "#\/definitions\/columnEnum" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createEnumColumn", + "group": "columns", + "weight": 395, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/enum\/{key}": { + "patch": { + "summary": "Update enum column", + "operationId": "tablesDBUpdateEnumColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an enum column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnEnum", + "schema": { + "$ref": "#\/definitions\/columnEnum" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateEnumColumn", + "group": "columns", + "weight": 396, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-enum-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-enum-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Updated list of enum values.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float": { + "post": { + "summary": "Create float column", + "operationId": "tablesDBCreateFloatColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a float column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnFloat", + "schema": { + "$ref": "#\/definitions\/columnFloat" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createFloatColumn", + "group": "columns", + "weight": 397, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/float\/{key}": { + "patch": { + "summary": "Update float column", + "operationId": "tablesDBUpdateFloatColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a float column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnFloat", + "schema": { + "$ref": "#\/definitions\/columnFloat" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateFloatColumn", + "group": "columns", + "weight": 398, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-float-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-float-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value. Cannot be set when required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer": { + "post": { + "summary": "Create integer column", + "operationId": "tablesDBCreateIntegerColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create an integer column. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "ColumnInteger", + "schema": { + "$ref": "#\/definitions\/columnInteger" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIntegerColumn", + "group": "columns", + "weight": 399, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/integer\/{key}": { + "patch": { + "summary": "Update integer column", + "operationId": "tablesDBUpdateIntegerColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an integer column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnInteger", + "schema": { + "$ref": "#\/definitions\/columnInteger" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIntegerColumn", + "group": "columns", + "weight": 400, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-integer-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-integer-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip": { + "post": { + "summary": "Create IP address column", + "operationId": "tablesDBCreateIpColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create IP address column.\n", + "responses": { + "202": { + "description": "ColumnIP", + "schema": { + "$ref": "#\/definitions\/columnIp" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIpColumn", + "group": "columns", + "weight": 401, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/ip\/{key}": { + "patch": { + "summary": "Update IP address column", + "operationId": "tablesDBUpdateIpColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an ip column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnIP", + "schema": { + "$ref": "#\/definitions\/columnIp" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateIpColumn", + "group": "columns", + "weight": 402, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-ip-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-ip-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line column.", + "responses": { + "202": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 403, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 404, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], \u2026], listing the vertices of the line in order. Cannot be set when column is required.", + "default": null, + "x-example": "[[1, 2], [3, 4], [5, 6]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point column.", + "responses": { + "202": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 405, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 406, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.", + "default": null, + "x-example": "[1, 2]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon column.", + "responses": { + "202": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 407, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing rows.", + "responses": { + "200": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "array", + "description": "Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], \u2026], \u2026], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.", + "default": null, + "x-example": "[[[1, 2], [3, 4], [5, 6], [1, 2]]]", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { + "post": { + "summary": "Create relationship column", + "operationId": "tablesDBCreateRelationshipColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "202": { + "description": "ColumnRelationship", + "schema": { + "$ref": "#\/definitions\/columnRelationship" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRelationshipColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "relatedTableId": { + "type": "string", + "description": "Related Table ID.", + "default": null, + "x-example": "<RELATED_TABLE_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "default": null, + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "default": false, + "x-example": false + }, + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Column Key.", + "default": null, + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": "restrict", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedTableId", + "type" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string": { + "post": { + "summary": "Create string column", + "operationId": "tablesDBCreateStringColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a string column.\n", + "responses": { + "202": { + "description": "ColumnString", + "schema": { + "$ref": "#\/definitions\/columnString" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createStringColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "size": { + "type": "integer", + "description": "Column size for text columns, in number of characters.", + "default": null, + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/string\/{key}": { + "patch": { + "summary": "Update string column", + "operationId": "tablesDBUpdateStringColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a string column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnString", + "schema": { + "$ref": "#\/definitions\/columnString" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateStringColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-string-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-string-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string column.", + "default": null, + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url": { + "post": { + "summary": "Create URL column", + "operationId": "tablesDBCreateUrlColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a URL column.\n", + "responses": { + "202": { + "description": "ColumnURL", + "schema": { + "$ref": "#\/definitions\/columnUrl" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createUrlColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/url\/{key}": { + "patch": { + "summary": "Update URL column", + "operationId": "tablesDBUpdateUrlColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update an url column. Changing the `default` value will not update already existing rows.\n", + "responses": { + "200": { + "description": "ColumnURL", + "schema": { + "$ref": "#\/definitions\/columnUrl" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateUrlColumn", + "group": "columns", + "weight": 414, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-url-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-url-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "default": null, + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}": { + "get": { + "summary": "Get column", + "operationId": "tablesDBGetColumn", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get column by ID.", + "responses": { + "200": { + "description": "ColumnBoolean, or ColumnInteger, or ColumnFloat, or ColumnEmail, or ColumnEnum, or ColumnURL, or ColumnIP, or ColumnDatetime, or ColumnRelationship, or ColumnString", + "schema": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getColumn", + "group": "columns", + "weight": 386, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete column", + "operationId": "tablesDBDeleteColumn", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Deletes a column.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteColumn", + "group": "columns", + "weight": 387, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/{key}\/relationship": { + "patch": { + "summary": "Update relationship column", + "operationId": "tablesDBUpdateRelationshipColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update relationship column. [Learn more about relationship columns](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-columns).\n", + "responses": { + "200": { + "description": "ColumnRelationship", + "schema": { + "$ref": "#\/definitions\/columnRelationship" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRelationshipColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-relationship-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-relationship-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": null, + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "tablesDBListIndexes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "List indexes on the table.", + "responses": { + "200": { + "description": "Column Indexes List", + "schema": { + "$ref": "#\/definitions\/columnIndexList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 418, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "tablesDBCreateIndex", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Creates an index on the columns listed. Your index should include all the columns you will query in a single request.\nType can be `key`, `fulltext`, or `unique`.", + "responses": { + "202": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/columnIndex" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createIndex", + "group": "indexes", + "weight": 415, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "default": null, + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "default": null, + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique", + "spatial" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "columns": { + "type": "array", + "description": "Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "default": [], + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "columns" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "tablesDBGetIndex", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/columnIndex" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 416, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.read", + "collections.read" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "tablesDBDeleteIndex", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 417, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows": { + "get": { + "summary": "List rows", + "operationId": "tablesDBListRows", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listRows", + "group": "rows", + "weight": 427, + "cookies": false, + "type": "", + "demo": "tablesdb\/list-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/list-rows.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TableDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdbdb#tablesdbCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create row", + "operationId": "tablesDBCreateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createRow", + "group": "rows", + "weight": 419, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createRow", + "namespace": "tablesDB", + "desc": "Create row", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-row.md" + }, + { + "name": "createRows", + "namespace": "tablesDB", + "desc": "Create rows", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/rowList" + } + ], + "description": "Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/create-rows.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "rowId": { + "type": "string", + "description": "Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<ROW_ID>" + }, + "data": { + "type": "object", + "description": "Row data as JSON object.", + "default": [], + "x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "description": "Array of rows data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + }, + "put": { + "summary": "Upsert rows", + "operationId": "tablesDBUpsertRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "responses": { + "201": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRows", + "group": "rows", + "weight": 424, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRows", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rows" + ], + "required": [ + "databaseId", + "tableId", + "rows" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/rowList" + } + ], + "description": "Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.\n", + "demo": "tablesdb\/upsert-rows.md" + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "rows": { + "type": "array", + "description": "Array of row data as JSON objects. May contain partial rows.", + "default": null, + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "rows" + ] + } + } + ] + }, + "patch": { + "summary": "Update rows", + "operationId": "tablesDBUpdateRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRows", + "group": "rows", + "weight": 422, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-rows.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only column and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete rows", + "operationId": "tablesDBDeleteRows", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Bulk delete rows using queries, if no queries are passed then all rows are deleted.", + "responses": { + "200": { + "description": "Rows List", + "schema": { + "$ref": "#\/definitions\/rowList" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRows", + "group": "rows", + "weight": 426, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-rows.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-rows.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { + "get": { + "summary": "Get row", + "operationId": "tablesDBGetRow", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Get a row by its unique ID. This endpoint response returns a JSON object with the row data.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getRow", + "group": "rows", + "weight": 420, + "cookies": false, + "type": "", + "demo": "tablesdb\/get-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/get-row.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert a row", + "operationId": "tablesDBUpsertRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "responses": { + "201": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "upsertRow", + "group": "rows", + "weight": 423, + "cookies": false, + "type": "", + "demo": "tablesdb\/upsert-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/upsert-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "upsertRow", + "namespace": "tablesDB", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "databaseId", + "tableId", + "rowId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "tableId", + "rowId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/row" + } + ], + "description": "Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreateTable) API or directly from your database console.", + "demo": "tablesdb\/upsert-row.md" + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include all required columns of the row to be created or updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "patch": { + "summary": "Update row", + "operationId": "tablesDBUpdateRow", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateRow", + "group": "rows", + "weight": 421, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-row.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Row data as JSON object. Include only columns and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete row", + "operationId": "tablesDBDeleteRow", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tablesDB" + ], + "description": "Delete a row by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteRow", + "group": "rows", + "weight": 425, + "cookies": false, + "type": "", + "demo": "tablesdb\/delete-row.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/delete-row.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/decrement": { + "patch": { + "summary": "Decrement row column", + "operationId": "tablesDBDecrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Decrement a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "decrementRowColumn", + "group": "rows", + "weight": 430, + "cookies": false, + "type": "", + "demo": "tablesdb\/decrement-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/decrement-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}\/{column}\/increment": { + "patch": { + "summary": "Increment row column", + "operationId": "tablesDBIncrementRowColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Increment a specific column of a row by a given value.", + "responses": { + "200": { + "description": "Row", + "schema": { + "$ref": "#\/definitions\/row" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "incrementRowColumn", + "group": "rows", + "weight": 429, + "cookies": false, + "type": "", + "demo": "tablesdb\/increment-row-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/increment-row-column.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.write", + "documents.write" + ], + "platforms": [ + "client", + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID.", + "required": true, + "type": "string", + "x-example": "<TABLE_ID>", + "in": "path" + }, + { + "name": "rowId", + "description": "Row ID.", + "required": true, + "type": "string", + "x-example": "<ROW_ID>", + "in": "path" + }, + { + "name": "column", + "description": "Column key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the column by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/teams": { "get": { "summary": "List teams", @@ -21029,13 +28997,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 171, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md", "rate-limit": 0, @@ -21044,7 +29012,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21106,13 +29073,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 170, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md", "rate-limit": 0, @@ -21121,7 +29088,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21198,13 +29164,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 172, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md", "rate-limit": 0, @@ -21213,7 +29179,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21262,13 +29227,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 174, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", "rate-limit": 0, @@ -21277,7 +29242,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21339,13 +29303,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 176, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md", "rate-limit": 0, @@ -21354,7 +29318,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21403,13 +29366,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 178, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/list-memberships.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", "rate-limit": 0, @@ -21418,7 +29381,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21488,13 +29450,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 177, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/create-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", "rate-limit": 10, @@ -21503,7 +29465,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21603,13 +29564,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 179, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", "rate-limit": 0, @@ -21618,7 +29579,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21675,13 +29635,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 180, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", "rate-limit": 0, @@ -21690,7 +29650,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21763,13 +29722,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 182, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/delete-membership.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md", "rate-limit": 0, @@ -21778,7 +29737,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21837,13 +29795,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 181, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-membership-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md", "rate-limit": 0, @@ -21932,13 +29890,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 173, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", "rate-limit": 0, @@ -21994,13 +29952,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 175, "cookies": false, "type": "", - "deprecated": false, "demo": "teams\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", "rate-limit": 0, @@ -22074,13 +30032,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 507, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", "rate-limit": 0, @@ -22155,13 +30113,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 505, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/create-file-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", "rate-limit": 60, @@ -22240,13 +30198,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 506, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", "rate-limit": 0, @@ -22301,13 +30259,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 508, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/update.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", "rate-limit": 60, @@ -22373,13 +30331,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 509, "cookies": false, "type": "", - "deprecated": false, "demo": "tokens\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", "rate-limit": 60, @@ -22434,13 +30392,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 193, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md", "rate-limit": 0, @@ -22507,13 +30465,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 184, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md", "rate-limit": 0, @@ -22603,14 +30561,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 187, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-argon2user.md", + "demo": "users\/create-argon-2-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", "rate-limit": 0, "rate-time": 3600, @@ -22695,13 +30653,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 185, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-bcrypt-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", "rate-limit": 0, @@ -22785,13 +30743,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 201, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-identities.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", "rate-limit": 0, @@ -22855,13 +30813,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 224, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-identity.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", "rate-limit": 0, @@ -22917,14 +30875,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 186, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-m-d5user.md", + "demo": "users\/create-md-5-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", "rate-limit": 0, "rate-time": 3600, @@ -23009,14 +30967,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 189, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-p-h-pass-user.md", + "demo": "users\/create-ph-pass-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", "rate-limit": 0, "rate-time": 3600, @@ -23101,13 +31059,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 190, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-scrypt-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", "rate-limit": 0, @@ -23228,13 +31186,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 191, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-scrypt-modified-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", "rate-limit": 0, @@ -23341,14 +31299,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 188, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-s-h-a-user.md", + "demo": "users\/create-sha-user.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", "rate-limit": 0, "rate-time": 3600, @@ -23452,13 +31410,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 194, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md", "rate-limit": 0, @@ -23507,13 +31465,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 222, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", "rate-limit": 0, @@ -23569,13 +31527,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 207, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-email.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", "rate-limit": 0, @@ -23649,14 +31607,14 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 225, "cookies": false, "type": "", - "deprecated": false, - "demo": "users\/create-j-w-t.md", + "demo": "users\/create-jwt.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", "rate-limit": 0, "rate-time": 3600, @@ -23732,13 +31690,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 203, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-labels.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", "rate-limit": 0, @@ -23813,13 +31771,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 199, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-logs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", "rate-limit": 0, @@ -23885,13 +31843,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 198, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-memberships.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", "rate-limit": 0, @@ -23968,13 +31926,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 212, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-mfa.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", "rate-limit": 0, @@ -23985,6 +31943,66 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + }, + "methods": [ + { + "name": "updateMfa", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + } + }, + { + "name": "updateMFA", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md" + } + ], "auth": { "Project": [], "Key": [] @@ -24043,13 +32061,13 @@ "description": "No content" } }, + "deprecated": true, "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 217, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-mfa-authenticator.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", "rate-limit": 0, @@ -24060,6 +32078,64 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md" + } + ], "auth": { "Project": [], "Key": [] @@ -24116,13 +32192,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 213, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-mfa-factors.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", "rate-limit": 0, @@ -24133,6 +32209,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md" + } + ], "auth": { "Project": [], "Key": [] @@ -24176,13 +32308,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 214, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", "rate-limit": 0, @@ -24193,6 +32325,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Key": [] @@ -24236,13 +32424,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 216, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", "rate-limit": 0, @@ -24253,6 +32441,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Key": [] @@ -24296,13 +32540,13 @@ } } }, + "deprecated": true, "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 215, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-mfa-recovery-codes.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", "rate-limit": 0, @@ -24313,6 +32557,62 @@ "server" ], "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md" + } + ], "auth": { "Project": [], "Key": [] @@ -24358,13 +32658,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 205, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-name.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", "rate-limit": 0, @@ -24438,13 +32738,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 206, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-password.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", "rate-limit": 0, @@ -24518,13 +32818,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 208, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-phone.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", "rate-limit": 0, @@ -24596,13 +32896,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 195, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md", "rate-limit": 0, @@ -24656,13 +32956,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 210, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-prefs.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md", "rate-limit": 0, @@ -24734,13 +33034,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 197, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", "rate-limit": 0, @@ -24794,13 +33094,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 218, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", "rate-limit": 0, @@ -24849,13 +33149,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 221, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-sessions.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", "rate-limit": 0, @@ -24906,13 +33206,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 220, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-session.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", "rate-limit": 0, @@ -24976,13 +33276,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 202, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-status.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md", "rate-limit": 0, @@ -25054,13 +33354,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 200, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/list-targets.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", "rate-limit": 0, @@ -25094,7 +33394,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "type": "array", "collectionFormat": "multi", @@ -25127,13 +33427,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 192, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", "rate-limit": 0, @@ -25239,13 +33539,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 196, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/get-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", "rate-limit": 0, @@ -25308,13 +33608,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 211, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", "rate-limit": 0, @@ -25399,13 +33699,13 @@ "description": "No content" } }, + "deprecated": false, "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 223, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/delete-target.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", "rate-limit": 0, @@ -25470,13 +33770,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 219, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/create-token.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", "rate-limit": 0, @@ -25553,13 +33853,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 209, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-email-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", "rate-limit": 0, @@ -25633,13 +33933,13 @@ } } }, + "deprecated": false, "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 204, "cookies": false, "type": "", - "deprecated": false, "demo": "users\/update-phone-verification.md", "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", "rate-limit": 0, @@ -25705,6 +34005,10 @@ "name": "databases", "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, + { + "name": "tablesdb", + "description": "The TablesDB service allows you to create structured tables of columns, query and filter lists of rows" + }, { "name": "locale", "description": "The Locale service allows you to customize your app based on your users' location." @@ -25766,7 +34070,37 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] + }, + "rowList": { + "description": "Rows List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rows that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rows": { + "type": "array", + "description": "List of rows.", + "items": { + "type": "object", + "$ref": "#\/definitions\/row" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rows" + ], + "example": { + "total": 5, + "rows": "" + } }, "documentList": { "description": "Documents List", @@ -25774,7 +34108,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of documents documents that matched your query.", + "description": "Total number of documents that matched your query.", "x-example": 5, "format": "int32" }, @@ -25791,7 +34125,40 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } + }, + "tableList": { + "description": "Tables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tables that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tables": { + "type": "array", + "description": "List of tables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/table" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tables" + ], + "example": { + "total": 5, + "tables": "" + } }, "collectionList": { "description": "Collections List", @@ -25799,7 +34166,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of collections documents that matched your query.", + "description": "Total number of collections that matched your query.", "x-example": 5, "format": "int32" }, @@ -25816,7 +34183,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -25824,7 +34195,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of databases documents that matched your query.", + "description": "Total number of databases that matched your query.", "x-example": 5, "format": "int32" }, @@ -25841,7 +34212,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -25849,7 +34224,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of indexes documents that matched your query.", + "description": "Total number of indexes that matched your query.", "x-example": 5, "format": "int32" }, @@ -25866,7 +34241,40 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } + }, + "columnIndexList": { + "description": "Column Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/columnIndex" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -25874,7 +34282,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of users documents that matched your query.", + "description": "Total number of users that matched your query.", "x-example": 5, "format": "int32" }, @@ -25891,7 +34299,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -25899,7 +34311,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of sessions documents that matched your query.", + "description": "Total number of sessions that matched your query.", "x-example": 5, "format": "int32" }, @@ -25916,7 +34328,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -25924,7 +34340,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of identities documents that matched your query.", + "description": "Total number of identities that matched your query.", "x-example": 5, "format": "int32" }, @@ -25941,7 +34357,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -25949,7 +34369,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of logs documents that matched your query.", + "description": "Total number of logs that matched your query.", "x-example": 5, "format": "int32" }, @@ -25966,7 +34386,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -25974,7 +34398,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of files documents that matched your query.", + "description": "Total number of files that matched your query.", "x-example": 5, "format": "int32" }, @@ -25991,7 +34415,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -25999,7 +34427,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of buckets documents that matched your query.", + "description": "Total number of buckets that matched your query.", "x-example": 5, "format": "int32" }, @@ -26016,7 +34444,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -26024,7 +34456,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of tokens documents that matched your query.", + "description": "Total number of tokens that matched your query.", "x-example": 5, "format": "int32" }, @@ -26041,7 +34473,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -26049,7 +34485,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of teams documents that matched your query.", + "description": "Total number of teams that matched your query.", "x-example": 5, "format": "int32" }, @@ -26066,7 +34502,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -26074,7 +34514,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of memberships documents that matched your query.", + "description": "Total number of memberships that matched your query.", "x-example": 5, "format": "int32" }, @@ -26091,7 +34531,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -26099,7 +34543,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of sites documents that matched your query.", + "description": "Total number of sites that matched your query.", "x-example": 5, "format": "int32" }, @@ -26116,7 +34560,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "functionList": { "description": "Functions List", @@ -26124,7 +34572,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of functions documents that matched your query.", + "description": "Total number of functions that matched your query.", "x-example": 5, "format": "int32" }, @@ -26141,7 +34589,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -26149,7 +34601,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of frameworks documents that matched your query.", + "description": "Total number of frameworks that matched your query.", "x-example": 5, "format": "int32" }, @@ -26166,7 +34618,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -26174,7 +34630,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of runtimes documents that matched your query.", + "description": "Total number of runtimes that matched your query.", "x-example": 5, "format": "int32" }, @@ -26191,7 +34647,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -26199,7 +34659,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of deployments documents that matched your query.", + "description": "Total number of deployments that matched your query.", "x-example": 5, "format": "int32" }, @@ -26216,7 +34676,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -26224,7 +34688,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of executions documents that matched your query.", + "description": "Total number of executions that matched your query.", "x-example": 5, "format": "int32" }, @@ -26241,7 +34705,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -26249,7 +34717,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of countries documents that matched your query.", + "description": "Total number of countries that matched your query.", "x-example": 5, "format": "int32" }, @@ -26266,7 +34734,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -26274,7 +34746,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of continents documents that matched your query.", + "description": "Total number of continents that matched your query.", "x-example": 5, "format": "int32" }, @@ -26291,7 +34763,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -26299,7 +34775,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of languages documents that matched your query.", + "description": "Total number of languages that matched your query.", "x-example": 5, "format": "int32" }, @@ -26316,7 +34792,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -26324,7 +34804,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of currencies documents that matched your query.", + "description": "Total number of currencies that matched your query.", "x-example": 5, "format": "int32" }, @@ -26341,7 +34821,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -26349,7 +34833,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of phones documents that matched your query.", + "description": "Total number of phones that matched your query.", "x-example": 5, "format": "int32" }, @@ -26366,7 +34850,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -26374,7 +34862,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of variables documents that matched your query.", + "description": "Total number of variables that matched your query.", "x-example": 5, "format": "int32" }, @@ -26391,7 +34879,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -26399,7 +34891,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of localeCodes documents that matched your query.", + "description": "Total number of localeCodes that matched your query.", "x-example": 5, "format": "int32" }, @@ -26416,7 +34908,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -26424,7 +34920,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of providers documents that matched your query.", + "description": "Total number of providers that matched your query.", "x-example": 5, "format": "int32" }, @@ -26441,7 +34937,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -26449,7 +34949,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of messages documents that matched your query.", + "description": "Total number of messages that matched your query.", "x-example": 5, "format": "int32" }, @@ -26466,7 +34966,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -26474,7 +34978,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of topics documents that matched your query.", + "description": "Total number of topics that matched your query.", "x-example": 5, "format": "int32" }, @@ -26491,7 +34995,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -26499,7 +35007,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of subscribers documents that matched your query.", + "description": "Total number of subscribers that matched your query.", "x-example": 5, "format": "int32" }, @@ -26516,7 +35024,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -26524,7 +35036,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of targets documents that matched your query.", + "description": "Total number of targets that matched your query.", "x-example": 5, "format": "int32" }, @@ -26541,7 +35053,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "specificationList": { "description": "Specifications List", @@ -26549,7 +35065,7 @@ "properties": { "total": { "type": "integer", - "description": "Total number of specifications documents that matched your query.", + "description": "Total number of specifications that matched your query.", "x-example": 5, "format": "int32" }, @@ -26566,7 +35082,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "database": { "description": "Database", @@ -26596,6 +35116,11 @@ "type": "boolean", "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", "x-example": false + }, + "type": { + "type": "string", + "description": "Database type.", + "x-example": "legacy" } }, "required": [ @@ -26603,8 +35128,17 @@ "name", "$createdAt", "$updatedAt", - "enabled" - ] + "enabled", + "type" + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false, + "type": "legacy" + } }, "collection": { "description": "Collection", @@ -26687,6 +35221,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -26715,7 +35258,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -26759,6 +35316,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -26770,7 +35336,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -26789,7 +35359,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -26828,6 +35406,12 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "default", "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "x-nullable": true } }, "required": [ @@ -26839,7 +35423,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -26858,7 +35455,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -26916,7 +35521,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -26935,7 +35553,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -26993,7 +35619,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -27012,7 +35651,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -27055,7 +35702,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -27074,7 +35732,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -27123,7 +35789,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -27142,7 +35820,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -27200,7 +35886,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -27219,7 +35918,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -27268,7 +35975,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -27287,7 +36006,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -27336,7 +36063,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -27355,7 +36094,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -27404,7 +36151,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -27423,7 +36182,15 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -27496,15 +36263,1701 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + 0, + 0 + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ], + "x-enum-name": "AttributeStatus" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } + }, + "table": { + "description": "Table", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Table creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Table update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Table permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Table name.", + "x-example": "My Table" + }, + "enabled": { + "type": "boolean", + "description": "Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "rowSecurity": { + "type": "boolean", + "description": "Whether row-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "columns": { + "type": "array", + "description": "Table columns.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Table indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/columnIndex" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "rowSecurity", + "columns", + "indexes" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Table", + "enabled": false, + "rowSecurity": true, + "columns": {}, + "indexes": {} + } + }, + "columnList": { + "description": "Columns List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of columns in the given table.", + "x-example": 5, + "format": "int32" + }, + "columns": { + "type": "array", + "description": "List of columns.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/columnBoolean" + }, + { + "$ref": "#\/definitions\/columnInteger" + }, + { + "$ref": "#\/definitions\/columnFloat" + }, + { + "$ref": "#\/definitions\/columnEmail" + }, + { + "$ref": "#\/definitions\/columnEnum" + }, + { + "$ref": "#\/definitions\/columnUrl" + }, + { + "$ref": "#\/definitions\/columnIp" + }, + { + "$ref": "#\/definitions\/columnDatetime" + }, + { + "$ref": "#\/definitions\/columnRelationship" + }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, + { + "$ref": "#\/definitions\/columnString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "columns" + ], + "example": { + "total": 5, + "columns": "" + } + }, + "columnString": { + "description": "ColumnString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Column size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default", + "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this column is encrypted or not.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } + }, + "columnInteger": { + "description": "ColumnInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "x-nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 10, + "format": "int32", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } + }, + "columnFloat": { + "description": "ColumnFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "x-nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "x-nullable": true + }, + "default": { + "type": "number", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": 2.5, + "format": "double", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } + }, + "columnBoolean": { + "description": "ColumnBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } + }, + "columnEmail": { + "description": "ColumnEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "default@example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } + }, + "columnEnum": { + "description": "ColumnEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "element", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } + }, + "columnIp": { + "description": "ColumnIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "192.0.2.0", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } + }, + "columnUrl": { + "description": "ColumnURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "https:\/\/example.com" + } + }, + "columnDatetime": { + "description": "ColumnDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for column when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } + }, + "columnRelationship": { + "description": "ColumnRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedTable": { + "type": "string", + "description": "The ID of the related table.", + "x-example": "table" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedTable", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedTable": "table", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } + }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + 0, + 0 + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + 0, + 0 + ] + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "array", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ], + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": [ + [ + [ + 0, + 0 + ], + [ + 0, + 10 + ] + ], + [ + [ + 10, + 10 + ], + [ + 0, + 0 + ] + ] + ] + } }, "index": { "description": "Index", "type": "object", "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, "key": { "type": "string", - "description": "Index Key.", + "description": "Index key.", "x-example": "index1" }, "type": { @@ -27515,7 +37968,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -27547,6 +38007,40 @@ }, "x-example": [], "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "type", + "status", + "error", + "attributes", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [] + } + }, + "columnIndex": { + "description": "Index", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Index ID.", + "x-example": "5e5ea5c16897e" }, "$createdAt": { "type": "string", @@ -27557,18 +38051,148 @@ "type": "string", "description": "Index update date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "columns": { + "type": "array", + "description": "Index columns.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index columns length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "x-nullable": true } }, "required": [ + "$id", + "$createdAt", + "$updatedAt", "key", "type", "status", "error", - "attributes", - "lengths", + "columns", + "lengths" + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "columns": [], + "lengths": [], + "orders": [] + } + }, + "row": { + "description": "Row", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Row ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Row automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, + "$tableId": { + "type": "string", + "description": "Table ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e", + "readOnly": true + }, + "$createdAt": { + "type": "string", + "description": "Row creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Row update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Row permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$tableId", + "$databaseId", "$createdAt", - "$updatedAt" - ] + "$updatedAt", + "$permissions" + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$tableId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ] + } }, "document": { "description": "Document", @@ -27579,15 +38203,24 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32", + "readOnly": true + }, "$collectionId": { "type": "string", "description": "Collection ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$databaseId": { "type": "string", "description": "Database ID.", - "x-example": "5e5ea5c15117e" + "x-example": "5e5ea5c15117e", + "readOnly": true }, "$createdAt": { "type": "string", @@ -27613,12 +38246,29 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -27752,7 +38402,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -27915,7 +38588,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -27929,7 +38628,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -27943,7 +38645,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -27957,7 +38662,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -27971,7 +38679,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -28013,7 +38724,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -28045,7 +38763,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -28080,12 +38804,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -28272,7 +39007,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -28340,7 +39108,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -28384,7 +39164,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -28398,7 +39186,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -28448,7 +39239,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -28468,7 +39268,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -28550,7 +39354,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -28642,7 +39461,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -28692,7 +39530,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -28744,7 +39591,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -28835,7 +39693,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -29022,7 +39897,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -29212,7 +40118,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "runtime": { "description": "Runtime", @@ -29271,7 +40207,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -29327,7 +40273,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -29365,7 +40329,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -29447,7 +40418,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -29475,11 +40453,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -29505,6 +40478,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -29532,14 +40510,43 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -29557,7 +40564,7 @@ }, "$updatedAt": { "type": "string", - "description": "Execution upate date in ISO 8601 format.", + "description": "Execution update date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, "$permissions": { @@ -29575,15 +40582,31 @@ "description": "Function ID.", "x-example": "5e5ea6g16897e" }, + "deploymentId": { + "type": "string", + "description": "Function's deployment ID used to create the execution.", + "x-example": "5e5ea5c16897e" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -29597,7 +40620,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "type": "object", "$ref": "#\/definitions\/headers" @@ -29661,6 +40684,7 @@ "$updatedAt", "$permissions", "functionId", + "deploymentId", "trigger", "status", "requestMethod", @@ -29672,7 +40696,37 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "deploymentId": "5e5ea5c16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "variable": { "description": "Variable", @@ -29728,7 +40782,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -29748,7 +40812,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -29768,7 +40836,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -29794,7 +40866,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -29846,7 +40923,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -29872,7 +40958,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -29885,14 +40976,23 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -29907,7 +41007,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -29926,15 +41029,25 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "description": "Service status. Possible values are: `pass`, `fail`", + "x-example": "pass", + "enum": [ + "pass", + "fail" + ], + "x-enum-name": "HealthCheckStatus" } }, "required": [ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -29978,7 +41091,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -30007,7 +41128,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "headers": { "description": "Headers", @@ -30027,7 +41153,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -30061,7 +41191,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -30093,7 +41229,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -30113,7 +41255,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -30133,7 +41281,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -30165,7 +41317,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -30232,7 +41390,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -30329,7 +41502,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ @@ -30343,7 +41523,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -30405,7 +41611,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -30480,7 +41696,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -30542,7 +41778,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "externalDocs": { diff --git a/app/config/storage/inputs.php b/app/config/storage/inputs.php index edcf667d86..a102dfdcf0 100644 --- a/app/config/storage/inputs.php +++ b/app/config/storage/inputs.php @@ -7,4 +7,5 @@ return [ "png" => "image/png", "heic" => "image/heic", "webp" => "image/webp", + "gif" => "image/gif", ]; diff --git a/app/config/storage/outputs.php b/app/config/storage/outputs.php index 519ff825fe..3e6fd45651 100644 --- a/app/config/storage/outputs.php +++ b/app/config/storage/outputs.php @@ -8,4 +8,5 @@ return [ "webp" => "image/webp", "heic" => "image/heic", "avif" => "image/avif", + "gif" => "image/gif", ]; diff --git a/app/config/storage/resource_limits.php b/app/config/storage/resource_limits.php new file mode 100644 index 0000000000..cfbcea5a47 --- /dev/null +++ b/app/config/storage/resource_limits.php @@ -0,0 +1,6 @@ +<?php + +use Utopia\Image\Image; +use Utopia\System\System; + +Image::setResourceLimit('memory', intval(System::getEnv('_APP_IMAGES_RESOURCE_LIMIT_MEMORY', 1024*1024*64))); diff --git a/app/config/template-runtimes.php b/app/config/template-runtimes.php index 8f1c0198c2..d1bb1a5b6a 100644 --- a/app/config/template-runtimes.php +++ b/app/config/template-runtimes.php @@ -14,7 +14,7 @@ return [ ], 'DART' => [ 'name' => 'dart', - 'versions' => ['3.5', '3.3', '3.1', '3.0', '2.19', '2.18', '2.17', '2.16'] + 'versions' => ['3.8', '3.5', '3.3', '3.1', '3.0', '2.19', '2.18', '2.17', '2.16'] ], 'GO' => [ 'name' => 'go', @@ -38,6 +38,6 @@ return [ ], 'FLUTTER' => [ 'name' => 'flutter', - 'versions' => ['3.24'] + 'versions' => ['3.32', '3.24'] ], ]; diff --git a/app/config/templates/function.php b/app/config/templates/function.php index d8426ad900..16838341a9 100644 --- a/app/config/templates/function.php +++ b/app/config/templates/function.php @@ -635,7 +635,7 @@ return [ 'type' => 'url' ] ], - 'scopes' => ['databases.read', 'databases.write', 'collections.write', 'attributes.write', 'documents.read', 'documents.write'] + 'scopes' => ['databases.read', 'databases.write', 'collections.write', 'tables.write', 'attributes.write', 'columns.write', 'documents.read', 'rows.read', 'documents.write', 'rows.write'] ], [ 'icon' => 'icon-algolia', @@ -717,7 +717,7 @@ return [ 'type' => 'password' ], ], - 'scopes' => ['databases.read', 'collections.read', 'documents.read'] + 'scopes' => ['databases.read', 'collections.read', 'tables.read', 'documents.read', 'rows.read'] ], [ 'icon' => 'icon-meilisearch', @@ -811,7 +811,7 @@ return [ 'type' => 'text' ], ], - 'scopes' => ['databases.read', 'collections.read', 'documents.read'] + 'scopes' => ['databases.read', 'collections.read', 'tables.read', 'documents.read', 'rows.read'] ], [ 'icon' => 'icon-vonage', @@ -1139,7 +1139,7 @@ return [ 'type' => 'text' ] ], - 'scopes' => ['databases.read', 'databases.write', 'collections.write', 'attributes.write', 'documents.read', 'documents.write'] + 'scopes' => ['databases.read', 'databases.write', 'collections.write', 'tables.write', 'attributes.write', 'columns.write', 'documents.read', 'rows.read', 'documents.write', 'rows.write'] ], [ 'icon' => 'icon-chat', @@ -1268,7 +1268,7 @@ return [ 'type' => 'password' ] ], - 'scopes' => ['databases.read', 'databases.write', 'collections.read', 'collections.write', 'attributes.write', 'documents.read', 'documents.write', 'buckets.read', 'buckets.write', 'files.read'] + 'scopes' => ['databases.read', 'databases.write', 'collections.read', 'tables.read', 'collections.write', 'tables.write', 'attributes.write', 'columns.write', 'documents.read', 'rows.read', 'documents.write', 'rows.write', 'buckets.read', 'buckets.write', 'files.read'] ], [ 'icon' => 'icon-eye', @@ -1327,7 +1327,7 @@ return [ 'type' => 'password' ] ], - 'scopes' => ['databases.read', 'databases.write', 'collections.read', 'collections.write', 'attributes.write', 'documents.read', 'documents.write', 'buckets.read', 'buckets.write', 'files.read'] + 'scopes' => ['databases.read', 'databases.write', 'collections.read', 'tables.read', 'collections.write', 'tables.write', 'attributes.write', 'columns.write', 'documents.read', 'rows.read', 'documents.write', 'rows.write', 'buckets.read', 'buckets.write', 'files.read'] ], [ 'icon' => 'icon-text', @@ -1386,7 +1386,7 @@ return [ 'type' => 'password' ] ], - 'scopes' => ['databases.read', 'databases.write', 'collections.read', 'collections.write', 'attributes.write', 'documents.read', 'documents.write', 'buckets.read', 'buckets.write', 'files.read'] + 'scopes' => ['databases.read', 'databases.write', 'collections.read', 'tables.read', 'collections.write', 'tables.write', 'attributes.write', 'columns.write', 'documents.read', 'rows.read', 'documents.write', 'rows.write', 'buckets.read', 'buckets.write', 'files.read'] ], [ 'icon' => 'icon-chat', @@ -1395,7 +1395,10 @@ return [ 'score' => 5, 'tagline' => 'Convert text to speech using the Hugging Face inference API.', 'permissions' => ['any'], - 'events' => ['databases.*.collections.*.documents.*.create'], + 'events' => [ + 'databases.*.tables.*.rows.*.create', + 'databases.*.collections.*.documents.*.create', + ], 'cron' => '', 'timeout' => 15, 'useCases' => ['ai'], @@ -1666,7 +1669,7 @@ return [ 'type' => 'text' ] ], - 'scopes' => ['databases.read', 'collections.read', 'documents.read'] + 'scopes' => ['databases.read', 'collections.read', 'tables.read', 'documents.read', 'rows.read'] ], [ 'icon' => 'icon-chip', @@ -1730,7 +1733,7 @@ return [ 'type' => 'text' ] ], - 'scopes' => ['databases.read', 'collections.read', 'documents.read'] + 'scopes' => ['databases.read', 'collections.read', 'tables.read', 'documents.read', 'rows.read'] ], [ 'icon' => 'icon-chat', @@ -2077,6 +2080,61 @@ return [ 'type' => 'text' ] ], + 'scopes' => ['databases.read', 'databases.write', 'collections.write', 'attributes.write', 'documents.read', 'documents.write'] + ], + [ + 'icon' => 'icon-apple', + 'id' => 'sign-in-with-apple', + 'name' => 'Sign in with Apple', + 'score' => 6, + 'tagline' => 'Use native Apple sign-in APIs on Apple devices with Appwrite Auth', + 'permissions' => ['any'], + 'events' => [], + 'cron' => '', + 'timeout' => 15, + 'useCases' => ['auth'], + 'runtimes' => [ + ...getRuntimes($templateRuntimes['DART'], 'dart pub get', 'lib/main.dart', 'dart/sign_in_with_apple') + ], + 'instructions' => 'For documentation and instructions, check out <a target="_blank" rel="noopener noreferrer" class="link" href="https://github.com/appwrite/templates/tree/main/dart/sign_in_with_apple">file</a>.', + 'vcsProvider' => 'github', + 'providerRepositoryId' => 'templates', + 'providerOwner' => 'appwrite', + 'providerVersion' => '0.2.*', + 'variables' => [ + [ + 'name' => 'BUNDLE_ID', + 'description' => 'Bundle ID of the app. <a class="u-bold" target="_blank" href="https://developer.apple.com/documentation/xcode/preparing-your-app-for-distribution/#Set-the-bundle-ID">Learn more</a>.', + 'value' => '', + 'placeholder' => 'com.companyname.appname', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'TEAM_ID', + 'description' => 'Team ID of the Apple Developer account.', + 'value' => '', + 'placeholder' => '6K3...5PH', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'KEY_ID', + 'description' => 'Key ID required to communicate with Apple Developer services. <a class="u-bold" target="_blank" href="https://developer.apple.com/help/account/keys/get-a-key-identifier/">Learn more</a>.', + 'value' => '', + 'placeholder' => '9G8...6YF', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'KEY_CONTENTS_ENCODED', + 'description' => 'Contents of Key required to communicated with Apple Developer services, encoded in Base64. <a class="u-bold" target="_blank" href="https://developer.apple.com/help/account/keys/revoke-edit-and-download-keys">Learn more</a>.', + 'value' => '', + 'placeholder' => '7x8aA...Ab7c', + 'required' => true, + 'type' => 'password' + ] + ], 'scopes' => ['users.read', 'users.write'] ] ]; diff --git a/app/config/templates/site.php b/app/config/templates/site.php index a853955a97..c7e169f05e 100644 --- a/app/config/templates/site.php +++ b/app/config/templates/site.php @@ -6,13 +6,8 @@ use Utopia\System\System; * List of Appwrite Sites templates */ -$protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; -$hostname = System::getEnv('_APP_DOMAIN'); - -// TODO: Development override -if (System::getEnv('_APP_ENV') === 'development') { - $hostname = 'localhost'; -} +$protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; +$hostname = System::getEnv('_APP_DOMAIN', ''); $url = $protocol . '://' . $hostname; @@ -478,13 +473,13 @@ return [ 'frameworks' => [ getFramework('FLUTTER', [ 'providerRootDirectory' => './', - 'buildCommand' => 'bash build.sh', + 'buildCommand' => 'bash prepare-env.sh && flutter build web', ]), ], 'vcsProvider' => 'github', 'providerRepositoryId' => 'starter-for-flutter', 'providerOwner' => 'appwrite', - 'providerVersion' => '0.1.*', + 'providerVersion' => '0.2.*', 'variables' => [ [ 'name' => 'APPWRITE_PUBLIC_ENDPOINT', @@ -1011,7 +1006,7 @@ return [ getFramework('NEXTJS', [ 'providerRootDirectory' => './', 'installCommand' => 'pnpm install', - 'buildCommand' => 'npm run build', + 'buildCommand' => 'pnpm build', ]), ], 'vcsProvider' => 'github', @@ -1020,7 +1015,7 @@ return [ 'providerVersion' => '0.1.*', 'variables' => [ [ - 'name' => 'NEXT_PUBLIC_APPWRITE_FUNCTION_PROJECT_ID', + 'name' => 'NEXT_PUBLIC_APPWRITE_FUNCTION_API_ENDPOINT', 'description' => 'Endpoint of Appwrite server', 'value' => '{apiEndpoint}', 'placeholder' => '{apiEndpoint}', @@ -1028,7 +1023,7 @@ return [ 'type' => 'text' ], [ - 'name' => 'NEXT_PUBLIC_APPWRITE_FUNCTION_API_ENDPOINT', + 'name' => 'NEXT_PUBLIC_APPWRITE_FUNCTION_PROJECT_ID', 'description' => 'Your Appwrite project ID', 'value' => '{projectId}', 'placeholder' => '{projectId}', diff --git a/app/config/variables.php b/app/config/variables.php index 2f9a5ab41a..8fd00557b3 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -151,6 +151,24 @@ return [ 'question' => '', 'filter' => '' ], + [ + 'name' => '_APP_DOMAIN_TARGET_CAA', + 'description' => 'A CAA record domain that can be used to validate custom domains. Value should be domain\'s hostname.', + 'introduction' => '', + 'default' => '', + 'required' => false, + 'question' => '', + 'filter' => '' + ], + [ + 'name' => '_APP_DNS', + 'description' => 'DNS server to use for domain validation. Default: 8.8.8.8', + 'introduction' => '', + 'default' => '8.8.8.8', + 'required' => false, + 'question' => '', + 'filter' => '' + ], [ 'name' => '_APP_CONSOLE_WHITELIST_ROOT', 'description' => '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.', @@ -827,7 +845,7 @@ return [ ], [ 'name' => '_APP_FUNCTIONS_TIMEOUT', - 'description' => '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.', + 'description' => '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.config.json.', 'introduction' => '0.7.0', 'default' => '900', 'required' => false, @@ -1070,7 +1088,7 @@ return [ 'variables' => [ [ 'name' => '_APP_SITES_TIMEOUT', - 'description' => 'The maximum number of seconds allowed as a timeout value when creating a new site. The default value is 900 seconds. This is the global limit, timeout for individual functions are configured in the sites\'s settings or in appwrite.json.', + 'description' => 'The maximum number of seconds allowed as a timeout value when creating a new site. The default value is 900 seconds. This is the global limit, timeout for individual functions are configured in the sites\'s settings or in appwrite.config.json.', 'introduction' => '1.7.0', 'default' => '900', 'required' => false, diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 0c53423325..8aaa5283c4 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -21,9 +21,11 @@ use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; +use Appwrite\Network\Validator\Redirect; use Appwrite\OpenSSL\OpenSSL; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; @@ -60,7 +62,6 @@ use Utopia\System\System; use Utopia\Validator\ArrayList; use Utopia\Validator\Assoc; use Utopia\Validator\Boolean; -use Utopia\Validator\Host; use Utopia\Validator\Text; use Utopia\Validator\URL; use Utopia\Validator\WhiteList; @@ -71,6 +72,7 @@ $oauthDefaultFailure = '/console/auth/oauth2/failure'; function sendSessionAlert(Locale $locale, Document $user, Document $project, Document $session, Mail $queueForMails) { $subject = $locale->getText("emails.sessionAlert.subject"); + $preview = $locale->getText("emails.sessionAlert.preview"); $customTemplate = $project->getAttribute('templates', [])['email.sessionAlert-' . $locale->default] ?? []; $message = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-session-alert.tpl'); @@ -132,6 +134,16 @@ function sendSessionAlert(Locale $locale, Document $user, Document $project, Doc ->setSmtpSenderName($senderName); } + // session alerts should always have a client name! + $clientName = $session->getAttribute('clientName'); + if (empty($clientName)) { + // fallback to the user agent and then unknown! + $userAgent = $session->getAttribute('userAgent'); + $clientName = !empty($userAgent) ? $userAgent : 'UNKNOWN'; + + $session->setAttribute('clientName', $clientName); + } + $emailVariables = [ 'direction' => $locale->getText('settings.direction'), 'date' => (new \DateTime())->format('F j'), @@ -148,6 +160,7 @@ function sendSessionAlert(Locale $locale, Document $user, Document $project, Doc $queueForMails ->setSubject($subject) + ->setPreview($preview) ->setBody($body) ->setVariables($emailVariables) ->setRecipient($email) @@ -1182,16 +1195,23 @@ App::get('/v1/account/sessions/oauth2/:provider') ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') - ->param('success', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients', 'devKey']) - ->param('failure', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients', 'devKey']) + ->param('success', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['platforms', 'devKey']) + ->param('failure', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['platforms', 'devKey']) ->param('scopes', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) ->inject('request') ->inject('response') ->inject('project') ->action(function (string $provider, string $success, string $failure, array $scopes, Request $request, Response $response, Document $project) use ($oauthDefaultSuccess, $oauthDefaultFailure) { - $protocol = $request->getProtocol(); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $request->getHostname(); + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } - $callback = $protocol . '://' . $request->getHostname() . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); + $callback = $callbackBase . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); $providerEnabled = $project->getAttribute('oAuthProviders', [])[$provider . 'Enabled'] ?? false; if (!$providerEnabled) { @@ -1216,12 +1236,20 @@ App::get('/v1/account/sessions/oauth2/:provider') throw new Exception(Exception::PROJECT_PROVIDER_UNSUPPORTED); } + $host = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); + $redirectBase = $protocol . '://' . $host; + if ($protocol === 'https' && $port !== '443') { + $redirectBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $redirectBase .= ':' . $port; + } + if (empty($success)) { - $success = $protocol . '://' . $request->getHostname() . $oauthDefaultSuccess; + $success = $redirectBase . $oauthDefaultSuccess; } if (empty($failure)) { - $failure = $protocol . '://' . $request->getHostname() . $oauthDefaultFailure; + $failure = $redirectBase . $oauthDefaultFailure; } $oauth2 = new $className($appId, $appSecret, $callback, [ @@ -1251,9 +1279,14 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->inject('request') ->inject('response') ->action(function (string $projectId, string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response) { - - $domain = $request->getHostname(); - $protocol = $request->getProtocol(); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $request->getHostname(); + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } $params = $request->getParams(); $params['project'] = $projectId; @@ -1262,7 +1295,7 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId') $response ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') ->addHeader('Pragma', 'no-cache') - ->redirect($protocol . '://' . $domain . '/v1/account/sessions/oauth2/' . $provider . '/redirect?' + ->redirect($callbackBase . '/v1/account/sessions/oauth2/' . $provider . '/redirect?' . \http_build_query($params)); }); @@ -1282,9 +1315,14 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->inject('request') ->inject('response') ->action(function (string $projectId, string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response) { - - $domain = $request->getHostname(); - $protocol = $request->getProtocol(); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $request->getHostname(); + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } $params = $request->getParams(); $params['project'] = $projectId; @@ -1293,7 +1331,7 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId') $response ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') ->addHeader('Pragma', 'no-cache') - ->redirect($protocol . '://' . $domain . '/v1/account/sessions/oauth2/' . $provider . '/redirect?' + ->redirect($callbackBase . '/v1/account/sessions/oauth2/' . $provider . '/redirect?' . \http_build_query($params)); }); @@ -1317,15 +1355,24 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ->inject('request') ->inject('response') ->inject('project') + ->inject('platforms') + ->inject('devKey') ->inject('user') ->inject('dbForProject') ->inject('geodb') ->inject('queueForEvents') - ->action(function (string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response, Document $project, Document $user, Database $dbForProject, Reader $geodb, Event $queueForEvents) use ($oauthDefaultSuccess) { - $protocol = $request->getProtocol(); - $callback = $protocol . '://' . $request->getHostname() . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); + ->action(function (string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response, Document $project, array $platforms, Document $devKey, Document $user, Database $dbForProject, Reader $geodb, Event $queueForEvents) use ($oauthDefaultSuccess) { + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $request->getHostname(); + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } + $callback = $callbackBase . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); $defaultState = ['success' => $project->getAttribute('url', ''), 'failure' => '']; - $validateURL = new URL(); + $redirect = new Redirect($platforms); $appId = $project->getAttribute('oAuthProviders', [])[$provider . 'Appid'] ?? ''; $appSecret = $project->getAttribute('oAuthProviders', [])[$provider . 'Secret'] ?? '{}'; $providerEnabled = $project->getAttribute('oAuthProviders', [])[$provider . 'Enabled'] ?? false; @@ -1352,11 +1399,11 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $state = $defaultState; } - if (!$validateURL->isValid($state['success'])) { + if ($devKey->isEmpty() && !$redirect->isValid($state['success'])) { throw new Exception(Exception::PROJECT_INVALID_SUCCESS_URL); } - if (!empty($state['failure']) && !$validateURL->isValid($state['failure'])) { + if ($devKey->isEmpty() && !empty($state['failure']) && !$redirect->isValid($state['failure'])) { throw new Exception(Exception::PROJECT_INVALID_FAILURE_URL); } $failure = []; @@ -1423,13 +1470,13 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $name = ''; $nameOAuth = $oauth2->getUserName($accessToken); - $userParam = \json_decode($request->getParam('user'), true); + $userParam = $request->getParam('user'); if (!empty($nameOAuth)) { $name = $nameOAuth; - } elseif (is_array($userParam)) { - $nameParam = $userParam['name']; - if (is_array($nameParam) && isset($nameParam['firstName']) && isset($nameParam['lastName'])) { - $name = $nameParam['firstName'] . ' ' . $nameParam['lastName']; + } elseif ($userParam !== null) { + $userDecoded = \json_decode($userParam, true); + if (isset($userDecoded['name']['firstName']) && isset($userDecoded['name']['lastName'])) { + $name = $userDecoded['name']['firstName'] . ' ' . $userDecoded['name']['lastName']; } } $email = $oauth2->getUserEmail($accessToken); @@ -1488,22 +1535,22 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') */ $isVerified = $oauth2->isEmailVerified($accessToken); - $userWithEmail = $dbForProject->findOne('users', [ - Query::equal('email', [$email]), + $identity = $dbForProject->findOne('identities', [ + Query::equal('provider', [$provider]), + Query::equal('providerUid', [$oauth2ID]), ]); - if (!$userWithEmail->isEmpty()) { - $user->setAttributes($userWithEmail->getArrayCopy()); + + if (!$identity->isEmpty()) { + $user = $dbForProject->getDocument('users', $identity->getAttribute('userId')); } // If user is not found, check if there is an identity with the same provider user ID if ($user === false || $user->isEmpty()) { - $identity = $dbForProject->findOne('identities', [ - Query::equal('provider', [$provider]), - Query::equal('providerUid', [$oauth2ID]), + $userWithEmail = $dbForProject->findOne('users', [ + Query::equal('email', [$email]), ]); - - if (!$identity->isEmpty()) { - $user = $dbForProject->getDocument('users', $identity->getAttribute('userId')); + if (!$userWithEmail->isEmpty()) { + $user->setAttributes($userWithEmail->getArrayCopy()); } } @@ -1747,8 +1794,6 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $state['success']['query'] = URLParser::unparseQuery($query); $state['success'] = URLParser::unparse($state['success']); - $expire = DateTime::formatTz(DateTime::addSeconds(new \DateTime(), $duration)); - $response ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') ->addHeader('Pragma', 'no-cache') @@ -1779,16 +1824,23 @@ App::get('/v1/account/tokens/oauth2/:provider') ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') - ->param('success', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients', 'devKey']) - ->param('failure', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients', 'devKey']) + ->param('success', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['platforms', 'devKey']) + ->param('failure', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['platforms', 'devKey']) ->param('scopes', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) ->inject('request') ->inject('response') ->inject('project') ->action(function (string $provider, string $success, string $failure, array $scopes, Request $request, Response $response, Document $project) use ($oauthDefaultSuccess, $oauthDefaultFailure) { - $protocol = $request->getProtocol(); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $request->getHostname(); + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } - $callback = $protocol . '://' . $request->getHostname() . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); + $callback = $callbackBase . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); $providerEnabled = $project->getAttribute('oAuthProviders', [])[$provider . 'Enabled'] ?? false; if (!$providerEnabled) { @@ -1813,12 +1865,20 @@ App::get('/v1/account/tokens/oauth2/:provider') throw new Exception(Exception::PROJECT_PROVIDER_UNSUPPORTED); } + $host = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); + $redirectBase = $protocol . '://' . $host; + if ($protocol === 'https' && $port !== '443') { + $redirectBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $redirectBase .= ':' . $port; + } + if (empty($success)) { - $success = $protocol . '://' . $request->getHostname() . $oauthDefaultSuccess; + $success = $redirectBase . $oauthDefaultSuccess; } if (empty($failure)) { - $failure = $protocol . '://' . $request->getHostname() . $oauthDefaultFailure; + $failure = $redirectBase . $oauthDefaultFailure; } $oauth2 = new $className($appId, $appSecret, $callback, [ @@ -1858,9 +1918,9 @@ App::post('/v1/account/tokens/magic-url') )) ->label('abuse-limit', 60) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) - ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') + ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.') ->param('email', '', new Email(), 'User email.') - ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients', 'devKey']) + ->param('url', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['platforms', 'devKey']) ->param('phrase', false, new Boolean(), 'Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.', true) ->inject('request') ->inject('response') @@ -1961,7 +2021,16 @@ App::post('/v1/account/tokens/magic-url') $dbForProject->purgeCachedDocument('users', $user->getId()); if (empty($url)) { - $url = $request->getProtocol() . '://' . $request->getHostname() . '/console/auth/magic-url'; + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $host = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $host; + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } + $url = $callbackBase . '/console/auth/magic-url'; } $url = Template::parseURL($url); @@ -1969,6 +2038,7 @@ App::post('/v1/account/tokens/magic-url') $url = Template::unParseURL($url); $subject = $locale->getText("emails.magicSession.subject"); + $preview = $locale->getText("emails.magicSession.preview"); $customTemplate = $project->getAttribute('templates', [])['email.magicSession-' . $locale->default] ?? []; $detector = new Detector($request->getUserAgent('UNKNOWN')); @@ -2057,6 +2127,7 @@ App::post('/v1/account/tokens/magic-url') $queueForMails ->setSubject($subject) + ->setPreview($preview) ->setBody($body) ->setVariables($emailVariables) ->setRecipient($email) @@ -2100,7 +2171,7 @@ App::post('/v1/account/tokens/email') )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) - ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') + ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.') ->param('email', '', new Email(), 'User email.') ->param('phrase', false, new Boolean(), 'Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.', true) ->inject('request') @@ -2169,7 +2240,30 @@ App::post('/v1/account/tokens/email') ]); $user->removeAttribute('$sequence'); - Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); + $user = Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); + try { + $target = Authorization::skip(fn () => $dbForProject->createDocument('targets', new Document([ + '$permissions' => [ + Permission::read(Role::user($user->getId())), + Permission::update(Role::user($user->getId())), + Permission::delete(Role::user($user->getId())), + ], + 'userId' => $user->getId(), + 'userInternalId' => $user->getSequence(), + 'providerType' => MESSAGE_TYPE_EMAIL, + 'identifier' => $email, + ]))); + $user->setAttribute('targets', [...$user->getAttribute('targets', []), $target]); + } catch (Duplicate) { + $existingTarget = $dbForProject->findOne('targets', [ + Query::equal('identifier', [$email]), + ]); + if (!$existingTarget->isEmpty()) { + $user->setAttribute('targets', $existingTarget, Document::SET_TYPE_APPEND); + } + } + + $dbForProject->purgeCachedDocument('users', $user->getId()); } $tokenSecret = Auth::codeGenerator(6); @@ -2198,6 +2292,7 @@ App::post('/v1/account/tokens/email') $dbForProject->purgeCachedDocument('users', $user->getId()); $subject = $locale->getText("emails.otpSession.subject"); + $preview = $locale->getText("emails.otpSession.preview"); $customTemplate = $project->getAttribute('templates', [])['email.otpSession-' . $locale->default] ?? []; $detector = new Detector($request->getUserAgent('UNKNOWN')); @@ -2283,6 +2378,7 @@ App::post('/v1/account/tokens/email') $queueForMails ->setSubject($subject) + ->setPreview($preview) ->setBody($body) ->setVariables($emailVariables) ->setRecipient($email) @@ -2323,7 +2419,10 @@ App::put('/v1/account/sessions/magic-url') ) ], contentType: ContentType::JSON, - deprecated: true, + deprecated: new Deprecated( + since: '1.6.0', + replaceWith: 'account.createSession' + ), )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') @@ -2361,7 +2460,10 @@ App::put('/v1/account/sessions/phone') ) ], contentType: ContentType::JSON, - deprecated: true, + deprecated: new Deprecated( + since: '1.6.0', + replaceWith: 'account.createSession' + ), )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') @@ -2403,7 +2505,7 @@ App::post('/v1/account/tokens/phone') )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},phone:{param-phone}', 'url:{url},ip:{ip}']) - ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') + ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.') ->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.') ->inject('request') ->inject('response') @@ -2843,6 +2945,18 @@ App::patch('/v1/account/password') ->setAttribute('hash', Auth::DEFAULT_ALGO) ->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS); + $sessions = $user->getAttribute('sessions', []); + $current = Auth::sessionVerify($sessions, Auth::$secret); + $invalidate = $project->getAttribute('auths', default: [])['invalidateSessions'] ?? false; + if ($invalidate && !empty($current)) { + foreach ($sessions as $session) { + /** @var Document $session */ + if ($session->getId() !== $current) { + $dbForProject->deleteDocument('sessions', $session->getId()); + } + } + } + $user = $dbForProject->updateDocument('users', $user->getId(), $user); $queueForEvents->setParam('userId', $user->getId()); @@ -3054,7 +3168,7 @@ App::patch('/v1/account/prefs') ], contentType: ContentType::JSON )) - ->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.') + ->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.', example: '{"language":"en","timezone":"UTC","darkTheme":true}') ->inject('requestTimestamp') ->inject('response') ->inject('user') @@ -3146,7 +3260,7 @@ App::post('/v1/account/recovery') ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) ->param('email', '', new Email(), 'User email.') - ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients', 'devKey']) + ->param('url', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['platforms', 'devKey']) ->inject('request') ->inject('response') ->inject('user') @@ -3177,7 +3291,7 @@ App::post('/v1/account/recovery') throw new Exception(Exception::USER_BLOCKED); } - $expire = DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_RECOVERY); + $expire = DateTime::formatTz(DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_RECOVERY)); $secret = Auth::tokenGenerator(Auth::TOKEN_LENGTH_RECOVERY); $recovery = new Document([ @@ -3209,6 +3323,7 @@ App::post('/v1/account/recovery') $projectName = $project->isEmpty() ? 'Console' : $project->getAttribute('name', '[APP-NAME]'); $body = $locale->getText("emails.recovery.body"); $subject = $locale->getText("emails.recovery.subject"); + $preview = $locale->getText("emails.recovery.preview"); $customTemplate = $project->getAttribute('templates', [])['email.recovery-' . $locale->default] ?? []; $message = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-inner-base.tpl'); @@ -3217,6 +3332,7 @@ App::post('/v1/account/recovery') ->setParam('{{hello}}', $locale->getText("emails.recovery.hello")) ->setParam('{{footer}}', $locale->getText("emails.recovery.footer")) ->setParam('{{thanks}}', $locale->getText("emails.recovery.thanks")) + ->setParam('{{buttonText}}', $locale->getText("emails.recovery.buttonText")) ->setParam('{{signature}}', $locale->getText("emails.recovery.signature")); $body = $message->render(); @@ -3282,6 +3398,7 @@ App::post('/v1/account/recovery') ->setBody($body) ->setVariables($emailVariables) ->setSubject($subject) + ->setPreview($preview) ->trigger(); $recovery->setAttribute('secret', $secret); @@ -3412,7 +3529,7 @@ App::post('/v1/account/verification') )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') - ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients', 'devKey']) // TODO add built-in confirm page + ->param('url', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['platforms', 'devKey']) // TODO add built-in confirm page ->inject('request') ->inject('response') ->inject('project') @@ -3433,7 +3550,7 @@ App::post('/v1/account/verification') } $verificationSecret = Auth::tokenGenerator(Auth::TOKEN_LENGTH_VERIFICATION); - $expire = DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_CONFIRM); + $expire = DateTime::formatTz(DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_CONFIRM)); $verification = new Document([ '$id' => ID::unique(), @@ -3463,6 +3580,7 @@ App::post('/v1/account/verification') $projectName = $project->isEmpty() ? 'Console' : $project->getAttribute('name', '[APP-NAME]'); $body = $locale->getText("emails.verification.body"); + $preview = $locale->getText("emails.verification.preview"); $subject = $locale->getText("emails.verification.subject"); $customTemplate = $project->getAttribute('templates', [])['email.verification-' . $locale->default] ?? []; @@ -3472,6 +3590,7 @@ App::post('/v1/account/verification') ->setParam('{{hello}}', $locale->getText("emails.verification.hello")) ->setParam('{{footer}}', $locale->getText("emails.verification.footer")) ->setParam('{{thanks}}', $locale->getText("emails.verification.thanks")) + ->setParam('{{buttonText}}', $locale->getText("emails.verification.buttonText")) ->setParam('{{signature}}', $locale->getText("emails.verification.signature")); $body = $message->render(); @@ -3534,6 +3653,7 @@ App::post('/v1/account/verification') $queueForMails ->setSubject($subject) + ->setPreview($preview) ->setBody($body) ->setVariables($emailVariables) ->setRecipient($user->getAttribute('email')) @@ -3680,7 +3800,7 @@ App::post('/v1/account/verification/phone') } $secret ??= Auth::codeGenerator(); - $expire = DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_CONFIRM); + $expire = DateTime::formatTz(DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_CONFIRM)); $verification = new Document([ '$id' => ID::unique(), @@ -3880,7 +4000,7 @@ App::patch('/v1/account/mfa') if ($user->getAttribute('phone', false) && $user->getAttribute('phoneVerification', false)) { $factors[] = Type::PHONE; } - $factors = \array_unique($factors); + $factors = \array_values(\array_unique($factors)); $session->setAttribute('factors', $factors); $dbForProject->updateDocument('sessions', $session->getId(), $session); @@ -3895,20 +4015,40 @@ App::get('/v1/account/mfa/factors') ->desc('List factors') ->groups(['api', 'account', 'mfa']) ->label('scope', 'account') - ->label('sdk', new Method( - namespace: 'account', - group: 'mfa', - name: 'listMfaFactors', - description: '/docs/references/account/list-mfa-factors.md', - auth: [AuthType::SESSION, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_MFA_FACTORS, - ) - ], - contentType: ContentType::JSON - )) + ->label('sdk', [ + new Method( + namespace: 'account', + group: 'mfa', + name: 'listMfaFactors', + description: '/docs/references/account/list-mfa-factors.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_FACTORS, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'account.listMFAFactors', + ), + ), + new Method( + namespace: 'account', + group: 'mfa', + name: 'listMFAFactors', + description: '/docs/references/account/list-mfa-factors.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_FACTORS, + ) + ], + contentType: ContentType::JSON + ) + ]) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -3936,20 +4076,40 @@ App::post('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk', new Method( - namespace: 'account', - group: 'mfa', - name: 'createMfaAuthenticator', - description: '/docs/references/account/create-mfa-authenticator.md', - auth: [AuthType::SESSION, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_MFA_TYPE, - ) - ], - contentType: ContentType::JSON - )) + ->label('sdk', [ + new Method( + namespace: 'account', + group: 'mfa', + name: 'createMfaAuthenticator', + description: '/docs/references/account/create-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_TYPE, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'account.createMFAAuthenticator', + ), + ), + new Method( + namespace: 'account', + group: 'mfa', + name: 'createMFAAuthenticator', + description: '/docs/references/account/create-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_TYPE, + ) + ], + contentType: ContentType::JSON + ) + ]) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . Type::TOTP . '`') ->inject('requestTimestamp') ->inject('response') @@ -4013,20 +4173,40 @@ App::put('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk', new Method( - namespace: 'account', - group: 'mfa', - name: 'updateMfaAuthenticator', - description: '/docs/references/account/update-mfa-authenticator.md', - auth: [AuthType::SESSION, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_USER, - ) - ], - contentType: ContentType::JSON - )) + ->label('sdk', [ + new Method( + namespace: 'account', + group: 'mfa', + name: 'updateMfaAuthenticator', + description: '/docs/references/account/update-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'account.updateMFAAuthenticator', + ), + ), + new Method( + namespace: 'account', + group: 'mfa', + name: 'updateMFAAuthenticator', + description: '/docs/references/account/update-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON + ) + ]) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->param('otp', '', new Text(256), 'Valid verification token.') ->inject('response') @@ -4065,7 +4245,7 @@ App::put('/v1/account/mfa/authenticators/:type') $factors = $session->getAttribute('factors', []); $factors[] = $type; - $factors = \array_unique($factors); + $factors = \array_values(\array_unique($factors)); $session->setAttribute('factors', $factors); $dbForProject->updateDocument('sessions', $session->getId(), $session); @@ -4083,20 +4263,40 @@ App::post('/v1/account/mfa/recovery-codes') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk', new Method( - namespace: 'account', - group: 'mfa', - name: 'createMfaRecoveryCodes', - description: '/docs/references/account/create-mfa-recovery-codes.md', - auth: [AuthType::SESSION, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_MFA_RECOVERY_CODES, - ) - ], - contentType: ContentType::JSON - )) + ->label('sdk', [ + new Method( + namespace: 'account', + group: 'mfa', + name: 'createMfaRecoveryCodes', + description: '/docs/references/account/create-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'account.createMFARecoveryCodes', + ), + ), + new Method( + namespace: 'account', + group: 'mfa', + name: 'createMFARecoveryCodes', + description: '/docs/references/account/create-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + contentType: ContentType::JSON + ) + ]) ->inject('response') ->inject('user') ->inject('dbForProject') @@ -4130,20 +4330,40 @@ App::patch('/v1/account/mfa/recovery-codes') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk', new Method( - namespace: 'account', - group: 'mfa', - name: 'updateMfaRecoveryCodes', - description: '/docs/references/account/update-mfa-recovery-codes.md', - auth: [AuthType::SESSION, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_MFA_RECOVERY_CODES, - ) - ], - contentType: ContentType::JSON - )) + ->label('sdk', [ + new Method( + namespace: 'account', + group: 'mfa', + name: 'updateMfaRecoveryCodes', + description: '/docs/references/account/update-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'account.updateMFARecoveryCodes', + ), + ), + new Method( + namespace: 'account', + group: 'mfa', + name: 'updateMFARecoveryCodes', + description: '/docs/references/account/update-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + contentType: ContentType::JSON + ) + ]) ->inject('dbForProject') ->inject('response') ->inject('user') @@ -4172,20 +4392,40 @@ App::get('/v1/account/mfa/recovery-codes') ->desc('List MFA recovery codes') ->groups(['api', 'account', 'mfaProtected']) ->label('scope', 'account') - ->label('sdk', new Method( - namespace: 'account', - group: 'mfa', - name: 'getMfaRecoveryCodes', - description: '/docs/references/account/get-mfa-recovery-codes.md', - auth: [AuthType::SESSION, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_MFA_RECOVERY_CODES, - ) - ], - contentType: ContentType::JSON - )) + ->label('sdk', [ + new Method( + namespace: 'account', + group: 'mfa', + name: 'getMfaRecoveryCodes', + description: '/docs/references/account/get-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'account.getMFARecoveryCodes', + ), + ), + new Method( + namespace: 'account', + group: 'mfa', + name: 'getMFARecoveryCodes', + description: '/docs/references/account/get-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + contentType: ContentType::JSON + ) + ]) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -4211,20 +4451,40 @@ App::delete('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk', new Method( - namespace: 'account', - group: 'mfa', - name: 'deleteMfaAuthenticator', - description: '/docs/references/account/delete-mfa-authenticator.md', - auth: [AuthType::SESSION, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_NOCONTENT, - model: Response::MODEL_NONE, - ) - ], - contentType: ContentType::NONE - )) + ->label('sdk', [ + new Method( + namespace: 'account', + group: 'mfa', + name: 'deleteMfaAuthenticator', + description: '/docs/references/account/delete-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'account.deleteMFAAuthenticator', + ), + ), + new Method( + namespace: 'account', + group: 'mfa', + name: 'deleteMFAAuthenticator', + description: '/docs/references/account/delete-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + ) + ]) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') ->inject('user') @@ -4257,20 +4517,40 @@ App::post('/v1/account/mfa/challenge') ->label('audits.event', 'challenge.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk', new Method( - namespace: 'account', - group: 'mfa', - name: 'createMfaChallenge', - description: '/docs/references/account/create-mfa-challenge.md', - auth: [], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_MFA_CHALLENGE, - ) - ], - contentType: ContentType::JSON, - )) + ->label('sdk', [ + new Method( + namespace: 'account', + group: 'mfa', + name: 'createMfaChallenge', + description: '/docs/references/account/create-mfa-challenge.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_CHALLENGE, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'account.createMFAChallenge', + ), + ), + new Method( + namespace: 'account', + group: 'mfa', + name: 'createMFAChallenge', + description: '/docs/references/account/create-mfa-challenge.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_CHALLENGE, + ) + ], + contentType: ContentType::JSON + ) + ]) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') ->param('factor', '', new WhiteList([Type::EMAIL, Type::PHONE, Type::TOTP, Type::RECOVERY_CODE]), 'Factor used for verification. Must be one of following: `' . Type::EMAIL . '`, `' . Type::PHONE . '`, `' . Type::TOTP . '`, `' . Type::RECOVERY_CODE . '`.') @@ -4288,7 +4568,7 @@ App::post('/v1/account/mfa/challenge') ->inject('plan') ->action(function (string $factor, Response $response, Database $dbForProject, Document $user, Locale $locale, Document $project, Request $request, Event $queueForEvents, Messaging $queueForMessaging, Mail $queueForMails, callable $timelimit, StatsUsage $queueForStatsUsage, array $plan) { - $expire = DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_CONFIRM); + $expire = DateTime::formatTz(DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_CONFIRM)); $code = Auth::codeGenerator(); $challenge = new Document([ 'userId' => $user->getId(), @@ -4379,6 +4659,7 @@ App::post('/v1/account/mfa/challenge') } $subject = $locale->getText("emails.mfaChallenge.subject"); + $preview = $locale->getText("emails.mfaChallenge.preview"); $customTemplate = $project->getAttribute('templates', [])['email.mfaChallenge-' . $locale->default] ?? []; $detector = new Detector($request->getUserAgent('UNKNOWN')); @@ -4455,6 +4736,7 @@ App::post('/v1/account/mfa/challenge') $queueForMails ->setSubject($subject) + ->setPreview($preview) ->setBody($body) ->setVariables($emailVariables) ->setRecipient($user->getAttribute('email')) @@ -4477,20 +4759,40 @@ App::put('/v1/account/mfa/challenge') ->label('audits.event', 'challenges.update') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk', new Method( - namespace: 'account', - group: 'mfa', - name: 'updateMfaChallenge', - description: '/docs/references/account/update-mfa-challenge.md', - auth: [AuthType::SESSION, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_SESSION, - ) - ], - contentType: ContentType::JSON - )) + ->label('sdk', [ + new Method( + namespace: 'account', + group: 'mfa', + name: 'updateMfaChallenge', + description: '/docs/references/account/update-mfa-challenge.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'account.updateMFAChallenge', + ), + ), + new Method( + namespace: 'account', + group: 'mfa', + name: 'updateMFAChallenge', + description: '/docs/references/account/update-mfa-challenge.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION, + ) + ], + contentType: ContentType::JSON + ) + ]) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},challengeId:{param-challengeId}') ->param('challengeId', '', new Text(256), 'ID of the challenge.') @@ -4549,7 +4851,7 @@ App::put('/v1/account/mfa/challenge') $factors = $session->getAttribute('factors', []); $factors[] = $type; - $factors = \array_unique($factors); + $factors = \array_values(\array_unique($factors)); $session ->setAttribute('factors', $factors) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 3a7b4aa582..90364d997e 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -10,6 +10,7 @@ use Appwrite\URL\URL as URLParse; use Appwrite\Utopia\Response; use chillerlan\QRCode\QRCode; use chillerlan\QRCode\QROptions; +use enshrined\svgSanitize\Sanitizer as SvgSanitizer; use Utopia\App; use Utopia\Config\Config; use Utopia\Database\Database; @@ -362,7 +363,8 @@ App::get('/v1/avatars/favicon') $client = new Client(); try { $res = $client - ->setAllowRedirects(false) + ->setAllowRedirects(true) + ->setMaxRedirects(5) ->setUserAgent(\sprintf( APP_USERAGENT, System::getEnv('_APP_VERSION', 'UNKNOWN'), @@ -373,15 +375,11 @@ App::get('/v1/avatars/favicon') throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED); } - if ($res->getStatusCode() !== 200) { - throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED); - } - $doc = new DOMDocument(); $doc->strictErrorChecking = false; @$doc->loadHTML($res->getBody()); - $links = $doc->getElementsByTagName('link'); + $links = $doc->getElementsByTagName('link') ?? []; $outputHref = ''; $outputExt = ''; $space = 0; @@ -399,6 +397,12 @@ App::get('/v1/avatars/favicon') $ext = \pathinfo(\parse_url($absolute, PHP_URL_PATH), PATHINFO_EXTENSION); switch ($ext) { + case 'svg': + // SVG icons are prioritized by assigning the maximum possible value. + $space = PHP_INT_MAX; + $outputHref = $absolute; + $outputExt = $ext; + break; case 'ico': case 'png': case 'jpg': @@ -437,7 +441,8 @@ App::get('/v1/avatars/favicon') $client = new Client(); try { $res = $client - ->setAllowRedirects(false) + ->setAllowRedirects(true) + ->setMaxRedirects(5) ->fetch($outputHref); } catch (\Throwable) { throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED); @@ -449,14 +454,33 @@ App::get('/v1/avatars/favicon') $data = $res->getBody(); - if ('ico' == $outputExt) { // Skip crop, Imagick isn\'t supporting icon files - if (empty($data) || (\mb_substr($data, 0, 5) === '<html') || \mb_substr($data, 0, 5) === '<!doc') { + if ('ico' === $outputExt) { // Skip crop, Imagick isn\'t supporting icon files + if ( + empty($data) || + stripos($data, '<html') === 0 || + stripos($data, '<!doc') === 0 + ) { throw new Exception(Exception::AVATAR_ICON_NOT_FOUND, 'Favicon not found'); } $response ->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days ->setContentType('image/x-icon') ->file($data); + return; + } + + if ('svg' === $outputExt) { // Skip crop, Imagick isn\'t supporting svg files + $sanitizer = new SvgSanitizer(); + $sanitizer->minify(true); + $cleanSvg = $sanitizer->sanitize($data); + if ($cleanSvg === false) { + throw new Exception(Exception::AVATAR_SVG_SANITIZATION_FAILED); + } + $response + ->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days + ->setContentType('image/svg+xml') + ->file($cleanSvg); + return; } $image = new Image($data); diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index 558dc0e4ef..b0619df3b3 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -71,6 +71,8 @@ App::get('/v1/console/variables') '_APP_DOMAIN_TARGET_CNAME' => System::getEnv('_APP_DOMAIN_TARGET_CNAME'), '_APP_DOMAIN_TARGET_AAAA' => System::getEnv('_APP_DOMAIN_TARGET_AAAA'), '_APP_DOMAIN_TARGET_A' => System::getEnv('_APP_DOMAIN_TARGET_A'), + // Combine CAA domain with most common flags and tag (no parameters) + '_APP_DOMAIN_TARGET_CAA' => '0 issue "' . System::getEnv('_APP_DOMAIN_TARGET_CAA') . '"', '_APP_STORAGE_LIMIT' => +System::getEnv('_APP_STORAGE_LIMIT'), '_APP_COMPUTE_SIZE_LIMIT' => +System::getEnv('_APP_COMPUTE_SIZE_LIMIT'), '_APP_USAGE_STATS' => System::getEnv('_APP_USAGE_STATS'), diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php deleted file mode 100644 index 4ff1c55fb3..0000000000 --- a/app/controllers/api/databases.php +++ /dev/null @@ -1,5169 +0,0 @@ -<?php - -use Appwrite\Auth\Auth; -use Appwrite\Detector\Detector; -use Appwrite\Event\Database as EventDatabase; -use Appwrite\Event\Event; -use Appwrite\Event\StatsUsage; -use Appwrite\Extend\Exception; -use Appwrite\Network\Validator\Email; -use Appwrite\SDK\AuthType; -use Appwrite\SDK\ContentType; -use Appwrite\SDK\Method; -use Appwrite\SDK\Parameter; -use Appwrite\SDK\Response as SDKResponse; -use Appwrite\Utopia\Database\Validator\CustomId; -use Appwrite\Utopia\Database\Validator\Queries\Attributes; -use Appwrite\Utopia\Database\Validator\Queries\Collections; -use Appwrite\Utopia\Database\Validator\Queries\Databases; -use Appwrite\Utopia\Database\Validator\Queries\Indexes; -use Appwrite\Utopia\Request; -use Appwrite\Utopia\Response; -use MaxMind\Db\Reader; -use Utopia\App; -use Utopia\Audit\Audit; -use Utopia\Config\Config; -use Utopia\Database\Database; -use Utopia\Database\DateTime; -use Utopia\Database\Document; -use Utopia\Database\Exception\Authorization as AuthorizationException; -use Utopia\Database\Exception\Conflict as ConflictException; -use Utopia\Database\Exception\Duplicate as DuplicateException; -use Utopia\Database\Exception\Index as IndexException; -use Utopia\Database\Exception\Limit as LimitException; -use Utopia\Database\Exception\NotFound as NotFoundException; -use Utopia\Database\Exception\Order as OrderException; -use Utopia\Database\Exception\Query as QueryException; -use Utopia\Database\Exception\Relationship as RelationshipException; -use Utopia\Database\Exception\Restricted as RestrictedException; -use Utopia\Database\Exception\Structure as StructureException; -use Utopia\Database\Exception\Truncate as TruncateException; -use Utopia\Database\Helpers\ID; -use Utopia\Database\Helpers\Permission; -use Utopia\Database\Helpers\Role; -use Utopia\Database\Query; -use Utopia\Database\Validator\Authorization; -use Utopia\Database\Validator\Datetime as DatetimeValidator; -use Utopia\Database\Validator\Index as IndexValidator; -use Utopia\Database\Validator\IndexDependency as IndexDependencyValidator; -use Utopia\Database\Validator\Key; -use Utopia\Database\Validator\Permissions; -use Utopia\Database\Validator\Queries; -use Utopia\Database\Validator\Query\Cursor; -use Utopia\Database\Validator\Query\Limit; -use Utopia\Database\Validator\Query\Offset; -use Utopia\Database\Validator\Structure; -use Utopia\Database\Validator\UID; -use Utopia\Locale\Locale; -use Utopia\Validator\ArrayList; -use Utopia\Validator\Boolean; -use Utopia\Validator\FloatValidator; -use Utopia\Validator\Integer; -use Utopia\Validator\IP; -use Utopia\Validator\JSON; -use Utopia\Validator\Nullable; -use Utopia\Validator\Range; -use Utopia\Validator\Text; -use Utopia\Validator\URL; -use Utopia\Validator\WhiteList; - -/** - * * Create attribute of varying type - * - * @param string $databaseId - * @param string $collectionId - * @param Document $attribute - * @param Response $response - * @param Database $dbForProject - * @param EventDatabase $queueForDatabase - * @param Event $queueForEvents - * @return Document Newly created attribute document - * @throws AuthorizationException - * @throws Exception - * @throws LimitException - * @throws RestrictedException - * @throws StructureException - * @throws \Utopia\Database\Exception - * @throws ConflictException - * @throws Exception - */ -function createAttribute(string $databaseId, string $collectionId, Document $attribute, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): Document -{ - $key = $attribute->getAttribute('key'); - $type = $attribute->getAttribute('type', ''); - $size = $attribute->getAttribute('size', 0); - $required = $attribute->getAttribute('required', true); - $signed = $attribute->getAttribute('signed', true); // integers are signed by default - $array = $attribute->getAttribute('array', false); - $format = $attribute->getAttribute('format', ''); - $formatOptions = $attribute->getAttribute('formatOptions', []); - $filters = $attribute->getAttribute('filters', []); // filters are hidden from the endpoint - $default = $attribute->getAttribute('default'); - $options = $attribute->getAttribute('options', []); - - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - if (!empty($format)) { - if (!Structure::hasFormat($format, $type)) { - throw new Exception(Exception::ATTRIBUTE_FORMAT_UNSUPPORTED, "Format {$format} not available for {$type} attributes."); - } - } - - // Must throw here since dbForProject->createAttribute is performed by db worker - if ($required && isset($default)) { - throw new Exception(Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED, 'Cannot set default value for required attribute'); - } - - if ($array && isset($default)) { - throw new Exception(Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED, 'Cannot set default value for array attributes'); - } - - if ($type === Database::VAR_RELATIONSHIP) { - $options['side'] = Database::RELATION_SIDE_PARENT; - $relatedCollection = $dbForProject->getDocument('database_' . $database->getSequence(), $options['relatedCollection'] ?? ''); - if ($relatedCollection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND, 'The related collection was not found.'); - } - } - - try { - $attribute = new Document([ - '$id' => ID::custom($database->getSequence() . '_' . $collection->getSequence() . '_' . $key), - 'key' => $key, - 'databaseInternalId' => $database->getSequence(), - 'databaseId' => $database->getId(), - 'collectionInternalId' => $collection->getSequence(), - 'collectionId' => $collectionId, - 'type' => $type, - 'status' => 'processing', // processing, available, failed, deleting, stuck - 'size' => $size, - 'required' => $required, - 'signed' => $signed, - 'default' => $default, - 'array' => $array, - 'format' => $format, - 'formatOptions' => $formatOptions, - 'filters' => $filters, - 'options' => $options, - ]); - - $dbForProject->checkAttribute($collection, $attribute); - $attribute = $dbForProject->createDocument('attributes', $attribute); - } catch (DuplicateException) { - throw new Exception(Exception::ATTRIBUTE_ALREADY_EXISTS); - } catch (LimitException) { - throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED); - } catch (\Throwable $e) { - $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); - $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); - throw $e; - } - - $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); - $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); - - if ($type === Database::VAR_RELATIONSHIP && $options['twoWay']) { - $twoWayKey = $options['twoWayKey']; - $options['relatedCollection'] = $collection->getId(); - $options['twoWayKey'] = $key; - $options['side'] = Database::RELATION_SIDE_CHILD; - - try { - try { - $twoWayAttribute = new Document([ - '$id' => ID::custom($database->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $twoWayKey), - 'key' => $twoWayKey, - 'databaseInternalId' => $database->getSequence(), - 'databaseId' => $database->getId(), - 'collectionInternalId' => $relatedCollection->getSequence(), - 'collectionId' => $relatedCollection->getId(), - 'type' => $type, - 'status' => 'processing', // processing, available, failed, deleting, stuck - 'size' => $size, - 'required' => $required, - 'signed' => $signed, - 'default' => $default, - 'array' => $array, - 'format' => $format, - 'formatOptions' => $formatOptions, - 'filters' => $filters, - 'options' => $options, - ]); - - $dbForProject->checkAttribute($relatedCollection, $twoWayAttribute); - $dbForProject->createDocument('attributes', $twoWayAttribute); - } catch (DuplicateException) { - throw new Exception(Exception::DOCUMENT_ALREADY_EXISTS); - } catch (LimitException) { - throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED); - } catch (StructureException $e) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); - } - } catch (\Throwable $e) { - $dbForProject->deleteDocument('attributes', $attribute->getId()); - throw $e; - } finally { - $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); - $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); - } - - // If operation succeeded, purge the cache for the related collection too - $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $relatedCollection->getId()); - $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence()); - } - - $queueForDatabase - ->setType(DATABASE_TYPE_CREATE_ATTRIBUTE) - ->setDatabase($database) - ->setCollection($collection) - ->setDocument($attribute); - - $queueForEvents - ->setContext('collection', $collection) - ->setContext('database', $database) - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setParam('attributeId', $attribute->getId()); - - $response->setStatusCode(Response::STATUS_CODE_CREATED); - - return $attribute; -} - -function updateAttribute( - string $databaseId, - string $collectionId, - string $key, - Database $dbForProject, - Event $queueForEvents, - string $type, - int $size = null, - string $filter = null, - string|bool|int|float $default = null, - bool $required = null, - int|float|null $min = null, - int|float|null $max = null, - array $elements = null, - array $options = [], - string $newKey = null, -): Document { - $database = $dbForProject->getDocument('databases', $databaseId); - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $attribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $collection->getSequence() . '_' . $key); - if ($attribute->isEmpty()) { - throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); - } - - if ($attribute->getAttribute('status') !== 'available') { - throw new Exception(Exception::ATTRIBUTE_NOT_AVAILABLE); - } - - if ($attribute->getAttribute(('type') !== $type)) { - throw new Exception(Exception::ATTRIBUTE_TYPE_INVALID); - } - - if ($attribute->getAttribute('type') === Database::VAR_STRING && $attribute->getAttribute(('filter') !== $filter)) { - throw new Exception(Exception::ATTRIBUTE_TYPE_INVALID); - } - - if ($required && isset($default)) { - throw new Exception(Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED, 'Cannot set default value for required attribute'); - } - - if ($attribute->getAttribute('array', false) && isset($default)) { - throw new Exception(Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED, 'Cannot set default value for array attributes'); - } - - $collectionId = 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(); - - $attribute - ->setAttribute('default', $default) - ->setAttribute('required', $required); - - if (!empty($size)) { - $attribute->setAttribute('size', $size); - } - - switch ($attribute->getAttribute('format')) { - case APP_DATABASE_ATTRIBUTE_INT_RANGE: - case APP_DATABASE_ATTRIBUTE_FLOAT_RANGE: - $min ??= $attribute->getAttribute('formatOptions')['min']; - $max ??= $attribute->getAttribute('formatOptions')['max']; - - if ($min > $max) { - throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Minimum value must be lesser than maximum value'); - } - - if ($attribute->getAttribute('format') === APP_DATABASE_ATTRIBUTE_INT_RANGE) { - $validator = new Range($min, $max, Database::VAR_INTEGER); - } else { - $validator = new Range($min, $max, Database::VAR_FLOAT); - - if (!is_null($default)) { - $default = \floatval($default); - } - } - - if (!is_null($default) && !$validator->isValid($default)) { - throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, $validator->getDescription()); - } - - $options = [ - 'min' => $min, - 'max' => $max - ]; - $attribute->setAttribute('formatOptions', $options); - - break; - case APP_DATABASE_ATTRIBUTE_ENUM: - if (empty($elements)) { - throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Enum elements must not be empty'); - } - - foreach ($elements as $element) { - if (\strlen($element) === 0) { - throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Each enum element must not be empty'); - } - } - - if (!is_null($default) && !in_array($default, $elements)) { - throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Default value not found in elements'); - } - - $options = [ - 'elements' => $elements - ]; - - $attribute->setAttribute('formatOptions', $options); - - break; - } - - if ($type === Database::VAR_RELATIONSHIP) { - $primaryDocumentOptions = \array_merge($attribute->getAttribute('options', []), $options); - $attribute->setAttribute('options', $primaryDocumentOptions); - try { - $dbForProject->updateRelationship( - collection: $collectionId, - id: $key, - newKey: $newKey, - onDelete: $primaryDocumentOptions['onDelete'], - ); - } catch (IndexException) { - throw new Exception(Exception::INDEX_INVALID); - } catch (LimitException) { - throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED); - } catch (RelationshipException $e) { - throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); - } catch (StructureException $e) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); - } - - if ($primaryDocumentOptions['twoWay']) { - $relatedCollection = $dbForProject->getDocument('database_' . $database->getSequence(), $primaryDocumentOptions['relatedCollection']); - $relatedAttribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $primaryDocumentOptions['twoWayKey']); - - if (!empty($newKey) && $newKey !== $key) { - $options['twoWayKey'] = $newKey; - } - - $relatedOptions = \array_merge($relatedAttribute->getAttribute('options'), $options); - $relatedAttribute->setAttribute('options', $relatedOptions); - - - $dbForProject->updateDocument('attributes', $database->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $primaryDocumentOptions['twoWayKey'], $relatedAttribute); - $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $relatedCollection->getId()); - } - } else { - try { - $dbForProject->updateAttribute( - collection: $collectionId, - id: $key, - size: $size, - required: $required, - default: $default, - formatOptions: $options, - newKey: $newKey ?? null - ); - } catch (DuplicateException) { - throw new Exception(Exception::DOCUMENT_ALREADY_EXISTS); - } catch (IndexException $e) { - throw new Exception(Exception::INDEX_INVALID, $e->getMessage()); - } catch (LimitException) { - throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED); - } catch (TruncateException) { - throw new Exception(Exception::ATTRIBUTE_INVALID_RESIZE); - } - } - - if (!empty($newKey) && $key !== $newKey) { - $originalUid = $attribute->getId(); - - $attribute - ->setAttribute('$id', ID::custom($database->getSequence() . '_' . $collection->getSequence() . '_' . $newKey)) - ->setAttribute('key', $newKey); - - try { - $dbForProject->updateDocument('attributes', $originalUid, $attribute); - } catch (DuplicateException) { - throw new Exception(Exception::DOCUMENT_ALREADY_EXISTS); - } - - /** - * @var Document $index - */ - foreach ($collection->getAttribute('indexes') as $index) { - /** - * @var string[] $attributes - */ - $attributes = $index->getAttribute('attributes', []); - $found = \array_search($key, $attributes); - - if ($found !== false) { - $attributes[$found] = $newKey; - $index->setAttribute('attributes', $attributes); - $dbForProject->updateDocument('indexes', $index->getId(), $index); - } - } - } else { - $attribute = $dbForProject->updateDocument('attributes', $database->getSequence() . '_' . $collection->getSequence() . '_' . $key, $attribute); - } - - $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collection->getId()); - - $queueForEvents - ->setContext('collection', $collection) - ->setContext('database', $database) - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setParam('attributeId', $attribute->getId()); - - return $attribute; -} - -App::init() - ->groups(['api', 'database']) - ->inject('request') - ->inject('dbForProject') - ->action(function (Request $request, Database $dbForProject) { - $timeout = \intval($request->getHeader('x-appwrite-timeout')); - - if (!empty($timeout) && App::isDevelopment()) { - $dbForProject->setTimeout($timeout); - } - }); - -App::post('/v1/databases') - ->desc('Create database') - ->groups(['api', 'database']) - ->label('event', 'databases.[databaseId].create') - ->label('scope', 'databases.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'database.create') - ->label('audits.resource', 'database/{response.$id}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'databases', - name: 'create', - description: '/docs/references/databases/create.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_DATABASE, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') - ->param('name', '', new Text(128), 'Database name. Max length: 128 chars.') - ->param('enabled', true, new Boolean(), 'Is the database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $name, bool $enabled, Response $response, Database $dbForProject, Event $queueForEvents) { - - $databaseId = $databaseId === 'unique()' - ? ID::unique() - : $databaseId; - - try { - $dbForProject->createDocument('databases', new Document([ - '$id' => $databaseId, - 'name' => $name, - 'enabled' => $enabled, - 'search' => implode(' ', [$databaseId, $name]), - ])); - } catch (DuplicateException) { - throw new Exception(Exception::DATABASE_ALREADY_EXISTS); - } catch (StructureException $e) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); - } - - $database = $dbForProject->getDocument('databases', $databaseId); - - $collections = (Config::getParam('collections', [])['databases'] ?? [])['collections'] ?? []; - if (empty($collections)) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, 'The "collections" collection is not configured.'); - } - - $attributes = []; - foreach ($collections['attributes'] as $attribute) { - $attributes[] = new Document($attribute); - } - - $indexes = []; - foreach ($collections['indexes'] as $index) { - $indexes[] = new Document($index); - } - - try { - $dbForProject->createCollection('database_' . $database->getSequence(), $attributes, $indexes); - } catch (DuplicateException) { - throw new Exception(Exception::DATABASE_ALREADY_EXISTS); - } catch (IndexException) { - throw new Exception(Exception::INDEX_INVALID); - } catch (LimitException) { - throw new Exception(Exception::COLLECTION_LIMIT_EXCEEDED); - } - - $queueForEvents->setParam('databaseId', $database->getId()); - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic($database, Response::MODEL_DATABASE); - }); - -App::get('/v1/databases') - ->desc('List databases') - ->groups(['api', 'database']) - ->label('scope', 'databases.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'databases', - name: 'list', - description: '/docs/references/databases/list.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_DATABASE_LIST, - ) - ], - contentType: ContentType::JSON - )) - ->param('queries', [], new Databases(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Databases::ALLOWED_ATTRIBUTES), true) - ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) - ->inject('response') - ->inject('dbForProject') - ->action(function (array $queries, string $search, Response $response, Database $dbForProject) { - $queries = Query::parseQueries($queries); - - if (!empty($search)) { - $queries[] = Query::search('search', $search); - } - - /** - * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries - */ - $cursor = \array_filter($queries, function ($query) { - return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); - }); - - $cursor = reset($cursor); - if ($cursor) { - /** @var Query $cursor */ - - $validator = new Cursor(); - if (!$validator->isValid($cursor)) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); - } - - $databaseId = $cursor->getValue(); - - $cursorDocument = $dbForProject->getDocument('databases', $databaseId); - if ($cursorDocument->isEmpty()) { - throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Database '{$databaseId}' for the 'cursor' value not found."); - } - - $cursor->setValue($cursorDocument); - } - - try { - $databases = $dbForProject->find('databases', $queries); - $total = $dbForProject->count('databases', $queries, APP_LIMIT_COUNT); - } catch (OrderException) { - throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL); - } catch (QueryException) { - throw new Exception(Exception::GENERAL_QUERY_INVALID); - } - - $response->dynamic(new Document([ - 'databases' => $databases, - 'total' => $total, - ]), Response::MODEL_DATABASE_LIST); - }); - -App::get('/v1/databases/:databaseId') - ->desc('Get database') - ->groups(['api', 'database']) - ->label('scope', 'databases.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'databases', - name: 'get', - description: '/docs/references/databases/get.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_DATABASE, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->inject('response') - ->inject('dbForProject') - ->action(function (string $databaseId, Response $response, Database $dbForProject) { - $database = $dbForProject->getDocument('databases', $databaseId); - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $response->dynamic($database, Response::MODEL_DATABASE); - }); - -App::get('/v1/databases/:databaseId/logs') - ->desc('List database logs') - ->groups(['api', 'database']) - ->label('scope', 'databases.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'logs', - name: 'listLogs', - description: '/docs/references/databases/get-logs.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_LOG_LIST, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) - ->inject('response') - ->inject('dbForProject') - ->inject('locale') - ->inject('geodb') - ->action(function (string $databaseId, array $queries, Response $response, Database $dbForProject, Locale $locale, Reader $geodb) { - $database = $dbForProject->getDocument('databases', $databaseId); - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - // Temp fix for logs - $queries[] = Query::or([ - Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))), - Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))), - ]); - - $audit = new Audit($dbForProject); - $resource = 'database/' . $databaseId; - $logs = $audit->getLogsByResource($resource, $queries); - - $output = []; - - foreach ($logs as $i => &$log) { - $log['userAgent'] = (!empty($log['userAgent'])) ? $log['userAgent'] : 'UNKNOWN'; - - $detector = new Detector($log['userAgent']); - $detector->skipBotDetection(); // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) - - $os = $detector->getOS(); - $client = $detector->getClient(); - $device = $detector->getDevice(); - - $output[$i] = new Document([ - 'event' => $log['event'], - 'userId' => ID::custom($log['data']['userId']), - 'userEmail' => $log['data']['userEmail'] ?? null, - 'userName' => $log['data']['userName'] ?? null, - 'mode' => $log['data']['mode'] ?? null, - 'ip' => $log['ip'], - 'time' => $log['time'], - 'osCode' => $os['osCode'], - 'osName' => $os['osName'], - 'osVersion' => $os['osVersion'], - 'clientType' => $client['clientType'], - 'clientCode' => $client['clientCode'], - 'clientName' => $client['clientName'], - 'clientVersion' => $client['clientVersion'], - 'clientEngine' => $client['clientEngine'], - 'clientEngineVersion' => $client['clientEngineVersion'], - 'deviceName' => $device['deviceName'], - 'deviceBrand' => $device['deviceBrand'], - 'deviceModel' => $device['deviceModel'] - ]); - - $record = $geodb->get($log['ip']); - - if ($record) { - $output[$i]['countryCode'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), false) ? \strtolower($record['country']['iso_code']) : '--'; - $output[$i]['countryName'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), $locale->getText('locale.country.unknown')); - } else { - $output[$i]['countryCode'] = '--'; - $output[$i]['countryName'] = $locale->getText('locale.country.unknown'); - } - } - - $response->dynamic(new Document([ - 'total' => $audit->countLogsByResource($resource, $queries), - 'logs' => $output, - ]), Response::MODEL_LOG_LIST); - }); - - -App::put('/v1/databases/:databaseId') - ->desc('Update database') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'databases.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].update') - ->label('audits.event', 'database.update') - ->label('audits.resource', 'database/{response.$id}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'databases', - name: 'update', - description: '/docs/references/databases/update.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_DATABASE, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('name', null, new Text(128), 'Database name. Max length: 128 chars.') - ->param('enabled', true, new Boolean(), 'Is database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $name, bool $enabled, Response $response, Database $dbForProject, Event $queueForEvents) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $database - ->setAttribute('name', $name) - ->setAttribute('enabled', $enabled) - ->setAttribute('search', implode(' ', [$databaseId, $name])); - - $database = $dbForProject->updateDocument('databases', $databaseId, $database); - - $queueForEvents->setParam('databaseId', $database->getId()); - - $response->dynamic($database, Response::MODEL_DATABASE); - }); - -App::delete('/v1/databases/:databaseId') - ->desc('Delete database') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'databases.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].delete') - ->label('audits.event', 'database.delete') - ->label('audits.resource', 'database/{request.databaseId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'databases', - name: 'delete', - description: '/docs/references/databases/delete.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_NOCONTENT, - model: Response::MODEL_NONE, - ) - ], - contentType: ContentType::NONE - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - if (!$dbForProject->deleteDocument('databases', $databaseId)) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove database from database'); - } - - $dbForProject->purgeCachedDocument('databases', $database->getId()); - $dbForProject->purgeCachedCollection('databases_' . $database->getSequence()); - - $queueForDatabase - ->setType(DATABASE_TYPE_DELETE_DATABASE) - ->setDatabase($database); - - $queueForEvents - ->setParam('databaseId', $database->getId()) - ->setPayload($response->output($database, Response::MODEL_DATABASE)); - - $response->noContent(); - }); - -App::post('/v1/databases/:databaseId/collections') - ->desc('Create collection') - ->groups(['api', 'database']) - ->label('event', 'databases.[databaseId].collections.[collectionId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'collection.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{response.$id}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'collections', - name: 'createCollection', - description: '/docs/references/databases/create-collection.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_COLLECTION, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') - ->param('name', '', new Text(128), 'Collection name. Max length: 128 chars.') - ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) - ->param('documentSecurity', false, new Boolean(true), 'Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) - ->param('enabled', true, new Boolean(), 'Is collection enabled? When set to \'disabled\', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('mode') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $name, ?array $permissions, bool $documentSecurity, bool $enabled, Response $response, Database $dbForProject, string $mode, Event $queueForEvents) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collectionId = $collectionId === 'unique()' - ? ID::unique() - : $collectionId; - - // Map aggregate permissions into the multiple permissions they represent. - $permissions = Permission::aggregate($permissions) ?? []; - - try { - $collection = $dbForProject->createDocument('database_' . $database->getSequence(), new Document([ - '$id' => $collectionId, - 'databaseInternalId' => $database->getSequence(), - 'databaseId' => $databaseId, - '$permissions' => $permissions, - 'documentSecurity' => $documentSecurity, - 'enabled' => $enabled, - 'name' => $name, - 'search' => implode(' ', [$collectionId, $name]), - ])); - } catch (DuplicateException) { - throw new Exception(Exception::COLLECTION_ALREADY_EXISTS); - } catch (LimitException) { - throw new Exception(Exception::COLLECTION_LIMIT_EXCEEDED); - } catch (NotFoundException) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - try { - $dbForProject->createCollection( - id: 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), - permissions: $permissions, - documentSecurity: $documentSecurity - ); - } catch (DuplicateException) { - throw new Exception(Exception::COLLECTION_ALREADY_EXISTS); - } catch (IndexException) { - throw new Exception(Exception::INDEX_INVALID); - } catch (LimitException) { - throw new Exception(Exception::COLLECTION_LIMIT_EXCEEDED); - } - - $queueForEvents - ->setContext('database', $database) - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()); - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic($collection, Response::MODEL_COLLECTION); - }); - -App::get('/v1/databases/:databaseId/collections') - ->alias('/v1/database/collections') - ->desc('List collections') - ->groups(['api', 'database']) - ->label('scope', 'collections.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'collections', - name: 'listCollections', - description: '/docs/references/databases/list-collections.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_COLLECTION_LIST, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('queries', [], new Collections(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Collections::ALLOWED_ATTRIBUTES), true) - ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) - ->inject('response') - ->inject('dbForProject') - ->action(function (string $databaseId, array $queries, string $search, Response $response, Database $dbForProject) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - if (!empty($search)) { - $queries[] = Query::search('search', $search); - } - - /** - * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries - */ - $cursor = \array_filter($queries, function ($query) { - return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); - }); - $cursor = reset($cursor); - if ($cursor) { - /** @var Query $cursor */ - - $validator = new Cursor(); - if (!$validator->isValid($cursor)) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); - } - - $collectionId = $cursor->getValue(); - - $cursorDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - - if ($cursorDocument->isEmpty()) { - throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Collection '{$collectionId}' for the 'cursor' value not found."); - } - - $cursor->setValue($cursorDocument); - } - - $collectionId = 'database_' . $database->getSequence(); - - try { - $collections = $dbForProject->find($collectionId, $queries); - $total = $dbForProject->count($collectionId, $queries, APP_LIMIT_COUNT); - } catch (OrderException) { - throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL); - } catch (QueryException) { - throw new Exception(Exception::GENERAL_QUERY_INVALID); - } - - $response->dynamic(new Document([ - 'collections' => $collections, - 'total' => $total, - ]), Response::MODEL_COLLECTION_LIST); - }); - -App::get('/v1/databases/:databaseId/collections/:collectionId') - ->alias('/v1/database/collections/:collectionId') - ->desc('Get collection') - ->groups(['api', 'database']) - ->label('scope', 'collections.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'collections', - name: 'getCollection', - description: '/docs/references/databases/get-collection.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_COLLECTION, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID.') - ->inject('response') - ->inject('dbForProject') - ->action(function (string $databaseId, string $collectionId, Response $response, Database $dbForProject) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $response->dynamic($collection, Response::MODEL_COLLECTION); - }); - -App::get('/v1/databases/:databaseId/collections/:collectionId/logs') - ->alias('/v1/database/collections/:collectionId/logs') - ->desc('List collection logs') - ->groups(['api', 'database']) - ->label('scope', 'collections.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'collections', - name: 'listCollectionLogs', - description: '/docs/references/databases/get-collection-logs.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_LOG_LIST, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID.') - ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) - ->inject('response') - ->inject('dbForProject') - ->inject('locale') - ->inject('geodb') - ->action(function (string $databaseId, string $collectionId, array $queries, Response $response, Database $dbForProject, Locale $locale, Reader $geodb) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collectionDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - $collection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $collectionDocument->getSequence()); - - if ($collectionDocument->isEmpty() || $collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - // Temp fix for logs - $queries[] = Query::or([ - Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))), - Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))), - ]); - - $audit = new Audit($dbForProject); - $resource = 'database/' . $databaseId . '/collection/' . $collectionId; - $logs = $audit->getLogsByResource($resource, $queries); - - $output = []; - - foreach ($logs as $i => &$log) { - $log['userAgent'] = (!empty($log['userAgent'])) ? $log['userAgent'] : 'UNKNOWN'; - - $detector = new Detector($log['userAgent']); - $detector->skipBotDetection(); // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) - - $os = $detector->getOS(); - $client = $detector->getClient(); - $device = $detector->getDevice(); - - $output[$i] = new Document([ - 'event' => $log['event'], - 'userId' => $log['data']['userId'], - 'userEmail' => $log['data']['userEmail'] ?? null, - 'userName' => $log['data']['userName'] ?? null, - 'mode' => $log['data']['mode'] ?? null, - 'ip' => $log['ip'], - 'time' => $log['time'], - 'osCode' => $os['osCode'], - 'osName' => $os['osName'], - 'osVersion' => $os['osVersion'], - 'clientType' => $client['clientType'], - 'clientCode' => $client['clientCode'], - 'clientName' => $client['clientName'], - 'clientVersion' => $client['clientVersion'], - 'clientEngine' => $client['clientEngine'], - 'clientEngineVersion' => $client['clientEngineVersion'], - 'deviceName' => $device['deviceName'], - 'deviceBrand' => $device['deviceBrand'], - 'deviceModel' => $device['deviceModel'] - ]); - - $record = $geodb->get($log['ip']); - - if ($record) { - $output[$i]['countryCode'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), false) ? \strtolower($record['country']['iso_code']) : '--'; - $output[$i]['countryName'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), $locale->getText('locale.country.unknown')); - } else { - $output[$i]['countryCode'] = '--'; - $output[$i]['countryName'] = $locale->getText('locale.country.unknown'); - } - } - - $response->dynamic(new Document([ - 'total' => $audit->countLogsByResource($resource, $queries), - 'logs' => $output, - ]), Response::MODEL_LOG_LIST); - }); - - -App::put('/v1/databases/:databaseId/collections/:collectionId') - ->alias('/v1/database/collections/:collectionId') - ->desc('Update collection') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].update') - ->label('audits.event', 'collection.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'collections', - name: 'updateCollection', - description: '/docs/references/databases/update-collection.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_COLLECTION, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID.') - ->param('name', null, new Text(128), 'Collection name. Max length: 128 chars.') - ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) - ->param('documentSecurity', false, new Boolean(true), 'Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) - ->param('enabled', true, new Boolean(), 'Is collection enabled? When set to \'disabled\', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('mode') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $name, ?array $permissions, bool $documentSecurity, bool $enabled, Response $response, Database $dbForProject, string $mode, Event $queueForEvents) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $permissions ??= $collection->getPermissions() ?? []; - - // Map aggregate permissions into the multiple permissions they represent. - $permissions = Permission::aggregate($permissions); - - $enabled ??= $collection->getAttribute('enabled', true); - - $collection - ->setAttribute('name', $name) - ->setAttribute('$permissions', $permissions) - ->setAttribute('documentSecurity', $documentSecurity) - ->setAttribute('enabled', $enabled) - ->setAttribute('search', \implode(' ', [$collectionId, $name])); - - $collection = $dbForProject->updateDocument( - 'database_' . $database->getSequence(), - $collectionId, - $collection - ); - - $dbForProject->updateCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $permissions, $documentSecurity); - - $queueForEvents - ->setContext('database', $database) - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()); - - $response->dynamic($collection, Response::MODEL_COLLECTION); - }); - -App::delete('/v1/databases/:databaseId/collections/:collectionId') - ->alias('/v1/database/collections/:collectionId') - ->desc('Delete collection') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].delete') - ->label('audits.event', 'collection.delete') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'collections', - name: 'deleteCollection', - description: '/docs/references/databases/delete-collection.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_NOCONTENT, - model: Response::MODEL_NONE, - ) - ], - contentType: ContentType::NONE - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID.') - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - if (!$dbForProject->deleteDocument('database_' . $database->getSequence(), $collectionId)) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove collection from DB'); - } - - $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); - - $queueForDatabase - ->setType(DATABASE_TYPE_DELETE_COLLECTION) - ->setDatabase($database) - ->setCollection($collection); - - $queueForEvents - ->setContext('database', $database) - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setPayload($response->output($collection, Response::MODEL_COLLECTION)); - - $response->noContent(); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string') - ->alias('/v1/database/collections/:collectionId/attributes/string') - ->desc('Create string attribute') - ->groups(['api', 'database', 'schema']) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'attribute.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'createStringAttribute', - description: '/docs/references/databases/create-string-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_ACCEPTED, - model: Response::MODEL_ATTRIBUTE_STRING - ) - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('size', null, new Range(1, APP_DATABASE_ATTRIBUTE_STRING_MAX_LENGTH, Range::TYPE_INTEGER), 'Attribute size for text attributes, in number of characters.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Text(0, 0), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) - ->param('encrypt', false, new Boolean(), 'Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->inject('plan') - ->action(function (string $databaseId, string $collectionId, string $key, ?int $size, ?bool $required, ?string $default, bool $array, bool $encrypt, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, array $plan) { - if ($encrypt && !empty($plan) && !($plan['databasesAllowEncrypt'] ?? false)) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Encrypted string attributes are not available on your plan. Please upgrade to create encrypted string attributes.'); - } - if ($encrypt && $size < APP_DATABASE_ENCRYPT_SIZE_MIN) { - throw new Exception( - Exception::GENERAL_BAD_REQUEST, - "Size too small. Encrypted strings require a minimum size of " . APP_DATABASE_ENCRYPT_SIZE_MIN . " characters." - ); - } - // Ensure attribute default is within required size - $validator = new Text($size, 0); - if (!is_null($default) && !$validator->isValid($default)) { - throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, $validator->getDescription()); - } - - $filters = []; - if ($encrypt) { - $filters[] = 'encrypt'; - } - - $attribute = createAttribute($databaseId, $collectionId, new Document([ - 'key' => $key, - 'type' => Database::VAR_STRING, - 'size' => $size, - 'required' => $required, - 'default' => $default, - 'array' => $array, - 'filters' => $filters, - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); - $attribute->setAttribute('encrypt', $encrypt); - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_STRING); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email') - ->alias('/v1/database/collections/:collectionId/attributes/email') - ->desc('Create email attribute') - ->groups(['api', 'database', 'schema']) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'attribute.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'createEmailAttribute', - description: '/docs/references/databases/create-email-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_ACCEPTED, - model: Response::MODEL_ATTRIBUTE_EMAIL, - ) - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Email(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - $attribute = createAttribute($databaseId, $collectionId, new Document([ - 'key' => $key, - 'type' => Database::VAR_STRING, - 'size' => 254, - 'required' => $required, - 'default' => $default, - 'array' => $array, - 'format' => APP_DATABASE_ATTRIBUTE_EMAIL, - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); - - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_EMAIL); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum') - ->alias('/v1/database/collections/:collectionId/attributes/enum') - ->desc('Create enum attribute') - ->groups(['api', 'database', 'schema']) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'attribute.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'createEnumAttribute', - description: '/docs/references/databases/create-attribute-enum.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_ACCEPTED, - model: Response::MODEL_ATTRIBUTE_ENUM, - ) - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('elements', [], new ArrayList(new Text(DATABASE::LENGTH_KEY), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' elements are allowed, each ' . DATABASE::LENGTH_KEY . ' characters long.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Text(0), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, array $elements, ?bool $required, ?string $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - if (!is_null($default) && !in_array($default, $elements)) { - throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Default value not found in elements'); - } - - $attribute = createAttribute($databaseId, $collectionId, new Document([ - 'key' => $key, - 'type' => Database::VAR_STRING, - 'size' => Database::LENGTH_KEY, - 'required' => $required, - 'default' => $default, - 'array' => $array, - 'format' => APP_DATABASE_ATTRIBUTE_ENUM, - 'formatOptions' => ['elements' => $elements], - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); - - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_ENUM); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip') - ->alias('/v1/database/collections/:collectionId/attributes/ip') - ->desc('Create IP address attribute') - ->groups(['api', 'database', 'schema']) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'attribute.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'createIpAttribute', - description: '/docs/references/databases/create-ip-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_ACCEPTED, - model: Response::MODEL_ATTRIBUTE_IP, - ) - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new IP(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - $attribute = createAttribute($databaseId, $collectionId, new Document([ - 'key' => $key, - 'type' => Database::VAR_STRING, - 'size' => 39, - 'required' => $required, - 'default' => $default, - 'array' => $array, - 'format' => APP_DATABASE_ATTRIBUTE_IP, - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); - - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_IP); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url') - ->alias('/v1/database/collections/:collectionId/attributes/url') - ->desc('Create URL attribute') - ->groups(['api', 'database', 'schema']) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'attribute.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'createUrlAttribute', - description: '/docs/references/databases/create-url-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_ACCEPTED, - model: Response::MODEL_ATTRIBUTE_URL, - ) - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new URL(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - $attribute = createAttribute($databaseId, $collectionId, new Document([ - 'key' => $key, - 'type' => Database::VAR_STRING, - 'size' => 2000, - 'required' => $required, - 'default' => $default, - 'array' => $array, - 'format' => APP_DATABASE_ATTRIBUTE_URL, - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); - - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_URL); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/integer') - ->alias('/v1/database/collections/:collectionId/attributes/integer') - ->desc('Create integer attribute') - ->groups(['api', 'database', 'schema']) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'attribute.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'createIntegerAttribute', - description: '/docs/references/databases/create-integer-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_ACCEPTED, - model: Response::MODEL_ATTRIBUTE_INTEGER, - ) - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('min', null, new Integer(), 'Minimum value to enforce on new documents', true) - ->param('max', null, new Integer(), 'Maximum value to enforce on new documents', true) - ->param('default', null, new Integer(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?int $min, ?int $max, ?int $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - // Ensure attribute default is within range - $min ??= PHP_INT_MIN; - $max ??= PHP_INT_MAX; - - if ($min > $max) { - throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Minimum value must be lesser than maximum value'); - } - - $validator = new Range($min, $max, Database::VAR_INTEGER); - - if (!is_null($default) && !$validator->isValid($default)) { - throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, $validator->getDescription()); - } - - $size = $max > 2147483647 ? 8 : 4; // Automatically create BigInt depending on max value - - $attribute = createAttribute($databaseId, $collectionId, new Document([ - 'key' => $key, - 'type' => Database::VAR_INTEGER, - 'size' => $size, - 'required' => $required, - 'default' => $default, - 'array' => $array, - 'format' => APP_DATABASE_ATTRIBUTE_INT_RANGE, - 'formatOptions' => [ - 'min' => $min, - 'max' => $max, - ], - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); - - $formatOptions = $attribute->getAttribute('formatOptions', []); - - if (!empty($formatOptions)) { - $attribute->setAttribute('min', \intval($formatOptions['min'])); - $attribute->setAttribute('max', \intval($formatOptions['max'])); - } - - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_INTEGER); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float') - ->alias('/v1/database/collections/:collectionId/attributes/float') - ->desc('Create float attribute') - ->groups(['api', 'database', 'schema']) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'attribute.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'createFloatAttribute', - description: '/docs/references/databases/create-float-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_ACCEPTED, - model: Response::MODEL_ATTRIBUTE_FLOAT, - ) - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('min', null, new FloatValidator(), 'Minimum value to enforce on new documents', true) - ->param('max', null, new FloatValidator(), 'Maximum value to enforce on new documents', true) - ->param('default', null, new FloatValidator(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?float $min, ?float $max, ?float $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - // Ensure attribute default is within range - $min ??= -PHP_FLOAT_MAX; - $max ??= PHP_FLOAT_MAX; - - if ($min > $max) { - throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Minimum value must be lesser than maximum value'); - } - - $validator = new Range($min, $max, Database::VAR_FLOAT); - - if (!\is_null($default) && !$validator->isValid($default)) { - throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, $validator->getDescription()); - } - - $attribute = createAttribute($databaseId, $collectionId, new Document([ - 'key' => $key, - 'type' => Database::VAR_FLOAT, - 'required' => $required, - 'size' => 0, - 'default' => $default, - 'array' => $array, - 'format' => APP_DATABASE_ATTRIBUTE_FLOAT_RANGE, - 'formatOptions' => [ - 'min' => $min, - 'max' => $max, - ], - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); - - $formatOptions = $attribute->getAttribute('formatOptions', []); - - if (!empty($formatOptions)) { - $attribute->setAttribute('min', \floatval($formatOptions['min'])); - $attribute->setAttribute('max', \floatval($formatOptions['max'])); - } - - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_FLOAT); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolean') - ->alias('/v1/database/collections/:collectionId/attributes/boolean') - ->desc('Create boolean attribute') - ->groups(['api', 'database', 'schema']) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'attribute.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'createBooleanAttribute', - description: '/docs/references/databases/create-boolean-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_ACCEPTED, - model: Response::MODEL_ATTRIBUTE_BOOLEAN, - ) - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Boolean(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?bool $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - $attribute = createAttribute($databaseId, $collectionId, new Document([ - 'key' => $key, - 'type' => Database::VAR_BOOLEAN, - 'size' => 0, - 'required' => $required, - 'default' => $default, - 'array' => $array, - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); - - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_BOOLEAN); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/datetime') - ->alias('/v1/database/collections/:collectionId/attributes/datetime') - ->desc('Create datetime attribute') - ->groups(['api', 'database']) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'attribute.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'createDatetimeAttribute', - description: '/docs/references/databases/create-datetime-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_ACCEPTED, - model: Response::MODEL_ATTRIBUTE_DATETIME, - ) - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, fn (Database $dbForProject) => new DatetimeValidator($dbForProject->getAdapter()->getMinDateTime(), $dbForProject->getAdapter()->getMaxDateTime()), 'Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.', true, ['dbForProject']) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - $filters[] = 'datetime'; - - $attribute = createAttribute($databaseId, $collectionId, new Document([ - 'key' => $key, - 'type' => Database::VAR_DATETIME, - 'size' => 0, - 'required' => $required, - 'default' => $default, - 'array' => $array, - 'filters' => $filters, - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); - - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_DATETIME); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relationship') - ->alias('/v1/database/collections/:collectionId/attributes/relationship') - ->desc('Create relationship attribute') - ->groups(['api', 'database']) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'attribute.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'createRelationshipAttribute', - description: '/docs/references/databases/create-relationship-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_ACCEPTED, - model: Response::MODEL_ATTRIBUTE_RELATIONSHIP, - ) - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('relatedCollectionId', '', new UID(), 'Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('type', '', new WhiteList([Database::RELATION_ONE_TO_ONE, Database::RELATION_MANY_TO_ONE, Database::RELATION_MANY_TO_MANY, Database::RELATION_ONE_TO_MANY], true), 'Relation type') - ->param('twoWay', false, new Boolean(), 'Is Two Way?', true) - ->param('key', null, new Key(), 'Attribute Key.', true) - ->param('twoWayKey', null, new Key(), 'Two Way Attribute Key.', true) - ->param('onDelete', Database::RELATION_MUTATE_RESTRICT, new WhiteList([Database::RELATION_MUTATE_CASCADE, Database::RELATION_MUTATE_RESTRICT, Database::RELATION_MUTATE_SET_NULL], true), 'Constraints option', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function ( - string $databaseId, - string $collectionId, - string $relatedCollectionId, - string $type, - bool $twoWay, - ?string $key, - ?string $twoWayKey, - string $onDelete, - Response $response, - Database $dbForProject, - EventDatabase $queueForDatabase, - Event $queueForEvents - ) { - $key ??= $relatedCollectionId; - $twoWayKey ??= $collectionId; - - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - $collection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $relatedCollectionDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId); - $relatedCollection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $relatedCollectionDocument->getSequence()); - - if ($relatedCollection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $attributes = $collection->getAttribute('attributes', []); - - /** @var Document[] $attributes */ - foreach ($attributes as $attribute) { - if ($attribute->getAttribute('type') !== Database::VAR_RELATIONSHIP) { - continue; - } - - if (\strtolower($attribute->getId()) === \strtolower($key)) { - throw new Exception(Exception::ATTRIBUTE_ALREADY_EXISTS); - } - - if ( - \strtolower($attribute->getAttribute('options')['twoWayKey']) === \strtolower($twoWayKey) && - $attribute->getAttribute('options')['relatedCollection'] === $relatedCollection->getId() - ) { - // Console should provide a unique twoWayKey input! - throw new Exception(Exception::ATTRIBUTE_ALREADY_EXISTS, 'Attribute with the requested key already exists. Attribute keys must be unique, try again with a different key.'); - } - - if ( - $type === Database::RELATION_MANY_TO_MANY && - $attribute->getAttribute('options')['relationType'] === Database::RELATION_MANY_TO_MANY && - $attribute->getAttribute('options')['relatedCollection'] === $relatedCollection->getId() - ) { - throw new Exception(Exception::ATTRIBUTE_ALREADY_EXISTS, 'Creating more than one "manyToMany" relationship on the same collection is currently not permitted.'); - } - } - - $attribute = createAttribute( - $databaseId, - $collectionId, - new Document([ - 'key' => $key, - 'type' => Database::VAR_RELATIONSHIP, - 'size' => 0, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - 'options' => [ - 'relatedCollection' => $relatedCollectionId, - 'relationType' => $type, - 'twoWay' => $twoWay, - 'twoWayKey' => $twoWayKey, - 'onDelete' => $onDelete, - ] - ]), - $response, - $dbForProject, - $queueForDatabase, - $queueForEvents - ); - - $options = $attribute->getAttribute('options', []); - - foreach ($options as $key => $option) { - $attribute->setAttribute($key, $option); - } - - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_RELATIONSHIP); - }); - -App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') - ->alias('/v1/database/collections/:collectionId/attributes') - ->desc('List attributes') - ->groups(['api', 'database']) - ->label('scope', 'collections.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'listAttributes', - description: '/docs/references/databases/list-attributes.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_ATTRIBUTE_LIST - ) - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('queries', [], new Attributes(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Attributes::ALLOWED_ATTRIBUTES), true) - ->inject('response') - ->inject('dbForProject') - ->action(function (string $databaseId, string $collectionId, array $queries, Response $response, Database $dbForProject) { - $database = $dbForProject->getDocument('databases', $databaseId); - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - \array_push( - $queries, - Query::equal('databaseInternalId', [$database->getSequence()]), - Query::equal('collectionInternalId', [$collection->getSequence()]), - ); - - /** - * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries - */ - $cursor = \array_filter($queries, function ($query) { - return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); - }); - - $cursor = \reset($cursor); - - if ($cursor) { - $validator = new Cursor(); - if (!$validator->isValid($cursor)) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); - } - - $attributeId = $cursor->getValue(); - - try { - $cursorDocument = $dbForProject->findOne('attributes', [ - Query::equal('databaseInternalId', [$database->getSequence()]), - Query::equal('collectionInternalId', [$collection->getSequence()]), - Query::equal('key', [$attributeId]), - ]); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - if ($cursorDocument->isEmpty()) { - throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Attribute '{$attributeId}' for the 'cursor' value not found."); - } - - $cursor->setValue($cursorDocument); - } - - try { - $attributes = $dbForProject->find('attributes', $queries); - $total = $dbForProject->count('attributes', $queries, APP_LIMIT_COUNT); - } catch (OrderException) { - throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL); - } catch (QueryException) { - throw new Exception(Exception::GENERAL_QUERY_INVALID); - } - - foreach ($attributes as $attribute) { - if ($attribute->getAttribute('type') === Database::VAR_STRING) { - $filters = $attribute->getAttribute('filters', []); - $attribute->setAttribute('encrypt', in_array('encrypt', $filters)); - } - } - - $response->dynamic(new Document([ - 'attributes' => $attributes, - 'total' => $total, - ]), Response::MODEL_ATTRIBUTE_LIST); - }); - -App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') - ->alias('/v1/database/collections/:collectionId/attributes/:key') - ->desc('Get attribute') - ->groups(['api', 'database']) - ->label('scope', 'collections.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'getAttribute', - description: '/docs/references/databases/get-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: [ - Response::MODEL_ATTRIBUTE_BOOLEAN, - Response::MODEL_ATTRIBUTE_INTEGER, - Response::MODEL_ATTRIBUTE_FLOAT, - Response::MODEL_ATTRIBUTE_EMAIL, - Response::MODEL_ATTRIBUTE_ENUM, - Response::MODEL_ATTRIBUTE_URL, - Response::MODEL_ATTRIBUTE_IP, - Response::MODEL_ATTRIBUTE_DATETIME, - Response::MODEL_ATTRIBUTE_RELATIONSHIP, - Response::MODEL_ATTRIBUTE_STRING - ] - ), - ] - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->inject('response') - ->inject('dbForProject') - ->action(function (string $databaseId, string $collectionId, string $key, Response $response, Database $dbForProject) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $attribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $collection->getSequence() . '_' . $key); - - if ($attribute->isEmpty()) { - throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); - } - - // Select response model based on type and format - $type = $attribute->getAttribute('type'); - $format = $attribute->getAttribute('format'); - $options = $attribute->getAttribute('options', []); - $filters = $attribute->getAttribute('filters', []); - foreach ($options as $key => $option) { - $attribute->setAttribute($key, $option); - } - - $model = match ($type) { - Database::VAR_BOOLEAN => Response::MODEL_ATTRIBUTE_BOOLEAN, - Database::VAR_INTEGER => Response::MODEL_ATTRIBUTE_INTEGER, - Database::VAR_FLOAT => Response::MODEL_ATTRIBUTE_FLOAT, - Database::VAR_DATETIME => Response::MODEL_ATTRIBUTE_DATETIME, - Database::VAR_RELATIONSHIP => Response::MODEL_ATTRIBUTE_RELATIONSHIP, - Database::VAR_STRING => match ($format) { - APP_DATABASE_ATTRIBUTE_EMAIL => Response::MODEL_ATTRIBUTE_EMAIL, - APP_DATABASE_ATTRIBUTE_ENUM => Response::MODEL_ATTRIBUTE_ENUM, - APP_DATABASE_ATTRIBUTE_IP => Response::MODEL_ATTRIBUTE_IP, - APP_DATABASE_ATTRIBUTE_URL => Response::MODEL_ATTRIBUTE_URL, - default => Response::MODEL_ATTRIBUTE_STRING, - }, - default => Response::MODEL_ATTRIBUTE, - }; - $attribute->setAttribute('encrypt', in_array('encrypt', $filters)); - $response->dynamic($attribute, $model); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/string/:key') - ->desc('Update string attribute') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') - ->label('audits.event', 'attribute.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'updateStringAttribute', - description: '/docs/references/databases/update-string-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_ATTRIBUTE_STRING, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new Text(0, 0)), 'Default value for attribute when not provided. Cannot be set when attribute is required.') - ->param('size', null, new Range(1, APP_DATABASE_ATTRIBUTE_STRING_MAX_LENGTH, Range::TYPE_INTEGER), 'Maximum size of the string attribute.', true) - ->param('newKey', null, new Key(), 'New attribute key.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?int $size, ?string $newKey, Response $response, Database $dbForProject, Event $queueForEvents) { - $attribute = updateAttribute( - databaseId: $databaseId, - collectionId: $collectionId, - key: $key, - dbForProject: $dbForProject, - queueForEvents: $queueForEvents, - type: Database::VAR_STRING, - size: $size, - default: $default, - required: $required, - newKey: $newKey - ); - - $response - ->setStatusCode(Response::STATUS_CODE_OK) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_STRING); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email/:key') - ->desc('Update email attribute') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') - ->label('audits.event', 'attribute.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'updateEmailAttribute', - description: '/docs/references/databases/update-email-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_ATTRIBUTE_EMAIL, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new Email()), 'Default value for attribute when not provided. Cannot be set when attribute is required.') - ->param('newKey', null, new Key(), 'New attribute key.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, Response $response, Database $dbForProject, Event $queueForEvents) { - $attribute = updateAttribute( - databaseId: $databaseId, - collectionId: $collectionId, - key: $key, - dbForProject: $dbForProject, - queueForEvents: $queueForEvents, - type: Database::VAR_STRING, - filter: APP_DATABASE_ATTRIBUTE_EMAIL, - default: $default, - required: $required, - newKey: $newKey - ); - - $response - ->setStatusCode(Response::STATUS_CODE_OK) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_EMAIL); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/:key') - ->desc('Update enum attribute') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') - ->label('audits.event', 'attribute.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'updateEnumAttribute', - description: '/docs/references/databases/update-enum-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_ATTRIBUTE_ENUM, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('elements', null, new ArrayList(new Text(DATABASE::LENGTH_KEY), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' elements are allowed, each ' . DATABASE::LENGTH_KEY . ' characters long.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new Text(0)), 'Default value for attribute when not provided. Cannot be set when attribute is required.') - ->param('newKey', null, new Key(), 'New attribute key.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?array $elements, ?bool $required, ?string $default, ?string $newKey, Response $response, Database $dbForProject, Event $queueForEvents) { - $attribute = updateAttribute( - databaseId: $databaseId, - collectionId: $collectionId, - key: $key, - dbForProject: $dbForProject, - queueForEvents: $queueForEvents, - type: Database::VAR_STRING, - filter: APP_DATABASE_ATTRIBUTE_ENUM, - default: $default, - required: $required, - elements: $elements, - newKey: $newKey - ); - - $response - ->setStatusCode(Response::STATUS_CODE_OK) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_ENUM); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:key') - ->desc('Update IP address attribute') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') - ->label('audits.event', 'attribute.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'updateIpAttribute', - description: '/docs/references/databases/update-ip-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_ATTRIBUTE_IP, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new IP()), 'Default value for attribute when not provided. Cannot be set when attribute is required.') - ->param('newKey', null, new Key(), 'New attribute key.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, Response $response, Database $dbForProject, Event $queueForEvents) { - $attribute = updateAttribute( - databaseId: $databaseId, - collectionId: $collectionId, - key: $key, - dbForProject: $dbForProject, - queueForEvents: $queueForEvents, - type: Database::VAR_STRING, - filter: APP_DATABASE_ATTRIBUTE_IP, - default: $default, - required: $required, - newKey: $newKey - ); - - $response - ->setStatusCode(Response::STATUS_CODE_OK) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_IP); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/:key') - ->desc('Update URL attribute') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') - ->label('audits.event', 'attribute.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'updateUrlAttribute', - description: '/docs/references/databases/update-url-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_ATTRIBUTE_URL, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new URL()), 'Default value for attribute when not provided. Cannot be set when attribute is required.') - ->param('newKey', null, new Key(), 'New attribute key.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, Response $response, Database $dbForProject, Event $queueForEvents) { - $attribute = updateAttribute( - databaseId: $databaseId, - collectionId: $collectionId, - key: $key, - dbForProject: $dbForProject, - queueForEvents: $queueForEvents, - type: Database::VAR_STRING, - filter: APP_DATABASE_ATTRIBUTE_URL, - default: $default, - required: $required, - newKey: $newKey - ); - - $response - ->setStatusCode(Response::STATUS_CODE_OK) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_URL); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integer/:key') - ->desc('Update integer attribute') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') - ->label('audits.event', 'attribute.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'updateIntegerAttribute', - description: '/docs/references/databases/update-integer-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_ATTRIBUTE_INTEGER, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('min', null, new Integer(), 'Minimum value to enforce on new documents', true) - ->param('max', null, new Integer(), 'Maximum value to enforce on new documents', true) - ->param('default', null, new Nullable(new Integer()), 'Default value for attribute when not provided. Cannot be set when attribute is required.') - ->param('newKey', null, new Key(), 'New attribute key.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?int $min, ?int $max, ?int $default, ?string $newKey, Response $response, Database $dbForProject, Event $queueForEvents) { - $attribute = updateAttribute( - databaseId: $databaseId, - collectionId: $collectionId, - key: $key, - dbForProject: $dbForProject, - queueForEvents: $queueForEvents, - type: Database::VAR_INTEGER, - default: $default, - required: $required, - min: $min, - max: $max, - newKey: $newKey - ); - - $formatOptions = $attribute->getAttribute('formatOptions', []); - - if (!empty($formatOptions)) { - $attribute->setAttribute('min', \intval($formatOptions['min'])); - $attribute->setAttribute('max', \intval($formatOptions['max'])); - } - - $response - ->setStatusCode(Response::STATUS_CODE_OK) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_INTEGER); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float/:key') - ->desc('Update float attribute') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') - ->label('audits.event', 'attribute.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'updateFloatAttribute', - description: '/docs/references/databases/update-float-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_ATTRIBUTE_FLOAT, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('min', null, new FloatValidator(), 'Minimum value to enforce on new documents', true) - ->param('max', null, new FloatValidator(), 'Maximum value to enforce on new documents', true) - ->param('default', null, new Nullable(new FloatValidator()), 'Default value for attribute when not provided. Cannot be set when attribute is required.') - ->param('newKey', null, new Key(), 'New attribute key.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?float $min, ?float $max, ?float $default, ?string $newKey, Response $response, Database $dbForProject, Event $queueForEvents) { - $attribute = updateAttribute( - databaseId: $databaseId, - collectionId: $collectionId, - key: $key, - dbForProject: $dbForProject, - queueForEvents: $queueForEvents, - type: Database::VAR_FLOAT, - default: $default, - required: $required, - min: $min, - max: $max, - newKey: $newKey - ); - - $formatOptions = $attribute->getAttribute('formatOptions', []); - - if (!empty($formatOptions)) { - $attribute->setAttribute('min', \floatval($formatOptions['min'])); - $attribute->setAttribute('max', \floatval($formatOptions['max'])); - } - - $response - ->setStatusCode(Response::STATUS_CODE_OK) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_FLOAT); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boolean/:key') - ->desc('Update boolean attribute') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') - ->label('audits.event', 'attribute.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'updateBooleanAttribute', - description: '/docs/references/databases/update-boolean-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_ATTRIBUTE_BOOLEAN, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new Boolean()), 'Default value for attribute when not provided. Cannot be set when attribute is required.') - ->param('newKey', null, new Key(), 'New attribute key.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?bool $default, ?string $newKey, Response $response, Database $dbForProject, Event $queueForEvents) { - $attribute = updateAttribute( - databaseId: $databaseId, - collectionId: $collectionId, - key: $key, - dbForProject: $dbForProject, - queueForEvents: $queueForEvents, - type: Database::VAR_BOOLEAN, - default: $default, - required: $required, - newKey: $newKey - ); - - $response - ->setStatusCode(Response::STATUS_CODE_OK) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_BOOLEAN); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datetime/:key') - ->desc('Update dateTime attribute') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') - ->label('audits.event', 'attribute.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'updateDatetimeAttribute', - description: '/docs/references/databases/update-datetime-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_ATTRIBUTE_DATETIME, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, fn (Database $dbForProject) => new Nullable(new DatetimeValidator($dbForProject->getAdapter()->getMinDateTime(), $dbForProject->getAdapter()->getMaxDateTime())), 'Default value for attribute when not provided. Cannot be set when attribute is required.', injections: ['dbForProject']) - ->param('newKey', null, new Key(), 'New attribute key.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, Response $response, Database $dbForProject, Event $queueForEvents) { - $attribute = updateAttribute( - databaseId: $databaseId, - collectionId: $collectionId, - key: $key, - dbForProject: $dbForProject, - queueForEvents: $queueForEvents, - type: Database::VAR_DATETIME, - default: $default, - required: $required, - newKey: $newKey - ); - - $response - ->setStatusCode(Response::STATUS_CODE_OK) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_DATETIME); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/relationship') - ->desc('Update relationship attribute') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') - ->label('audits.event', 'attribute.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'updateRelationshipAttribute', - description: '/docs/references/databases/update-relationship-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_ATTRIBUTE_RELATIONSHIP, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->param('onDelete', null, new WhiteList([Database::RELATION_MUTATE_CASCADE, Database::RELATION_MUTATE_RESTRICT, Database::RELATION_MUTATE_SET_NULL], true), 'Constraints option', true) - ->param('newKey', null, new Key(), 'New attribute key.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function ( - string $databaseId, - string $collectionId, - string $key, - ?string $onDelete, - ?string $newKey, - Response $response, - Database $dbForProject, - Event $queueForEvents - ) { - $attribute = updateAttribute( - $databaseId, - $collectionId, - $key, - $dbForProject, - $queueForEvents, - type: Database::VAR_RELATIONSHIP, - required: false, - options: [ - 'onDelete' => $onDelete - ], - newKey: $newKey - ); - - $options = $attribute->getAttribute('options', []); - - foreach ($options as $key => $option) { - $attribute->setAttribute($key, $option); - } - - $response - ->setStatusCode(Response::STATUS_CODE_OK) - ->dynamic($attribute, Response::MODEL_ATTRIBUTE_RELATIONSHIP); - }); - -App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') - ->alias('/v1/database/collections/:collectionId/attributes/:key') - ->desc('Delete attribute') - ->groups(['api', 'database', 'schema']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') - ->label('audits.event', 'attribute.delete') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'attributes', - name: 'deleteAttribute', - description: '/docs/references/databases/delete-attribute.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_NOCONTENT, - model: Response::MODEL_NONE, - ) - ], - contentType: ContentType::NONE - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Attribute Key.') - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $attribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $collection->getSequence() . '_' . $key); - - if ($attribute->isEmpty()) { - throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); - } - - /** - * Check index dependency - */ - $validator = new IndexDependencyValidator( - $collection->getAttribute('indexes'), - $dbForProject->getAdapter()->getSupportForCastIndexArray(), - ); - - if (! $validator->isValid($attribute)) { - throw new Exception(Exception::INDEX_DEPENDENCY); - } - - // Only update status if removing available attribute - if ($attribute->getAttribute('status') === 'available') { - $attribute = $dbForProject->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'deleting')); - } - - $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); - $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); - - if ($attribute->getAttribute('type') === Database::VAR_RELATIONSHIP) { - $options = $attribute->getAttribute('options'); - if ($options['twoWay']) { - $relatedCollection = $dbForProject->getDocument('database_' . $database->getSequence(), $options['relatedCollection']); - - if ($relatedCollection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $relatedAttribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $options['twoWayKey']); - - if ($relatedAttribute->isEmpty()) { - throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); - } - - if ($relatedAttribute->getAttribute('status') === 'available') { - $dbForProject->updateDocument('attributes', $relatedAttribute->getId(), $relatedAttribute->setAttribute('status', 'deleting')); - } - - $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $options['relatedCollection']); - $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence()); - } - } - - $queueForDatabase - ->setType(DATABASE_TYPE_DELETE_ATTRIBUTE) - ->setCollection($collection) - ->setDatabase($database) - ->setDocument($attribute); - - // Select response model based on type and format - $type = $attribute->getAttribute('type'); - $format = $attribute->getAttribute('format'); - - $model = match ($type) { - Database::VAR_BOOLEAN => Response::MODEL_ATTRIBUTE_BOOLEAN, - Database::VAR_INTEGER => Response::MODEL_ATTRIBUTE_INTEGER, - Database::VAR_FLOAT => Response::MODEL_ATTRIBUTE_FLOAT, - Database::VAR_DATETIME => Response::MODEL_ATTRIBUTE_DATETIME, - Database::VAR_RELATIONSHIP => Response::MODEL_ATTRIBUTE_RELATIONSHIP, - Database::VAR_STRING => match ($format) { - APP_DATABASE_ATTRIBUTE_EMAIL => Response::MODEL_ATTRIBUTE_EMAIL, - APP_DATABASE_ATTRIBUTE_ENUM => Response::MODEL_ATTRIBUTE_ENUM, - APP_DATABASE_ATTRIBUTE_IP => Response::MODEL_ATTRIBUTE_IP, - APP_DATABASE_ATTRIBUTE_URL => Response::MODEL_ATTRIBUTE_URL, - default => Response::MODEL_ATTRIBUTE_STRING, - }, - default => Response::MODEL_ATTRIBUTE, - }; - - $queueForEvents - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setParam('attributeId', $attribute->getId()) - ->setContext('collection', $collection) - ->setContext('database', $database) - ->setPayload($response->output($attribute, $model)); - - $response->noContent(); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') - ->alias('/v1/database/collections/:collectionId/indexes') - ->desc('Create index') - ->groups(['api', 'database']) - ->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].create') - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'index.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'collections', - name: 'createIndex', - description: '/docs/references/databases/create-index.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_ACCEPTED, - model: Response::MODEL_INDEX, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', null, new Key(), 'Index Key.') - ->param('type', null, new WhiteList([Database::INDEX_KEY, Database::INDEX_FULLTEXT, Database::INDEX_UNIQUE]), 'Index type.') - ->param('attributes', null, new ArrayList(new Key(true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of attributes to index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' attributes are allowed, each 32 characters long.') - ->param('orders', [], new ArrayList(new WhiteList(['ASC', 'DESC'], false, Database::VAR_STRING), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of index orders. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' orders are allowed.', true) - ->param('lengths', [], new ArrayList(new Nullable(new Integer()), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Length of index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE, optional:true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, string $type, array $attributes, array $orders, array $lengths, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $limit = $dbForProject->getLimitForIndexes(); - - $count = $dbForProject->count('indexes', [ - Query::equal('collectionInternalId', [$collection->getSequence()]), - Query::equal('databaseInternalId', [$database->getSequence()]) - ], max: $limit); - - - if ($count >= $limit) { - throw new Exception(Exception::INDEX_LIMIT_EXCEEDED, 'Index limit exceeded'); - } - - // Convert Document array to array of attribute metadata - $oldAttributes = \array_map(fn ($a) => $a->getArrayCopy(), $collection->getAttribute('attributes')); - - $oldAttributes[] = [ - 'key' => '$id', - 'type' => Database::VAR_STRING, - 'status' => 'available', - 'required' => true, - 'array' => false, - 'default' => null, - 'size' => Database::LENGTH_KEY - ]; - $oldAttributes[] = [ - 'key' => '$createdAt', - 'type' => Database::VAR_DATETIME, - 'status' => 'available', - 'signed' => false, - 'required' => false, - 'array' => false, - 'default' => null, - 'size' => 0 - ]; - $oldAttributes[] = [ - 'key' => '$updatedAt', - 'type' => Database::VAR_DATETIME, - 'status' => 'available', - 'signed' => false, - 'required' => false, - 'array' => false, - 'default' => null, - 'size' => 0 - ]; - - foreach ($attributes as $i => $attribute) { - // Find attribute metadata in collection document - $attributeIndex = \array_search($attribute, array_column($oldAttributes, 'key')); - - if ($attributeIndex === false) { - throw new Exception(Exception::ATTRIBUTE_UNKNOWN, 'Unknown attribute: ' . $attribute . '. Verify the attribute name or create the attribute.'); - } - - $attributeStatus = $oldAttributes[$attributeIndex]['status']; - $attributeType = $oldAttributes[$attributeIndex]['type']; - $attributeArray = $oldAttributes[$attributeIndex]['array'] ?? false; - - if ($attributeType === Database::VAR_RELATIONSHIP) { - throw new Exception(Exception::ATTRIBUTE_TYPE_INVALID, 'Cannot create an index for a relationship attribute: ' . $oldAttributes[$attributeIndex]['key']); - } - - // ensure attribute is available - if ($attributeStatus !== 'available') { - throw new Exception(Exception::ATTRIBUTE_NOT_AVAILABLE, 'Attribute not available: ' . $oldAttributes[$attributeIndex]['key']); - } - - $lengths[$i] ??= null; - if ($attributeArray === true) { - $lengths[$i] = Database::ARRAY_INDEX_LENGTH; - $orders[$i] = null; - } - } - - $index = new Document([ - '$id' => ID::custom($database->getSequence() . '_' . $collection->getSequence() . '_' . $key), - 'key' => $key, - 'status' => 'processing', // processing, available, failed, deleting, stuck - 'databaseInternalId' => $database->getSequence(), - 'databaseId' => $databaseId, - 'collectionInternalId' => $collection->getSequence(), - 'collectionId' => $collectionId, - 'type' => $type, - 'attributes' => $attributes, - 'lengths' => $lengths, - 'orders' => $orders, - ]); - - $validator = new IndexValidator( - $collection->getAttribute('attributes'), - $dbForProject->getAdapter()->getMaxIndexLength(), - $dbForProject->getAdapter()->getInternalIndexesKeys(), - ); - - if (!$validator->isValid($index)) { - throw new Exception(Exception::INDEX_INVALID, $validator->getDescription()); - } - - try { - $index = $dbForProject->createDocument('indexes', $index); - } catch (DuplicateException) { - throw new Exception(Exception::INDEX_ALREADY_EXISTS); - } - - $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); - - $queueForDatabase - ->setType(DATABASE_TYPE_CREATE_INDEX) - ->setDatabase($database) - ->setCollection($collection) - ->setDocument($index); - - $queueForEvents - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setParam('indexId', $index->getId()) - ->setContext('collection', $collection) - ->setContext('database', $database); - - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($index, Response::MODEL_INDEX); - }); - -App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') - ->alias('/v1/database/collections/:collectionId/indexes') - ->desc('List indexes') - ->groups(['api', 'database']) - ->label('scope', 'collections.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'indexes', - name: 'listIndexes', - description: '/docs/references/databases/list-indexes.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_INDEX_LIST, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('queries', [], new Indexes(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Indexes::ALLOWED_ATTRIBUTES), true) - ->inject('response') - ->inject('dbForProject') - ->action(function (string $databaseId, string $collectionId, array $queries, Response $response, Database $dbForProject) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $queries = Query::parseQueries($queries); - - \array_push( - $queries, - Query::equal('databaseId', [$databaseId]), - Query::equal('collectionId', [$collectionId]), - ); - - /** - * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries - */ - $cursor = \array_filter($queries, function ($query) { - return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); - }); - - $cursor = reset($cursor); - - if ($cursor) { - $validator = new Cursor(); - if (!$validator->isValid($cursor)) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); - } - - $indexId = $cursor->getValue(); - $cursorDocument = Authorization::skip(fn () => $dbForProject->find('indexes', [ - Query::equal('collectionInternalId', [$collection->getSequence()]), - Query::equal('databaseInternalId', [$database->getSequence()]), - Query::equal('key', [$indexId]), - Query::limit(1) - ])); - - if (empty($cursorDocument) || $cursorDocument[0]->isEmpty()) { - throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Index '{$indexId}' for the 'cursor' value not found."); - } - - $cursor->setValue($cursorDocument[0]); - } - - try { - $total = $dbForProject->count('indexes', $queries, APP_LIMIT_COUNT); - $indexes = $dbForProject->find('indexes', $queries); - } catch (OrderException $e) { - throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - $response->dynamic(new Document([ - 'total' => $total, - 'indexes' => $indexes, - ]), Response::MODEL_INDEX_LIST); - }); - -App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') - ->alias('/v1/database/collections/:collectionId/indexes/:key') - ->desc('Get index') - ->groups(['api', 'database']) - ->label('scope', 'collections.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'indexes', - name: 'getIndex', - description: '/docs/references/databases/get-index.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_INDEX, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', null, new Key(), 'Index Key.') - ->inject('response') - ->inject('dbForProject') - ->action(function (string $databaseId, string $collectionId, string $key, Response $response, Database $dbForProject) { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $index = $collection->find('key', $key, 'indexes'); - - if (empty($index)) { - throw new Exception(Exception::INDEX_NOT_FOUND); - } - - $response->dynamic($index, Response::MODEL_INDEX); - }); - - -App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') - ->alias('/v1/database/collections/:collectionId/indexes/:key') - ->desc('Delete index') - ->groups(['api', 'database']) - ->label('scope', 'collections.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].update') - ->label('audits.event', 'index.delete') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk', new Method( - namespace: 'databases', - group: 'indexes', - name: 'deleteIndex', - description: '/docs/references/databases/delete-index.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_NOCONTENT, - model: Response::MODEL_NONE, - ) - ], - contentType: ContentType::NONE - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('key', '', new Key(), 'Index Key.') - ->inject('response') - ->inject('dbForProject') - ->inject('queueForDatabase') - ->inject('queueForEvents') - ->action(function (string $databaseId, string $collectionId, string $key, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { - $database = $dbForProject->getDocument('databases', $databaseId); - - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $index = $dbForProject->getDocument('indexes', $database->getSequence() . '_' . $collection->getSequence() . '_' . $key); - - if ($index->isEmpty()) { - throw new Exception(Exception::INDEX_NOT_FOUND); - } - - // Only update status if removing available index - if ($index->getAttribute('status') === 'available') { - $index = $dbForProject->updateDocument('indexes', $index->getId(), $index->setAttribute('status', 'deleting')); - } - - $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); - - $queueForDatabase - ->setType(DATABASE_TYPE_DELETE_INDEX) - ->setDatabase($database) - ->setCollection($collection) - ->setDocument($index); - - $queueForEvents - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setParam('indexId', $index->getId()) - ->setContext('collection', $collection) - ->setContext('database', $database) - ->setPayload($response->output($index, Response::MODEL_INDEX)); - - $response->noContent(); - }); - -App::post('/v1/databases/:databaseId/collections/:collectionId/documents') - ->alias('/v1/database/collections/:collectionId/documents') - ->desc('Create document') - ->groups(['api', 'database']) - ->label('scope', 'documents.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'document.create') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') - ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) - ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label( - 'sdk', - // Using multiple methods to abstract the complexity for SDK users - [ - new Method( - namespace: 'databases', - group: 'documents', - name: 'createDocument', - description: '/docs/references/databases/create-document.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_DOCUMENT, - ) - ], - contentType: ContentType::JSON, - parameters: [ - new Parameter('databaseId', optional: false), - new Parameter('collectionId', optional: false), - new Parameter('documentId', optional: false), - new Parameter('data', optional: false), - new Parameter('permissions', optional: true), - ] - ), - new Method( - namespace: 'databases', - group: 'documents', - name: 'createDocuments', - description: '/docs/references/databases/create-documents.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_DOCUMENT_LIST, - ) - ], - contentType: ContentType::JSON, - parameters: [ - new Parameter('databaseId', optional: false), - new Parameter('collectionId', optional: false), - new Parameter('documents', optional: false), - ] - ) - ] - ) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') - ->param('data', [], new JSON(), 'Document data as JSON object.', true) - ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) - ->param('documents', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of documents data as JSON objects.', true, ['plan']) - ->inject('response') - ->inject('dbForProject') - ->inject('user') - ->inject('queueForEvents') - ->inject('queueForStatsUsage') - ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $permissions, ?array $documents, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage) { - $data = \is_string($data) - ? \json_decode($data, true) - : $data; - - /** - * Determine which internal path to call, single or bulk - */ - if (empty($data) && empty($documents)) { - // No single or bulk documents provided - throw new Exception(Exception::DOCUMENT_MISSING_DATA); - } - if (!empty($data) && !empty($documents)) { - // Both single and bulk documents provided - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'You can only send one of the following parameters: data, documents'); - } - if (!empty($data) && empty($documentId)) { - // Single document provided without document ID - throw new Exception(Exception::DOCUMENT_MISSING_DATA, 'Document ID is required when creating a single document'); - } - if (!empty($documents) && !empty($documentId)) { - // Bulk documents provided with document ID - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "documentId" is disallowed when creating multiple documents, set "$id" in each document instead'); - } - if (!empty($documents) && !empty($permissions)) { - // Bulk documents provided with permissions - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "permissions" is disallowed when creating multiple documents, set "$permissions" in each document instead'); - } - - $isBulk = true; - if (!empty($data)) { - // Single document provided, convert to single item array - // But remember that it was single to respond with a single document - $isBulk = false; - $documents = [$data]; - } - - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); - - if ($isBulk && !$isAPIKey && !$isPrivilegedUser) { - throw new Exception(Exception::GENERAL_UNAUTHORIZED_SCOPE); - } - - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); - if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $hasRelationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - if ($isBulk && $hasRelationships) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is not supported for collections with relationship attributes'); - } - - $setPermissions = function (Document $document, ?array $permissions) use ($user, $isAPIKey, $isPrivilegedUser, $isBulk) { - $allowedPermissions = [ - Database::PERMISSION_READ, - Database::PERMISSION_UPDATE, - Database::PERMISSION_DELETE, - ]; - - // If bulk, we need to validate permissions explicitly per document - if ($isBulk) { - $permissions = $document['$permissions'] ?? null; - if (!empty($permissions)) { - $validator = new Permissions(); - if (!$validator->isValid($permissions)) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, $validator->getDescription()); - } - } - } - - $permissions = Permission::aggregate($permissions, $allowedPermissions); - - // Add permissions for current the user if none were provided. - if (\is_null($permissions)) { - $permissions = []; - if (!empty($user->getId())) { - foreach ($allowedPermissions as $permission) { - $permissions[] = (new Permission($permission, 'user', $user->getId()))->toString(); - } - } - } - - // Users can only manage their own roles, API keys and Admin users can manage any - if (!$isAPIKey && !$isPrivilegedUser) { - foreach (Database::PERMISSIONS as $type) { - foreach ($permissions as $permission) { - $permission = Permission::parse($permission); - if ($permission->getPermission() != $type) { - continue; - } - $role = (new Role( - $permission->getRole(), - $permission->getIdentifier(), - $permission->getDimension() - ))->toString(); - if (!Authorization::isRole($role)) { - throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', Authorization::getRoles()) . ')'); - } - } - } - } - - $document->setAttribute('$permissions', $permissions); - }; - - $operations = 0; - - $checkPermissions = function (Document $collection, Document $document, string $permission) use (&$checkPermissions, $dbForProject, $database, &$operations) { - $operations++; - - $documentSecurity = $collection->getAttribute('documentSecurity', false); - $validator = new Authorization($permission); - - $valid = $validator->isValid($collection->getPermissionsByType($permission)); - if (($permission === Database::PERMISSION_UPDATE && !$documentSecurity) || !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } - - if ($permission === Database::PERMISSION_UPDATE) { - $valid = $valid || $validator->isValid($document->getUpdate()); - if ($documentSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } - } - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - continue; - } - - $isList = \is_array($related) && \array_values($related) === $related; - - if ($isList) { - $relations = $related; - } else { - $relations = [$related]; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) - ); - - foreach ($relations as &$relation) { - if ( - \is_array($relation) - && \array_values($relation) !== $relation - && !isset($relation['$id']) - ) { - $relation['$id'] = ID::unique(); - $relation = new Document($relation); - } - if ($relation instanceof Document) { - $current = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), $relation->getId()) - ); - - if ($current->isEmpty()) { - $type = Database::PERMISSION_CREATE; - - if (isset($relation['$id']) && $relation['$id'] === 'unique()') { - $relation['$id'] = ID::unique(); - } - } else { - $relation->removeAttribute('$collectionId'); - $relation->removeAttribute('$databaseId'); - $relation->setAttribute('$collection', $relatedCollection->getId()); - $type = Database::PERMISSION_UPDATE; - } - - $checkPermissions($relatedCollection, $relation, $type); - } - } - - if ($isList) { - $document->setAttribute($relationship->getAttribute('key'), \array_values($relations)); - } else { - $document->setAttribute($relationship->getAttribute('key'), \reset($relations)); - } - } - }; - - $documents = \array_map(function ($document) use ($collection, $permissions, $checkPermissions, $isBulk, $documentId, $setPermissions) { - $document['$collection'] = $collection->getId(); - - // Determine the source ID depending on whether it's a bulk operation. - $sourceId = $isBulk - ? ($document['$id'] ?? ID::unique()) - : $documentId; - - // If bulk, we need to validate ID explicitly - if ($isBulk) { - $validator = new CustomId(); - if (!$validator->isValid($sourceId)) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, $validator->getDescription()); - } - } - - // Assign a unique ID if needed, otherwise use the provided ID. - $document['$id'] = $sourceId === 'unique()' ? ID::unique() : $sourceId; - $document = new Document($document); - $setPermissions($document, $permissions); - $checkPermissions($collection, $document, Database::PERMISSION_CREATE); - - return $document; - }, $documents); - - try { - $dbForProject->createDocuments( - 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), - $documents - ); - } catch (DuplicateException) { - throw new Exception(Exception::DOCUMENT_ALREADY_EXISTS); - } catch (NotFoundException) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } catch (RelationshipException $e) { - throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); - } catch (StructureException $e) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); - } - - $queueForEvents - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setContext('collection', $collection) - ->setContext('database', $database); - - // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { - $document->removeAttribute('$collection'); - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - continue; - } - if (!\is_array($related)) { - $related = [$related]; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) - ); - - foreach ($related as $relation) { - if ($relation instanceof Document) { - $processDocument($relatedCollection, $relation); - } - } - } - }; - - foreach ($documents as $document) { - $processDocument($collection, $document); - } - - $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); // per collection - - $response->setStatusCode(Response::STATUS_CODE_CREATED); - - if ($isBulk) { - $response->dynamic(new Document([ - 'total' => count($documents), - 'documents' => $documents - ]), Response::MODEL_DOCUMENT_LIST); - - return; - } - - $queueForEvents - ->setParam('documentId', $documents[0]->getId()) - ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].create'); - - $response->dynamic( - $documents[0], - Response::MODEL_DOCUMENT - ); - }); - -App::get('/v1/databases/:databaseId/collections/:collectionId/documents') - ->alias('/v1/database/collections/:collectionId/documents') - ->desc('List documents') - ->groups(['api', 'database']) - ->label('scope', 'documents.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'documents', - name: 'listDocuments', - description: '/docs/references/databases/list-documents.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_DOCUMENT_LIST, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForStatsUsage') - ->action(function (string $databaseId, string $collectionId, array $queries, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage) { - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); - - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); - if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - /** - * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries - */ - $cursor = \array_filter($queries, function ($query) { - return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); - }); - - $cursor = \reset($cursor); - - if ($cursor) { - $validator = new Cursor(); - if (!$validator->isValid($cursor)) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); - } - - $documentId = $cursor->getValue(); - - $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); - - if ($cursorDocument->isEmpty()) { - throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Document '{$documentId}' for the 'cursor' value not found."); - } - - $cursor->setValue($cursorDocument); - } - try { - $documents = $dbForProject->find('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $queries); - $total = $dbForProject->count('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $queries, APP_LIMIT_COUNT); - } catch (OrderException $e) { - throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - $operations = 0; - - // Add $collectionId and $databaseId for all documents - $processDocument = (function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations): bool { - if ($document->isEmpty()) { - return false; - } - - $operations++; - - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - if (\in_array(\gettype($related), ['array', 'object'])) { - $operations++; - } - - continue; - } - - if (!\is_array($related)) { - $relations = [$related]; - } else { - $relations = $related; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - // todo: Use local cache for this getDocument - $relatedCollection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId)); - - foreach ($relations as $index => $doc) { - if ($doc instanceof Document) { - if (!$processDocument($relatedCollection, $doc)) { - unset($relations[$index]); - } - } - } - - if (\is_array($related)) { - $document->setAttribute($relationship->getAttribute('key'), \array_values($relations)); - } elseif (empty($relations)) { - $document->setAttribute($relationship->getAttribute('key'), null); - } - } - - return true; - }); - - foreach ($documents as $document) { - $processDocument($collection, $document); - } - - $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_READS, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_READS), \max(1, $operations)); - - $select = \array_reduce($queries, function ($result, $query) { - return $result || ($query->getMethod() === Query::TYPE_SELECT); - }, false); - - // Check if the SELECT query includes $databaseId and $collectionId - $hasDatabaseId = false; - $hasCollectionId = false; - if ($select) { - $hasDatabaseId = \array_reduce($queries, function ($result, $query) { - return $result || ($query->getMethod() === Query::TYPE_SELECT && \in_array('$databaseId', $query->getValues())); - }, false); - $hasCollectionId = \array_reduce($queries, function ($result, $query) { - return $result || ($query->getMethod() === Query::TYPE_SELECT && \in_array('$collectionId', $query->getValues())); - }, false); - } - - if ($select) { - foreach ($documents as $document) { - if (!$hasDatabaseId) { - $document->removeAttribute('$databaseId'); - } - if (!$hasCollectionId) { - $document->removeAttribute('$collectionId'); - } - } - } - - $response->dynamic(new Document([ - 'total' => $total, - 'documents' => $documents, - ]), Response::MODEL_DOCUMENT_LIST); - }); - -App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') - ->alias('/v1/database/collections/:collectionId/documents/:documentId') - ->desc('Get document') - ->groups(['api', 'database']) - ->label('scope', 'documents.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'documents', - name: 'getDocument', - description: '/docs/references/databases/get-document.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_DOCUMENT, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('documentId', '', new UID(), 'Document ID.') - ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForStatsUsage') - ->action(function (string $databaseId, string $collectionId, string $documentId, array $queries, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage) { - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); - - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); - if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - try { - $document = $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId, $queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - if ($document->isEmpty()) { - throw new Exception(Exception::DOCUMENT_NOT_FOUND); - } - - $operations = 0; - - // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { - if ($document->isEmpty()) { - return; - } - - $operations++; - - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - if (\in_array(\gettype($related), ['array', 'object'])) { - $operations++; - } - - continue; - } - - if (!\is_array($related)) { - $related = [$related]; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) - ); - - foreach ($related as $relation) { - if ($relation instanceof Document) { - $processDocument($relatedCollection, $relation); - } - } - } - }; - - $processDocument($collection, $document); - - $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_READS, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_READS), \max(1, $operations)); - - $response->dynamic($document, Response::MODEL_DOCUMENT); - }); - -App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId/logs') - ->alias('/v1/database/collections/:collectionId/documents/:documentId/logs') - ->desc('List document logs') - ->groups(['api', 'database']) - ->label('scope', 'documents.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: 'logs', - name: 'listDocumentLogs', - description: '/docs/references/databases/get-document-logs.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_LOG_LIST, - ) - ], - contentType: ContentType::JSON, - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID.') - ->param('documentId', '', new UID(), 'Document ID.') - ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) - ->inject('response') - ->inject('dbForProject') - ->inject('locale') - ->inject('geodb') - ->action(function (string $databaseId, string $collectionId, string $documentId, array $queries, Response $response, Database $dbForProject, Locale $locale, Reader $geodb) { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $document = $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId); - - if ($document->isEmpty()) { - throw new Exception(Exception::DOCUMENT_NOT_FOUND); - } - - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - // Temp fix for logs - $queries[] = Query::or([ - Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))), - Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))), - ]); - - $audit = new Audit($dbForProject); - $resource = 'database/' . $databaseId . '/collection/' . $collectionId . '/document/' . $document->getId(); - $logs = $audit->getLogsByResource($resource, $queries); - - $output = []; - - foreach ($logs as $i => &$log) { - $log['userAgent'] = (!empty($log['userAgent'])) ? $log['userAgent'] : 'UNKNOWN'; - - $detector = new Detector($log['userAgent']); - $detector->skipBotDetection(); // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) - - $os = $detector->getOS(); - $client = $detector->getClient(); - $device = $detector->getDevice(); - - $output[$i] = new Document([ - 'event' => $log['event'], - 'userId' => $log['data']['userId'], - 'userEmail' => $log['data']['userEmail'] ?? null, - 'userName' => $log['data']['userName'] ?? null, - 'mode' => $log['data']['mode'] ?? null, - 'ip' => $log['ip'], - 'time' => $log['time'], - 'osCode' => $os['osCode'], - 'osName' => $os['osName'], - 'osVersion' => $os['osVersion'], - 'clientType' => $client['clientType'], - 'clientCode' => $client['clientCode'], - 'clientName' => $client['clientName'], - 'clientVersion' => $client['clientVersion'], - 'clientEngine' => $client['clientEngine'], - 'clientEngineVersion' => $client['clientEngineVersion'], - 'deviceName' => $device['deviceName'], - 'deviceBrand' => $device['deviceBrand'], - 'deviceModel' => $device['deviceModel'] - ]); - - $record = $geodb->get($log['ip']); - - if ($record) { - $output[$i]['countryCode'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), false) ? \strtolower($record['country']['iso_code']) : '--'; - $output[$i]['countryName'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), $locale->getText('locale.country.unknown')); - } else { - $output[$i]['countryCode'] = '--'; - $output[$i]['countryName'] = $locale->getText('locale.country.unknown'); - } - } - - $response->dynamic(new Document([ - 'total' => $audit->countLogsByResource($resource, $queries), - 'logs' => $output, - ]), Response::MODEL_LOG_LIST); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') - ->alias('/v1/database/collections/:collectionId/documents/:documentId') - ->desc('Update document') - ->groups(['api', 'database']) - ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].update') - ->label('scope', 'documents.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'document.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}/document/{response.$id}') - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') - ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) - ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk', new Method( - namespace: 'databases', - group: 'documents', - name: 'updateDocument', - description: '/docs/references/databases/update-document.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_DOCUMENT, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID.') - ->param('documentId', '', new UID(), 'Document ID.') - ->param('data', [], new JSON(), 'Document data as JSON object. Include only attribute and value pairs to be updated.', true) - ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) - ->inject('requestTimestamp') - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->inject('queueForStatsUsage') - ->action(function (string $databaseId, string $collectionId, string $documentId, string|array $data, ?array $permissions, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage) { - $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array - - if (empty($data) && \is_null($permissions)) { - throw new Exception(Exception::DOCUMENT_MISSING_PAYLOAD); - } - - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); - - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); - if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - // Read permission should not be required for update - $document = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); - if ($document->isEmpty()) { - throw new Exception(Exception::DOCUMENT_NOT_FOUND); - } - - // Map aggregate permissions into the multiple permissions they represent. - $permissions = Permission::aggregate($permissions, [ - Database::PERMISSION_READ, - Database::PERMISSION_UPDATE, - Database::PERMISSION_DELETE, - ]); - - // Users can only manage their own roles, API keys and Admin users can manage any - $roles = Authorization::getRoles(); - if (!$isAPIKey && !$isPrivilegedUser && !\is_null($permissions)) { - foreach (Database::PERMISSIONS as $type) { - foreach ($permissions as $permission) { - $permission = Permission::parse($permission); - if ($permission->getPermission() != $type) { - continue; - } - $role = (new Role( - $permission->getRole(), - $permission->getIdentifier(), - $permission->getDimension() - ))->toString(); - if (!Authorization::isRole($role)) { - throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); - } - } - } - } - - if (\is_null($permissions)) { - $permissions = $document->getPermissions() ?? []; - } - - $data['$id'] = $documentId; - $data['$permissions'] = $permissions; - $newDocument = new Document($data); - - $operations = 0; - - $setCollection = (function (Document $collection, Document $document) use (&$setCollection, $dbForProject, $database, &$operations) { - - $operations++; - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - continue; - } - - $isList = \is_array($related) && \array_values($related) === $related; - - if ($isList) { - $relations = $related; - } else { - $relations = [$related]; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) - ); - - foreach ($relations as &$relation) { - // If the relation is an array it can be either update or create a child document. - if ( - \is_array($relation) - && \array_values($relation) !== $relation - && !isset($relation['$id']) - ) { - $relation['$id'] = ID::unique(); - $relation = new Document($relation); - } - if ($relation instanceof Document) { - $oldDocument = Authorization::skip(fn () => $dbForProject->getDocument( - 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), - $relation->getId() - )); - $relation->removeAttribute('$collectionId'); - $relation->removeAttribute('$databaseId'); - // Attribute $collection is required for Utopia. - $relation->setAttribute( - '$collection', - 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence() - ); - - if ($oldDocument->isEmpty()) { - if (isset($relation['$id']) && $relation['$id'] === 'unique()') { - $relation['$id'] = ID::unique(); - } - } - $setCollection($relatedCollection, $relation); - } - } - - if ($isList) { - $document->setAttribute($relationship->getAttribute('key'), \array_values($relations)); - } else { - $document->setAttribute($relationship->getAttribute('key'), \reset($relations)); - } - } - }); - - $setCollection($collection, $newDocument); - - $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); - - try { - $document = $dbForProject->updateDocument( - 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), - $document->getId(), - $newDocument - ); - } catch (ConflictException) { - throw new Exception(Exception::DOCUMENT_UPDATE_CONFLICT); - } catch (DuplicateException) { - throw new Exception(Exception::DOCUMENT_ALREADY_EXISTS); - } catch (RelationshipException $e) { - throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); - } catch (StructureException $e) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); - } - - // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - continue; - } - if (!\is_array($related)) { - $related = [$related]; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) - ); - - foreach ($related as $relation) { - if ($relation instanceof Document) { - $processDocument($relatedCollection, $relation); - } - } - } - }; - - $processDocument($collection, $document); - - $relationships = \array_map( - fn ($document) => $document->getAttribute('key'), - \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ) - ); - - $queueForEvents - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setParam('documentId', $document->getId()) - ->setContext('collection', $collection) - ->setContext('database', $database) - ->setPayload($response->getPayload(), sensitive: $relationships); - - $response->dynamic($document, Response::MODEL_DOCUMENT); - }); - -App::put('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') - ->desc('Upsert document') - ->groups(['api', 'database']) - ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].upsert') - ->label('scope', 'documents.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'document.upsert') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}/document/{response.$id}') - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') - ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) - ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk', new Method( - namespace: 'databases', - group: 'documents', - name: 'upsertDocument', - description: '/docs/references/databases/upsert-document.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_DOCUMENT, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID.') - ->param('documentId', '', new CustomId(), 'Document ID.') - ->param('data', [], new JSON(), 'Document data as JSON object. Include all required attributes of the document to be created or updated.') - ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) - ->inject('requestTimestamp') - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->inject('queueForStatsUsage') - ->action(function (string $databaseId, string $collectionId, string $documentId, string|array $data, ?array $permissions, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage) { - $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array - - if (empty($data) && \is_null($permissions)) { - throw new Exception(Exception::DOCUMENT_MISSING_PAYLOAD); - } - - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); - - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); - if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - // Map aggregate permissions into the multiple permissions they represent. - $permissions = Permission::aggregate($permissions, [ - Database::PERMISSION_READ, - Database::PERMISSION_UPDATE, - Database::PERMISSION_DELETE, - ]); - - // Users can only manage their own roles, API keys and Admin users can manage any - $roles = Authorization::getRoles(); - if (!$isAPIKey && !$isPrivilegedUser && !\is_null($permissions)) { - foreach (Database::PERMISSIONS as $type) { - foreach ($permissions as $permission) { - $permission = Permission::parse($permission); - if ($permission->getPermission() != $type) { - continue; - } - $role = (new Role( - $permission->getRole(), - $permission->getIdentifier(), - $permission->getDimension() - ))->toString(); - if (!Authorization::isRole($role)) { - throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); - } - } - } - } - - $data['$id'] = $documentId; - $data['$permissions'] = $permissions; - $newDocument = new Document($data); - - $operations = 0; - - $setCollection = (function (Document $collection, Document $document) use (&$setCollection, $dbForProject, $database, &$operations) { - - $operations++; - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - continue; - } - - $isList = \is_array($related) && \array_values($related) === $related; - - if ($isList) { - $relations = $related; - } else { - $relations = [$related]; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) - ); - - foreach ($relations as &$relation) { - // If the relation is an array it can be either update or create a child document. - if ( - \is_array($relation) - && \array_values($relation) !== $relation - && !isset($relation['$id']) - ) { - $relation['$id'] = ID::unique(); - $relation = new Document($relation); - } - if ($relation instanceof Document) { - $oldDocument = Authorization::skip(fn () => $dbForProject->getDocument( - 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), - $relation->getId() - )); - $relation->removeAttribute('$collectionId'); - $relation->removeAttribute('$databaseId'); - // Attribute $collection is required for Utopia. - $relation->setAttribute( - '$collection', - 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence() - ); - - if ($oldDocument->isEmpty()) { - if (isset($relation['$id']) && $relation['$id'] === 'unique()') { - $relation['$id'] = ID::unique(); - } - } - $setCollection($relatedCollection, $relation); - } - } - - if ($isList) { - $document->setAttribute($relationship->getAttribute('key'), \array_values($relations)); - } else { - $document->setAttribute($relationship->getAttribute('key'), \reset($relations)); - } - } - }); - - $setCollection($collection, $newDocument); - - $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); - - $upserted = []; - try { - $modified = $dbForProject->createOrUpdateDocuments( - 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), - [$newDocument], - onNext: function (Document $document) use (&$upserted) { - $upserted[] = $document; - }, - ); - } catch (ConflictException) { - throw new Exception(Exception::DOCUMENT_UPDATE_CONFLICT); - } catch (DuplicateException) { - throw new Exception(Exception::DOCUMENT_ALREADY_EXISTS); - } catch (RelationshipException $e) { - throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); - } catch (StructureException $e) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); - } - - $document = $upserted[0]; - // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - continue; - } - if (!\is_array($related)) { - $related = [$related]; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) - ); - - foreach ($related as $relation) { - if ($relation instanceof Document) { - $processDocument($relatedCollection, $relation); - } - } - } - }; - - $processDocument($collection, $document); - - $relationships = \array_map( - fn ($document) => $document->getAttribute('key'), - \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ) - ); - - $queueForEvents - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setParam('documentId', $document->getId()) - ->setContext('collection', $collection) - ->setContext('database', $database) - ->setPayload($response->getPayload(), sensitive: $relationships); - - $response->dynamic($document, Response::MODEL_DOCUMENT); - }); - -App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') - ->desc('Update documents') - ->groups(['api', 'database']) - ->label('scope', 'documents.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'documents.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') - ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) - ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk', new Method( - namespace: 'databases', - group: 'documents', - name: 'updateDocuments', - description: '/docs/references/databases/update-documents.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_DOCUMENT_LIST, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID.') - ->param('data', [], new JSON(), 'Document data as JSON object. Include only attribute and value pairs to be updated.', true) - ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) - ->inject('requestTimestamp') - ->inject('response') - ->inject('dbForProject') - ->inject('queueForStatsUsage') - ->inject('plan') - ->action(function (string $databaseId, string $collectionId, string|array $data, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage, array $plan) { - $data = \is_string($data) - ? \json_decode($data, true) - : $data; - - if (empty($data)) { - throw new Exception(Exception::DOCUMENT_MISSING_PAYLOAD); - } - - $database = $dbForProject->getDocument('databases', $databaseId); - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $hasRelationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - if ($hasRelationships) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk update is not supported for collections with relationship attributes'); - } - - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - if ($data['$permissions']) { - $validator = new Permissions(); - if (!$validator->isValid($data['$permissions'])) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, $validator->getDescription()); - } - } - - $documents = []; - - try { - $modified = $dbForProject->updateDocuments( - 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), - new Document($data), - $queries, - onNext: function (Document $document) use ($plan, &$documents) { - if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { - $documents[] = $document; - } - }, - ); - } catch (ConflictException) { - throw new Exception(Exception::DOCUMENT_UPDATE_CONFLICT); - } catch (RelationshipException $e) { - throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); - } catch (StructureException $e) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); - } - - foreach ($documents as $document) { - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - } - - $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) - ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); - - $response->dynamic(new Document([ - 'total' => $modified, - 'documents' => $documents - ]), Response::MODEL_DOCUMENT_LIST); - }); - -App::put('/v1/databases/:databaseId/collections/:collectionId/documents') - ->desc('Create or update documents') - ->groups(['api', 'database']) - ->label('scope', 'documents.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'documents.upsert') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') - ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) - ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk', new Method( - namespace: 'databases', - group: 'documents', - name: 'upsertDocuments', - description: '/docs/references/databases/upsert-documents.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_DOCUMENT_LIST, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID.') - ->param('documents', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of document data as JSON objects. May contain partial documents.', true, ['plan']) - ->inject('response') - ->inject('dbForProject') - ->inject('queueForStatsUsage') - ->inject('plan') - ->action(function (string $databaseId, string $collectionId, array $documents, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage, array $plan) { - $database = $dbForProject->getDocument('databases', $databaseId); - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $hasRelationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - if ($hasRelationships) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk upsert is not supported for collections with relationship attributes'); - } - - foreach ($documents as $key => $document) { - $documents[$key] = new Document($document); - } - - $upserted = []; - - try { - $modified = $dbForProject->createOrUpdateDocuments( - 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), - $documents, - onNext: function (Document $document) use ($plan, &$upserted) { - if (\count($upserted) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { - $upserted[] = $document; - } - }, - ); - } catch (ConflictException) { - throw new Exception(Exception::DOCUMENT_UPDATE_CONFLICT); - } catch (DuplicateException) { - throw new Exception(Exception::DOCUMENT_ALREADY_EXISTS); - } catch (RelationshipException $e) { - throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); - } catch (StructureException $e) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); - } - - foreach ($upserted as $document) { - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - } - - $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) - ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); - - $response->dynamic(new Document([ - 'total' => $modified, - 'documents' => $upserted - ]), Response::MODEL_DOCUMENT_LIST); - }); - -App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') - ->alias('/v1/database/collections/:collectionId/documents/:documentId') - ->desc('Delete document') - ->groups(['api', 'database']) - ->label('scope', 'documents.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].delete') - ->label('audits.event', 'document.delete') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}/document/{request.documentId}') - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') - ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) - ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk', new Method( - namespace: 'databases', - group: 'documents', - name: 'deleteDocument', - description: '/docs/references/databases/delete-document.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_NOCONTENT, - model: Response::MODEL_NONE, - ) - ], - contentType: ContentType::NONE - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('documentId', '', new UID(), 'Document ID.') - ->inject('requestTimestamp') - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->inject('queueForStatsUsage') - ->action(function (string $databaseId, string $collectionId, string $documentId, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage) { - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); - - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); - if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - // Read permission should not be required for delete - $document = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); - if ($document->isEmpty()) { - throw new Exception(Exception::DOCUMENT_NOT_FOUND); - } - - try { - $dbForProject->deleteDocument( - 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), - $documentId - ); - } catch (ConflictException) { - throw new Exception(Exception::DOCUMENT_UPDATE_CONFLICT); - } catch (RestrictedException) { - throw new Exception(Exception::DOCUMENT_DELETE_RESTRICTED); - } - - $operations = 0; - - // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { - $operations++; - - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - continue; - } - if (!\is_array($related)) { - $related = [$related]; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) - ); - - foreach ($related as $relation) { - if ($relation instanceof Document) { - $processDocument($relatedCollection, $relation); - } - } - } - }; - - $processDocument($collection, $document); - - $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); - - $relationships = \array_map( - fn ($document) => $document->getAttribute('key'), - \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ) - ); - - $queueForEvents - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setParam('documentId', $document->getId()) - ->setContext('collection', $collection) - ->setContext('database', $database) - ->setPayload($response->output($document, Response::MODEL_DOCUMENT), sensitive: $relationships); - - $response->noContent(); - }); - -App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') - ->desc('Delete documents') - ->groups(['api', 'database']) - ->label('scope', 'documents.write') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('audits.event', 'documents.delete') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') - ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) - ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk', new Method( - namespace: 'databases', - group: 'documents', - name: 'deleteDocuments', - description: '/docs/references/databases/delete-documents.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_DOCUMENT_LIST, - ) - ], - contentType: ContentType::JSON - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') - ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) - ->inject('requestTimestamp') - ->inject('response') - ->inject('dbForProject') - ->inject('queueForStatsUsage') - ->inject('plan') - ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage, array $plan) { - $database = $dbForProject->getDocument('databases', $databaseId); - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $hasRelationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - if ($hasRelationships) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk delete is not supported for collections with relationship attributes'); - } - - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - $documents = []; - - try { - $modified = $dbForProject->deleteDocuments( - 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), - $queries, - onNext: function (Document $document) use ($plan, &$documents) { - if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { - $documents[] = $document; - } - }, - ); - } catch (ConflictException) { - throw new Exception(Exception::DOCUMENT_UPDATE_CONFLICT); - } catch (RestrictedException) { - throw new Exception(Exception::DOCUMENT_DELETE_RESTRICTED); - } - - foreach ($documents as $document) { - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - } - - $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) - ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); - - $response->dynamic(new Document([ - 'total' => $modified, - 'documents' => $documents, - ]), Response::MODEL_DOCUMENT_LIST); - }); - -App::get('/v1/databases/usage') - ->desc('Get databases usage stats') - ->groups(['api', 'database', 'usage']) - ->label('scope', 'collections.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: null, - name: 'getUsage', - description: '/docs/references/databases/get-usage.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_USAGE_DATABASES, - ) - ], - contentType: ContentType::JSON - )) - ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) - ->inject('response') - ->inject('dbForProject') - ->action(function (string $range, Response $response, Database $dbForProject) { - $periods = Config::getParam('usage', []); - $stats = $usage = []; - $days = $periods[$range]; - $metrics = [ - METRIC_DATABASES, - METRIC_COLLECTIONS, - METRIC_DOCUMENTS, - METRIC_DATABASES_STORAGE, - METRIC_DATABASES_OPERATIONS_READS, - METRIC_DATABASES_OPERATIONS_WRITES, - ]; - - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { - foreach ($metrics as $metric) { - $result = $dbForProject->findOne('stats', [ - Query::equal('metric', [$metric]), - Query::equal('period', ['inf']) - ]); - - $stats[$metric]['total'] = $result['value'] ?? 0; - $limit = $days['limit']; - $period = $days['period']; - $results = $dbForProject->find('stats', [ - Query::equal('metric', [$metric]), - Query::equal('period', [$period]), - Query::limit($limit), - Query::orderDesc('time'), - ]); - $stats[$metric]['data'] = []; - foreach ($results as $result) { - $stats[$metric]['data'][$result->getAttribute('time')] = [ - 'value' => $result->getAttribute('value'), - ]; - } - } - }); - - $format = match ($days['period']) { - '1h' => 'Y-m-d\TH:00:00.000P', - '1d' => 'Y-m-d\T00:00:00.000P', - }; - - foreach ($metrics as $metric) { - $usage[$metric]['total'] = $stats[$metric]['total']; - $usage[$metric]['data'] = []; - $leap = time() - ($days['limit'] * $days['factor']); - while ($leap < time()) { - $leap += $days['factor']; - $formatDate = date($format, $leap); - $usage[$metric]['data'][] = [ - 'value' => $stats[$metric]['data'][$formatDate]['value'] ?? 0, - 'date' => $formatDate, - ]; - } - } - $response->dynamic(new Document([ - 'range' => $range, - 'databasesTotal' => $usage[$metrics[0]]['total'], - 'collectionsTotal' => $usage[$metrics[1]]['total'], - 'documentsTotal' => $usage[$metrics[2]]['total'], - 'storageTotal' => $usage[$metrics[3]]['total'], - 'databasesReadsTotal' => $usage[$metrics[4]]['total'], - 'databasesWritesTotal' => $usage[$metrics[5]]['total'], - 'databases' => $usage[$metrics[0]]['data'], - 'collections' => $usage[$metrics[1]]['data'], - 'documents' => $usage[$metrics[2]]['data'], - 'storage' => $usage[$metrics[3]]['data'], - 'databasesReads' => $usage[$metrics[4]]['data'], - 'databasesWrites' => $usage[$metrics[5]]['data'], - ]), Response::MODEL_USAGE_DATABASES); - }); - -App::get('/v1/databases/:databaseId/usage') - ->desc('Get database usage stats') - ->groups(['api', 'database', 'usage']) - ->label('scope', 'collections.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: null, - name: 'getDatabaseUsage', - description: '/docs/references/databases/get-database-usage.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_USAGE_DATABASE, - ) - ], - contentType: ContentType::JSON, - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) - ->inject('response') - ->inject('dbForProject') - ->action(function (string $databaseId, string $range, Response $response, Database $dbForProject) { - $database = $dbForProject->getDocument('databases', $databaseId); - if ($database->isEmpty()) { - throw new Exception(Exception::DATABASE_NOT_FOUND); - } - - $periods = Config::getParam('usage', []); - $stats = $usage = []; - $days = $periods[$range]; - $metrics = [ - str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_COLLECTIONS), - str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_DOCUMENTS), - str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_STORAGE), - str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_READS), - str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES) - ]; - - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { - foreach ($metrics as $metric) { - $result = $dbForProject->findOne('stats', [ - Query::equal('metric', [$metric]), - Query::equal('period', ['inf']) - ]); - - $stats[$metric]['total'] = $result['value'] ?? 0; - $limit = $days['limit']; - $period = $days['period']; - $results = $dbForProject->find('stats', [ - Query::equal('metric', [$metric]), - Query::equal('period', [$period]), - Query::limit($limit), - Query::orderDesc('time'), - ]); - $stats[$metric]['data'] = []; - foreach ($results as $result) { - $stats[$metric]['data'][$result->getAttribute('time')] = [ - 'value' => $result->getAttribute('value'), - ]; - } - } - }); - - $format = match ($days['period']) { - '1h' => 'Y-m-d\TH:00:00.000P', - '1d' => 'Y-m-d\T00:00:00.000P', - }; - - foreach ($metrics as $metric) { - $usage[$metric]['total'] = $stats[$metric]['total']; - $usage[$metric]['data'] = []; - $leap = time() - ($days['limit'] * $days['factor']); - while ($leap < time()) { - $leap += $days['factor']; - $formatDate = date($format, $leap); - $usage[$metric]['data'][] = [ - 'value' => $stats[$metric]['data'][$formatDate]['value'] ?? 0, - 'date' => $formatDate, - ]; - } - } - - $response->dynamic(new Document([ - 'range' => $range, - 'collectionsTotal' => $usage[$metrics[0]]['total'], - 'documentsTotal' => $usage[$metrics[1]]['total'], - 'storageTotal' => $usage[$metrics[2]]['total'], - 'databaseReadsTotal' => $usage[$metrics[3]]['total'], - 'databaseWritesTotal' => $usage[$metrics[4]]['total'], - 'collections' => $usage[$metrics[0]]['data'], - 'documents' => $usage[$metrics[1]]['data'], - 'storage' => $usage[$metrics[2]]['data'], - 'databaseReads' => $usage[$metrics[3]]['data'], - 'databaseWrites' => $usage[$metrics[4]]['data'], - ]), Response::MODEL_USAGE_DATABASE); - }); - -App::get('/v1/databases/:databaseId/collections/:collectionId/usage') - ->alias('/v1/database/:collectionId/usage') - ->desc('Get collection usage stats') - ->groups(['api', 'database', 'usage']) - ->label('scope', 'collections.read') - ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk', new Method( - namespace: 'databases', - group: null, - name: 'getCollectionUsage', - description: '/docs/references/databases/get-collection-usage.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_USAGE_COLLECTION, - ) - ], - contentType: ContentType::JSON, - )) - ->param('databaseId', '', new UID(), 'Database ID.') - ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) - ->param('collectionId', '', new UID(), 'Collection ID.') - ->inject('response') - ->inject('dbForProject') - ->action(function (string $databaseId, string $range, string $collectionId, Response $response, Database $dbForProject) { - $database = $dbForProject->getDocument('databases', $databaseId); - $collectionDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); - $collection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $collectionDocument->getSequence()); - - if ($collection->isEmpty()) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } - - $periods = Config::getParam('usage', []); - $stats = $usage = []; - $days = $periods[$range]; - $metrics = [ - str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getSequence(), $collectionDocument->getSequence()], METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS), - ]; - - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { - foreach ($metrics as $metric) { - $result = $dbForProject->findOne('stats', [ - Query::equal('metric', [$metric]), - Query::equal('period', ['inf']) - ]); - - $stats[$metric]['total'] = $result['value'] ?? 0; - $limit = $days['limit']; - $period = $days['period']; - $results = $dbForProject->find('stats', [ - Query::equal('metric', [$metric]), - Query::equal('period', [$period]), - Query::limit($limit), - Query::orderDesc('time'), - ]); - $stats[$metric]['data'] = []; - foreach ($results as $result) { - $stats[$metric]['data'][$result->getAttribute('time')] = [ - 'value' => $result->getAttribute('value'), - ]; - } - } - }); - - $format = match ($days['period']) { - '1h' => 'Y-m-d\TH:00:00.000P', - '1d' => 'Y-m-d\T00:00:00.000P', - }; - - foreach ($metrics as $metric) { - $usage[$metric]['total'] = $stats[$metric]['total']; - $usage[$metric]['data'] = []; - $leap = time() - ($days['limit'] * $days['factor']); - while ($leap < time()) { - $leap += $days['factor']; - $formatDate = date($format, $leap); - $usage[$metric]['data'][] = [ - 'value' => $stats[$metric]['data'][$formatDate]['value'] ?? 0, - 'date' => $formatDate, - ]; - } - } - - $response->dynamic(new Document([ - 'range' => $range, - 'documentsTotal' => $usage[$metrics[0]]['total'], - 'documents' => $usage[$metrics[0]]['data'], - ]), Response::MODEL_USAGE_COLLECTION); - }); diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 2bdaea3c2c..765688e1ee 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -1,7 +1,19 @@ <?php use Appwrite\ClamAV\Network; +use Appwrite\Event\Audit; +use Appwrite\Event\Build; +use Appwrite\Event\Certificate; +use Appwrite\Event\Database; +use Appwrite\Event\Delete; use Appwrite\Event\Event; +use Appwrite\Event\Func; +use Appwrite\Event\Mail; +use Appwrite\Event\Messaging; +use Appwrite\Event\Migration; +use Appwrite\Event\StatsResources; +use Appwrite\Event\StatsUsage; +use Appwrite\Event\Webhook; use Appwrite\Extend\Exception; use Appwrite\PubSub\Adapter\Pool as PubSubPool; use Appwrite\SDK\AuthType; @@ -16,17 +28,17 @@ use Utopia\Database\Adapter\Pool as DatabasePool; use Utopia\Database\Document; use Utopia\Domains\Validator\PublicDomain; use Utopia\Pools\Group; -use Utopia\Queue\Publisher; -use Utopia\Queue\Queue; use Utopia\Registry\Registry; use Utopia\Storage\Device; use Utopia\Storage\Device\Local; use Utopia\Storage\Storage; use Utopia\System\System; +use Utopia\Validator\AnyOf; use Utopia\Validator\Domain; use Utopia\Validator\Integer; use Utopia\Validator\Multiple; use Utopia\Validator\Text; +use Utopia\Validator\URL; use Utopia\Validator\WhiteList; App::get('/v1/health') @@ -332,12 +344,12 @@ App::get('/v1/health/queue/webhooks') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForWebhooks') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Webhook $queueForWebhooks, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::WEBHOOK_QUEUE_NAME)); + $size = $queueForWebhooks->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -365,12 +377,12 @@ App::get('/v1/health/queue/logs') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForAudits') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Audit $queueForAudits, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::AUDITS_QUEUE_NAME)); + $size = $queueForAudits->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -397,7 +409,7 @@ App::get('/v1/health/certificate') ], contentType: ContentType::JSON )) - ->param('domain', null, new Multiple([new Domain(), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name') + ->param('domain', null, new Multiple([new AnyOf([new URL(), new Domain()]), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name') ->inject('response') ->action(function (string $domain, Response $response) { if (filter_var($domain, FILTER_VALIDATE_URL)) { @@ -455,12 +467,12 @@ App::get('/v1/health/queue/certificates') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForCertificates') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Certificate $queueForCertificates, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::CERTIFICATES_QUEUE_NAME)); + $size = $queueForCertificates->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -488,12 +500,12 @@ App::get('/v1/health/queue/builds') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForBuilds') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Build $queueForBuilds, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::BUILDS_QUEUE_NAME)); + $size = $queueForBuilds->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -522,12 +534,11 @@ App::get('/v1/health/queue/databases') )) ->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForDatabase') ->inject('response') - ->action(function (string $name, int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (string $name, int|string $threshold, Database $queueForDatabase, Response $response) { $threshold = \intval($threshold); - - $size = $publisher->getQueueSize(new Queue($name)); + $size = $queueForDatabase->setQueue($name)->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -555,12 +566,12 @@ App::get('/v1/health/queue/deletes') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForDeletes') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Delete $queueForDeletes, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::DELETE_QUEUE_NAME)); + $size = $queueForDeletes->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -588,12 +599,12 @@ App::get('/v1/health/queue/mails') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForMails') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Mail $queueForMails, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::MAILS_QUEUE_NAME)); + $size = $queueForMails->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -621,12 +632,12 @@ App::get('/v1/health/queue/messaging') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForMessaging') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Messaging $queueForMessaging, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::MESSAGING_QUEUE_NAME)); + $size = $queueForMessaging->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -654,12 +665,12 @@ App::get('/v1/health/queue/migrations') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForMigrations') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Migration $queueForMigrations, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::MIGRATIONS_QUEUE_NAME)); + $size = $queueForMigrations->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -687,12 +698,12 @@ App::get('/v1/health/queue/functions') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForFunctions') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Func $queueForFunctions, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::FUNCTIONS_QUEUE_NAME)); + $size = $queueForFunctions->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -702,7 +713,7 @@ App::get('/v1/health/queue/functions') }); App::get('/v1/health/queue/stats-resources') - ->desc('Get stats resources queue') + ->desc('Get stats resources queue') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk', new Method( @@ -720,12 +731,12 @@ App::get('/v1/health/queue/stats-resources') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForStatsResources') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, StatsResources $queueForStatsResources, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::STATS_RESOURCES_QUEUE_NAME)); + $size = $queueForStatsResources->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -753,12 +764,12 @@ App::get('/v1/health/queue/stats-usage') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForStatsUsage') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, StatsUsage $queueForStatsUsage, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::STATS_USAGE_QUEUE_NAME)); + $size = $queueForStatsUsage->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -949,11 +960,53 @@ App::get('/v1/health/queue/failed/:name') ]), 'The name of the queue') ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('response') - ->inject('publisher') - ->action(function (string $name, int|string $threshold, Response $response, Publisher $publisher) { + ->inject('queueForDatabase') + ->inject('queueForDeletes') + ->inject('queueForAudits') + ->inject('queueForMails') + ->inject('queueForFunctions') + ->inject('queueForStatsResources') + ->inject('queueForStatsUsage') + ->inject('queueForWebhooks') + ->inject('queueForCertificates') + ->inject('queueForBuilds') + ->inject('queueForMessaging') + ->inject('queueForMigrations') + ->action(function ( + string $name, + int|string $threshold, + Response $response, + Database $queueForDatabase, + Delete $queueForDeletes, + Audit $queueForAudits, + Mail $queueForMails, + Func $queueForFunctions, + StatsResources $queueForStatsResources, + StatsUsage $queueForStatsUsage, + Webhook $queueForWebhooks, + Certificate $queueForCertificates, + Build $queueForBuilds, + Messaging $queueForMessaging, + Migration $queueForMigrations + ) { $threshold = \intval($threshold); - $failed = $publisher->getQueueSize(new Queue($name), failedJobs: true); + /** @var Event $queue */ + $queue = match ($name) { + Event::DATABASE_QUEUE_NAME => $queueForDatabase, + Event::DELETE_QUEUE_NAME => $queueForDeletes, + Event::AUDITS_QUEUE_NAME => $queueForAudits, + Event::MAILS_QUEUE_NAME => $queueForMails, + Event::FUNCTIONS_QUEUE_NAME => $queueForFunctions, + Event::STATS_RESOURCES_QUEUE_NAME => $queueForStatsResources, + Event::STATS_USAGE_QUEUE_NAME => $queueForStatsUsage, + Event::WEBHOOK_QUEUE_NAME => $queueForWebhooks, + Event::CERTIFICATES_QUEUE_NAME => $queueForCertificates, + Event::BUILDS_QUEUE_NAME => $queueForBuilds, + Event::MESSAGING_QUEUE_NAME => $queueForMessaging, + Event::MIGRATIONS_QUEUE_NAME => $queueForMigrations, + }; + $failed = $queue->getSize(failed: true); if ($failed >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue failed jobs threshold hit. Current size is {$failed} and threshold is {$threshold}."); diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 0bc6f93787..dbc384f3c4 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -13,6 +13,7 @@ use Appwrite\Permission; use Appwrite\Role; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CompoundUID; @@ -238,19 +239,38 @@ App::post('/v1/messaging/providers/smtp') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk', new Method( - namespace: 'messaging', - group: 'providers', - name: 'createSmtpProvider', - description: '/docs/references/messaging/create-smtp-provider.md', - auth: [AuthType::ADMIN, AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_PROVIDER, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'messaging', + group: 'providers', + name: 'createSmtpProvider', + description: '/docs/references/messaging/create-smtp-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'messaging.createSMTPProvider', + ), + ), + new Method( + namespace: 'messaging', + group: 'providers', + name: 'createSMTPProvider', + description: '/docs/references/messaging/create-smtp-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + ) + ]) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('host', '', new Text(0), 'SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.') @@ -752,19 +772,38 @@ App::post('/v1/messaging/providers/fcm') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk', new Method( - namespace: 'messaging', - group: 'providers', - name: 'createFcmProvider', - description: '/docs/references/messaging/create-fcm-provider.md', - auth: [AuthType::ADMIN, AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_PROVIDER, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'messaging', + group: 'providers', + name: 'createFcmProvider', + description: '/docs/references/messaging/create-fcm-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'messaging.createFCMProvider', + ), + ), + new Method( + namespace: 'messaging', + group: 'providers', + name: 'createFCMProvider', + description: '/docs/references/messaging/create-fcm-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + ) + ]) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('serviceAccountJSON', null, new JSON(), 'FCM service account JSON.', true) @@ -822,19 +861,38 @@ App::post('/v1/messaging/providers/apns') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk', new Method( - namespace: 'messaging', - group: 'providers', - name: 'createApnsProvider', - description: '/docs/references/messaging/create-apns-provider.md', - auth: [AuthType::ADMIN, AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_PROVIDER, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'messaging', + group: 'providers', + name: 'createApnsProvider', + description: '/docs/references/messaging/create-apns-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'messaging.createAPNSProvider', + ), + ), + new Method( + namespace: 'messaging', + group: 'providers', + name: 'createAPNSProvider', + description: '/docs/references/messaging/create-apns-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + ) + ]) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('authKey', '', new Text(0), 'APNS authentication key.', true) @@ -1322,19 +1380,38 @@ App::patch('/v1/messaging/providers/smtp/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk', new Method( - namespace: 'messaging', - group: 'providers', - name: 'updateSmtpProvider', - description: '/docs/references/messaging/update-smtp-provider.md', - auth: [AuthType::ADMIN, AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_PROVIDER, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'messaging', + group: 'providers', + name: 'updateSmtpProvider', + description: '/docs/references/messaging/update-smtp-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'messaging.updateSMTPProvider', + ), + ), + new Method( + namespace: 'messaging', + group: 'providers', + name: 'updateSMTPProvider', + description: '/docs/references/messaging/update-smtp-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + ) + ]) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('host', '', new Text(0), 'SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.', true) @@ -1894,19 +1971,38 @@ App::patch('/v1/messaging/providers/fcm/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk', new Method( - namespace: 'messaging', - group: 'providers', - name: 'updateFcmProvider', - description: '/docs/references/messaging/update-fcm-provider.md', - auth: [AuthType::ADMIN, AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_PROVIDER, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'messaging', + group: 'providers', + name: 'updateFcmProvider', + description: '/docs/references/messaging/update-fcm-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'messaging.updateFCMProvider', + ), + ), + new Method( + namespace: 'messaging', + group: 'providers', + name: 'updateFCMProvider', + description: '/docs/references/messaging/update-fcm-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + ) + ]) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1970,19 +2066,38 @@ App::patch('/v1/messaging/providers/apns/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk', new Method( - namespace: 'messaging', - group: 'providers', - name: 'updateApnsProvider', - description: '/docs/references/messaging/update-apns-provider.md', - auth: [AuthType::ADMIN, AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_PROVIDER, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'messaging', + group: 'providers', + name: 'updateApnsProvider', + description: '/docs/references/messaging/update-apns-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'messaging.updateAPNSProvider', + ), + ), + new Method( + namespace: 'messaging', + group: 'providers', + name: 'updateAPNSProvider', + description: '/docs/references/messaging/update-apns-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + ) + ]) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -2896,7 +3011,7 @@ App::post('/v1/messaging/messages/email') ->inject('project') ->inject('queueForMessaging') ->inject('response') - ->action(function (string $messageId, string $subject, string $content, array $topics, array $users, array $targets, array $cc, array $bcc, array $attachments, bool $draft, bool $html, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { + ->action(function (string $messageId, string $subject, string $content, ?array $topics, ?array $users, ?array $targets, ?array $cc, ?array $bcc, ?array $attachments, bool $draft, bool $html, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { $messageId = $messageId == 'unique()' ? ID::unique() : $messageId; @@ -2987,7 +3102,7 @@ App::post('/v1/messaging/messages/email') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3024,19 +3139,38 @@ App::post('/v1/messaging/messages/sms') ->label('event', 'messages.[messageId].create') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk', new Method( - namespace: 'messaging', - group: 'messages', - name: 'createSms', - description: '/docs/references/messaging/create-sms.md', - auth: [AuthType::ADMIN, AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_MESSAGE, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'messaging', + group: 'messages', + name: 'createSms', + description: '/docs/references/messaging/create-sms.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MESSAGE, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'messaging.createSMS', + ), + ), + new Method( + namespace: 'messaging', + group: 'messages', + name: 'createSMS', + description: '/docs/references/messaging/create-sms.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MESSAGE, + ) + ] + ) + ]) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('content', '', new Text(64230), 'SMS Content.') ->param('topics', [], new ArrayList(new UID()), 'List of Topic IDs.', true) @@ -3050,7 +3184,7 @@ App::post('/v1/messaging/messages/sms') ->inject('project') ->inject('queueForMessaging') ->inject('response') - ->action(function (string $messageId, string $content, array $topics, array $users, array $targets, bool $draft, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { + ->action(function (string $messageId, string $content, ?array $topics, ?array $users, ?array $targets, bool $draft, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { $messageId = $messageId == 'unique()' ? ID::unique() : $messageId; @@ -3110,7 +3244,7 @@ App::post('/v1/messaging/messages/sms') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3185,7 +3319,7 @@ App::post('/v1/messaging/messages/push') ->inject('project') ->inject('queueForMessaging') ->inject('response') - ->action(function (string $messageId, string $title, string $body, array $topics, array $users, array $targets, ?array $data, string $action, string $image, string $icon, string $sound, string $color, string $tag, int $badge, bool $draft, ?string $scheduledAt, bool $contentAvailable, bool $critical, string $priority, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { + ->action(function (string $messageId, string $title, string $body, ?array $topics, ?array $users, ?array $targets, ?array $data, string $action, string $image, string $icon, string $sound, string $color, string $tag, int $badge, bool $draft, ?string $scheduledAt, bool $contentAvailable, bool $critical, string $priority, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { $messageId = $messageId == 'unique()' ? ID::unique() : $messageId; @@ -3328,7 +3462,7 @@ App::post('/v1/messaging/messages/push') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3729,7 +3863,7 @@ App::patch('/v1/messaging/messages/email/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3851,19 +3985,38 @@ App::patch('/v1/messaging/messages/sms/:messageId') ->label('event', 'messages.[messageId].update') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk', new Method( - namespace: 'messaging', - group: 'messages', - name: 'updateSms', - description: '/docs/references/messaging/update-sms.md', - auth: [AuthType::ADMIN, AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_MESSAGE, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'messaging', + group: 'messages', + name: 'updateSms', + description: '/docs/references/messaging/update-sms.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'messaging.updateSMS', + ), + ), + new Method( + namespace: 'messaging', + group: 'messages', + name: 'updateSMS', + description: '/docs/references/messaging/update-sms.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] + ) + ]) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) @@ -3931,7 +4084,7 @@ App::patch('/v1/messaging/messages/sms/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -4105,7 +4258,7 @@ App::patch('/v1/messaging/messages/push/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 92fca88744..4a968e63f2 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -35,6 +35,7 @@ use Utopia\Storage\Compression\Compression; use Utopia\Storage\Device; use Utopia\System\System; use Utopia\Validator\ArrayList; +use Utopia\Validator\Boolean; use Utopia\Validator\Integer; use Utopia\Validator\Text; use Utopia\Validator\URL; @@ -328,24 +329,33 @@ App::post('/v1/migrations/csv') ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->param('resourceId', null, new CompoundUID(), 'Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.') + ->param('internalFile', false, new Boolean(), 'Is the file stored in an internal bucket?', true) ->inject('response') ->inject('dbForProject') + ->inject('dbForPlatform') ->inject('project') ->inject('deviceForFiles') ->inject('deviceForImports') ->inject('queueForEvents') ->inject('queueForMigrations') - ->action(function (string $bucketId, string $fileId, string $resourceId, Response $response, Database $dbForProject, Document $project, Device $deviceForFiles, Device $deviceForImports, Event $queueForEvents, Migration $queueForMigrations) { + ->action(function (string $bucketId, string $fileId, string $resourceId, bool $internalFile, Response $response, Database $dbForProject, Database $dbForPlatform, Document $project, Device $deviceForFiles, Device $deviceForImports, Event $queueForEvents, Migration $queueForMigrations) { $isAPIKey = Auth::isAppUser(Authorization::getRoles()); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); - - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + if ($internalFile && !$isPrivilegedUser) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + $bucket = Authorization::skip(function () use ($internalFile, $dbForPlatform, $dbForProject, $bucketId) { + if ($internalFile) { + return $dbForPlatform->getDocument('buckets', 'default'); + } + return $dbForProject->getDocument('buckets', $bucketId); + }); if ($bucket->isEmpty() || (!$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $file = Authorization::skip(fn () => $internalFile ? $dbForPlatform->getDocument('bucket_' . $bucket->getSequence(), $fileId) : $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } @@ -361,7 +371,7 @@ App::post('/v1/migrations/csv') $hasCompression = $compression !== Compression::NONE; $migrationId = ID::unique(); - $newPath = $deviceForImports->getPath('/' . $migrationId . '_' . $fileId . '.csv'); + $newPath = $deviceForImports->getPath($migrationId . '_' . $fileId . '.csv'); if ($hasEncryption || $hasCompression) { $source = $deviceForFiles->read($path); @@ -410,8 +420,8 @@ App::post('/v1/migrations/csv') 'resources' => $resources, 'resourceId' => $resourceId, 'resourceType' => Resource::TYPE_DATABASE, - 'statusCounters' => [], - 'resourceData' => [], + 'statusCounters' => '{}', + 'resourceData' => '{}', 'errors' => [], 'options' => [ 'path' => $newPath, diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index d09470ff39..390e88637a 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -354,6 +354,7 @@ App::get('/v1/project/usage') 'executionsMbSecondsTotal' => $total[METRIC_EXECUTIONS_MB_SECONDS], 'buildsMbSecondsTotal' => $total[METRIC_BUILDS_MB_SECONDS], 'documentsTotal' => $total[METRIC_DOCUMENTS], + 'rowsTotal' => $total[METRIC_DOCUMENTS], 'databasesTotal' => $total[METRIC_DATABASES], 'databasesStorageTotal' => $total[METRIC_DATABASES_STORAGE], 'usersTotal' => $total[METRIC_USERS], diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 51cbc097f5..ea3a00dcb6 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -8,10 +8,11 @@ use Appwrite\Event\Mail; use Appwrite\Event\Validator\Event; use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; +use Appwrite\Network\Platform; use Appwrite\Network\Validator\Email; -use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Template\Template; @@ -29,14 +30,11 @@ use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Exception\Duplicate; -use Utopia\Database\Exception\Order as OrderException; -use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Query; use Utopia\Database\Validator\Datetime as DatetimeValidator; -use Utopia\Database\Validator\Query\Cursor; use Utopia\Database\Validator\UID; use Utopia\Domains\Validator\PublicDomain; use Utopia\DSN\DSN; @@ -127,6 +125,7 @@ App::post('/v1/projects') 'membershipsUserName' => false, 'membershipsUserEmail' => false, 'membershipsMfa' => false, + 'invalidateSessions' => true ]; foreach ($auth as $method) { @@ -230,7 +229,7 @@ App::post('/v1/projects') if ($sharedTables) { $dbForProject ->setSharedTables(true) - ->setTenant($sharedTablesV1 ? $project->getSequence() : null) + ->setTenant($sharedTablesV1 ? (int)$project->getSequence() : null) ->setNamespace($dsn->getParam('namespace')); } else { $dbForProject @@ -302,77 +301,6 @@ App::post('/v1/projects') ->dynamic($project, Response::MODEL_PROJECT); }); -App::get('/v1/projects') - ->desc('List projects') - ->groups(['api', 'projects']) - ->label('scope', 'projects.read') - ->label('sdk', new Method( - namespace: 'projects', - group: 'projects', - name: 'list', - description: '/docs/references/projects/list.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_PROJECT_LIST, - ) - ] - )) - ->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true) - ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) - ->inject('response') - ->inject('dbForPlatform') - ->action(function (array $queries, string $search, Response $response, Database $dbForPlatform) { - - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - if (!empty($search)) { - $queries[] = Query::search('search', $search); - } - - /** - * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries - */ - $cursor = \array_filter($queries, function ($query) { - return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); - }); - $cursor = reset($cursor); - if ($cursor) { - /** @var Query $cursor */ - - $validator = new Cursor(); - if (!$validator->isValid($cursor)) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); - } - - $projectId = $cursor->getValue(); - $cursorDocument = $dbForPlatform->getDocument('projects', $projectId); - - if ($cursorDocument->isEmpty()) { - throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Project '{$projectId}' for the 'cursor' value not found."); - } - - $cursor->setValue($cursorDocument); - } - - $filterQueries = Query::groupByType($queries)['filters']; - try { - $projects = $dbForPlatform->find('projects', $queries); - $total = $dbForPlatform->count('projects', $filterQueries, APP_LIMIT_COUNT); - } catch (OrderException $e) { - throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); - } - $response->dynamic(new Document([ - 'projects' => $projects, - 'total' => $total, - ]), Response::MODEL_PROJECT_LIST); - }); - App::get('/v1/projects/:projectId') ->desc('Get project') ->groups(['api', 'projects']) @@ -618,19 +546,38 @@ App::patch('/v1/projects/:projectId/api') ->desc('Update API status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk', new Method( - namespace: 'projects', - group: 'projects', - name: 'updateApiStatus', - description: '/docs/references/projects/update-api-status.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_PROJECT, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'projects', + group: 'projects', + name: 'updateApiStatus', + description: '/docs/references/projects/update-api-status.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'projects.updateAPIStatus', + ), + ), + new Method( + namespace: 'projects', + group: 'projects', + name: 'updateAPIStatus', + description: '/docs/references/projects/update-api-status.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + ) + ]) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('api', '', new WhiteList(array_keys(Config::getParam('apis')), true), 'API name.') ->param('status', null, new Boolean(), 'API status.') @@ -656,19 +603,38 @@ App::patch('/v1/projects/:projectId/api/all') ->desc('Update all API status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk', new Method( - namespace: 'projects', - group: 'projects', - name: 'updateApiStatusAll', - description: '/docs/references/projects/update-api-status-all.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_PROJECT, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'projects', + group: 'projects', + name: 'updateApiStatusAll', + description: '/docs/references/projects/update-api-status-all.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'projects.updateAPIStatusAll', + ), + ), + new Method( + namespace: 'projects', + group: 'projects', + name: 'updateAPIStatusAll', + description: '/docs/references/projects/update-api-status-all.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + ) + ]) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('status', null, new Boolean(), 'API status.') ->inject('response') @@ -1790,7 +1756,7 @@ App::post('/v1/projects/:projectId/platforms') ] )) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('type', null, new WhiteList([Origin::CLIENT_TYPE_WEB, Origin::CLIENT_TYPE_FLUTTER_WEB, Origin::CLIENT_TYPE_FLUTTER_IOS, Origin::CLIENT_TYPE_FLUTTER_ANDROID, Origin::CLIENT_TYPE_FLUTTER_LINUX, Origin::CLIENT_TYPE_FLUTTER_MACOS, Origin::CLIENT_TYPE_FLUTTER_WINDOWS, Origin::CLIENT_TYPE_APPLE_IOS, Origin::CLIENT_TYPE_APPLE_MACOS, Origin::CLIENT_TYPE_APPLE_WATCHOS, Origin::CLIENT_TYPE_APPLE_TVOS, Origin::CLIENT_TYPE_ANDROID, Origin::CLIENT_TYPE_UNITY, Origin::CLIENT_TYPE_REACT_NATIVE_IOS, Origin::CLIENT_TYPE_REACT_NATIVE_ANDROID], true), 'Platform type.') + ->param('type', null, new WhiteList([Platform::TYPE_WEB, Platform::TYPE_FLUTTER_WEB, Platform::TYPE_FLUTTER_IOS, Platform::TYPE_FLUTTER_ANDROID, Platform::TYPE_FLUTTER_LINUX, Platform::TYPE_FLUTTER_MACOS, Platform::TYPE_FLUTTER_WINDOWS, Platform::TYPE_APPLE_IOS, Platform::TYPE_APPLE_MACOS, Platform::TYPE_APPLE_WATCHOS, Platform::TYPE_APPLE_TVOS, Platform::TYPE_ANDROID, Platform::TYPE_UNITY, Platform::TYPE_REACT_NATIVE_IOS, Platform::TYPE_REACT_NATIVE_ANDROID], true), 'Platform type.') ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.') ->param('key', '', new Text(256), 'Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.', true) ->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true) @@ -2017,19 +1983,38 @@ App::patch('/v1/projects/:projectId/smtp') ->desc('Update SMTP') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk', new Method( - namespace: 'projects', - group: 'templates', - name: 'updateSmtp', - description: '/docs/references/projects/update-smtp.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_PROJECT, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'projects', + group: 'templates', + name: 'updateSmtp', + description: '/docs/references/projects/update-smtp.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'projects.updateSMTP', + ), + ), + new Method( + namespace: 'projects', + group: 'templates', + name: 'updateSMTP', + description: '/docs/references/projects/update-smtp.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + ) + ]) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(), 'Enable custom SMTP service') ->param('senderName', '', new Text(255, 0), 'Name of the email sender', true) @@ -2114,19 +2099,38 @@ App::post('/v1/projects/:projectId/smtp/tests') ->desc('Create SMTP test') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk', new Method( - namespace: 'projects', - group: 'templates', - name: 'createSmtpTest', - description: '/docs/references/projects/create-smtp-test.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_NOCONTENT, - model: Response::MODEL_NONE, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'projects', + group: 'templates', + name: 'createSmtpTest', + description: '/docs/references/projects/create-smtp-test.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'projects.createSMTPTest', + ), + ), + new Method( + namespace: 'projects', + group: 'templates', + name: 'createSMTPTest', + description: '/docs/references/projects/create-smtp-test.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] + ) + ]) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('emails', [], new ArrayList(new Email(), 10), 'Array of emails to send test email to. Maximum of 10 emails are allowed.') ->param('senderName', System::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME . ' Server'), new Text(255, 0), 'Name of the email sender') @@ -2175,7 +2179,7 @@ App::post('/v1/projects/:projectId/smtp/tests') ->setSmtpSenderName($senderName) ->setRecipient($email) ->setName('') - ->setbodyTemplate(__DIR__ . '/../../config/locale/templates/email-base-styled.tpl') + ->setBodyTemplate(__DIR__ . '/../../config/locale/templates/email-base-styled.tpl') ->setBody($template->render()) ->setVariables([]) ->setSubject($subject) @@ -2189,19 +2193,38 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Get custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk', new Method( - namespace: 'projects', - group: 'templates', - name: 'getSmsTemplate', - description: '/docs/references/projects/get-sms-template.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_SMS_TEMPLATE, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'projects', + group: 'templates', + name: 'getSmsTemplate', + description: '/docs/references/projects/get-sms-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'projects.getSMSTemplate', + ), + ), + new Method( + namespace: 'projects', + group: 'templates', + name: 'getSMSTemplate', + description: '/docs/references/projects/get-sms-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ] + ) + ]) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -2267,16 +2290,56 @@ App::get('/v1/projects/:projectId/templates/email/:type/:locale') $template = $templates['email.' . $type . '-' . $locale] ?? null; $localeObj = new Locale($locale); + $localeObj->setFallback(System::getEnv('_APP_LOCALE', 'en')); + if (is_null($template)) { - $message = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-inner-base.tpl'); + /** + * different templates, different placeholders. + */ + $templateConfigs = [ + 'magicSession' => [ + 'file' => 'email-magic-url.tpl', + 'placeholders' => ['optionButton', 'buttonText', 'optionUrl', 'clientInfo', 'securityPhrase'] + ], + 'mfaChallenge' => [ + 'file' => 'email-mfa-challenge.tpl', + 'placeholders' => ['description', 'clientInfo'] + ], + 'otpSession' => [ + 'file' => 'email-otp.tpl', + 'placeholders' => ['description', 'clientInfo', 'securityPhrase'] + ], + 'sessionAlert' => [ + 'file' => 'email-session-alert.tpl', + 'placeholders' => ['body', 'listDevice', 'listIpAddress', 'listCountry', 'footer'] + ], + ]; + + // fallback to the base template. + $config = $templateConfigs[$type] ?? [ + 'file' => 'email-inner-base.tpl', + 'placeholders' => ['buttonText', 'body', 'footer'] + ]; + + $templateString = file_get_contents(__DIR__ . '/../../config/locale/templates/' . $config['file']); + + // We use `fromString` due to the replace above + $message = Template::fromString($templateString); + + // Set type-specific parameters + foreach ($config['placeholders'] as $param) { + $escapeHtml = !in_array($param, ['clientInfo', 'body', 'footer', 'description']); + $message->setParam("{{{$param}}}", $localeObj->getText("emails.{$type}.{$param}"), escapeHtml: $escapeHtml); + } + $message + // common placeholders on all the templates ->setParam('{{hello}}', $localeObj->getText("emails.{$type}.hello")) - ->setParam('{{footer}}', $localeObj->getText("emails.{$type}.footer")) - ->setParam('{{body}}', $localeObj->getText('emails.' . $type . '.body'), escapeHtml: false) ->setParam('{{thanks}}', $localeObj->getText("emails.{$type}.thanks")) - ->setParam('{{signature}}', $localeObj->getText("emails.{$type}.signature")) - ->setParam('{{direction}}', $localeObj->getText('settings.direction')); - $message = $message->render(); + ->setParam('{{signature}}', $localeObj->getText("emails.{$type}.signature")); + + // `useContent: false` will strip new lines! + $message = $message->render(useContent: true); $template = [ 'message' => $message, @@ -2296,19 +2359,38 @@ App::patch('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Update custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk', new Method( - namespace: 'projects', - group: 'templates', - name: 'updateSmsTemplate', - description: '/docs/references/projects/update-sms-template.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_SMS_TEMPLATE, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'projects', + group: 'templates', + name: 'updateSmsTemplate', + description: '/docs/references/projects/update-sms-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'projects.updateSMSTemplate', + ), + ), + new Method( + namespace: 'projects', + group: 'templates', + name: 'updateSMSTemplate', + description: '/docs/references/projects/update-sms-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ] + ) + ]) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -2400,20 +2482,40 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Reset custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk', new Method( - namespace: 'projects', - group: 'templates', - name: 'deleteSmsTemplate', - description: '/docs/references/projects/delete-sms-template.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_SMS_TEMPLATE, - ) - ], - contentType: ContentType::JSON - )) + ->label('sdk', [ + new Method( + namespace: 'projects', + group: 'templates', + name: 'deleteSmsTemplate', + description: '/docs/references/projects/delete-sms-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'projects.deleteSMSTemplate', + ), + ), + new Method( + namespace: 'projects', + group: 'templates', + name: 'deleteSMSTemplate', + description: '/docs/references/projects/delete-sms-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ], + contentType: ContentType::JSON + ) + ]) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -2499,3 +2601,40 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale') 'message' => $template['message'] ]), Response::MODEL_EMAIL_TEMPLATE); }); + +App::patch('/v1/projects/:projectId/auth/session-invalidation') + ->desc('Update invalidate session option of the project') + ->groups(['api', 'projects']) + ->label('scope', 'projects.write') + ->label('sdk', new Method( + namespace: 'projects', + group: 'auth', + name: 'updateSessionInvalidation', + description: '/docs/references/projects/update-session-invalidation.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('enabled', false, new Boolean(), 'Update authentication session invalidation status. Use this endpoint to enable or disable session invalidation on password change') + ->inject('response') + ->inject('dbForPlatform') + ->action(function (string $projectId, bool $enabled, Response $response, Database $dbForPlatform) { + + $project = $dbForPlatform->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $auths = $project->getAttribute('auths', []); + $auths['invalidateSessions'] = $enabled; + $dbForPlatform->updateDocument('projects', $project->getId(), $project + ->setAttribute('auths', $auths)); + + $response->dynamic($project, Response::MODEL_PROJECT); + }); diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php deleted file mode 100644 index 417ea602ba..0000000000 --- a/app/controllers/api/proxy.php +++ /dev/null @@ -1,305 +0,0 @@ -<?php - -use Appwrite\Event\Certificate; -use Appwrite\Event\Delete; -use Appwrite\Event\Event; -use Appwrite\Extend\Exception; -use Appwrite\Network\Validator\DNS; -use Appwrite\SDK\AuthType; -use Appwrite\SDK\ContentType; -use Appwrite\SDK\Method; -use Appwrite\SDK\Response as SDKResponse; -use Appwrite\Utopia\Database\Validator\Queries\Rules; -use Appwrite\Utopia\Response; -use Utopia\App; -use Utopia\Database\Database; -use Utopia\Database\Document; -use Utopia\Database\Exception\Query as QueryException; -use Utopia\Database\Query; -use Utopia\Database\Validator\Query\Cursor; -use Utopia\Database\Validator\UID; -use Utopia\Domains\Domain; -use Utopia\Logger\Log; -use Utopia\System\System; -use Utopia\Validator\AnyOf; -use Utopia\Validator\IP; -use Utopia\Validator\Text; - -App::get('/v1/proxy/rules') - ->groups(['api', 'proxy']) - ->desc('List rules') - ->label('scope', 'rules.read') - ->label('sdk', new Method( - namespace: 'proxy', - group: null, - name: 'listRules', - description: '/docs/references/proxy/list-rules.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_PROXY_RULE_LIST, - ) - ] - )) - ->param('queries', [], new Rules(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Rules::ALLOWED_ATTRIBUTES), true) - ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) - ->inject('response') - ->inject('project') - ->inject('dbForPlatform') - ->action(function (array $queries, string $search, Response $response, Document $project, Database $dbForPlatform) { - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - - if (!empty($search)) { - $queries[] = Query::search('search', $search); - } - - $queries[] = Query::equal('projectInternalId', [$project->getSequence()]); - - /** - * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries - */ - $cursor = \array_filter($queries, function ($query) { - return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); - }); - $cursor = reset($cursor); - if ($cursor) { - /** @var Query $cursor */ - - $validator = new Cursor(); - if (!$validator->isValid($cursor)) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); - } - - $ruleId = $cursor->getValue(); - $cursorDocument = $dbForPlatform->getDocument('rules', $ruleId); - - if ($cursorDocument->isEmpty()) { - throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Rule '{$ruleId}' for the 'cursor' value not found."); - } - - $cursor->setValue($cursorDocument); - } - - $filterQueries = Query::groupByType($queries)['filters']; - - $rules = $dbForPlatform->find('rules', $queries); - foreach ($rules as $rule) { - $certificate = $dbForPlatform->getDocument('certificates', $rule->getAttribute('certificateId', '')); - $rule->setAttribute('logs', $certificate->getAttribute('logs', '')); - $rule->setAttribute('renewAt', $certificate->getAttribute('renewDate', '')); - } - - $response->dynamic(new Document([ - 'rules' => $rules, - 'total' => $dbForPlatform->count('rules', $filterQueries, APP_LIMIT_COUNT), - ]), Response::MODEL_PROXY_RULE_LIST); - }); - -App::get('/v1/proxy/rules/:ruleId') - ->groups(['api', 'proxy']) - ->desc('Get rule') - ->label('scope', 'rules.read') - ->label('sdk', new Method( - namespace: 'proxy', - group: null, - name: 'getRule', - description: '/docs/references/proxy/get-rule.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_PROXY_RULE, - ) - ] - )) - ->param('ruleId', '', new UID(), 'Rule ID.') - ->inject('response') - ->inject('project') - ->inject('dbForPlatform') - ->action(function (string $ruleId, Response $response, Document $project, Database $dbForPlatform) { - $rule = $dbForPlatform->getDocument('rules', $ruleId); - - if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getSequence()) { - throw new Exception(Exception::RULE_NOT_FOUND); - } - - $certificate = $dbForPlatform->getDocument('certificates', $rule->getAttribute('certificateId', '')); - $rule->setAttribute('logs', $certificate->getAttribute('logs', '')); - $rule->setAttribute('renewAt', $certificate->getAttribute('renewDate', '')); - - $response->dynamic($rule, Response::MODEL_PROXY_RULE); - }); - -App::delete('/v1/proxy/rules/:ruleId') - ->groups(['api', 'proxy']) - ->desc('Delete rule') - ->label('scope', 'rules.write') - ->label('event', 'rules.[ruleId].delete') - ->label('audits.event', 'rules.delete') - ->label('audits.resource', 'rule/{request.ruleId}') - ->label('sdk', new Method( - namespace: 'proxy', - group: null, - name: 'deleteRule', - description: '/docs/references/proxy/delete-rule.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_NOCONTENT, - model: Response::MODEL_NONE, - ) - ], - contentType: ContentType::NONE - )) - ->param('ruleId', '', new UID(), 'Rule ID.') - ->inject('response') - ->inject('project') - ->inject('dbForPlatform') - ->inject('queueForDeletes') - ->inject('queueForEvents') - ->action(function (string $ruleId, Response $response, Document $project, Database $dbForPlatform, Delete $queueForDeletes, Event $queueForEvents) { - $rule = $dbForPlatform->getDocument('rules', $ruleId); - - if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getSequence()) { - throw new Exception(Exception::RULE_NOT_FOUND); - } - - $dbForPlatform->deleteDocument('rules', $rule->getId()); - - $queueForDeletes - ->setType(DELETE_TYPE_DOCUMENT) - ->setDocument($rule); - - $queueForEvents->setParam('ruleId', $rule->getId()); - - $response->noContent(); - }); - -App::patch('/v1/proxy/rules/:ruleId/verification') - ->desc('Update rule verification status') - ->groups(['api', 'proxy']) - ->label('scope', 'rules.write') - ->label('event', 'rules.[ruleId].update') - ->label('audits.event', 'rule.update') - ->label('audits.resource', 'rule/{response.$id}') - ->label('sdk', new Method( - namespace: 'proxy', - group: null, - name: 'updateRuleVerification', - description: '/docs/references/proxy/update-rule-verification.md', - auth: [AuthType::ADMIN], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_PROXY_RULE, - ) - ] - )) - ->param('ruleId', '', new UID(), 'Rule ID.') - ->inject('response') - ->inject('queueForCertificates') - ->inject('queueForEvents') - ->inject('project') - ->inject('dbForPlatform') - ->inject('log') - ->action(function (string $ruleId, Response $response, Certificate $queueForCertificates, Event $queueForEvents, Document $project, Database $dbForPlatform, Log $log) { - $rule = $dbForPlatform->getDocument('rules', $ruleId); - - if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getSequence()) { - throw new Exception(Exception::RULE_NOT_FOUND); - } - - $targetCNAME = null; - switch ($rule->getAttribute('type', '')) { - case 'api': - // For example: fra.cloud.appwrite.io - $targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_TARGET_CNAME', '')); - break; - case 'redirect': - // For example: appwrite.network - $targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_SITES', '')); - break; - case 'deployment': - switch ($rule->getAttribute('deploymentResourceType', '')) { - case 'function': - // For example: fra.appwrite.run - $targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_FUNCTIONS', '')); - break; - case 'site': - // For example: appwrite.network - $targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_SITES', '')); - break; - default: - break; - } - // no break - default: - break; - } - - $validators = []; - - if (!is_null($targetCNAME)) { - if ($targetCNAME->isKnown() && !$targetCNAME->isTest()) { - $validators[] = new DNS($targetCNAME->get(), DNS::RECORD_CNAME); - } - } - - if ((new IP(IP::V4))->isValid(System::getEnv('_APP_DOMAIN_TARGET_A', ''))) { - $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_A', ''), DNS::RECORD_A); - } - if ((new IP(IP::V6))->isValid(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''))) { - $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); - } - - if (empty($validators)) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, 'At least one of domain targets environment variable must be configured.'); - } - - if ($rule->getAttribute('verification') === true) { - return $response->dynamic($rule, Response::MODEL_PROXY_RULE); - } - - $validator = new AnyOf($validators, AnyOf::TYPE_STRING); - $domain = new Domain($rule->getAttribute('domain', '')); - - $validationStart = \microtime(true); - if (!$validator->isValid($domain->get())) { - $log->addExtra('dnsTiming', \strval(\microtime(true) - $validationStart)); - $log->addTag('dnsDomain', $domain->get()); - - $errors = []; - foreach ($validators as $validator) { - if (!empty($validator->getLogs())) { - $errors[] = $validator->getLogs(); - } - } - - $error = \implode("\n", $errors); - $log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error)); - - throw new Exception(Exception::RULE_VERIFICATION_FAILED); - } - - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule->setAttribute('status', 'verifying')); - - // Issue a TLS certificate when domain is verified - $queueForCertificates - ->setDomain(new Document([ - 'domain' => $rule->getAttribute('domain'), - 'domainType' => $rule->getAttribute('deploymentResourceType', $rule->getAttribute('type')), - ])) - ->trigger(); - - $queueForEvents->setParam('ruleId', $rule->getId()); - - $certificate = $dbForPlatform->getDocument('certificates', $rule->getAttribute('certificateId', '')); - $rule->setAttribute('logs', $certificate->getAttribute('logs', '')); - - $response->dynamic($rule, Response::MODEL_PROXY_RULE); - }); diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index a25241ec4b..8bc383cabd 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -18,6 +18,7 @@ use Appwrite\Utopia\Database\Validator\Queries\Buckets; use Appwrite\Utopia\Database\Validator\Queries\Files; use Appwrite\Utopia\Response; use Utopia\App; +use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\DateTime; @@ -92,7 +93,7 @@ App::post('/v1/storage/buckets') $bucketId = $bucketId === 'unique()' ? ID::unique() : $bucketId; // Map aggregate permissions into the multiple permissions they represent. - $permissions = Permission::aggregate($permissions); + $permissions = Permission::aggregate($permissions) ?? []; $compression ??= Compression::NONE; $encryption ??= true; try { @@ -145,7 +146,7 @@ App::post('/v1/storage/buckets') $bucket = $dbForProject->getDocument('buckets', $bucketId); - $dbForProject->createCollection('bucket_' . $bucket->getSequence(), $attributes, $indexes, permissions: $permissions ?? [], documentSecurity: $fileSecurity); + $dbForProject->createCollection('bucket_' . $bucket->getSequence(), $attributes, $indexes, permissions: $permissions, documentSecurity: $fileSecurity); } catch (DuplicateException) { throw new Exception(Exception::STORAGE_BUCKET_ALREADY_EXISTS); } @@ -224,6 +225,8 @@ App::get('/v1/storage/buckets') $total = $dbForProject->count('buckets', $filterQueries, APP_LIMIT_COUNT); } catch (OrderException $e) { throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } $response->dynamic(new Document([ 'buckets' => $buckets, @@ -316,15 +319,15 @@ App::put('/v1/storage/buckets/:bucketId') $permissions = Permission::aggregate($permissions); $bucket = $dbForProject->updateDocument('buckets', $bucket->getId(), $bucket - ->setAttribute('name', $name) - ->setAttribute('$permissions', $permissions) - ->setAttribute('maximumFileSize', $maximumFileSize) - ->setAttribute('allowedFileExtensions', $allowedFileExtensions) - ->setAttribute('fileSecurity', $fileSecurity) - ->setAttribute('enabled', $enabled) - ->setAttribute('encryption', $encryption) - ->setAttribute('compression', $compression) - ->setAttribute('antivirus', $antivirus)); + ->setAttribute('name', $name) + ->setAttribute('$permissions', $permissions) + ->setAttribute('maximumFileSize', $maximumFileSize) + ->setAttribute('allowedFileExtensions', $allowedFileExtensions) + ->setAttribute('fileSecurity', $fileSecurity) + ->setAttribute('enabled', $enabled) + ->setAttribute('encryption', $encryption) + ->setAttribute('compression', $compression) + ->setAttribute('antivirus', $antivirus)); $dbForProject->updateCollection('bucket_' . $bucket->getSequence(), $permissions, $fileSecurity); @@ -852,6 +855,8 @@ App::get('/v1/storage/buckets/:bucketId/files') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } catch (OrderException $e) { throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } $response->dynamic(new Document([ @@ -953,17 +958,20 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') ->param('output', '', new WhiteList(\array_keys(Config::getParam('storage-outputs')), true), 'Output format type (jpeg, jpg, png, gif and webp).', true) // NOTE: this is only for the sdk generator and is not used in the action below and is utilised in `resources.php` for `resourceToken`. ->param('token', '', new Text(512), 'File token for accessing this file.', true) + ->inject('request') ->inject('response') ->inject('dbForProject') ->inject('resourceToken') ->inject('deviceForFiles') ->inject('deviceForLocal') - ->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, ?string $token, Response $response, Database $dbForProject, Document $resourceToken, Device $deviceForFiles, Device $deviceForLocal) { + ->inject('project') + ->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, ?string $token, Request $request, Response $response, Database $dbForProject, Document $resourceToken, Device $deviceForFiles, Device $deviceForLocal, Document $project) { if (!\extension_loaded('imagick')) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Imagick extension is missing'); } + /* @type Document $bucket */ $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -984,6 +992,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') if ($fileSecurity && !$valid && !$isToken) { $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { + /* @type Document $file */ $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } @@ -1004,7 +1013,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') $algorithm = $file->getAttribute('algorithm', Compression::NONE); $cipher = $file->getAttribute('openSSLCipher'); $mime = $file->getAttribute('mimeType'); - if (!\in_array($mime, $inputs) || $file->getAttribute('sizeActual') > (int) System::getEnv('_APP_STORAGE_PREVIEW_LIMIT', 20000000)) { + if (!\in_array($mime, $inputs) || $file->getAttribute('sizeActual') > (int) System::getEnv('_APP_STORAGE_PREVIEW_LIMIT', APP_STORAGE_READ_BUFFER)) { if (!\in_array($mime, $inputs)) { $path = (\array_key_exists($mime, $fileLogos)) ? $fileLogos[$mime] : $fileLogos['default']; } else { @@ -1035,8 +1044,12 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') $output = empty($type) ? (array_search($mime, $outputs) ?? 'jpg') : $type; } + $startTime = \microtime(true); + $source = $deviceForFiles->read($path); + $downloadTime = \microtime(true) - $startTime; + if (!empty($cipher)) { // Decrypt $source = OpenSSL::decrypt( $source, @@ -1048,6 +1061,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') ); } + $decryptionTime = \microtime(true) - $startTime - $downloadTime; + switch ($algorithm) { case Compression::ZSTD: $compressor = new Zstd(); @@ -1059,6 +1074,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') break; } + $decompressionTime = \microtime(true) - $startTime - $downloadTime - $decryptionTime; + try { $image = new Image($source); } catch (ImagickException $e) { @@ -1089,6 +1106,12 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') $data = $image->output($output, $quality); + $renderingTime = \microtime(true) - $startTime - $downloadTime - $decryptionTime - $decompressionTime; + + $totalTime = \microtime(true) - $startTime; + + Console::info("File preview rendered,project=" . $project->getId() . ",bucket=" . $bucketId . ",file=" . $file->getId() . ",uri=" . $request->getURI() . ",total=" . $totalTime . ",rendering=" . $renderingTime . ",decryption=" . $decryptionTime . ",decompression=" . $decompressionTime . ",download=" . $downloadTime); + $contentType = (\array_key_exists($output, $outputs)) ? $outputs[$output] : $outputs['jpg']; //Do not update transformedAt if it's a console user @@ -1140,7 +1163,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') ->inject('resourceToken') ->inject('deviceForFiles') ->action(function (string $bucketId, string $fileId, ?string $token, Request $request, Response $response, Database $dbForProject, string $mode, Document $resourceToken, Device $deviceForFiles) { - + /* @type Document $bucket */ $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -1158,9 +1181,10 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') throw new Exception(Exception::USER_UNAUTHORIZED); } - if ($fileSecurity && !$valid) { + if ($fileSecurity && !$valid && !$isToken) { $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { + /* @type Document $file */ $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } @@ -1178,13 +1202,6 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND, 'File not found in ' . $path); } - $response - ->setContentType($file->getAttribute('mimeType')) - ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days - ->addHeader('X-Peak', \memory_get_peak_usage()) - ->addHeader('Content-Disposition', 'attachment; filename="' . $file->getAttribute('name', '') . '"') - ; - $size = $file->getAttribute('sizeOriginal', 0); $rangeHeader = $request->getHeader('range'); @@ -1193,7 +1210,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') $end = $request->getRangeEnd(); $unit = $request->getRangeUnit(); - if ($end === null) { + if ($end === null || $end - $start > APP_STORAGE_READ_BUFFER) { $end = min(($start + MAX_OUTPUT_CHUNK_SIZE - 1), ($size - 1)); } @@ -1208,6 +1225,13 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') ->setStatusCode(Response::STATUS_CODE_PARTIALCONTENT); } + $response + ->setContentType($file->getAttribute('mimeType')) + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days + ->addHeader('X-Peak', \memory_get_peak_usage()) + ->addHeader('Content-Disposition', 'attachment; filename="' . $file->getAttribute('name', '') . '"') + ; + $source = ''; if (!empty($file->getAttribute('openSSLCipher'))) { // Decrypt $source = $deviceForFiles->read($path); @@ -1300,6 +1324,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') ->inject('resourceToken') ->inject('deviceForFiles') ->action(function (string $bucketId, string $fileId, ?string $token, Response $response, Request $request, Database $dbForProject, string $mode, Document $resourceToken, Device $deviceForFiles) { + /* @type Document $bucket */ $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -1317,9 +1342,10 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') throw new Exception(Exception::USER_UNAUTHORIZED); } - if ($fileSecurity && !$valid) { + if ($fileSecurity && !$valid && !$isToken) { $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { + /* @type Document $file */ $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } @@ -1345,15 +1371,6 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') $contentType = $file->getAttribute('mimeType'); } - $response - ->setContentType($contentType) - ->addHeader('Content-Security-Policy', 'script-src none;') - ->addHeader('X-Content-Type-Options', 'nosniff') - ->addHeader('Content-Disposition', 'inline; filename="' . $file->getAttribute('name', '') . '"') - ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days - ->addHeader('X-Peak', \memory_get_peak_usage()) - ; - $size = $file->getAttribute('sizeOriginal', 0); $rangeHeader = $request->getHeader('range'); @@ -1362,8 +1379,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') $end = $request->getRangeEnd(); $unit = $request->getRangeUnit(); - if ($end === null) { - $end = min(($start + 2000000 - 1), ($size - 1)); + if ($end === null || $end - $start > APP_STORAGE_READ_BUFFER) { + $end = min(($start + APP_STORAGE_READ_BUFFER - 1), ($size - 1)); } if ($unit != 'bytes' || $start >= $end || $end >= $size) { @@ -1377,6 +1394,15 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') ->setStatusCode(Response::STATUS_CODE_PARTIALCONTENT); } + $response + ->setContentType($contentType) + ->addHeader('Content-Security-Policy', 'script-src none;') + ->addHeader('X-Content-Type-Options', 'nosniff') + ->addHeader('Content-Disposition', 'inline; filename="' . $file->getAttribute('name', '') . '"') + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days + ->addHeader('X-Peak', \memory_get_peak_usage()) + ; + $source = ''; if (!empty($file->getAttribute('openSSLCipher'))) { // Decrypt $source = $deviceForFiles->read($path); @@ -1498,14 +1524,6 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') $contentType = $file->getAttribute('mimeType'); } - $response - ->setContentType($contentType) - ->addHeader('Content-Security-Policy', 'script-src none;') - ->addHeader('X-Content-Type-Options', 'nosniff') - ->addHeader('Content-Disposition', 'inline; filename="' . $file->getAttribute('name', '') . '"') - ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days - ->addHeader('X-Peak', \memory_get_peak_usage()); - $size = $file->getAttribute('sizeOriginal', 0); $rangeHeader = $request->getHeader('range'); @@ -1514,8 +1532,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') $end = $request->getRangeEnd(); $unit = $request->getRangeUnit(); - if ($end === null) { - $end = min(($start + 2000000 - 1), ($size - 1)); + if ($end === null || $end - $start > APP_STORAGE_READ_BUFFER) { + $end = min(($start + APP_STORAGE_READ_BUFFER - 1), ($size - 1)); } if ($unit != 'bytes' || $start >= $end || $end >= $size) { @@ -1529,6 +1547,14 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') ->setStatusCode(Response::STATUS_CODE_PARTIALCONTENT); } + $response + ->setContentType($contentType) + ->addHeader('Content-Security-Policy', 'script-src none;') + ->addHeader('X-Content-Type-Options', 'nosniff') + ->addHeader('Content-Disposition', 'inline; filename="' . $file->getAttribute('name', '') . '"') + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days + ->addHeader('X-Peak', \memory_get_peak_usage()); + $source = ''; if (!empty($file->getAttribute('openSSLCipher'))) { // Decrypt $source = $deviceForFiles->read($path); @@ -1848,7 +1874,7 @@ App::get('/v1/storage/usage') $total = []; Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats, &$total) { foreach ($metrics as $metric) { - $result = $dbForProject->findOne('stats', [ + $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), Query::equal('period', ['inf']) ]); @@ -1877,7 +1903,7 @@ App::get('/v1/storage/usage') }; foreach ($metrics as $metric) { - $usage[$metric]['total'] = $stats[$metric]['total']; + $usage[$metric]['total'] = $stats[$metric]['total']; $usage[$metric]['data'] = []; $leap = time() - ($days['limit'] * $days['factor']); while ($leap < time()) { @@ -1895,8 +1921,8 @@ App::get('/v1/storage/usage') 'filesTotal' => $usage[$metrics[1]]['total'], 'filesStorageTotal' => $usage[$metrics[2]]['total'], 'buckets' => $usage[$metrics[0]]['data'], - 'files' => $usage[$metrics[1]]['data'], - 'storage' => $usage[$metrics[2]]['data'], + 'files' => $usage[$metrics[1]]['data'], + 'storage' => $usage[$metrics[2]]['data'], ]), Response::MODEL_USAGE_STORAGE); }); @@ -1948,7 +1974,7 @@ App::get('/v1/storage/:bucketId/usage') ? $dbForLogs : $dbForProject; - $result = $db->findOne('stats', [ + $result = $db->findOne('stats', [ Query::equal('metric', [$metric]), Query::equal('period', ['inf']) ]); @@ -1978,7 +2004,7 @@ App::get('/v1/storage/:bucketId/usage') }; foreach ($metrics as $metric) { - $usage[$metric]['total'] = $stats[$metric]['total']; + $usage[$metric]['total'] = $stats[$metric]['total']; $usage[$metric]['data'] = []; $leap = time() - ($days['limit'] * $days['factor']); while ($leap < time()) { diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index c83cad7eb1..7398e451b5 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -11,6 +11,7 @@ use Appwrite\Event\Messaging; use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; +use Appwrite\Network\Validator\Redirect; use Appwrite\Platform\Workers\Deletes; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; @@ -35,6 +36,7 @@ use Utopia\Database\Exception\Authorization as AuthorizationException; use Utopia\Database\Exception\Duplicate; use Utopia\Database\Exception\Order as OrderException; use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Exception\Structure as StructureException; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -50,7 +52,6 @@ use Utopia\Locale\Locale; use Utopia\System\System; use Utopia\Validator\ArrayList; use Utopia\Validator\Assoc; -use Utopia\Validator\Host; use Utopia\Validator\Text; use Utopia\Validator\URL; use Utopia\Validator\WhiteList; @@ -282,7 +283,13 @@ App::get('/v1/teams/:teamId/prefs') $prefs = $team->getAttribute('prefs', []); - $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); + try { + $prefs = new Document($prefs); + } catch (StructureException $e) { + throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); + } + + $response->dynamic($prefs, Response::MODEL_PREFERENCES); }); App::put('/v1/teams/:teamId') @@ -357,6 +364,11 @@ App::put('/v1/teams/:teamId/prefs') ->inject('dbForProject') ->inject('queueForEvents') ->action(function (string $teamId, array $prefs, Response $response, Database $dbForProject, Event $queueForEvents) { + try { + $prefs = new Document($prefs); + } catch (StructureException $e) { + throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); + } $team = $dbForProject->getDocument('teams', $teamId); @@ -364,11 +376,13 @@ App::put('/v1/teams/:teamId/prefs') throw new Exception(Exception::TEAM_NOT_FOUND); } - $team = $dbForProject->updateDocument('teams', $team->getId(), $team->setAttribute('prefs', $prefs)); + $team = $dbForProject->updateDocument('teams', $team->getId(), new Document([ + 'prefs' => $prefs->getArrayCopy() + ])); $queueForEvents->setParam('teamId', $team->getId()); - $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); + $response->dynamic($prefs, Response::MODEL_PREFERENCES); }); App::delete('/v1/teams/:teamId') @@ -466,7 +480,7 @@ App::post('/v1/teams/:teamId/memberships') } return new ArrayList(new Key(), APP_LIMIT_ARRAY_PARAMS_SIZE); }, 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 32 characters long.', false, ['project']) - ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients', 'devKey']) // TODO add our own built-in confirm page + ->param('url', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['platforms', 'devKey']) // TODO add our own built-in confirm page ->param('name', '', new Text(128), 'Name of the new team member. Max length: 128 chars.', true) ->inject('response') ->inject('project') @@ -657,7 +671,8 @@ App::post('/v1/teams/:teamId/memberships') $projectName = $project->isEmpty() ? 'Console' : $project->getAttribute('name', '[APP-NAME]'); $body = $locale->getText("emails.invitation.body"); - $subject = \sprintf($locale->getText("emails.invitation.subject"), $team->getAttribute('name'), $projectName); + $preview = $locale->getText("emails.invitation.preview"); + $subject = $locale->getText("emails.invitation.subject"); $customTemplate = $project->getAttribute('templates', [])['email.invitation-' . $locale->default] ?? []; $message = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-inner-base.tpl'); @@ -666,6 +681,7 @@ App::post('/v1/teams/:teamId/memberships') ->setParam('{{hello}}', $locale->getText("emails.invitation.hello")) ->setParam('{{footer}}', $locale->getText("emails.invitation.footer")) ->setParam('{{thanks}}', $locale->getText("emails.invitation.thanks")) + ->setParam('{{buttonText}}', $locale->getText("emails.invitation.buttonText")) ->setParam('{{signature}}', $locale->getText("emails.invitation.signature")); $body = $message->render(); @@ -728,6 +744,7 @@ App::post('/v1/teams/:teamId/memberships') $queueForMails ->setSubject($subject) ->setBody($body) + ->setPreview($preview) ->setRecipient($invitee->getAttribute('email')) ->setName($invitee->getAttribute('name', '')) ->setVariables($emailVariables) @@ -1097,10 +1114,13 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId') max: 2 ); + // Is the role change being requested by the user on their own membership? + $isCurrentUserAnOwner = $user->getSequence() === $membership->getAttribute('userInternalId'); + // Prevent role change if there's only one owner left, - // the requester is that owner, and the new `$roles` no longer include 'owner'! - if ($ownersCount === 1 && $isOwner && !\in_array('owner', $roles)) { - throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'There must be at least one owner in the organization.'); + // the requester is that owner, and the new `$roles` no longer include 'owner' + if ($ownersCount === 1 && $isOwner && $isCurrentUserAnOwner && !\in_array('owner', $roles)) { + throw new Exception(Exception::MEMBERSHIP_DOWNGRADE_PROHIBITED, 'There must be at least one owner in the organization.'); } } @@ -1315,10 +1335,12 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') + ->inject('user') + ->inject('project') ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->action(function (string $teamId, string $membershipId, Response $response, Database $dbForProject, Event $queueForEvents) { + ->action(function (string $teamId, string $membershipId, Document $user, Document $project, Response $response, Database $dbForProject, Event $queueForEvents) { $membership = $dbForProject->getDocument('memberships', $membershipId); @@ -1326,9 +1348,9 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') throw new Exception(Exception::TEAM_INVITE_NOT_FOUND); } - $user = $dbForProject->getDocument('users', $membership->getAttribute('userId')); + $profile = $dbForProject->getDocument('users', $membership->getAttribute('userId')); - if ($user->isEmpty()) { + if ($profile->isEmpty()) { throw new Exception(Exception::USER_NOT_FOUND); } @@ -1342,6 +1364,29 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') throw new Exception(Exception::TEAM_MEMBERSHIP_MISMATCH); } + if ($project->getId() === 'console') { + // Quick check: + // fetch up to 2 owners to determine if only one exists + $ownersCount = $dbForProject->count( + collection: 'memberships', + queries: [ + Query::contains('roles', ['owner']), + Query::equal('teamInternalId', [$team->getSequence()]) + ], + max: 2 + ); + + // Is the deletion being requested by the user on their own membership and they are also the owner? + $isSelfOwner = + in_array('owner', $membership->getAttribute('roles')) && + $membership->getAttribute('userInternalId') === $user->getSequence(); + + if ($ownersCount === 1 && $isSelfOwner) { + /* Prevent removal if the user is the only owner. */ + throw new Exception(Exception::MEMBERSHIP_DELETION_PROHIBITED, 'There must be at least one owner in the organization.'); + } + } + try { $dbForProject->deleteDocument('memberships', $membership->getId()); } catch (AuthorizationException $exception) { @@ -1350,15 +1395,15 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove membership from DB'); } - $dbForProject->purgeCachedDocument('users', $user->getId()); + $dbForProject->purgeCachedDocument('users', $profile->getId()); if ($membership->getAttribute('confirm')) { // Count only confirmed members Authorization::skip(fn () => $dbForProject->decreaseDocumentAttribute('teams', $team->getId(), 'total', 1, 0)); } $queueForEvents - ->setParam('userId', $user->getId()) ->setParam('teamId', $team->getId()) + ->setParam('userId', $profile->getId()) ->setParam('membershipId', $membership->getId()) ->setPayload($response->output($membership, Response::MODEL_MEMBERSHIP)) ; diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 4b6e5abe6b..5498a33bf5 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -19,6 +19,7 @@ use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CustomId; @@ -643,13 +644,20 @@ App::get('/v1/users') $cursor->setValue($cursorDocument); } - $filterQueries = Query::groupByType($queries)['filters']; - try { - $users = $dbForProject->find('users', $queries); - $total = $dbForProject->count('users', $filterQueries, APP_LIMIT_COUNT); - } catch (OrderException $e) { - throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); - } + $users = []; + $total = 0; + + $dbForProject->skipFilters(function () use ($dbForProject, $queries, &$users, &$total) { + try { + $users = $dbForProject->find('users', $queries); + $total = $dbForProject->count('users', $queries, APP_LIMIT_COUNT); + } catch (OrderException $e) { + throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + }, ['subQueryAuthenticators', 'subQuerySessions', 'subQueryTokens', 'subQueryChallenges', 'subQueryMemberships']); + $response->dynamic(new Document([ 'users' => $users, 'total' => $total, @@ -980,7 +988,7 @@ App::get('/v1/users/:userId/targets') ] )) ->param('userId', '', new UID(), 'User ID.') - ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) + ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Targets::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForProject') ->action(function (string $userId, array $queries, Response $response, Database $dbForProject) { @@ -1351,6 +1359,17 @@ App::patch('/v1/users/:userId/password') $user = $dbForProject->updateDocument('users', $user->getId(), $user); + $sessions = $user->getAttribute('sessions', []); + $invalidate = $project->getAttribute('auths', default: [])['invalidateSessions'] ?? false; + if ($invalidate) { + foreach ($sessions as $session) { + /** @var Document $session */ + $dbForProject->deleteDocument('sessions', $session->getId()); + } + } + + $dbForProject->purgeCachedDocument('users', $user->getId()); + $queueForEvents->setParam('userId', $user->getId()); $response->dynamic($user, Response::MODEL_USER); @@ -1738,19 +1757,38 @@ App::patch('/v1/users/:userId/mfa') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk', new Method( - namespace: 'users', - group: 'users', - name: 'updateMfa', - description: '/docs/references/users/update-user-mfa.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_USER, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'users', + group: 'users', + name: 'updateMfa', + description: '/docs/references/users/update-user-mfa.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'users.updateMFA', + ), + ), + new Method( + namespace: 'users', + group: 'users', + name: 'updateMFA', + description: '/docs/references/users/update-user-mfa.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] + ) + ]) ->param('userId', '', new UID(), 'User ID.') ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') ->inject('response') @@ -1778,19 +1816,38 @@ App::get('/v1/users/:userId/mfa/factors') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('usage.metric', 'users.{scope}.requests.read') - ->label('sdk', new Method( - namespace: 'users', - group: 'mfa', - name: 'listMfaFactors', - description: '/docs/references/users/list-mfa-factors.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_MFA_FACTORS, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'users', + group: 'mfa', + name: 'listMfaFactors', + description: '/docs/references/users/list-mfa-factors.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_FACTORS, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'users.listMFAFactors', + ), + ), + new Method( + namespace: 'users', + group: 'mfa', + name: 'listMFAFactors', + description: '/docs/references/users/list-mfa-factors.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_FACTORS, + ) + ] + ) + ]) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1817,19 +1874,38 @@ App::get('/v1/users/:userId/mfa/recovery-codes') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('usage.metric', 'users.{scope}.requests.read') - ->label('sdk', new Method( - namespace: 'users', - group: 'mfa', - name: 'getMfaRecoveryCodes', - description: '/docs/references/users/get-mfa-recovery-codes.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_MFA_RECOVERY_CODES, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'users', + group: 'mfa', + name: 'getMfaRecoveryCodes', + description: '/docs/references/users/get-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'users.getMFARecoveryCodes', + ), + ), + new Method( + namespace: 'users', + group: 'mfa', + name: 'getMFARecoveryCodes', + description: '/docs/references/users/get-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] + ) + ]) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1862,19 +1938,38 @@ App::patch('/v1/users/:userId/mfa/recovery-codes') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk', new Method( - namespace: 'users', - group: 'mfa', - name: 'createMfaRecoveryCodes', - description: '/docs/references/users/create-mfa-recovery-codes.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_MFA_RECOVERY_CODES, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'users', + group: 'mfa', + name: 'createMfaRecoveryCodes', + description: '/docs/references/users/create-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'users.createMFARecoveryCodes', + ), + ), + new Method( + namespace: 'users', + group: 'mfa', + name: 'createMFARecoveryCodes', + description: '/docs/references/users/create-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] + ) + ]) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1914,19 +2009,38 @@ App::put('/v1/users/:userId/mfa/recovery-codes') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk', new Method( - namespace: 'users', - group: 'mfa', - name: 'updateMfaRecoveryCodes', - description: '/docs/references/users/update-mfa-recovery-codes.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_MFA_RECOVERY_CODES, - ) - ] - )) + ->label('sdk', [ + new Method( + namespace: 'users', + group: 'mfa', + name: 'updateMfaRecoveryCodes', + description: '/docs/references/users/update-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'users.updateMFARecoveryCodes', + ), + ), + new Method( + namespace: 'users', + group: 'mfa', + name: 'updateMFARecoveryCodes', + description: '/docs/references/users/update-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] + ) + ]) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1965,20 +2079,40 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk', new Method( - namespace: 'users', - group: 'mfa', - name: 'deleteMfaAuthenticator', - description: '/docs/references/users/delete-mfa-authenticator.md', - auth: [AuthType::KEY], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_NOCONTENT, - model: Response::MODEL_NONE, - ) - ], - contentType: ContentType::NONE - )) + ->label('sdk', [ + new Method( + namespace: 'users', + group: 'mfa', + name: 'deleteMfaAuthenticator', + description: '/docs/references/users/delete-mfa-authenticator.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'users.deleteMFAAuthenticator', + ), + ), + new Method( + namespace: 'users', + group: 'mfa', + name: 'deleteMFAAuthenticator', + description: '/docs/references/users/delete-mfa-authenticator.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + ) + ]) ->param('userId', '', new UID(), 'User ID.') ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 746f61c59c..5bda9961f3 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -4,6 +4,7 @@ use Appwrite\Auth\OAuth2\Github as OAuth2Github; use Appwrite\Event\Build; use Appwrite\Event\Delete; use Appwrite\Extend\Exception; +use Appwrite\Network\Validator\Redirect; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; @@ -14,6 +15,7 @@ use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use Appwrite\Vcs\Comment; use Utopia\App; +use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\DateTime; @@ -53,7 +55,6 @@ use Utopia\Detector\Detector\Runtime; use Utopia\Detector\Detector\Strategy; use Utopia\System\System; use Utopia\Validator\Boolean; -use Utopia\Validator\Host; use Utopia\Validator\Text; use Utopia\Validator\WhiteList; use Utopia\VCS\Adapter\Git\GitHub; @@ -116,8 +117,10 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } $commentStatus = $isAuthorized ? 'waiting' : 'failed'; + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); - $authorizeUrl = $request->getProtocol() . '://' . $request->getHostname() . "/console/git/authorize-contributor?projectId={$projectId}&installationId={$installationId}&repositoryId={$repositoryId}&providerPullRequestId={$providerPullRequestId}"; + $authorizeUrl = $protocol . '://' . $hostname . "/console/git/authorize-contributor?projectId={$projectId}&installationId={$installationId}&repositoryId={$repositoryId}&providerPullRequestId={$providerPullRequestId}"; $action = $isAuthorized ? ['type' => 'logs'] : ['type' => 'authorize', 'url' => $authorizeUrl]; @@ -133,11 +136,39 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId if (!$latestComment->isEmpty()) { $latestCommentId = $latestComment->getAttribute('providerCommentId', ''); - $comment = new Comment(); - $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); - $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); + $retries = 0; + $lockAcquired = false; - $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); + while ($retries < 9) { + $retries++; + + try { + $dbForPlatform->createDocument('vcsCommentLocks', new Document([ + '$id' => $latestCommentId + ])); + $lockAcquired = true; + break; + } catch (\Throwable $err) { + if ($retries >= 9) { + Console::warning("Error creating vcs comment lock for " . $latestCommentId . ": " . $err->getMessage()); + } + + \sleep(1); + } + } + + if ($lockAcquired) { + // Wrap in try/finally to ensure lock file gets deleted + try { + $comment = new Comment(); + $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); + $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); + + $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); + } finally { + $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); + } + } } else { $comment = new Comment(); $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); @@ -175,11 +206,40 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId foreach ($latestComments as $comment) { $latestCommentId = $comment->getAttribute('providerCommentId', ''); - $comment = new Comment(); - $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); - $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); - $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); + $retries = 0; + $lockAcquired = false; + + while ($retries < 9) { + $retries++; + + try { + $dbForPlatform->createDocument('vcsCommentLocks', new Document([ + '$id' => $latestCommentId + ])); + $lockAcquired = true; + break; + } catch (\Throwable $err) { + if ($retries >= 9) { + Console::warning("Error creating vcs comment lock for " . $latestCommentId . ": " . $err->getMessage()); + } + + \sleep(1); + } + } + + if ($lockAcquired) { + // Wrap in try/finally to ensure lock file gets deleted + try { + $comment = new Comment(); + $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); + $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); + + $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); + } finally { + $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); + } + } } } @@ -269,6 +329,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); $domain = ID::unique() . "." . $sitesDomain; $ruleId = md5($domain); + $previewRuleId = $ruleId; Authorization::skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, @@ -293,7 +354,13 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId // VCS branch preview if (!empty($providerBranch)) { - $domain = "branch-{$providerBranch}-{$resource->getId()}-{$project->getId()}.{$sitesDomain}"; + $branchPrefix = substr($providerBranch, 0, 16); + if (strlen($providerBranch) > 16) { + $remainingChars = substr($providerBranch, 16); + $branchPrefix .= '-' . substr(hash('sha256', $remainingChars), 0, 7); + } + $resourceProjectHash = substr(hash('sha256', $resource->getId() . $project->getId()), 0, 7); + $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; $ruleId = md5($domain); try { Authorization::skip( @@ -324,7 +391,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId // VCS commit preview if (!empty($providerCommitHash)) { - $domain = "commit-{$providerCommitHash}-{$resource->getId()}-{$project->getId()}.{$sitesDomain}"; + $domain = "commit-" . substr($providerCommitHash, 0, 16) . ".{$sitesDomain}"; $ruleId = md5($domain); try { Authorization::skip( @@ -354,9 +421,52 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } } + if ($resource->getCollection() === 'sites' && !empty($latestCommentId) && !empty($previewRuleId)) { + $retries = 0; + $lockAcquired = false; + + while ($retries < 9) { + $retries++; + + try { + $dbForPlatform->createDocument('vcsCommentLocks', new Document([ + '$id' => $latestCommentId + ])); + $lockAcquired = true; + break; + } catch (\Throwable $err) { + if ($retries >= 9) { + Console::warning("Error creating vcs comment lock for " . $latestCommentId . ": " . $err->getMessage()); + } + + \sleep(1); + } + } + + if ($lockAcquired) { + // Wrap in try/finally to ensure lock file gets deleted + try { + $rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', $previewRuleId)); + + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $previewUrl = !empty($rule) ? ("{$protocol}://" . $rule->getAttribute('domain', '')) : ''; + + if (!empty($previewUrl)) { + $comment = new Comment(); + $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); + $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, $previewUrl); + $github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment()); + } + } finally { + $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); + } + } + } + if (!empty($providerCommitHash) && $resource->getAttribute('providerSilentMode', false) === false) { $resourceName = $resource->getAttribute('name'); $projectName = $project->getAttribute('name'); + $region = $project->getAttribute('region', 'default'); $name = "{$resourceName} ({$projectName})"; $message = 'Starting...'; @@ -371,7 +481,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } $owner = $github->getOwnerName($providerInstallationId); - $providerTargetUrl = $request->getProtocol() . '://' . $request->getHostname() . "/console/project-$projectId/$resourceCollection/$resourceType-$resourceId"; + $providerTargetUrl = $protocol . '://' . $hostname . "/console/project-$region-$projectId/$resourceCollection/$resourceType-$resourceId"; $github->updateCommitStatus($repositoryName, $providerCommitHash, $owner, 'pending', $message, $providerTargetUrl, $name); } @@ -417,8 +527,8 @@ App::get('/v1/vcs/github/authorize') type: MethodType::WEBAUTH, hide: true, )) - ->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a successful installation attempt.', true, ['clients']) - ->param('failure', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a failed installation attempt.', true, ['clients']) + ->param('success', '', fn ($platforms) => new Redirect($platforms), 'URL to redirect back to console after a successful installation attempt.', true, ['platforms']) + ->param('failure', '', fn ($platforms) => new Redirect($platforms), 'URL to redirect back to console after a failed installation attempt.', true, ['platforms']) ->inject('request') ->inject('response') ->inject('project') @@ -430,6 +540,8 @@ App::get('/v1/vcs/github/authorize') ]); $appName = System::getEnv('_APP_VCS_GITHUB_APP_NAME'); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); if (empty($appName)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'GitHub App name is not configured. Please configure VCS (Version Control System) variables in .env file.'); @@ -437,7 +549,7 @@ App::get('/v1/vcs/github/authorize') $url = "https://github.com/apps/$appName/installations/new?" . \http_build_query([ 'state' => $state, - 'redirect_uri' => $request->getProtocol() . '://' . $request->getHostname() . "/v1/vcs/github/callback" + 'redirect_uri' => $protocol . '://' . $hostname . "/v1/vcs/github/callback" ]); $response @@ -470,16 +582,6 @@ App::get('/v1/vcs/github/callback') $state = \json_decode($state, true); $projectId = $state['projectId'] ?? ''; - $defaultState = [ - 'success' => $request->getProtocol() . '://' . $request->getHostname() . "/console/project-$projectId/settings/git-installations", - 'failure' => $request->getProtocol() . '://' . $request->getHostname() . "/console/project-$projectId/settings/git-installations", - ]; - - $state = \array_merge($defaultState, $state ?? []); - - $redirectSuccess = $state['success'] ?? ''; - $redirectFailure = $state['failure'] ?? ''; - $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { @@ -496,6 +598,20 @@ App::get('/v1/vcs/github/callback') throw new Exception(Exception::PROJECT_NOT_FOUND, $error); } + $region = $project->getAttribute('region', 'default'); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); + + $defaultState = [ + 'success' => $protocol . '://' . $hostname . "/console/project-$region-$projectId/settings/git-installations", + 'failure' => $protocol . '://' . $hostname . "/console/project-$region-$projectId/settings/git-installations", + ]; + + $state = \array_merge($defaultState, $state ?? []); + + $redirectSuccess = $state['success'] ?? ''; + $redirectFailure = $state['failure'] ?? ''; + // Create / Update installation if (!empty($providerInstallationId)) { $privateKey = System::getEnv('_APP_VCS_GITHUB_PRIVATE_KEY'); @@ -599,11 +715,12 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->param('providerRootDirectory', '', new Text(256, 0), 'Path to get contents of nested directory', true) + ->param('providerReference', '', new Text(256, 0), 'Git reference (branch, tag, commit) to get contents from', true) ->inject('gitHub') ->inject('response') ->inject('project') ->inject('dbForPlatform') - ->action(function (string $installationId, string $providerRepositoryId, string $providerRootDirectory, GitHub $github, Response $response, Document $project, Database $dbForPlatform) { + ->action(function (string $installationId, string $providerRepositoryId, string $providerRootDirectory, string $providerReference, GitHub $github, Response $response, Document $project, Database $dbForPlatform) { $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation->isEmpty()) { @@ -625,7 +742,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro throw new Exception(Exception::PROVIDER_REPOSITORY_NOT_FOUND); } - $contents = $github->listRepositoryContents($owner, $repositoryName, $providerRootDirectory); + $contents = $github->listRepositoryContents($owner, $repositoryName, $providerRootDirectory, $providerReference); $vcsContents = []; foreach ($contents as $content) { @@ -1121,6 +1238,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro $repository['pushedAt'] = $repository['pushed_at'] ?? ''; $repository['organization'] = $installation->getAttribute('organization', ''); $repository['provider'] = $installation->getAttribute('provider', ''); + $repository['defaultBranch'] = $repository['default_branch'] ?? ''; $response->dynamic(new Document($repository), Response::MODEL_PROVIDER_REPOSITORY); }); @@ -1209,6 +1327,7 @@ App::post('/v1/vcs/github/events') if ($event == $github::EVENT_PUSH) { $providerBranchCreated = $parsedPayload["branchCreated"] ?? false; + $providerBranchDeleted = $parsedPayload["branchDeleted"] ?? false; $providerBranch = $parsedPayload["branch"] ?? ''; $providerBranchUrl = $parsedPayload["branchUrl"] ?? ''; $providerRepositoryId = $parsedPayload["repositoryId"] ?? ''; @@ -1217,7 +1336,8 @@ App::post('/v1/vcs/github/events') $providerRepositoryUrl = $parsedPayload["repositoryUrl"] ?? ''; $providerCommitHash = $parsedPayload["commitHash"] ?? ''; $providerRepositoryOwner = $parsedPayload["owner"] ?? ''; - $providerCommitAuthor = $parsedPayload["headCommitAuthor"] ?? ''; + $providerCommitAuthorName = $parsedPayload["headCommitAuthorName"] ?? ''; + $providerCommitAuthorEmail = $parsedPayload["headCommitAuthorEmail"] ?? ''; $providerCommitAuthorUrl = $parsedPayload["authorUrl"] ?? ''; $providerCommitMessage = $parsedPayload["headCommitMessage"] ?? ''; $providerCommitUrl = $parsedPayload["headCommitUrl"] ?? ''; @@ -1230,9 +1350,9 @@ App::post('/v1/vcs/github/events') Query::limit(100), ])); - // create new deployment only on push and not when branch is created - if (!$providerBranchCreated) { - $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthor, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, '', false, $dbForPlatform, $queueForBuilds, $getProjectDB, $request); + // create new deployment only on push (not committed by us) and not when branch is created or deleted + if ($providerCommitAuthorEmail !== APP_VCS_GITHUB_EMAIL && !$providerBranchCreated && !$providerBranchDeleted) { + $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthorName, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, '', false, $dbForPlatform, $queueForBuilds, $getProjectDB, $request); } } elseif ($event == $github::EVENT_INSTALLATION) { if ($parsedPayload["action"] == "deleted") { diff --git a/app/controllers/general.php b/app/controllers/general.php index 90a108c7c6..8abca96742 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -22,6 +22,7 @@ use Appwrite\Utopia\Request\Filters\V16 as RequestV16; use Appwrite\Utopia\Request\Filters\V17 as RequestV17; use Appwrite\Utopia\Request\Filters\V18 as RequestV18; use Appwrite\Utopia\Request\Filters\V19 as RequestV19; +use Appwrite\Utopia\Request\Filters\V20 as RequestV20; use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Filters\V16 as ResponseV16; use Appwrite\Utopia\Response\Filters\V17 as ResponseV17; @@ -49,14 +50,13 @@ use Utopia\Logger\Log\User; use Utopia\Logger\Logger; use Utopia\Platform\Service; use Utopia\System\System; -use Utopia\Validator\Hostname; use Utopia\Validator\Text; Config::setParam('domainVerification', false); Config::setParam('cookieDomain', 'localhost'); Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE); -function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) +function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { $host = $request->getHostname() ?? ''; if (!empty($previewHostname)) { @@ -76,7 +76,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw } $errorView = __DIR__ . '/../views/general/error.phtml'; - $url = (System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https') . '://' . System::getEnv('_APP_DOMAIN', ''); + $url = (System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https') . '://' . System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); if ($rule->isEmpty()) { $appDomainFunctionsFallback = System::getEnv('_APP_DOMAIN_FUNCTIONS_FALLBACK', ''); @@ -118,6 +118,11 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $project->setAttribute('accessedAt', DateTime::now()); Authorization::skip(fn () => $dbForPlatform->updateDocument('projects', $project->getId(), $project)); } + + /** + * Set projectId to update the Error hook logger, since x-appwrite-project is not available when executing custom domain function + */ + $log->addTag('projectId', $project->getId()); } if (array_key_exists('proxy', $project->getAttribute('services', []))) { @@ -186,7 +191,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $resourceId = $rule->getAttribute('deploymentResourceId', ''); $type = ($resourceType === 'site') ? 'sites' : 'functions'; $exception = new AppwriteException(AppwriteException::DEPLOYMENT_NOT_FOUND, view: $errorView); - $exception->addCTA('View deployments', $url . '/console/project-' . $projectId . '/' . $type . '/' . $resourceType . '-' . $resourceId); + $exception->addCTA('View deployments', $url . '/console/project-' . $project->getAttribute('region', 'default') . '-' . $projectId . '/' . $type . '/' . $resourceType . '-' . $resourceId); throw $exception; } @@ -262,7 +267,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw } if (!$authorized) { - $url = (System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https') . "://" . System::getEnv('_APP_DOMAIN'); + $url = (System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https') . "://" . System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); $response ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') ->addHeader('Pragma', 'no-cache') @@ -319,21 +324,22 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $allowAnyStatus = !\is_null($apiKey) && $apiKey->isDeploymentStatusIgnored(); if (!$allowAnyStatus && $deployment->getAttribute('status') !== 'ready') { $status = $deployment->getAttribute('status'); + $region = $project->getAttribute('region', 'default'); switch ($status) { case 'failed': $exception = new AppwriteException(AppwriteException::BUILD_FAILED, view: $errorView); - $ctaUrl = '/console/project-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments/deployment-' . $deployment->getId(); + $ctaUrl = '/console/project-' . $region . '-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments/deployment-' . $deployment->getId(); $exception->addCTA('View logs', $url . $ctaUrl); break; case 'canceled': $exception = new AppwriteException(AppwriteException::BUILD_CANCELED, view: $errorView); - $ctaUrl = '/console/project-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments'; + $ctaUrl = '/console/project-' . $region . '-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments'; $exception->addCTA('View deployments', $url . $ctaUrl); break; default: $exception = new AppwriteException(AppwriteException::BUILD_NOT_READY, view: $errorView); - $ctaUrl = '/console/project-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments/deployment-' . $deployment->getId(); + $ctaUrl = '/console/project-' . $region . '-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments/deployment-' . $deployment->getId(); $exception->addCTA('Reload', '/'); $exception->addCTA('View logs', $url . $ctaUrl); break; @@ -345,18 +351,23 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $permissions = $resource->getAttribute('execute'); if (!(\in_array('any', $permissions)) && !(\in_array('guests', $permissions))) { $exception = new AppwriteException(AppwriteException::FUNCTION_EXECUTE_PERMISSION_MISSING, view: $errorView); - $exception->addCTA('View settings', $url . '/console/project-' . $project->getId() . '/functions/function-' . $resource->getId() . '/settings'); + $exception->addCTA('View settings', $url . '/console/project-' . $project->getAttribute('region', 'default') . '-' . $project->getId() . '/functions/function-' . $resource->getId() . '/settings'); throw $exception; } } + $executionId = ID::unique(); + $headers = \array_merge([], $requestHeaders); + $headers['x-appwrite-execution-id'] = $executionId ?? ''; $headers['x-appwrite-user-id'] = ''; $headers['x-appwrite-country-code'] = ''; $headers['x-appwrite-continent-code'] = ''; $headers['x-appwrite-continent-eu'] = 'false'; + $ip = $request->getIP(); + $headers['x-appwrite-client-ip'] = $ip; - $jwtExpiry = $resource->getAttribute('timeout', 900); + $jwtExpiry = $resource->getAttribute('timeout', 900) + 60; // 1min extra to account for possible cold-starts $jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $jwtExpiry, 0); $jwtKey = $jwtObj->encode([ 'projectId' => $project->getId(), @@ -366,7 +377,6 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $headers['x-appwrite-trigger'] = 'http'; $headers['x-appwrite-user-jwt'] = ''; - $ip = $headers['x-real-ip'] ?? ''; if (!empty($ip)) { $record = $geodb->get($ip); @@ -386,8 +396,6 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw } } - $executionId = ID::unique(); - $execution = new Document([ '$id' => $executionId, '$permissions' => [], @@ -447,7 +455,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $vars[$var->getAttribute('key')] = $var->getAttribute('value', ''); } - $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; $hostname = System::getEnv('_APP_DOMAIN'); $endpoint = $protocol . '://' . $hostname . "/v1"; @@ -511,28 +519,27 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw 'function' => $deployment->getAttribute('entrypoint', ''), 'site' => '', }; + $source = $deployment->getAttribute('buildPath', ''); + $extension = str_ends_with($source, '.tar') ? 'tar' : 'tar.gz'; - if ($type === 'function') { - $runtimeEntrypoint = match ($version) { - 'v2' => '', - default => 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $runtime['startCommand'] . '"' - }; - } elseif ($type === 'site') { + $startCommand = $runtime['startCommand']; + if ($type === 'site') { $frameworks = Config::getParam('frameworks', []); $framework = $frameworks[$resource->getAttribute('framework', '')] ?? null; - $startCommand = $runtime['startCommand']; - if (!is_null($framework)) { $adapter = ($framework['adapters'] ?? [])[$deployment->getAttribute('adapter', '')] ?? null; if (!is_null($adapter) && isset($adapter['startCommand'])) { $startCommand = $adapter['startCommand']; } } - - $runtimeEntrypoint = 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $startCommand . '"'; } + $runtimeEntrypoint = match ($version) { + 'v2' => '', + default => "cp /tmp/code.$extension /mnt/code/code.$extension && nohup helpers/start.sh \"$startCommand\"", + }; + $entrypoint = match ($type) { 'function' => $deployment->getAttribute('entrypoint', ''), 'site' => '', @@ -545,7 +552,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw variables: $vars, timeout: $resource->getAttribute('timeout', 30), image: $runtime['image'], - source: $deployment->getAttribute('buildPath', ''), + source: $source, entrypoint: $entrypoint, version: $version, path: $path, @@ -555,15 +562,18 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw cpus: $spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT, memory: $spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT, logging: $resource->getAttribute('logging', true), - requestTimeout: 30 + requestTimeout: 30, + responseFormat: Executor::RESPONSE_FORMAT_ARRAY_HEADERS ); + $headerOverrides = []; + // Branded 404 override $isResponseBranded = false; if ($executionResponse['statusCode'] === 404 && $deployment->getAttribute('adapter', '') === 'static') { $layout = new View(__DIR__ . '/../views/general/404.phtml'); $executionResponse['body'] = $layout->render(); - $executionResponse['headers']['content-length'] = \strlen($executionResponse['body']); + $headerOverrides['content-length'] = \strlen($executionResponse['body']); $isResponseBranded = true; } @@ -573,15 +583,16 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $transformation = new Transformation(); $transformation->addAdapter(new Preview()); $transformation->setInput($executionResponse['body']); - $transformation->setTraits($executionResponse['headers']); + + $simpleHeaders = []; + foreach ($executionResponse['headers'] as $key => $value) { + $simpleHeaders[$key] = \is_array($value) ? \implode(', ', $value) : $value; + } + + $transformation->setTraits($simpleHeaders); if ($isPreview && $transformation->transform()) { $executionResponse['body'] = $transformation->getOutput(); - - foreach ($executionResponse['headers'] as $key => $value) { - if (\strtolower($key) === 'content-length') { - $executionResponse['headers'][$key] = \strlen($executionResponse['body']); - } - } + $headerOverrides['content-length'] = \strlen($executionResponse['body']); } } } @@ -595,27 +606,62 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw ->setParam('code', $executionResponse['statusCode']); $executionResponse['body'] = $layout->render(); - foreach ($executionResponse['headers'] as $key => $value) { - if (\strtolower($key) === 'content-length') { - $executionResponse['headers'][$key] = \strlen($executionResponse['body']); - } elseif (\strtolower($key) === 'content-type') { - $executionResponse['headers'][$key] = 'text/html'; + + $headerOverrides['content-length'] = \strlen($executionResponse['body']); + $headerOverrides['content-type'] = 'text/html'; + } + + if ($deployment->getAttribute('resourceType') === 'functions') { + $headerOverrides['x-appwrite-execution-id'] = $execution->getId(); + } elseif ($deployment->getAttribute('resourceType') === 'sites') { + $headerOverrides['x-appwrite-log-id'] = $execution->getId(); + } + + foreach ($headerOverrides as $key => $value) { + if (\array_key_exists($key, $executionResponse['headers'])) { + if (\is_array($executionResponse['headers'][$key])) { + $executionResponse['headers'][$key][] = $value; + } else { + $executionResponse['headers'][$key] = [$executionResponse['headers'][$key], $value]; } + } else { + $executionResponse['headers'][$key] = $value; } } $headersFiltered = []; foreach ($executionResponse['headers'] as $key => $value) { if (\in_array(\strtolower($key), FUNCTION_ALLOWLIST_HEADERS_RESPONSE)) { - $headersFiltered[] = ['name' => $key, 'value' => $value]; + $headersFiltered[] = ['name' => $key, 'value' => \is_array($value) ? \implode(', ', $value) : $value]; } } + // Truncate logs if they exceed the limit + $maxLogLength = APP_FUNCTION_LOG_LENGTH_LIMIT; + $logs = $executionResponse['logs'] ?? ''; + + if (\is_string($logs) && \strlen($logs) > $maxLogLength) { + $warningMessage = "[WARNING] Logs truncated. The output exceeded {$maxLogLength} characters.\n"; + $warningLength = \strlen($warningMessage); + $maxContentLength = max(0, $maxLogLength - $warningLength); + $logs = $warningMessage . ($maxContentLength > 0 ? \substr($logs, -$maxContentLength) : ''); + } + + // Truncate errors if they exceed the limit + $maxErrorLength = APP_FUNCTION_ERROR_LENGTH_LIMIT; + $errors = $executionResponse['errors'] ?? ''; + + if (\is_string($errors) && \strlen($errors) > $maxErrorLength) { + $warningMessage = "[WARNING] Errors truncated. The output exceeded {$maxErrorLength} characters.\n"; + $warningLength = \strlen($warningMessage); + $maxContentLength = max(0, $maxErrorLength - $warningLength); + $errors = $warningMessage . ($maxContentLength > 0 ? \substr($errors, -$maxContentLength) : ''); + } /** Update execution status */ $status = $executionResponse['statusCode'] >= 500 ? 'failed' : 'completed'; $execution->setAttribute('status', $status); - $execution->setAttribute('logs', $executionResponse['logs']); - $execution->setAttribute('errors', $executionResponse['errors']); + $execution->setAttribute('logs', $logs); + $execution->setAttribute('errors', $errors); $execution->setAttribute('responseStatusCode', $executionResponse['statusCode']); $execution->setAttribute('responseHeaders', $headersFiltered); $execution->setAttribute('duration', $executionResponse['duration']); @@ -653,7 +699,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $headers = []; foreach (($executionResponse['headers'] ?? []) as $key => $value) { - $headers[] = ['name' => $key, 'value' => $value]; + $headers[] = ['name' => $key, 'value' => \is_array($value) ? \implode(', ', $value) : $value]; } $execution->setAttribute('responseBody', $executionResponse['body'] ?? ''); @@ -662,16 +708,26 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $body = $execution['responseBody'] ?? ''; $contentType = 'text/plain'; - foreach ($execution['responseHeaders'] as $header) { - if (\strtolower($header['name']) === 'content-type') { - $contentType = $header['value']; - } - - if (\strtolower($header['name']) === 'transfer-encoding') { + foreach ($executionResponse['headers'] as $name => $values) { + if (\strtolower($name) === 'content-type') { + $contentType = \is_array($values) ? $values[0] : $values; continue; } - $response->addHeader(\strtolower($header['name']), $header['value']); + if (\strtolower($name) === 'transfer-encoding') { + continue; + } + + if (\is_array($values)) { + $count = 0; + foreach ($values as $value) { + $override = $count === 0; + $response->addHeader($name, $value, override: $override); + $count++; + } + } else { + $response->addHeader($name, $values); + } } $response @@ -749,12 +805,6 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw return false; } elseif ($type === 'redirect') { $url = $rule->getAttribute('redirectUrl', ''); - - $query = ($swooleRequest->server['query_string'] ?? ''); - if (!empty($query)) { - $url .= '?' . $query; - } - $response->redirect($url, \intval($rule->getAttribute('redirectStatusCode', 301))); return true; } else { @@ -793,13 +843,14 @@ App::init() ->inject('swooleRequest') ->inject('request') ->inject('response') + ->inject('log') ->inject('console') ->inject('project') ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('locale') ->inject('localeCodes') - ->inject('clients') + ->inject('platforms') ->inject('geodb') ->inject('queueForStatsUsage') ->inject('queueForEvents') @@ -810,7 +861,9 @@ App::init() ->inject('previewHostname') ->inject('devKey') ->inject('apiKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Document $console, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, array $clients, Reader $geodb, StatsUsage $queueForStatsUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, Executor $executor, callable $isResourceBlocked, string $previewHostname, Document $devKey, ?Key $apiKey) { + ->inject('httpReferrer') + ->inject('httpReferrerSafe') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Document $console, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, array $platforms, Reader $geodb, StatsUsage $queueForStatsUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, Executor $executor, callable $isResourceBlocked, string $previewHostname, Document $devKey, ?Key $apiKey, string $httpReferrer, string $httpReferrerSafe) { /* * Appwrite Router */ @@ -818,7 +871,7 @@ App::init() $mainDomain = System::getEnv('_APP_DOMAIN', ''); // Only run Router when external domain if ($host !== $mainDomain || !empty($previewHostname)) { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { $utopia->getRoute()?->label('router', true); } } @@ -849,6 +902,10 @@ App::init() if (version_compare($requestFormat, '1.7.0', '<')) { $request->addFilter(new RequestV19()); } + if (version_compare($requestFormat, '1.8.0', '<')) { + $dbForProject = $getProjectDB($project); + $request->addFilter(new RequestV20($dbForProject, $route->getPathValues($request))); + } } $domain = $request->getHostname(); @@ -942,42 +999,9 @@ App::init() $locale->setDefault($localeParam); } - $referrer = $request->getReferer(); - $origin = \parse_url($request->getOrigin($referrer), PHP_URL_HOST); - $protocol = \parse_url($request->getOrigin($referrer), PHP_URL_SCHEME); - $port = \parse_url($request->getOrigin($referrer), PHP_URL_PORT); - - $refDomainOrigin = 'localhost'; - $validator = new Hostname($clients); - if ($validator->isValid($origin)) { - $refDomainOrigin = $origin; - } elseif (!empty($origin)) { - // Auto-allow domains with linked rule - if (System::getEnv('_APP_RULES_FORMAT') === 'md5') { - $rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', md5($origin ?? ''))); - } else { - $rule = Authorization::skip( - fn () => $dbForPlatform->find('rules', [ - Query::equal('domain', [$origin]), - Query::limit(1) - ]) - )[0] ?? new Document(); - } - - if (!$rule->isEmpty() && $rule->getAttribute('projectInternalId') === $project->getSequence()) { - $refDomainOrigin = $origin; - } - } - - $refDomain = (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $refDomainOrigin . (!empty($port) ? ':' . $port : ''); - - $refDomain = (!$route->getLabel('origin', false)) // This route is publicly accessible - ? $refDomain - : (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $origin . (!empty($port) ? ':' . $port : ''); - + $origin = \parse_url($request->getOrigin($httpReferrer), PHP_URL_HOST); $selfDomain = new Domain($request->getHostname()); $endDomain = new Domain((string)$origin); - Config::setParam( 'domainVerification', ($selfDomain->getRegisterable() === $endDomain->getRegisterable()) && @@ -1001,6 +1025,8 @@ App::init() ) ); + $warnings = []; + /* * Response format */ @@ -1019,7 +1045,7 @@ App::init() $response->addFilter(new ResponseV19()); } if (version_compare($responseFormat, APP_VERSION_STABLE, '>')) { - $response->addHeader('X-Appwrite-Warning', "The current SDK is built for Appwrite " . $responseFormat . ". However, the current Appwrite server version is " . APP_VERSION_STABLE . ". Please downgrade your SDK to match the Appwrite version: https://appwrite.io/docs/sdks"); + $warnings[] = "The current SDK is built for Appwrite " . $responseFormat . ". However, the current Appwrite server version is " . APP_VERSION_STABLE . ". Please downgrade your SDK to match the Appwrite version: https://appwrite.io/docs/sdks"; } } @@ -1049,27 +1075,33 @@ App::init() ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Dev-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-Appwrite-Timeout, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-SDK-GraphQL, X-Appwrite-ID, X-Appwrite-Timestamp, Content-Range, Range, Cache-Control, Expires, Pragma, X-Forwarded-For, X-Forwarded-User-Agent') ->addHeader('Access-Control-Expose-Headers', 'X-Appwrite-Session, X-Fallback-Cookies') - ->addHeader('Access-Control-Allow-Origin', $refDomain) + ->addHeader('Access-Control-Allow-Origin', $httpReferrerSafe) ->addHeader('Access-Control-Allow-Credentials', 'true'); if (!$devKey->isEmpty()) { $response->addHeader('Access-Control-Allow-Origin', '*'); } + if (!empty($warnings)) { + $response->addHeader('X-Appwrite-Warning', implode(';', $warnings)); + } + /* * Validate Client Domain - Check to avoid CSRF attack * Adding Appwrite API domains to allow XDOMAIN communication * Skip this check for non-web platforms which are not required to send an origin header */ $origin = $request->getOrigin($request->getReferer('')); - $originValidator = new Origin(\array_merge($project->getAttribute('platforms', []), $console->getAttribute('platforms', []))); + $originValidator = new Origin($platforms); if ( - !$originValidator->isValid($origin) - && $devKey->isEmpty() + $devKey->isEmpty() + && !empty($origin) + && !$originValidator->isValid($origin) && \in_array($request->getMethod(), [Request::METHOD_POST, Request::METHOD_PUT, Request::METHOD_PATCH, Request::METHOD_DELETE]) && $route->getLabel('origin', false) !== '*' && empty($request->getHeader('x-appwrite-key', '')) + && \parse_url($httpReferrerSafe, PHP_URL_HOST) === 'localhost' ) { throw new AppwriteException(AppwriteException::GENERAL_UNKNOWN_ORIGIN, $originValidator->getDescription()); } @@ -1080,6 +1112,7 @@ App::options() ->inject('swooleRequest') ->inject('request') ->inject('response') + ->inject('log') ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('queueForEvents') @@ -1092,7 +1125,7 @@ App::options() ->inject('project') ->inject('devKey') ->inject('apiKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, Document $project, Document $devKey, ?Key $apiKey) { + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, Document $project, Document $devKey, ?Key $apiKey) { /* * Appwrite Router */ @@ -1100,7 +1133,7 @@ App::options() $mainDomain = System::getEnv('_APP_DOMAIN', ''); // Only run Router when external domain if ($host !== $mainDomain || !empty($previewHostname)) { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { $utopia->getRoute()?->label('router', true); } } @@ -1273,7 +1306,12 @@ App::error() $log->addTag('url', $request->getURI()); $log->addTag('verboseType', get_class($error)); $log->addTag('code', $error->getCode()); - $log->addTag('projectId', $project->getId()); + + $tags = $log->getTags(); + if (!isset($tags['projectId'])) { + $log->addTag('projectId', $project->getId()); + } + $log->addTag('hostname', $request->getHostname()); $log->addTag('locale', (string)$request->getParam('locale', $request->getHeader('x-appwrite-locale', ''))); @@ -1284,7 +1322,7 @@ App::error() $action = 'UNKNOWN_NAMESPACE.UNKNOWN.METHOD'; if (!empty($sdk)) { - /** @var Appwrite\SDK\Method $sdk */ + /** @var \Appwrite\SDK\Method $sdk */ $action = $sdk->getNamespace() . '.' . $sdk->getMethodName(); } @@ -1391,6 +1429,7 @@ App::get('/robots.txt') ->inject('swooleRequest') ->inject('request') ->inject('response') + ->inject('log') ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('queueForEvents') @@ -1401,15 +1440,16 @@ App::get('/robots.txt') ->inject('isResourceBlocked') ->inject('previewHostname') ->inject('apiKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { $host = $request->getHostname() ?? ''; + $consoleDomain = System::getEnv('_APP_CONSOLE_DOMAIN', ''); $mainDomain = System::getEnv('_APP_DOMAIN', ''); - if (($host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { + if (($host === $consoleDomain || $host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { $template = new View(__DIR__ . '/../views/general/robots.phtml'); $response->text($template->render(false)); } else { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { $utopia->getRoute()?->label('router', true); } } @@ -1423,6 +1463,7 @@ App::get('/humans.txt') ->inject('swooleRequest') ->inject('request') ->inject('response') + ->inject('log') ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('queueForEvents') @@ -1433,15 +1474,16 @@ App::get('/humans.txt') ->inject('isResourceBlocked') ->inject('previewHostname') ->inject('apiKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { $host = $request->getHostname() ?? ''; + $consoleDomain = System::getEnv('_APP_CONSOLE_DOMAIN', ''); $mainDomain = System::getEnv('_APP_DOMAIN', ''); - if (($host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { + if (($host === $consoleDomain || $host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { $template = new View(__DIR__ . '/../views/general/humans.phtml'); $response->text($template->render(false)); } else { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { $utopia->getRoute()?->label('router', true); } } diff --git a/app/controllers/mock.php b/app/controllers/mock.php index fd7b9ab495..40ddae8f30 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -13,6 +13,7 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\UID; +use Utopia\Locale\Locale; use Utopia\System\System; use Utopia\Validator\Host; use Utopia\Validator\Text; @@ -35,6 +36,25 @@ App::get('/v1/mock/tests/general/oauth2') $response->redirect($redirectURI . '?' . \http_build_query(['code' => 'abcdef', 'state' => $state])); }); +App::get('/v1/mock/tests/locale') + ->desc('Mock locale translation key') + ->groups(['mock']) + ->label('scope', 'public') + ->label('docs', false) + ->label('mock', true) + ->inject('locale') + ->inject('localeCodes') + ->inject('request') + ->inject('response') + ->action(function (Locale $locale, array $localeCodes, Request $request, Response $response) { + $localeParam = (string) $request->getParam('locale', $request->getHeader('x-appwrite-locale', '')); + if (\in_array($localeParam, $localeCodes)) { + $locale->setDefault($localeParam); + } + + $response->send($locale->getText('mock')); + }); + App::get('/v1/mock/tests/general/oauth2/token') ->desc('OAuth2 Token') ->groups(['mock']) @@ -129,32 +149,6 @@ App::get('/v1/mock/tests/general/oauth2/failure') ]); }); -App::patch('/v1/mock/functions-v2') - ->desc('Update Function Version to V2 (outdated code syntax)') - ->groups(['mock', 'api', 'functions']) - ->label('scope', 'functions.write') - ->label('docs', false) - ->param('functionId', '', new UID(), 'Function ID.') - ->inject('response') - ->inject('dbForProject') - ->action(function (string $functionId, Response $response, Database $dbForProject) { - $isDevelopment = System::getEnv('_APP_ENV', 'development') === 'development'; - - if (!$isDevelopment) { - throw new Exception(Exception::GENERAL_NOT_IMPLEMENTED); - } - - $function = $dbForProject->getDocument('functions', $functionId); - - if ($function->isEmpty()) { - throw new Exception(Exception::FUNCTION_NOT_FOUND); - } - - $dbForProject->updateDocument('functions', $function->getId(), $function->setAttribute('version', 'v2')); - - $response->noContent(); - }); - App::post('/v1/mock/api-key-unprefixed') ->desc('Create API Key (without standard prefix)') ->groups(['mock', 'api', 'projects']) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index f99ebbce07..959ee77b7d 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -22,6 +22,7 @@ use Utopia\Abuse\Abuse; use Utopia\App; use Utopia\Cache\Adapter\Filesystem; use Utopia\Cache\Cache; +use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\DateTime; @@ -30,6 +31,7 @@ use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use Utopia\Queue\Publisher; use Utopia\System\System; +use Utopia\Telemetry\Adapter as Telemetry; use Utopia\Validator\WhiteList; $parseLabel = function (string $label, array $responsePayload, array $requestParams, Document $user) { @@ -58,6 +60,12 @@ $parseLabel = function (string $label, array $responsePayload, array $requestPar return $label; }; +/** + * This isolated event handling for `users.*.create` which is based on a `Database::EVENT_DOCUMENT_CREATE` listener may look odd, but it is **intentional**. + * + * Accounts can be created in many ways beyond `createAccount` + * (anonymous, OAuth, phone, etc.), and those flows are probably not covered in event tests; so we handle this here. + */ $eventDatabaseListener = function (Document $project, Document $document, Response $response, Event $queueForEvents, Func $queueForFunctions, Webhook $queueForWebhooks, Realtime $queueForRealtime) { // Only trigger events for user creation with the database listener. if ($document->getCollection() !== 'users') { @@ -238,10 +246,11 @@ App::init() $role = $apiKey->getRole(); $scopes = $apiKey->getScopes(); - // Disable authorization checks for API keys - Authorization::setDefaultStatus(false); if ($apiKey->getRole() === Auth::USER_ROLE_APPS) { + // Disable authorization checks for API keys + Authorization::setDefaultStatus(false); + $user = new Document([ '$id' => '', 'status' => true, @@ -370,9 +379,9 @@ App::init() } // Do now allow access if scope is not allowed - $scope = $route->getLabel('scope', 'none'); - if (!\in_array($scope, $scopes)) { - throw new Exception(Exception::GENERAL_UNAUTHORIZED_SCOPE, $user->getAttribute('email', 'User') . ' (role: ' . \strtolower($roles[$role]['label']) . ') missing scope (' . $scope . ')'); + $allowed = (array)$route->getLabel('scope', 'none'); + if (empty(\array_intersect($allowed, $scopes))) { + throw new Exception(Exception::GENERAL_UNAUTHORIZED_SCOPE, $user->getAttribute('email', 'User') . ' (role: ' . \strtolower($roles[$role]['label']) . ') missing scopes (' . \json_encode($allowed) . ')'); } // Do not allow access to blocked accounts @@ -406,6 +415,8 @@ App::init() ->inject('project') ->inject('user') ->inject('publisher') + ->inject('publisherFunctions') + ->inject('publisherWebhooks') ->inject('queueForEvents') ->inject('queueForMessaging') ->inject('queueForAudits') @@ -420,7 +431,8 @@ App::init() ->inject('apiKey') ->inject('plan') ->inject('devKey') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey) use ($usageDatabaseListener, $eventDatabaseListener) { + ->inject('telemetry') + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Publisher $publisherFunctions, Publisher $publisherWebhooks, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Telemetry $telemetry) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); @@ -532,8 +544,8 @@ App::init() // Clone the queues, to prevent events triggered by the database listener // from overwriting the events that are supposed to be triggered in the shutdown hook. $queueForEventsClone = new Event($publisher); - $queueForFunctions = new Func($publisher); - $queueForWebhooks = new Webhook($publisher); + $queueForFunctions = new Func($publisherFunctions); + $queueForWebhooks = new Webhook($publisherWebhooks); $queueForRealtime = new Realtime(); $dbForProject @@ -553,6 +565,7 @@ App::init() )); $useCache = $route->getLabel('cache', false); + $storageCacheOperationsCounter = $telemetry->createCounter('storage.cache.operations.load'); if ($useCache) { $route = $utopia->match($request); $isImageTransformation = $route->getPath() === '/v1/storage/buckets/:bucketId/files/:fileId/preview'; @@ -563,7 +576,7 @@ App::init() $cache = new Cache( new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId()) ); - $timestamp = 60 * 60 * 24 * 30; + $timestamp = 60 * 60 * 24 * 180; // Temporarily increase the TTL to 180 day to ensure files in the cache are still fetched. $data = $cache->load($key, $timestamp); if (!empty($data) && !$cacheLog->isEmpty()) { @@ -575,7 +588,6 @@ App::init() $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getSequence(); - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAppUser && !$isPrivilegedUser)) { @@ -619,10 +631,12 @@ App::init() ->addHeader('Cache-Control', sprintf('private, max-age=%d', $timestamp)) ->addHeader('X-Appwrite-Cache', 'hit') ->setContentType($cacheLog->getAttribute('mimeType')); + $storageCacheOperationsCounter->add(1, ['result' => 'hit']); if (!$isImageTransformation || !$isDisabled) { $response->send($data); } } else { + $storageCacheOperationsCounter->add(1, ['result' => 'miss']); $response ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') ->addHeader('Pragma', 'no-cache') @@ -824,6 +838,10 @@ App::shutdown() $resourceType = $parseLabel($pattern, $responsePayload, $requestParams, $user); } + $cache = new Cache( + new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId()) + ); + $key = $request->cacheIdentifier(); $signature = md5($data['payload']); $cacheLog = Authorization::skip(fn () => $dbForProject->getDocument('cache', $key)); @@ -841,12 +859,11 @@ App::shutdown() } elseif (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_CACHE_UPDATE)) > $accessedAt) { $cacheLog->setAttribute('accessedAt', $now); Authorization::skip(fn () => $dbForProject->updateDocument('cache', $cacheLog->getId(), $cacheLog)); + // Overwrite the file every APP_CACHE_UPDATE seconds to update the file modified time that is used in the TTL checks in cache->load() + $cache->save($key, $data['payload']); } if ($signature !== $cacheLog->getAttribute('signature')) { - $cache = new Cache( - new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId()) - ); $cache->save($key, $data['payload']); } } diff --git a/app/http.php b/app/http.php index 30f4013821..1bd3e97e69 100644 --- a/app/http.php +++ b/app/http.php @@ -10,6 +10,7 @@ use Swoole\Http\Response as SwooleResponse; use Swoole\Http\Server; use Swoole\Process; use Swoole\Table; +use Swoole\Timer; use Utopia\App; use Utopia\Audit\Audit; use Utopia\CLI\Console; @@ -156,11 +157,16 @@ $http->on(Constant::EVENT_WORKER_START, function ($server, $workerId) { Console::success('Worker ' . ++$workerId . ' started successfully'); }); -$http->on(Constant::EVENT_BEFORE_RELOAD, function ($server, $workerId) { +$http->on(Constant::EVENT_WORKER_STOP, function ($server, $workerId) { + Timer::clearAll(); + Console::success('Worker ' . ++$workerId . ' stopped successfully'); +}); + +$http->on(Constant::EVENT_BEFORE_RELOAD, function ($server) { Console::success('Starting reload...'); }); -$http->on(Constant::EVENT_AFTER_RELOAD, function ($server, $workerId) { +$http->on(Constant::EVENT_AFTER_RELOAD, function ($server) { Console::success('Reload completed...'); }); @@ -550,7 +556,7 @@ $http->on(Constant::EVENT_TASK, function () use ($register, $domains) { /** @var Utopia\Database\Database $dbForPlatform */ $dbForPlatform = $app->getResource('dbForPlatform'); - Console::loop(function () use ($dbForPlatform, $domains, &$lastSyncUpdate) { + Timer::tick(DOMAIN_SYNC_TIMER * 1000, function () use ($dbForPlatform, $domains, &$lastSyncUpdate) { try { $time = DateTime::now(); $limit = 1000; @@ -589,8 +595,6 @@ $http->on(Constant::EVENT_TASK, function () use ($register, $domains) { } catch (Throwable $th) { Console::error($th->getMessage()); } - }, DOMAIN_SYNC_TIMER, 0, function ($error) { - Console::error($error); }); }); diff --git a/app/init/configs.php b/app/init/configs.php index 6cd57faa93..7572302919 100644 --- a/app/init/configs.php +++ b/app/init/configs.php @@ -2,6 +2,8 @@ use Utopia\Config\Config; +require_once __DIR__ . '/../config/storage/resource_limits.php'; + Config::load('template-runtimes', __DIR__ . '/../config/template-runtimes.php'); Config::load('events', __DIR__ . '/../config/events.php'); Config::load('auth', __DIR__ . '/../config/auth.php'); diff --git a/app/init/constants.php b/app/init/constants.php index f364b10d6e..74f04f25e9 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -37,8 +37,8 @@ const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours const APP_RESOURCE_TOKEN_ACCESS = 24 * 60 * 60; // 24 hours const APP_FILE_ACCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours -const APP_CACHE_BUSTER = 4319; -const APP_VERSION_STABLE = '1.7.2'; +const APP_CACHE_BUSTER = 4321; +const APP_VERSION_STABLE = '1.8.0'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; const APP_DATABASE_ATTRIBUTE_IP = 'ip'; @@ -46,6 +46,9 @@ const APP_DATABASE_ATTRIBUTE_DATETIME = 'datetime'; const APP_DATABASE_ATTRIBUTE_URL = 'url'; const APP_DATABASE_ATTRIBUTE_INT_RANGE = 'intRange'; const APP_DATABASE_ATTRIBUTE_FLOAT_RANGE = 'floatRange'; +const APP_DATABASE_ATTRIBUTE_POINT = 'point'; +const APP_DATABASE_ATTRIBUTE_LINE = 'line'; +const APP_DATABASE_ATTRIBUTE_POLYGON = 'polygon'; const APP_DATABASE_ATTRIBUTE_STRING_MAX_LENGTH = 1_073_741_824; // 2^32 bits / 4 bits per char const APP_DATABASE_TIMEOUT_MILLISECONDS_API = 15 * 1000; // 15 seconds const APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER = 300 * 1000; // 5 minutes @@ -80,6 +83,8 @@ const APP_COMPUTE_SPECIFICATION_DEFAULT = Specification::S_1VCPU_512MB; const APP_PLATFORM_SERVER = 'server'; const APP_PLATFORM_CLIENT = 'client'; const APP_PLATFORM_CONSOLE = 'console'; +const APP_VCS_GITHUB_USERNAME = 'Appwrite'; +const APP_VCS_GITHUB_EMAIL = 'team@appwrite.io'; // Database Reconnect const DATABASE_RECONNECT_SLEEP = 2; @@ -141,8 +146,10 @@ const APP_AUTH_TYPE_KEY = 'Key'; const APP_AUTH_TYPE_ADMIN = 'Admin'; // Response related const MAX_OUTPUT_CHUNK_SIZE = 10 * 1024 * 1024; // 10MB +const APP_FUNCTION_LOG_LENGTH_LIMIT = 1000000; +const APP_FUNCTION_ERROR_LENGTH_LIMIT = 1000000; // Function headers -const FUNCTION_ALLOWLIST_HEADERS_REQUEST = ['content-type', 'agent', 'content-length', 'host']; +const FUNCTION_ALLOWLIST_HEADERS_REQUEST = ['content-type', 'agent', 'content-length', 'host', 'x-appwrite-client-ip']; const FUNCTION_ALLOWLIST_HEADERS_RESPONSE = ['content-type', 'content-length']; // Message types const MESSAGE_TYPE_EMAIL = 'email'; @@ -255,7 +262,6 @@ const METRIC_SITES_ID_INBOUND = 'sites.{siteInternalId}.inbound'; const METRIC_SITES_ID_OUTBOUND = 'sites.{siteInternalId}.outbound'; // Resource types - const RESOURCE_TYPE_PROJECTS = 'projects'; const RESOURCE_TYPE_FUNCTIONS = 'functions'; const RESOURCE_TYPE_SITES = 'sites'; @@ -265,10 +271,15 @@ const RESOURCE_TYPE_PROVIDERS = 'providers'; const RESOURCE_TYPE_TOPICS = 'topics'; const RESOURCE_TYPE_SUBSCRIBERS = 'subscribers'; const RESOURCE_TYPE_MESSAGES = 'messages'; +const RESOURCE_TYPE_EXECUTIONS = 'executions'; // Resource types for Tokens - const TOKENS_RESOURCE_TYPE_FILES = 'files'; const TOKENS_RESOURCE_TYPE_SITES = 'sites'; const TOKENS_RESOURCE_TYPE_FUNCTIONS = 'functions'; const TOKENS_RESOURCE_TYPE_DATABASES = 'databases'; + +// Resource types for Schedules +const SCHEDULE_RESOURCE_TYPE_EXECUTION = 'execution'; +const SCHEDULE_RESOURCE_TYPE_FUNCTION = 'function'; +const SCHEDULE_RESOURCE_TYPE_MESSAGE = 'message'; diff --git a/app/init/database/filters.php b/app/init/database/filters.php index 98a37ec4ad..c4cfd1ac81 100644 --- a/app/init/database/filters.php +++ b/app/init/database/filters.php @@ -245,10 +245,18 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { + $resourceType = match ($document->getCollection()) { + 'functions' => ['function'], + 'sites' => ['site'], + default => ['function', 'site'] + }; + return $database ->find('variables', [ Query::equal('resourceInternalId', [$document->getSequence()]), - Query::equal('resourceType', ['function', 'site']), + Query::equal('resourceType', $resourceType), + Query::orderAsc('resourceType'), + Query::orderAsc(), Query::limit(APP_LIMIT_SUBQUERY), ]); } diff --git a/app/init/registers.php b/app/init/registers.php index 415730f936..3dc0e22dba 100644 --- a/app/init/registers.php +++ b/app/init/registers.php @@ -36,7 +36,8 @@ App::setMode(System::getEnv('_APP_ENV', App::MODE_TYPE_PRODUCTION)); if (!App::isProduction()) { // Allow specific domains to skip public domain validation in dev environment // Useful for existing tests involving webhooks - PublicDomain::allow(['request-catcher']); + PublicDomain::allow(['request-catcher-sms']); + PublicDomain::allow(['request-catcher-webhook']); } $register->set('logger', function () { // Register error logger diff --git a/app/init/resources.php b/app/init/resources.php index 7c3df681b1..e4e8fbef5e 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -15,10 +15,12 @@ use Appwrite\Event\Mail; use Appwrite\Event\Messaging; use Appwrite\Event\Migration; use Appwrite\Event\Realtime; +use Appwrite\Event\StatsResources; use Appwrite\Event\StatsUsage; use Appwrite\Event\Webhook; use Appwrite\Extend\Exception; use Appwrite\GraphQL\Schema; +use Appwrite\Network\Platform; use Appwrite\Network\Validator\Origin; use Appwrite\Utopia\Request; use Executor\Executor; @@ -52,6 +54,7 @@ use Utopia\Storage\Device\S3; use Utopia\Storage\Device\Wasabi; use Utopia\Storage\Storage; use Utopia\System\System; +use Utopia\Telemetry\Adapter as Telemetry; use Utopia\Telemetry\Adapter\None as NoTelemetry; use Utopia\Validator\Hostname; use Utopia\Validator\WhiteList; @@ -68,7 +71,11 @@ App::setResource('hooks', function ($register) { }, ['register']); App::setResource('register', fn () => $register); -App::setResource('locale', fn () => new Locale(System::getEnv('_APP_LOCALE', 'en'))); +App::setResource('locale', function () { + $locale = new Locale(System::getEnv('_APP_LOCALE', 'en')); + $locale->setFallback(System::getEnv('_APP_LOCALE', 'en')); + return $locale; +}); App::setResource('localeCodes', function () { return array_map(fn ($locale) => $locale['code'], Config::getParam('locale-codes', [])); @@ -78,9 +85,30 @@ App::setResource('localeCodes', function () { App::setResource('publisher', function (Group $pools) { return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); -App::setResource('consumer', function (Group $pools) { - return new BrokerPool(consumer: $pools->get('consumer')); -}, ['pools']); +App::setResource('publisherDatabases', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherFunctions', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherMigrations', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherStatsUsage', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherMails', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherDeletes', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherMessaging', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherWebhooks', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); App::setResource('queueForMessaging', function (Publisher $publisher) { return new Messaging($publisher); }, ['publisher']); @@ -120,11 +148,14 @@ App::setResource('queueForCertificates', function (Publisher $publisher) { App::setResource('queueForMigrations', function (Publisher $publisher) { return new Migration($publisher); }, ['publisher']); -App::setResource('clients', function ($request, $console, $project) { +App::setResource('queueForStatsResources', function (Publisher $publisher) { + return new StatsResources($publisher); +}, ['publisher']); +App::setResource('platforms', function (Request $request, Document $console, Document $project) { $console->setAttribute('platforms', [ // Always allow current host '$collection' => ID::custom('platforms'), 'name' => 'Current Host', - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'hostname' => $request->getHostname(), ], Document::SET_TYPE_APPEND); @@ -137,39 +168,32 @@ App::setResource('clients', function ($request, $console, $project) { } $console->setAttribute('platforms', [ '$collection' => ID::custom('platforms'), - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'name' => $hostname, 'hostname' => $hostname, ], Document::SET_TYPE_APPEND); } - /** - * Get All verified client URLs for both console and current projects - * + Filter for duplicated entries - */ - $clientsConsole = \array_map( - fn ($node) => $node['hostname'], - \array_filter( - $console->getAttribute('platforms', []), - fn ($node) => (isset($node['type']) && ($node['type'] === Origin::CLIENT_TYPE_WEB) && !empty($node['hostname'])) - ) - ); - - $clients = $clientsConsole; - $platforms = $project->getAttribute('platforms', []); - - foreach ($platforms as $node) { - if ( - isset($node['type']) && - ($node['type'] === Origin::CLIENT_TYPE_WEB || - $node['type'] === Origin::CLIENT_TYPE_FLUTTER_WEB) && - !empty($node['hostname']) - ) { - $clients[] = $node['hostname']; - } + // Add `exp` and `appwrite-callback-{projectId}` schemes + if (!$project->isEmpty() && $project->getId() !== 'console') { + $project->setAttribute('platforms', [ + '$collection' => ID::custom('platforms'), + 'type' => Platform::TYPE_SCHEME, + 'name' => 'Expo', + 'key' => 'exp', + ], Document::SET_TYPE_APPEND); + $project->setAttribute('platforms', [ + '$collection' => ID::custom('platforms'), + 'type' => Platform::TYPE_SCHEME, + 'name' => 'Appwrite Callback', + 'key' => 'appwrite-callback-' . $project->getId(), + ], Document::SET_TYPE_APPEND); } - return \array_unique($clients); + return [ + ...$console->getAttribute('platforms', []), + ...$project->getAttribute('platforms', []), + ]; }, ['request', 'console', 'project']); App::setResource('user', function ($mode, $project, $console, $request, $response, $dbForProject, $dbForPlatform) { @@ -221,18 +245,18 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons Auth::$unique = $session['id'] ?? ''; Auth::$secret = $session['secret'] ?? ''; - if (APP_MODE_ADMIN !== $mode) { - if ($project->isEmpty()) { - $user = new Document([]); - } else { + $user = new Document([]); + + if (!empty(Auth::$unique)) { + if ($mode === APP_MODE_ADMIN) { + $user = $dbForPlatform->getDocument('users', Auth::$unique); + } elseif (!$project->isEmpty()) { if ($project->getId() === 'console') { $user = $dbForPlatform->getDocument('users', Auth::$unique); } else { $user = $dbForProject->getDocument('users', Auth::$unique); } } - } else { - $user = $dbForPlatform->getDocument('users', Auth::$unique); } if ( @@ -263,7 +287,11 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons $jwtUserId = $payload['userId'] ?? ''; if (!empty($jwtUserId)) { - $user = $dbForProject->getDocument('users', $jwtUserId); + if ($mode === APP_MODE_ADMIN) { + $user = $dbForPlatform->getDocument('users', $jwtUserId); + } else { + $user = $dbForProject->getDocument('users', $jwtUserId); + } } $jwtSessionId = $payload['sessionId'] ?? ''; @@ -347,7 +375,7 @@ App::setResource('dbForProject', function (Group $pools, Database $dbForPlatform if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getSequence()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database @@ -400,7 +428,7 @@ App::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getSequence()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database @@ -430,7 +458,7 @@ App::setResource('getLogsDB', function (Group $pools, Cache $cache) { return function (?Document $project = null) use ($pools, $cache, &$database) { if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getSequence()); + $database->setTenant((int)$project->getSequence()); return $database; } @@ -445,7 +473,7 @@ App::setResource('getLogsDB', function (Group $pools, Cache $cache) { // set tenant if ($project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getSequence()); + $database->setTenant((int)$project->getSequence()); } return $database; @@ -454,7 +482,7 @@ App::setResource('getLogsDB', function (Group $pools, Cache $cache) { App::setResource('telemetry', fn () => new NoTelemetry()); -App::setResource('cache', function (Group $pools) { +App::setResource('cache', function (Group $pools, Telemetry $telemetry) { $list = Config::getParam('pools-cache', []); $adapters = []; @@ -462,8 +490,10 @@ App::setResource('cache', function (Group $pools) { $adapters[] = new CachePool($pools->get($value)); } - return new Cache(new Sharding($adapters)); -}, ['pools']); + $cache = new Cache(new Sharding($adapters)); + $cache->setTelemetry($telemetry); + return $cache; +}, ['pools', 'telemetry']); App::setResource('redis', function () { $host = System::getEnv('_APP_REDIS_HOST', 'localhost'); @@ -486,24 +516,24 @@ App::setResource('timelimit', function (\Redis $redis) { }; }, ['redis']); -App::setResource('deviceForLocal', function () { - return new Local(); -}); -App::setResource('deviceForFiles', function ($project) { - return getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId()); -}, ['project']); -App::setResource('deviceForSites', function ($project) { - return getDevice(APP_STORAGE_SITES . '/app-' . $project->getId()); -}, ['project']); -App::setResource('deviceForImports', function ($project) { - return getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId()); -}, ['project']); -App::setResource('deviceForFunctions', function ($project) { - return getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId()); -}, ['project']); -App::setResource('deviceForBuilds', function ($project) { - return getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId()); -}, ['project']); +App::setResource('deviceForLocal', function (Telemetry $telemetry) { + return new Device\Telemetry($telemetry, new Local()); +}, ['telemetry']); +App::setResource('deviceForFiles', function ($project, Telemetry $telemetry) { + return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); +App::setResource('deviceForSites', function ($project, Telemetry $telemetry) { + return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_SITES . '/app-' . $project->getId())); +}, ['project', 'telemetry']); +App::setResource('deviceForImports', function ($project, Telemetry $telemetry) { + return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); +App::setResource('deviceForFunctions', function ($project, Telemetry $telemetry) { + return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); +App::setResource('deviceForBuilds', function ($project, Telemetry $telemetry) { + return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); function getDevice(string $root, string $connection = ''): Device { @@ -681,6 +711,7 @@ App::setResource('schema', function ($utopia, $dbForProject) { }, ]; + // NOTE: `params` and `urls` are not used internally in the `Schema::build` function below! $params = [ 'list' => function (string $databaseId, string $collectionId, array $args) { return [ 'queries' => $args['queries']]; @@ -829,11 +860,20 @@ App::setResource('team', function (Document $project, Database $dbForPlatform, A $teamInternalId = $p->getAttribute('teamInternalId', ''); } elseif ($path === '/v1/projects') { $teamId = $request->getParam('teamId', ''); + + if (empty($teamId)) { + return new Document([]); + } + $team = Authorization::skip(fn () => $dbForPlatform->getDocument('teams', $teamId)); return $team; } } + if (empty($teamInternalId)) { + return new Document([]); + } + $team = Authorization::skip(function () use ($dbForPlatform, $teamInternalId) { return $dbForPlatform->findOne('teams', [ Query::equal('$sequence', [$teamInternalId]), @@ -877,7 +917,7 @@ App::setResource('apiKey', function (Request $request, Document $project): ?Key return Key::decode($project, $key); }, ['request', 'project']); -App::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST'))); +App::setResource('executor', fn () => new Executor()); App::setResource('resourceToken', function ($project, $dbForProject, $request) { $tokenJWT = $request->getParam('token'); @@ -941,3 +981,52 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { } return new Document([]); }, ['project', 'dbForProject', 'request']); + +App::setResource('httpReferrer', function (Request $request): string { + $referrer = $request->getReferer(); + return $referrer; +}, ['request']); + +App::setResource('httpReferrerSafe', function (Request $request, string $httpReferrer, array $platforms, Database $dbForPlatform, Document $project, App $utopia): string { + $origin = \parse_url($request->getOrigin($httpReferrer), PHP_URL_HOST); + $protocol = \parse_url($request->getOrigin($httpReferrer), PHP_URL_SCHEME); + $port = \parse_url($request->getOrigin($httpReferrer), PHP_URL_PORT); + $referrer = (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $origin . (!empty($port) ? ':' . $port : ''); + + // Safe if route is publicly accessible + $route = $utopia->getRoute(); + if ($route->getLabel('origin', false)) { + return $referrer; + } + + // Safe if added as web platform + $originValidator = new Origin($platforms); + if ($originValidator->isValid($request->getOrigin($httpReferrer))) { + return $referrer; + } + + // Safe if rule with same project ID exists + if (!empty($origin)) { + if (System::getEnv('_APP_RULES_FORMAT') === 'md5') { + $rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', md5($origin ?? ''))); + } else { + $rule = Authorization::skip( + fn () => $dbForPlatform->find('rules', [ + Query::equal('domain', [$origin]), + Query::limit(1) + ]) + )[0] ?? new Document(); + } + + if (!$rule->isEmpty() && $rule->getAttribute('projectInternalId') === $project->getSequence()) { + return $referrer; + } + } + + // Unsafe; Localhost is always safe for ease of local development + $origin = 'localhost'; + $protocol = \parse_url($request->getOrigin($httpReferrer), PHP_URL_SCHEME); + $port = \parse_url($request->getOrigin($httpReferrer), PHP_URL_PORT); + $referrer = (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $origin . (!empty($port) ? ':' . $port : ''); + return $referrer; +}, ['request', 'httpReferrer', 'platforms', 'dbForPlatform', 'project', 'utopia']); diff --git a/app/realtime.php b/app/realtime.php index 96484c8a35..bb0d4da78c 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -105,7 +105,7 @@ if (!function_exists('getProjectDB')) { if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getSequence()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database @@ -532,7 +532,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, } $timelimit = $app->getResource('timelimit'); - $console = $app->getResource('console'); /** @var Document $console */ + $platforms = $app->getResource('platforms'); $user = $app->getResource('user'); /** @var Document $user */ /* @@ -557,9 +557,9 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, * Skip this check for non-web platforms which are not required to send an origin header. */ $origin = $request->getOrigin(); - $originValidator = new Origin(array_merge($project->getAttribute('platforms', []), $console->getAttribute('platforms', []))); + $originValidator = new Origin($platforms); - if (!$originValidator->isValid($origin) && $project->getId() !== 'console') { + if (!empty($origin) && !$originValidator->isValid($origin) && $project->getId() !== 'console') { throw new Exception(Exception::REALTIME_POLICY_VIOLATION, $originValidator->getDescription()); } diff --git a/app/views/general/404.phtml b/app/views/general/404.phtml index 5e63344c8a..e89e295701 100644 --- a/app/views/general/404.phtml +++ b/app/views/general/404.phtml @@ -6,9 +6,32 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>404 Not Found + + + <?php echo $this->print($title); ?> - +
-
+
print($label); ?>

print($message); ?>

@@ -474,14 +486,14 @@ switch ($type) { - +
-
-
Error trace
@@ -512,36 +524,17 @@ switch ($type) {
-
-

Powered by

- - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index f53a6f2545..ed4de38d2b 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -95,6 +95,8 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -177,7 +179,7 @@ $image = $this->getParam('image', ''); appwrite-console: <<: *x-logging container_name: appwrite-console - image: /console:6.0.8 + image: /console:7.0.2 restart: unless-stopped networks: - appwrite @@ -472,6 +474,8 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_EMAIL_CERTIFICATES - _APP_REDIS_HOST @@ -629,6 +633,8 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DNS - _APP_EMAIL_SECURITY - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -660,6 +666,8 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_OPENSSL_KEY_V1 - _APP_REDIS_HOST @@ -841,7 +849,7 @@ $image = $this->getParam('image', ''); - _APP_DB_PASS appwrite-assistant: - image: appwrite/assistant:0.4.0 + image: appwrite/assistant:0.8.3 container_name: appwrite-assistant <<: *x-logging restart: unless-stopped @@ -864,7 +872,7 @@ $image = $this->getParam('image', ''); <<: *x-logging restart: unless-stopped stop_signal: SIGINT - image: openruntimes/executor:0.7.14 + image: openruntimes/executor:0.7.22 networks: - appwrite - runtimes diff --git a/app/worker.php b/app/worker.php index 2b6726c855..bf0a6583ec 100644 --- a/app/worker.php +++ b/app/worker.php @@ -40,7 +40,9 @@ use Utopia\Queue\Message; use Utopia\Queue\Publisher; use Utopia\Queue\Server; use Utopia\Registry\Registry; +use Utopia\Storage\Device\Telemetry as TelemetryDevice; use Utopia\System\System; +use Utopia\Telemetry\Adapter as Telemetry; use Utopia\Telemetry\Adapter\None as NoTelemetry; Authorization::disable(); @@ -90,7 +92,7 @@ Server::setResource('dbForProject', function (Cache $cache, Registry $register, if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getSequence()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database @@ -127,7 +129,7 @@ Server::setResource('getProjectDB', function (Group $pools, Database $dbForPlatf if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getSequence()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database @@ -149,7 +151,7 @@ Server::setResource('getProjectDB', function (Group $pools, Database $dbForPlatf if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getSequence()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database @@ -168,7 +170,7 @@ Server::setResource('getLogsDB', function (Group $pools, Cache $cache) { $database = null; return function (?Document $project = null) use ($pools, $cache, $database) { if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getSequence()); + $database->setTenant((int)$project->getSequence()); return $database; } @@ -183,7 +185,7 @@ Server::setResource('getLogsDB', function (Group $pools, Cache $cache) { // set tenant if ($project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getSequence()); + $database->setTenant((int)$project->getSequence()); } return $database; @@ -245,10 +247,42 @@ Server::setResource('publisher', function (Group $pools) { return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); +Server::setResource('publisherDatabases', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); + +Server::setResource('publisherFunctions', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); + +Server::setResource('publisherMigrations', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); + +Server::setResource('publisherStatsUsage', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); + +Server::setResource('publisherMessaging', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); + Server::setResource('consumer', function (Group $pools) { return new BrokerPool(consumer: $pools->get('consumer')); }, ['pools']); +Server::setResource('consumerDatabases', function (BrokerPool $consumer) { + return $consumer; +}, ['consumer']); + +Server::setResource('consumerMigrations', function (BrokerPool $consumer) { + return $consumer; +}, ['consumer']); + +Server::setResource('consumerStatsUsage', function (BrokerPool $consumer) { + return $consumer; +}, ['consumer']); + Server::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); @@ -311,29 +345,29 @@ Server::setResource('pools', function (Registry $register) { Server::setResource('telemetry', fn () => new NoTelemetry()); -Server::setResource('deviceForSites', function (Document $project) { - return getDevice(APP_STORAGE_SITES . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForSites', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_SITES . '/app-' . $project->getId())); +}, ['project', 'telemetry']); -Server::setResource('deviceForImports', function (Document $project) { - return getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForImports', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); -Server::setResource('deviceForFunctions', function (Document $project) { - return getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForFunctions', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); -Server::setResource('deviceForFiles', function (Document $project) { - return getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForFiles', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); -Server::setResource('deviceForBuilds', function (Document $project) { - return getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForBuilds', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); -Server::setResource('deviceForCache', function (Document $project) { - return getDevice(APP_STORAGE_CACHE . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForCache', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_CACHE . '/app-' . $project->getId())); +}, ['project', 'telemetry']); Server::setResource( 'isResourceBlocked', @@ -398,7 +432,7 @@ Server::setResource('logError', function (Registry $register, Document $project) }; }, ['register', 'project']); -Server::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST'))); +Server::setResource('executor', fn () => new Executor()); $pools = $register->get('pools'); $platform = new Appwrite(); diff --git a/composer.json b/composer.json index 9b61351956..1dc7288441 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,8 @@ ], "scripts": { "test": "vendor/bin/phpunit", - "lint": "vendor/bin/pint --test", - "format": "vendor/bin/pint", + "lint": "vendor/bin/pint --test --config pint.json", + "format": "vendor/bin/pint --config pint.json", "bench": "vendor/bin/phpbench run --report=benchmark", "check": "./vendor/bin/phpstan analyse -c phpstan.neon" }, @@ -46,47 +46,49 @@ "ext-sockets": "*", "appwrite/php-runtimes": "0.19.*", "appwrite/php-clamav": "2.0.*", - "utopia-php/abuse": "0.52.*", + "utopia-php/abuse": "1.*", "utopia-php/analytics": "0.10.*", - "utopia-php/audit": "0.55.*", + "utopia-php/audit": "1.*", "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", + "utopia-php/database": "1.*", "utopia-php/detector": "0.1.*", - "utopia-php/database": "0.71.*", - "utopia-php/domains": "0.8.0", + "utopia-php/domains": "0.8.*", + "utopia-php/dns": "0.3.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", "utopia-php/fetch": "0.4.*", "utopia-php/image": "0.8.*", - "utopia-php/locale": "0.4.*", + "utopia-php/locale": "0.8.*", "utopia-php/logger": "0.6.*", - "utopia-php/messaging": "0.17.*", - "utopia-php/migration": "0.10.*", + "utopia-php/messaging": "0.18.*", + "utopia-php/migration": "1.*", "utopia-php/orchestration": "0.9.*", "utopia-php/platform": "0.7.*", "utopia-php/pools": "0.8.*", "utopia-php/preloader": "0.2.*", - "utopia-php/queue": "0.10.*", + "utopia-php/queue": "0.11.*", "utopia-php/registry": "0.5.*", "utopia-php/storage": "0.18.*", "utopia-php/swoole": "0.8.*", "utopia-php/system": "0.9.*", "utopia-php/telemetry": "0.1.*", - "utopia-php/vcs": "0.10.*", + "utopia-php/vcs": "0.11.*", "utopia-php/websocket": "0.3.*", - "matomo/device-detector": "6.1.*", - "dragonmantank/cron-expression": "3.3.2", - "phpmailer/phpmailer": "6.9.1", - "chillerlan/php-qrcode": "4.3.4", - "adhocore/jwt": "1.1.2", - "spomky-labs/otphp": "^10.0", + "matomo/device-detector": "6.4.*", + "dragonmantank/cron-expression": "3.4.*", + "phpmailer/phpmailer": "6.9.*", + "chillerlan/php-qrcode": "4.4.*", + "adhocore/jwt": "1.1.*", + "spomky-labs/otphp": "10.0.*", "webonyx/graphql-php": "14.11.*", - "league/csv": "9.14.*" + "league/csv": "9.24.*", + "enshrined/svg-sanitize": "0.22.*" }, "require-dev": { "ext-fileinfo": "*", - "appwrite/sdk-generator": "0.40.*", + "appwrite/sdk-generator": "*", "phpunit/phpunit": "9.*", "swoole/ide-helper": "5.1.2", "phpstan/phpstan": "1.8.*", diff --git a/composer.lock b/composer.lock index dc8661f3bb..b9475de5b9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,27 +4,27 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5027a541e6377eb2c87357b69f11daea", + "content-hash": "7553e976312b0423cc31544abb91caec", "packages": [ { "name": "adhocore/jwt", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/adhocore/php-jwt.git", - "reference": "6c434af7170090bb7a8880d2bc220a2254ba7899" + "reference": "ad417603d9d45578b6af2089ad5b78f101c82367" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/adhocore/php-jwt/zipball/6c434af7170090bb7a8880d2bc220a2254ba7899", - "reference": "6c434af7170090bb7a8880d2bc220a2254ba7899", + "url": "https://api.github.com/repos/adhocore/php-jwt/zipball/ad417603d9d45578b6af2089ad5b78f101c82367", + "reference": "ad417603d9d45578b6af2089ad5b78f101c82367", "shasum": "" }, "require": { "php": "^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.5" + "phpunit/phpunit": "^7.5 || ^8.5" }, "type": "library", "autoload": { @@ -53,28 +53,32 @@ ], "support": { "issues": "https://github.com/adhocore/php-jwt/issues", - "source": "https://github.com/adhocore/php-jwt/tree/1.1.2" + "source": "https://github.com/adhocore/php-jwt/tree/1.1.3" }, "funding": [ { "url": "https://paypal.me/ji10", "type": "custom" + }, + { + "url": "https://github.com/adhocore", + "type": "github" } ], - "time": "2021-02-20T09:56:44+00:00" + "time": "2025-02-18T01:00:50+00:00" }, { "name": "appwrite/appwrite", - "version": "11.1.0", + "version": "15.1.0", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-for-php.git", - "reference": "1d043f543acdb17b9fdb440b1b2dd208e400bad3" + "reference": "c438b3885071ac7c0329199dce5e6f6a24dd215b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/1d043f543acdb17b9fdb440b1b2dd208e400bad3", - "reference": "1d043f543acdb17b9fdb440b1b2dd208e400bad3", + "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/c438b3885071ac7c0329199dce5e6f6a24dd215b", + "reference": "c438b3885071ac7c0329199dce5e6f6a24dd215b", "shasum": "" }, "require": { @@ -100,10 +104,10 @@ "support": { "email": "team@appwrite.io", "issues": "https://github.com/appwrite/sdk-for-php/issues", - "source": "https://github.com/appwrite/sdk-for-php/tree/11.1.0", + "source": "https://github.com/appwrite/sdk-for-php/tree/15.1.0", "url": "https://appwrite.io/support" }, - "time": "2024-06-26T07:03:23+00:00" + "time": "2025-08-01T04:50:51+00:00" }, { "name": "appwrite/php-clamav", @@ -157,16 +161,16 @@ }, { "name": "appwrite/php-runtimes", - "version": "0.19.0", + "version": "0.19.1", "source": { "type": "git", "url": "https://github.com/appwrite/runtimes.git", - "reference": "8d21483efc19b9d977e323188989ee67a188464b" + "reference": "7bd0cc3cb97de625d7b07230bd91b121f88e72ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/runtimes/zipball/8d21483efc19b9d977e323188989ee67a188464b", - "reference": "8d21483efc19b9d977e323188989ee67a188464b", + "url": "https://api.github.com/repos/appwrite/runtimes/zipball/7bd0cc3cb97de625d7b07230bd91b121f88e72ae", + "reference": "7bd0cc3cb97de625d7b07230bd91b121f88e72ae", "shasum": "" }, "require": { @@ -206,9 +210,9 @@ ], "support": { "issues": "https://github.com/appwrite/runtimes/issues", - "source": "https://github.com/appwrite/runtimes/tree/0.19.0" + "source": "https://github.com/appwrite/runtimes/tree/0.19.1" }, - "time": "2025-03-25T22:37:51+00:00" + "time": "2025-05-27T07:12:56+00:00" }, { "name": "beberlei/assert", @@ -279,25 +283,25 @@ }, { "name": "brick/math", - "version": "0.12.3", + "version": "0.14.0", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba" + "reference": "113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/866551da34e9a618e64a819ee1e01c20d8a588ba", - "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba", + "url": "https://api.github.com/repos/brick/math/zipball/113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2", + "reference": "113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2", "shasum": "" }, "require": { - "php": "^8.1" + "php": "^8.2" }, "require-dev": { "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^10.1", - "vimeo/psalm": "6.8.8" + "phpstan/phpstan": "2.1.22", + "phpunit/phpunit": "^11.5" }, "type": "library", "autoload": { @@ -327,7 +331,7 @@ ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.12.3" + "source": "https://github.com/brick/math/tree/0.14.0" }, "funding": [ { @@ -335,35 +339,38 @@ "type": "github" } ], - "time": "2025-02-28T13:11:00+00:00" + "time": "2025-08-29T12:40:03+00:00" }, { "name": "chillerlan/php-qrcode", - "version": "4.3.4", + "version": "4.4.2", "source": { "type": "git", "url": "https://github.com/chillerlan/php-qrcode.git", - "reference": "2ca4bf5ae048af1981d1023ee42a0a2a9d51e51d" + "reference": "345ed8e4ffb56e6b3fcd9f42e3970b9026fa6ce4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/2ca4bf5ae048af1981d1023ee42a0a2a9d51e51d", - "reference": "2ca4bf5ae048af1981d1023ee42a0a2a9d51e51d", + "url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/345ed8e4ffb56e6b3fcd9f42e3970b9026fa6ce4", + "reference": "345ed8e4ffb56e6b3fcd9f42e3970b9026fa6ce4", "shasum": "" }, "require": { - "chillerlan/php-settings-container": "^2.1.4", + "chillerlan/php-settings-container": "^2.1.6 || ^3.2.1", "ext-mbstring": "*", "php": "^7.4 || ^8.0" }, "require-dev": { - "phan/phan": "^5.3", - "phpunit/phpunit": "^9.5", - "setasign/fpdf": "^1.8.2" + "phan/phan": "^5.4.5", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^9.6", + "setasign/fpdf": "^1.8.2", + "squizlabs/php_codesniffer": "^3.11" }, "suggest": { "chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.", - "setasign/fpdf": "Required to use the QR FPDF output." + "setasign/fpdf": "Required to use the QR FPDF output.", + "simple-icons/simple-icons": "SVG icons that you can use to embed as logos in the QR Code" }, "type": "library", "autoload": { @@ -390,7 +397,7 @@ "homepage": "https://github.com/chillerlan/php-qrcode/graphs/contributors" } ], - "description": "A QR code generator. PHP 7.4+", + "description": "A QR code generator with a user friendly API. PHP 7.4+", "homepage": "https://github.com/chillerlan/php-qrcode", "keywords": [ "phpqrcode", @@ -401,43 +408,39 @@ ], "support": { "issues": "https://github.com/chillerlan/php-qrcode/issues", - "source": "https://github.com/chillerlan/php-qrcode/tree/4.3.4" + "source": "https://github.com/chillerlan/php-qrcode/tree/4.4.2" }, "funding": [ - { - "url": "https://www.paypal.com/donate?hosted_button_id=WLYUNAT9ZTJZ4", - "type": "custom" - }, { "url": "https://ko-fi.com/codemasher", "type": "ko_fi" } ], - "time": "2022-07-25T09:12:45+00:00" + "time": "2024-11-15T15:36:24+00:00" }, { "name": "chillerlan/php-settings-container", - "version": "2.1.6", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/chillerlan/php-settings-container.git", - "reference": "5553558bd381fce5108c6d0343c12e488cfec6bb" + "reference": "95ed3e9676a1d47cab2e3174d19b43f5dbf52681" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/5553558bd381fce5108c6d0343c12e488cfec6bb", - "reference": "5553558bd381fce5108c6d0343c12e488cfec6bb", + "url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/95ed3e9676a1d47cab2e3174d19b43f5dbf52681", + "reference": "95ed3e9676a1d47cab2e3174d19b43f5dbf52681", "shasum": "" }, "require": { "ext-json": "*", - "php": "^7.4 || ^8.0" + "php": "^8.1" }, "require-dev": { "phpmd/phpmd": "^2.15", "phpstan/phpstan": "^1.11", "phpstan/phpstan-deprecation-rules": "^1.2", - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^10.5", "squizlabs/php_codesniffer": "^3.10" }, "type": "library", @@ -457,10 +460,9 @@ "homepage": "https://github.com/codemasher" } ], - "description": "A container class for immutable settings objects. Not a DI container. PHP 7.4+", + "description": "A container class for immutable settings objects. Not a DI container.", "homepage": "https://github.com/chillerlan/php-settings-container", "keywords": [ - "PHP7", "Settings", "configuration", "container", @@ -480,20 +482,20 @@ "type": "ko_fi" } ], - "time": "2024-07-17T01:04:28+00:00" + "time": "2024-07-16T11:13:48+00:00" }, { "name": "composer/semver", - "version": "3.4.3", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", "shasum": "" }, "require": { @@ -545,7 +547,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.3" + "source": "https://github.com/composer/semver/tree/3.4.4" }, "funding": [ { @@ -555,26 +557,22 @@ { "url": "https://github.com/composer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2024-09-19T14:15:21+00:00" + "time": "2025-08-20T19:15:30+00:00" }, { "name": "dragonmantank/cron-expression", - "version": "v3.3.2", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8" + "reference": "8c784d071debd117328803d86b2097615b457500" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/8c784d071debd117328803d86b2097615b457500", + "reference": "8c784d071debd117328803d86b2097615b457500", "shasum": "" }, "require": { @@ -587,10 +585,14 @@ "require-dev": { "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.0", - "phpstan/phpstan-webmozart-assert": "^1.0", "phpunit/phpunit": "^7.0|^8.0|^9.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, "autoload": { "psr-4": { "Cron\\": "src/Cron/" @@ -614,7 +616,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.4.0" }, "funding": [ { @@ -622,7 +624,52 @@ "type": "github" } ], - "time": "2022-09-10T18:51:20+00:00" + "time": "2024-10-09T13:47:03+00:00" + }, + { + "name": "enshrined/svg-sanitize", + "version": "0.22.0", + "source": { + "type": "git", + "url": "https://github.com/darylldoyle/svg-sanitizer.git", + "reference": "0afa95ea74be155a7bcd6c6fb60c276c39984500" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/0afa95ea74be155a7bcd6c6fb60c276c39984500", + "reference": "0afa95ea74be155a7bcd6c6fb60c276c39984500", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5 || ^8.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "enshrined\\svgSanitize\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Daryll Doyle", + "email": "daryll@enshrined.co.uk" + } + ], + "description": "An SVG sanitizer for PHP", + "support": { + "issues": "https://github.com/darylldoyle/svg-sanitizer/issues", + "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.22.0" + }, + "time": "2025-08-12T10:13:48+00:00" }, { "name": "giggsey/libphonenumber-for-php-lite", @@ -709,23 +756,23 @@ }, { "name": "google/protobuf", - "version": "v4.31.0", + "version": "v4.32.1", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "d59e31ce4bf0e4b48728e90c4d880839edb5be07" + "reference": "c4ed1c1f9bbc1e91766e2cd6c0af749324fe87cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/d59e31ce4bf0e4b48728e90c4d880839edb5be07", - "reference": "d59e31ce4bf0e4b48728e90c4d880839edb5be07", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/c4ed1c1f9bbc1e91766e2cd6c0af749324fe87cb", + "reference": "c4ed1c1f9bbc1e91766e2cd6c0af749324fe87cb", "shasum": "" }, "require": { - "php": ">=7.0.0" + "php": ">=8.1.0" }, "require-dev": { - "phpunit/phpunit": ">=5.0.0" + "phpunit/phpunit": ">=5.0.0 <8.5.27" }, "suggest": { "ext-bcmath": "Need to support JSON deserialization" @@ -747,46 +794,48 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.31.0" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.32.1" }, - "time": "2025-05-14T16:17:23+00:00" + "time": "2025-09-14T05:14:52+00:00" }, { "name": "league/csv", - "version": "9.14.0", + "version": "9.24.1", "source": { "type": "git", "url": "https://github.com/thephpleague/csv.git", - "reference": "34bf0df7340b60824b9449b5c526fcc3325070d5" + "reference": "e0221a3f16aa2a823047d59fab5809d552e29bc8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/csv/zipball/34bf0df7340b60824b9449b5c526fcc3325070d5", - "reference": "34bf0df7340b60824b9449b5c526fcc3325070d5", + "url": "https://api.github.com/repos/thephpleague/csv/zipball/e0221a3f16aa2a823047d59fab5809d552e29bc8", + "reference": "e0221a3f16aa2a823047d59fab5809d552e29bc8", "shasum": "" }, "require": { "ext-filter": "*", - "ext-json": "*", - "ext-mbstring": "*", "php": "^8.1.2" }, "require-dev": { - "doctrine/collections": "^2.1.4", "ext-dom": "*", "ext-xdebug": "*", - "friendsofphp/php-cs-fixer": "^v3.22.0", - "phpbench/phpbench": "^1.2.15", - "phpstan/phpstan": "^1.10.50", - "phpstan/phpstan-deprecation-rules": "^1.1.4", - "phpstan/phpstan-phpunit": "^1.3.15", - "phpstan/phpstan-strict-rules": "^1.5.2", - "phpunit/phpunit": "^10.5.3", - "symfony/var-dumper": "^6.4.0" + "friendsofphp/php-cs-fixer": "^3.75.0", + "phpbench/phpbench": "^1.4.1", + "phpstan/phpstan": "^1.12.27", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.2", + "phpstan/phpstan-strict-rules": "^1.6.2", + "phpunit/phpunit": "^10.5.16 || ^11.5.22", + "symfony/var-dumper": "^6.4.8 || ^7.3.0" }, "suggest": { "ext-dom": "Required to use the XMLConverter and the HTMLConverter classes", - "ext-iconv": "Needed to ease transcoding CSV using iconv stream filters" + "ext-iconv": "Needed to ease transcoding CSV using iconv stream filters", + "ext-mbstring": "Needed to ease transcoding CSV using mb stream filters", + "ext-mysqli": "Requiered to use the package with the MySQLi extension", + "ext-pdo": "Required to use the package with the PDO extension", + "ext-pgsql": "Requiered to use the package with the PgSQL extension", + "ext-sqlite3": "Required to use the package with the SQLite3 extension" }, "type": "library", "extra": { @@ -838,20 +887,20 @@ "type": "github" } ], - "time": "2023-12-29T07:34:53+00:00" + "time": "2025-06-25T14:53:51+00:00" }, { "name": "matomo/device-detector", - "version": "6.1.6", + "version": "6.4.7", "source": { "type": "git", "url": "https://github.com/matomo-org/device-detector.git", - "reference": "5cbea85106e561c7138d03603eb6e05128480409" + "reference": "e53eed31bb1530851feebe52bd64c3451da19e77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/5cbea85106e561c7138d03603eb6e05128480409", - "reference": "5cbea85106e561c7138d03603eb6e05128480409", + "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/e53eed31bb1530851feebe52bd64c3451da19e77", + "reference": "e53eed31bb1530851feebe52bd64c3451da19e77", "shasum": "" }, "require": { @@ -863,11 +912,12 @@ }, "require-dev": { "matthiasmullie/scrapbook": "^1.4.7", - "mayflower/mo4-coding-standard": "^v8.0.0", - "phpstan/phpstan": "^0.12.52", + "mayflower/mo4-coding-standard": "^v9.0.0", + "phpstan/phpstan": "^1.10.44", "phpunit/phpunit": "^8.5.8", "psr/cache": "^1.0.1", "psr/simple-cache": "^1.0.1", + "slevomat/coding-standard": "<8.16.0", "symfony/yaml": "^5.1.7" }, "suggest": { @@ -907,7 +957,7 @@ "source": "https://github.com/matomo-org/matomo", "wiki": "https://dev.matomo.org/" }, - "time": "2023-10-02T10:01:54+00:00" + "time": "2025-08-20T17:20:16+00:00" }, { "name": "mustangostang/spyc", @@ -1109,20 +1159,20 @@ }, { "name": "open-telemetry/api", - "version": "1.3.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/api.git", - "reference": "4e3bb38e069876fb73c2ce85c89583bf2b28cd86" + "reference": "ee17d937652eca06c2341b6fadc0f74c1c1a5af2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/4e3bb38e069876fb73c2ce85c89583bf2b28cd86", - "reference": "4e3bb38e069876fb73c2ce85c89583bf2b28cd86", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/ee17d937652eca06c2341b6fadc0f74c1c1a5af2", + "reference": "ee17d937652eca06c2341b6fadc0f74c1c1a5af2", "shasum": "" }, "require": { - "open-telemetry/context": "^1.0", + "open-telemetry/context": "^1.4", "php": "^8.1", "psr/log": "^1.1|^2.0|^3.0", "symfony/polyfill-php82": "^1.26" @@ -1138,7 +1188,7 @@ ] }, "branch-alias": { - "dev-main": "1.1.x-dev" + "dev-main": "1.4.x-dev" } }, "autoload": { @@ -1175,20 +1225,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-05-07T12:32:21+00:00" + "time": "2025-09-19T00:05:49+00:00" }, { "name": "open-telemetry/context", - "version": "1.2.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/context.git", - "reference": "1eb2b837ee9362db064a6b65d5ecce15a9f9f020" + "reference": "d4c4470b541ce72000d18c339cfee633e4c8e0cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/1eb2b837ee9362db064a6b65d5ecce15a9f9f020", - "reference": "1eb2b837ee9362db064a6b65d5ecce15a9f9f020", + "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/d4c4470b541ce72000d18c339cfee633e4c8e0cf", + "reference": "d4c4470b541ce72000d18c339cfee633e4c8e0cf", "shasum": "" }, "require": { @@ -1234,20 +1284,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-05-07T23:36:50+00:00" + "time": "2025-09-19T00:05:49+00:00" }, { "name": "open-telemetry/exporter-otlp", - "version": "1.3.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/exporter-otlp.git", - "reference": "8b3ca1f86d01429c73b407bf1a2075d9c187001e" + "reference": "196f3a1dbce3b2c0f8110d164232c11ac00ddbb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/8b3ca1f86d01429c73b407bf1a2075d9c187001e", - "reference": "8b3ca1f86d01429c73b407bf1a2075d9c187001e", + "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/196f3a1dbce3b2c0f8110d164232c11ac00ddbb2", + "reference": "196f3a1dbce3b2c0f8110d164232c11ac00ddbb2", "shasum": "" }, "require": { @@ -1298,20 +1348,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-05-21T12:02:20+00:00" + "time": "2025-06-16T00:24:51+00:00" }, { "name": "open-telemetry/gen-otlp-protobuf", - "version": "1.5.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/gen-otlp-protobuf.git", - "reference": "585bafddd4ae6565de154610b10a787a455c9ba0" + "reference": "673af5b06545b513466081884b47ef15a536edde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/585bafddd4ae6565de154610b10a787a455c9ba0", - "reference": "585bafddd4ae6565de154610b10a787a455c9ba0", + "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/673af5b06545b513466081884b47ef15a536edde", + "reference": "673af5b06545b513466081884b47ef15a536edde", "shasum": "" }, "require": { @@ -1361,27 +1411,27 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-01-15T23:07:07+00:00" + "time": "2025-09-17T23:10:12+00:00" }, { "name": "open-telemetry/sdk", - "version": "1.5.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sdk.git", - "reference": "cd0d7367599717fc29e04eb8838ec061e6c2c657" + "reference": "105c6e81e3d86150bd5704b00c7e4e165e957b89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/cd0d7367599717fc29e04eb8838ec061e6c2c657", - "reference": "cd0d7367599717fc29e04eb8838ec061e6c2c657", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/105c6e81e3d86150bd5704b00c7e4e165e957b89", + "reference": "105c6e81e3d86150bd5704b00c7e4e165e957b89", "shasum": "" }, "require": { "ext-json": "*", "nyholm/psr7-server": "^1.1", - "open-telemetry/api": "~1.0 || ~1.1", - "open-telemetry/context": "^1.0", + "open-telemetry/api": "^1.6", + "open-telemetry/context": "^1.4", "open-telemetry/sem-conv": "^1.0", "php": "^8.1", "php-http/discovery": "^1.14", @@ -1393,7 +1443,7 @@ "ramsey/uuid": "^3.0 || ^4.0", "symfony/polyfill-mbstring": "^1.23", "symfony/polyfill-php82": "^1.26", - "tbachert/spi": "^1.0.1" + "tbachert/spi": "^1.0.5" }, "suggest": { "ext-gmp": "To support unlimited number of synchronous metric readers", @@ -1403,6 +1453,13 @@ "type": "library", "extra": { "spi": { + "OpenTelemetry\\API\\Configuration\\ConfigEnv\\EnvComponentLoader": [ + "OpenTelemetry\\API\\Instrumentation\\Configuration\\General\\ConfigEnv\\EnvComponentLoaderHttpConfig", + "OpenTelemetry\\API\\Instrumentation\\Configuration\\General\\ConfigEnv\\EnvComponentLoaderPeerConfig" + ], + "OpenTelemetry\\SDK\\Common\\Configuration\\Resolver\\ResolverInterface": [ + "OpenTelemetry\\SDK\\Common\\Configuration\\Resolver\\SdkConfigurationResolver" + ], "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" ] @@ -1451,20 +1508,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-05-22T02:33:34+00:00" + "time": "2025-09-19T00:05:49+00:00" }, { "name": "open-telemetry/sem-conv", - "version": "1.32.0", + "version": "1.37.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sem-conv.git", - "reference": "16585cc0dbc3032a318e274043454679430d2ebf" + "reference": "8da7ec497c881e39afa6657d72586e27efbd29a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/16585cc0dbc3032a318e274043454679430d2ebf", - "reference": "16585cc0dbc3032a318e274043454679430d2ebf", + "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/8da7ec497c881e39afa6657d72586e27efbd29a1", + "reference": "8da7ec497c881e39afa6657d72586e27efbd29a1", "shasum": "" }, "require": { @@ -1508,20 +1565,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-05-05T03:58:53+00:00" + "time": "2025-09-03T12:08:10+00:00" }, { "name": "paragonie/constant_time_encoding", - "version": "v2.7.0", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "52a0d99e69f56b9ec27ace92ba56897fe6993105" + "reference": "ce27936c8dfb73e3ab9c94469130428af9752c96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/52a0d99e69f56b9ec27ace92ba56897fe6993105", - "reference": "52a0d99e69f56b9ec27ace92ba56897fe6993105", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/ce27936c8dfb73e3ab9c94469130428af9752c96", + "reference": "ce27936c8dfb73e3ab9c94469130428af9752c96", "shasum": "" }, "require": { @@ -1575,7 +1632,7 @@ "issues": "https://github.com/paragonie/constant_time_encoding/issues", "source": "https://github.com/paragonie/constant_time_encoding" }, - "time": "2024-05-08T12:18:48+00:00" + "time": "2025-09-22T20:41:46+00:00" }, { "name": "paragonie/random_compat", @@ -1870,16 +1927,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.43", + "version": "3.0.46", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "709ec107af3cb2f385b9617be72af8cf62441d02" + "reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/709ec107af3cb2f385b9617be72af8cf62441d02", - "reference": "709ec107af3cb2f385b9617be72af8cf62441d02", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6", + "reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6", "shasum": "" }, "require": { @@ -1960,7 +2017,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.43" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.46" }, "funding": [ { @@ -1976,7 +2033,7 @@ "type": "tidelift" } ], - "time": "2024-12-14T21:12:59+00:00" + "time": "2025-06-26T16:29:55+00:00" }, { "name": "psr/container", @@ -2319,21 +2376,20 @@ }, { "name": "ramsey/uuid", - "version": "4.7.6", + "version": "4.9.1", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "91039bc1faa45ba123c4328958e620d382ec7088" + "reference": "81f941f6f729b1e3ceea61d9d014f8b6c6800440" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", - "reference": "91039bc1faa45ba123c4328958e620d382ec7088", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/81f941f6f729b1e3ceea61d9d014f8b6c6800440", + "reference": "81f941f6f729b1e3ceea61d9d014f8b6c6800440", "shasum": "" }, "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", - "ext-json": "*", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14", "php": "^8.0", "ramsey/collection": "^1.2 || ^2.0" }, @@ -2341,26 +2397,23 @@ "rhumsaa/uuid": "self.version" }, "require-dev": { - "captainhook/captainhook": "^5.10", + "captainhook/captainhook": "^5.25", "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "ramsey/composer-repl": "^1.4", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", @@ -2395,19 +2448,9 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.7.6" + "source": "https://github.com/ramsey/uuid/tree/4.9.1" }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", - "type": "tidelift" - } - ], - "time": "2024-04-27T21:32:50+00:00" + "time": "2025-09-04T20:59:21+00:00" }, { "name": "spomky-labs/otphp", @@ -2486,16 +2529,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.1", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", - "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", "shasum": "" }, "require": { @@ -2508,7 +2551,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.5-dev" + "dev-main": "3.6-dev" } }, "autoload": { @@ -2533,7 +2576,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" }, "funding": [ { @@ -2549,20 +2592,20 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/http-client", - "version": "v7.2.4", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "78981a2ffef6437ed92d4d7e2a86a82f256c6dc6" + "reference": "333b9bd7639cbdaecd25a3a48a9d2dcfaa86e019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/78981a2ffef6437ed92d4d7e2a86a82f256c6dc6", - "reference": "78981a2ffef6437ed92d4d7e2a86a82f256c6dc6", + "url": "https://api.github.com/repos/symfony/http-client/zipball/333b9bd7639cbdaecd25a3a48a9d2dcfaa86e019", + "reference": "333b9bd7639cbdaecd25a3a48a9d2dcfaa86e019", "shasum": "" }, "require": { @@ -2570,10 +2613,12 @@ "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", "symfony/http-client-contracts": "~3.4.4|^3.5.2", + "symfony/polyfill-php83": "^1.29", "symfony/service-contracts": "^2.5|^3" }, "conflict": { "amphp/amp": "<2.5", + "amphp/socket": "<1.1", "php-http/discovery": "<1.15", "symfony/http-foundation": "<6.4" }, @@ -2586,7 +2631,6 @@ "require-dev": { "amphp/http-client": "^4.2.1|^5.0", "amphp/http-tunnel": "^1.0|^2.0", - "amphp/socket": "^1.1", "guzzlehttp/promises": "^1.4|^2.0", "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", @@ -2628,7 +2672,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.2.4" + "source": "https://github.com/symfony/http-client/tree/v7.3.3" }, "funding": [ { @@ -2639,25 +2683,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-02-13T10:27:23+00:00" + "time": "2025-08-27T07:45:05+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.5.2", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645" + "reference": "75d7043853a42837e68111812f4d964b01e5101c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/ee8d807ab20fcb51267fdace50fbe3494c31e645", - "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/75d7043853a42837e68111812f4d964b01e5101c", + "reference": "75d7043853a42837e68111812f4d964b01e5101c", "shasum": "" }, "require": { @@ -2670,7 +2718,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.5-dev" + "dev-main": "3.6-dev" } }, "autoload": { @@ -2706,7 +2754,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.2" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.6.0" }, "funding": [ { @@ -2722,11 +2770,11 @@ "type": "tidelift" } ], - "time": "2024-12-07T08:49:48+00:00" + "time": "2025-04-29T11:18:49+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -2787,7 +2835,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" }, "funding": [ { @@ -2798,6 +2846,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -2807,7 +2859,7 @@ }, { "name": "symfony/polyfill-php82", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php82.git", @@ -2863,7 +2915,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php82/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php82/tree/v1.33.0" }, "funding": [ { @@ -2874,6 +2926,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -2882,17 +2938,97 @@ "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/service-contracts", - "version": "v3.5.1", + "name": "symfony/polyfill-php83", + "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", - "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-07-08T02:45:35+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", "shasum": "" }, "require": { @@ -2910,7 +3046,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.5-dev" + "dev-main": "3.6-dev" } }, "autoload": { @@ -2946,7 +3082,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" }, "funding": [ { @@ -2962,20 +3098,20 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2025-04-25T09:37:31+00:00" }, { "name": "tbachert/spi", - "version": "v1.0.3", + "version": "v1.0.5", "source": { "type": "git", "url": "https://github.com/Nevay/spi.git", - "reference": "506a79c98e1a51522e76ee921ccb6c62d52faf3a" + "reference": "e7078767866d0a9e0f91d3f9d42a832df5e39002" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nevay/spi/zipball/506a79c98e1a51522e76ee921ccb6c62d52faf3a", - "reference": "506a79c98e1a51522e76ee921ccb6c62d52faf3a", + "url": "https://api.github.com/repos/Nevay/spi/zipball/e7078767866d0a9e0f91d3f9d42a832df5e39002", + "reference": "e7078767866d0a9e0f91d3f9d42a832df5e39002", "shasum": "" }, "require": { @@ -2993,7 +3129,7 @@ "extra": { "class": "Nevay\\SPI\\Composer\\Plugin", "branch-alias": { - "dev-main": "0.2.x-dev" + "dev-main": "1.0.x-dev" }, "plugin-optional": true }, @@ -3012,9 +3148,9 @@ ], "support": { "issues": "https://github.com/Nevay/spi/issues", - "source": "https://github.com/Nevay/spi/tree/v1.0.3" + "source": "https://github.com/Nevay/spi/tree/v1.0.5" }, - "time": "2025-04-02T19:38:14+00:00" + "time": "2025-06-29T15:42:06+00:00" }, { "name": "thecodingmachine/safe", @@ -3157,16 +3293,16 @@ }, { "name": "utopia-php/abuse", - "version": "0.52.0", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "a0d6421e7e5baa3ac02755496dca9fdeaa814b93" + "reference": "c5e2232033b507a07f72180dc56d37e1872ee7be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/a0d6421e7e5baa3ac02755496dca9fdeaa814b93", - "reference": "a0d6421e7e5baa3ac02755496dca9fdeaa814b93", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/c5e2232033b507a07f72180dc56d37e1872ee7be", + "reference": "c5e2232033b507a07f72180dc56d37e1872ee7be", "shasum": "" }, "require": { @@ -3174,7 +3310,7 @@ "ext-pdo": "*", "ext-redis": "*", "php": ">=8.0", - "utopia-php/database": "0.*.*" + "utopia-php/database": "1.*" }, "require-dev": { "laravel/pint": "1.*", @@ -3202,9 +3338,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.52.0" + "source": "https://github.com/utopia-php/abuse/tree/1.0.0" }, - "time": "2025-03-06T03:48:29+00:00" + "time": "2025-08-13T09:12:54+00:00" }, { "name": "utopia-php/analytics", @@ -3254,21 +3390,21 @@ }, { "name": "utopia-php/audit", - "version": "0.55.0", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "9f8cfe5fa5d5011b8dbf93b710236dfa91dc5518" + "reference": "c0ed75f4d068f1f6c2e7149a909490d4214e72bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/9f8cfe5fa5d5011b8dbf93b710236dfa91dc5518", - "reference": "9f8cfe5fa5d5011b8dbf93b710236dfa91dc5518", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/c0ed75f4d068f1f6c2e7149a909490d4214e72bb", + "reference": "c0ed75f4d068f1f6c2e7149a909490d4214e72bb", "shasum": "" }, "require": { "php": ">=8.0", - "utopia-php/database": "0.*.*" + "utopia-php/database": "1.*" }, "require-dev": { "laravel/pint": "1.*", @@ -3295,9 +3431,9 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/0.55.0" + "source": "https://github.com/utopia-php/audit/tree/1.0.0" }, - "time": "2025-03-06T03:47:47+00:00" + "time": "2025-08-13T09:09:00+00:00" }, { "name": "utopia-php/cache", @@ -3499,16 +3635,16 @@ }, { "name": "utopia-php/database", - "version": "0.71.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "cf463c0a5c64a4168fe56266ace4ae835d61c920" + "reference": "24c4519b4ac32aee13af31dddd984db2a3b34980" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/cf463c0a5c64a4168fe56266ace4ae835d61c920", - "reference": "cf463c0a5c64a4168fe56266ace4ae835d61c920", + "url": "https://api.github.com/repos/utopia-php/database/zipball/24c4519b4ac32aee13af31dddd984db2a3b34980", + "reference": "24c4519b4ac32aee13af31dddd984db2a3b34980", "shasum": "" }, "require": { @@ -3549,9 +3685,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.71.0" + "source": "https://github.com/utopia-php/database/tree/1.5.0" }, - "time": "2025-05-23T07:32:59+00:00" + "time": "2025-09-18T14:42:01+00:00" }, { "name": "utopia-php/detector", @@ -3598,6 +3734,62 @@ }, "time": "2025-05-19T11:01:28+00:00" }, + { + "name": "utopia-php/dns", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/dns.git", + "reference": "8fd4161bc3a8021a670c1101b40f6b09a97f1a54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/dns/zipball/8fd4161bc3a8021a670c1101b40f6b09a97f1a54", + "reference": "8fd4161bc3a8021a670c1101b40f6b09a97f1a54", + "shasum": "" + }, + "require": { + "php": ">=8.0", + "utopia-php/cli": "0.15.*", + "utopia-php/telemetry": "^0.1.1" + }, + "require-dev": { + "laravel/pint": "1.2.*", + "phpstan/phpstan": "1.8.*", + "phpunit/phpunit": "^9.3", + "rregeer/phpunit-coverage-check": "^0.3.1", + "swoole/ide-helper": "4.6.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\DNS\\": "src/DNS" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eldad Fux", + "email": "eldad@appwrite.io" + } + ], + "description": "Lite & fast micro PHP DNS server abstraction that is **easy to use**.", + "keywords": [ + "dns", + "framework", + "php", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/dns/issues", + "source": "https://github.com/utopia-php/dns/tree/0.3.0" + }, + "time": "2025-08-04T11:05:53+00:00" + }, { "name": "utopia-php/domains", "version": "0.8.0", @@ -3747,16 +3939,16 @@ }, { "name": "utopia-php/framework", - "version": "0.33.20", + "version": "0.33.27", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "e1c7ab4e0b5b0a9a70256b1e00912e101e76a131" + "reference": "d9d10a895e85c8c7675220347cc6109db9d3bd37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/e1c7ab4e0b5b0a9a70256b1e00912e101e76a131", - "reference": "e1c7ab4e0b5b0a9a70256b1e00912e101e76a131", + "url": "https://api.github.com/repos/utopia-php/http/zipball/d9d10a895e85c8c7675220347cc6109db9d3bd37", + "reference": "d9d10a895e85c8c7675220347cc6109db9d3bd37", "shasum": "" }, "require": { @@ -3788,22 +3980,22 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.20" + "source": "https://github.com/utopia-php/http/tree/0.33.27" }, - "time": "2025-05-18T23:51:21+00:00" + "time": "2025-09-07T18:40:53+00:00" }, { "name": "utopia-php/image", - "version": "0.8.3", + "version": "0.8.4", "source": { "type": "git", "url": "https://github.com/utopia-php/image.git", - "reference": "8820b0e53b3636b7bdf815e92394d333fef06f26" + "reference": "ce788ff0121a79286fdbe3ef3eba566de646df65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/image/zipball/8820b0e53b3636b7bdf815e92394d333fef06f26", - "reference": "8820b0e53b3636b7bdf815e92394d333fef06f26", + "url": "https://api.github.com/repos/utopia-php/image/zipball/ce788ff0121a79286fdbe3ef3eba566de646df65", + "reference": "ce788ff0121a79286fdbe3ef3eba566de646df65", "shasum": "" }, "require": { @@ -3837,28 +4029,30 @@ ], "support": { "issues": "https://github.com/utopia-php/image/issues", - "source": "https://github.com/utopia-php/image/tree/0.8.3" + "source": "https://github.com/utopia-php/image/tree/0.8.4" }, - "time": "2025-05-15T10:39:28+00:00" + "time": "2025-06-03T08:32:20+00:00" }, { "name": "utopia-php/locale", - "version": "0.4.0", + "version": "0.8.0", "source": { "type": "git", "url": "https://github.com/utopia-php/locale.git", - "reference": "c2d9358d0fe2f6b6ed5448369f9d1e430c615447" + "reference": "10ffc869c904c45e32ab0c61f4b33ba774777eb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/locale/zipball/c2d9358d0fe2f6b6ed5448369f9d1e430c615447", - "reference": "c2d9358d0fe2f6b6ed5448369f9d1e430c615447", + "url": "https://api.github.com/repos/utopia-php/locale/zipball/10ffc869c904c45e32ab0c61f4b33ba774777eb6", + "reference": "10ffc869c904c45e32ab0c61f4b33ba774777eb6", "shasum": "" }, "require": { "php": ">=7.4" }, "require-dev": { + "laravel/pint": "1.2.*", + "phpstan/phpstan": "1.*", "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.0.1" }, @@ -3872,12 +4066,6 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Eldad Fux", - "email": "eldad@appwrite.io" - } - ], "description": "A simple locale library to manage application translations", "keywords": [ "framework", @@ -3888,9 +4076,9 @@ ], "support": { "issues": "https://github.com/utopia-php/locale/issues", - "source": "https://github.com/utopia-php/locale/tree/0.4.0" + "source": "https://github.com/utopia-php/locale/tree/0.8.0" }, - "time": "2021-07-24T11:35:55+00:00" + "time": "2025-08-12T12:58:26+00:00" }, { "name": "utopia-php/logger", @@ -3948,16 +4136,16 @@ }, { "name": "utopia-php/messaging", - "version": "0.17.0", + "version": "0.18.2", "source": { "type": "git", "url": "https://github.com/utopia-php/messaging.git", - "reference": "c51915d0e030db3a3add37f1561751d18b2d9a85" + "reference": "0d364edacf4d4867964c7e17f653031dd39394bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/messaging/zipball/c51915d0e030db3a3add37f1561751d18b2d9a85", - "reference": "c51915d0e030db3a3add37f1561751d18b2d9a85", + "url": "https://api.github.com/repos/utopia-php/messaging/zipball/0d364edacf4d4867964c7e17f653031dd39394bf", + "reference": "0d364edacf4d4867964c7e17f653031dd39394bf", "shasum": "" }, "require": { @@ -3993,30 +4181,30 @@ ], "support": { "issues": "https://github.com/utopia-php/messaging/issues", - "source": "https://github.com/utopia-php/messaging/tree/0.17.0" + "source": "https://github.com/utopia-php/messaging/tree/0.18.2" }, - "time": "2025-05-12T16:14:08+00:00" + "time": "2025-07-21T18:27:03+00:00" }, { "name": "utopia-php/migration", - "version": "0.10.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "0b0e94c4b5243c5566b9634b07ba2ec5f7990914" + "reference": "c42935a6a4ee3701c68d24244e82ecb39e945ec4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/0b0e94c4b5243c5566b9634b07ba2ec5f7990914", - "reference": "0b0e94c4b5243c5566b9634b07ba2ec5f7990914", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/c42935a6a4ee3701c68d24244e82ecb39e945ec4", + "reference": "c42935a6a4ee3701c68d24244e82ecb39e945ec4", "shasum": "" }, "require": { - "appwrite/appwrite": "11.*", + "appwrite/appwrite": "15.*", "ext-curl": "*", "ext-openssl": "*", "php": ">=8.1", - "utopia-php/database": "0.*.*", + "utopia-php/database": "1.*", "utopia-php/dsn": "0.2.*", "utopia-php/framework": "0.33.*", "utopia-php/storage": "0.18.*" @@ -4049,9 +4237,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.10.0" + "source": "https://github.com/utopia-php/migration/tree/1.1.1" }, - "time": "2025-05-23T07:40:24+00:00" + "time": "2025-09-10T06:17:20+00:00" }, { "name": "utopia-php/orchestration", @@ -4105,16 +4293,16 @@ }, { "name": "utopia-php/platform", - "version": "0.7.7", + "version": "0.7.12", "source": { "type": "git", "url": "https://github.com/utopia-php/platform.git", - "reference": "8c43cd866148a7c4c495e3401268429e338004b3" + "reference": "04255de21db75e90b170040f4d1b457ba721e7a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/platform/zipball/8c43cd866148a7c4c495e3401268429e338004b3", - "reference": "8c43cd866148a7c4c495e3401268429e338004b3", + "url": "https://api.github.com/repos/utopia-php/platform/zipball/04255de21db75e90b170040f4d1b457ba721e7a5", + "reference": "04255de21db75e90b170040f4d1b457ba721e7a5", "shasum": "" }, "require": { @@ -4123,7 +4311,7 @@ "php": ">=8.0", "utopia-php/cli": "0.15.*", "utopia-php/framework": "0.33.*", - "utopia-php/queue": "0.10.*" + "utopia-php/queue": "0.11.*" }, "require-dev": { "laravel/pint": "1.*", @@ -4149,9 +4337,9 @@ ], "support": { "issues": "https://github.com/utopia-php/platform/issues", - "source": "https://github.com/utopia-php/platform/tree/0.7.7" + "source": "https://github.com/utopia-php/platform/tree/0.7.12" }, - "time": "2025-05-20T09:23:44+00:00" + "time": "2025-09-05T15:53:12+00:00" }, { "name": "utopia-php/pools", @@ -4260,16 +4448,16 @@ }, { "name": "utopia-php/queue", - "version": "0.10.0", + "version": "0.11.1", "source": { "type": "git", "url": "https://github.com/utopia-php/queue.git", - "reference": "0eccc559168ea72241c39a4c482d868314666be1" + "reference": "498bbbef418b1db71b51e1bb62f5d1d752ddd8d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/queue/zipball/0eccc559168ea72241c39a4c482d868314666be1", - "reference": "0eccc559168ea72241c39a4c482d868314666be1", + "url": "https://api.github.com/repos/utopia-php/queue/zipball/498bbbef418b1db71b51e1bb62f5d1d752ddd8d6", + "reference": "498bbbef418b1db71b51e1bb62f5d1d752ddd8d6", "shasum": "" }, "require": { @@ -4320,9 +4508,9 @@ ], "support": { "issues": "https://github.com/utopia-php/queue/issues", - "source": "https://github.com/utopia-php/queue/tree/0.10.0" + "source": "https://github.com/utopia-php/queue/tree/0.11.1" }, - "time": "2025-04-17T12:15:52+00:00" + "time": "2025-05-30T11:50:34+00:00" }, { "name": "utopia-php/registry", @@ -4378,16 +4566,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.12", + "version": "0.18.13", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "9a2556c39b5f4d9f8e79111fd34ec889b7bb1e97" + "reference": "3d8ce53ae042173bf230445e996056c5f65ded22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/9a2556c39b5f4d9f8e79111fd34ec889b7bb1e97", - "reference": "9a2556c39b5f4d9f8e79111fd34ec889b7bb1e97", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/3d8ce53ae042173bf230445e996056c5f65ded22", + "reference": "3d8ce53ae042173bf230445e996056c5f65ded22", "shasum": "" }, "require": { @@ -4430,22 +4618,22 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.12" + "source": "https://github.com/utopia-php/storage/tree/0.18.13" }, - "time": "2025-05-15T07:55:58+00:00" + "time": "2025-05-26T13:10:35+00:00" }, { "name": "utopia-php/swoole", - "version": "0.8.3", + "version": "0.8.4", "source": { "type": "git", "url": "https://github.com/utopia-php/swoole.git", - "reference": "1af73dd3e73987cf729c7db399054e4a70befd99" + "reference": "150c30700e738c52348cce9ed0e0f0ff96872081" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/swoole/zipball/1af73dd3e73987cf729c7db399054e4a70befd99", - "reference": "1af73dd3e73987cf729c7db399054e4a70befd99", + "url": "https://api.github.com/repos/utopia-php/swoole/zipball/150c30700e738c52348cce9ed0e0f0ff96872081", + "reference": "150c30700e738c52348cce9ed0e0f0ff96872081", "shasum": "" }, "require": { @@ -4481,9 +4669,9 @@ ], "support": { "issues": "https://github.com/utopia-php/swoole/issues", - "source": "https://github.com/utopia-php/swoole/tree/0.8.3" + "source": "https://github.com/utopia-php/swoole/tree/0.8.4" }, - "time": "2025-03-26T10:09:05+00:00" + "time": "2025-09-07T09:39:46+00:00" }, { "name": "utopia-php/system", @@ -4593,16 +4781,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.10.2", + "version": "0.11.0", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "1f9823ebcb8fd098607de0074f18f48e28985012" + "reference": "0e665eaa7d906168525bf6aac50b6bcc3e4fe528" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/1f9823ebcb8fd098607de0074f18f48e28985012", - "reference": "1f9823ebcb8fd098607de0074f18f48e28985012", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/0e665eaa7d906168525bf6aac50b6bcc3e4fe528", + "reference": "0e665eaa7d906168525bf6aac50b6bcc3e4fe528", "shasum": "" }, "require": { @@ -4636,9 +4824,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.10.2" + "source": "https://github.com/utopia-php/vcs/tree/0.11.0" }, - "time": "2025-04-17T04:35:25+00:00" + "time": "2025-07-23T13:54:58+00:00" }, { "name": "utopia-php/websocket", @@ -4816,16 +5004,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.40.18", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "38de4b9c58112d7e83eb75955994c8412a401093" + "reference": "3583fa6fddb1d1a902b37ff2048527a5827fc008" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/38de4b9c58112d7e83eb75955994c8412a401093", - "reference": "38de4b9c58112d7e83eb75955994c8412a401093", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/3583fa6fddb1d1a902b37ff2048527a5827fc008", + "reference": "3583fa6fddb1d1a902b37ff2048527a5827fc008", "shasum": "" }, "require": { @@ -4861,9 +5049,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.40.18" + "source": "https://github.com/appwrite/sdk-generator/tree/1.4.0" }, - "time": "2025-05-21T14:14:47+00:00" + "time": "2025-09-23T02:27:10+00:00" }, { "name": "doctrine/annotations", @@ -5090,16 +5278,16 @@ }, { "name": "laravel/pint", - "version": "v1.22.1", + "version": "v1.25.1", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "941d1927c5ca420c22710e98420287169c7bcaf7" + "reference": "5016e263f95d97670d71b9a987bd8996ade6d8d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/941d1927c5ca420c22710e98420287169c7bcaf7", - "reference": "941d1927c5ca420c22710e98420287169c7bcaf7", + "url": "https://api.github.com/repos/laravel/pint/zipball/5016e263f95d97670d71b9a987bd8996ade6d8d9", + "reference": "5016e263f95d97670d71b9a987bd8996ade6d8d9", "shasum": "" }, "require": { @@ -5110,10 +5298,10 @@ "php": "^8.2.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.75.0", - "illuminate/view": "^11.44.7", - "larastan/larastan": "^3.4.0", - "laravel-zero/framework": "^11.36.1", + "friendsofphp/php-cs-fixer": "^3.87.2", + "illuminate/view": "^11.46.0", + "larastan/larastan": "^3.7.1", + "laravel-zero/framework": "^11.45.0", "mockery/mockery": "^1.6.12", "nunomaduro/termwind": "^2.3.1", "pestphp/pest": "^2.36.0" @@ -5152,20 +5340,20 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2025-05-08T08:38:12+00:00" + "time": "2025-09-19T02:57:12+00:00" }, { "name": "matthiasmullie/minify", - "version": "1.3.73", + "version": "1.3.75", "source": { "type": "git", "url": "https://github.com/matthiasmullie/minify.git", - "reference": "cb7a9297b4ab070909cefade30ee95054d4ae87a" + "reference": "76ba4a5f555fd7bf4aa408af608e991569076671" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/cb7a9297b4ab070909cefade30ee95054d4ae87a", - "reference": "cb7a9297b4ab070909cefade30ee95054d4ae87a", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/76ba4a5f555fd7bf4aa408af608e991569076671", + "reference": "76ba4a5f555fd7bf4aa408af608e991569076671", "shasum": "" }, "require": { @@ -5176,8 +5364,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": ">=2.0", "matthiasmullie/scrapbook": ">=1.3", - "phpunit/phpunit": ">=4.8", - "squizlabs/php_codesniffer": ">=3.0" + "phpunit/phpunit": ">=4.8" }, "suggest": { "psr/cache-implementation": "Cache implementation to use with Minify::cache" @@ -5215,7 +5402,7 @@ ], "support": { "issues": "https://github.com/matthiasmullie/minify/issues", - "source": "https://github.com/matthiasmullie/minify/tree/1.3.73" + "source": "https://github.com/matthiasmullie/minify/tree/1.3.75" }, "funding": [ { @@ -5223,7 +5410,7 @@ "type": "github" } ], - "time": "2024-03-15T10:27:10+00:00" + "time": "2025-06-25T09:56:19+00:00" }, { "name": "matthiasmullie/path-converter", @@ -5280,16 +5467,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.1", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -5328,7 +5515,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -5336,20 +5523,20 @@ "type": "tidelift" } ], - "time": "2025-04-29T12:36:36+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "nikic/php-parser", - "version": "v5.4.0", + "version": "v5.6.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494" + "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2", + "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2", "shasum": "" }, "require": { @@ -5368,7 +5555,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.x-dev" } }, "autoload": { @@ -5392,9 +5579,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.1" }, - "time": "2024-12-30T11:07:19+00:00" + "time": "2025-08-13T20:13:15+00:00" }, { "name": "phar-io/manifest", @@ -6043,16 +6230,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.23", + "version": "9.6.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95" + "reference": "0a9aa4440b6a9528cf360071502628d717af3e0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", - "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0a9aa4440b6a9528cf360071502628d717af3e0a", + "reference": "0a9aa4440b6a9528cf360071502628d717af3e0a", "shasum": "" }, "require": { @@ -6063,7 +6250,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.13.1", + "myclabs/deep-copy": "^1.13.4", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -6074,11 +6261,11 @@ "phpunit/php-timer": "^5.0.3", "sebastian/cli-parser": "^1.0.2", "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.8", + "sebastian/comparator": "^4.0.9", "sebastian/diff": "^4.0.6", "sebastian/environment": "^5.1.5", "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", + "sebastian/global-state": "^5.0.8", "sebastian/object-enumerator": "^4.0.4", "sebastian/resource-operations": "^3.0.4", "sebastian/type": "^3.2.1", @@ -6126,7 +6313,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.23" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.27" }, "funding": [ { @@ -6150,7 +6337,7 @@ "type": "tidelift" } ], - "time": "2025-05-02T06:40:34+00:00" + "time": "2025-09-14T06:18:03+00:00" }, { "name": "psr/cache", @@ -6370,16 +6557,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "4.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5", + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5", "shasum": "" }, "require": { @@ -6432,15 +6619,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.9" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2025-08-10T06:51:50+00:00" }, { "name": "sebastian/complexity", @@ -6630,16 +6829,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.6", + "version": "4.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "reference": "eb49b981ef0817890129cb70f774506bebe57740" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/eb49b981ef0817890129cb70f774506bebe57740", + "reference": "eb49b981ef0817890129cb70f774506bebe57740", "shasum": "" }, "require": { @@ -6695,28 +6894,40 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.7" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" } ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2025-09-22T05:18:21+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "5.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6", "shasum": "" }, "require": { @@ -6759,15 +6970,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", + "type": "tidelift" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2025-08-10T07:10:35+00:00" }, { "name": "sebastian/lines-of-code", @@ -6940,16 +7163,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0", + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0", "shasum": "" }, "require": { @@ -6991,15 +7214,27 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.6" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2023-02-03T06:07:39+00:00" + "time": "2025-08-10T06:57:39+00:00" }, { "name": "sebastian/resource-operations", @@ -7262,23 +7497,24 @@ }, { "name": "symfony/console", - "version": "v7.2.6", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218" + "reference": "cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0e2e3f38c192e93e622e41ec37f4ca70cfedf218", - "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218", + "url": "https://api.github.com/repos/symfony/console/zipball/cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7", + "reference": "cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^6.4|^7.0" + "symfony/string": "^7.2" }, "conflict": { "symfony/dependency-injection": "<6.4", @@ -7335,7 +7571,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.6" + "source": "https://github.com/symfony/console/tree/v7.3.3" }, "funding": [ { @@ -7346,25 +7582,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-04-07T19:09:28+00:00" + "time": "2025-08-25T06:35:40+00:00" }, { "name": "symfony/filesystem", - "version": "v7.2.0", + "version": "v7.3.2", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" + "reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", - "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/edcbb768a186b5c3f25d0643159a787d3e63b7fd", + "reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd", "shasum": "" }, "require": { @@ -7401,7 +7641,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.2.0" + "source": "https://github.com/symfony/filesystem/tree/v7.3.2" }, "funding": [ { @@ -7412,25 +7652,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-10-25T15:15:23+00:00" + "time": "2025-07-07T08:17:47+00:00" }, { "name": "symfony/finder", - "version": "v7.2.2", + "version": "v7.3.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb" + "reference": "2a6614966ba1074fa93dae0bc804227422df4dfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb", + "url": "https://api.github.com/repos/symfony/finder/zipball/2a6614966ba1074fa93dae0bc804227422df4dfe", + "reference": "2a6614966ba1074fa93dae0bc804227422df4dfe", "shasum": "" }, "require": { @@ -7465,7 +7709,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.2.2" + "source": "https://github.com/symfony/finder/tree/v7.3.2" }, "funding": [ { @@ -7476,25 +7720,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-12-30T19:00:17+00:00" + "time": "2025-07-15T13:41:35+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.2.0", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" + "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0ff2f5c3df08a395232bbc3c2eb7e84912df911d", + "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d", "shasum": "" }, "require": { @@ -7532,7 +7780,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" + "source": "https://github.com/symfony/options-resolver/tree/v7.3.3" }, "funding": [ { @@ -7543,16 +7791,20 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-20T11:17:29+00:00" + "time": "2025-08-05T10:16:07+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -7611,7 +7863,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" }, "funding": [ { @@ -7622,6 +7874,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -7631,16 +7887,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", "shasum": "" }, "require": { @@ -7689,7 +7945,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" }, "funding": [ { @@ -7700,16 +7956,20 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-06-27T09:58:17+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -7770,7 +8030,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" }, "funding": [ { @@ -7781,6 +8041,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -7790,7 +8054,7 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -7846,7 +8110,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.33.0" }, "funding": [ { @@ -7857,6 +8121,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -7866,16 +8134,16 @@ }, { "name": "symfony/process", - "version": "v7.2.5", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "87b7c93e57df9d8e39a093d32587702380ff045d" + "reference": "32241012d521e2e8a9d713adb0812bb773b907f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/87b7c93e57df9d8e39a093d32587702380ff045d", - "reference": "87b7c93e57df9d8e39a093d32587702380ff045d", + "url": "https://api.github.com/repos/symfony/process/zipball/32241012d521e2e8a9d713adb0812bb773b907f1", + "reference": "32241012d521e2e8a9d713adb0812bb773b907f1", "shasum": "" }, "require": { @@ -7907,7 +8175,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.2.5" + "source": "https://github.com/symfony/process/tree/v7.3.3" }, "funding": [ { @@ -7918,25 +8186,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-03-13T12:21:46+00:00" + "time": "2025-08-18T09:42:54+00:00" }, { "name": "symfony/string", - "version": "v7.2.6", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931" + "reference": "17a426cce5fd1f0901fefa9b2a490d0038fd3c9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a214fe7d62bd4df2a76447c67c6b26e1d5e74931", - "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931", + "url": "https://api.github.com/repos/symfony/string/zipball/17a426cce5fd1f0901fefa9b2a490d0038fd3c9c", + "reference": "17a426cce5fd1f0901fefa9b2a490d0038fd3c9c", "shasum": "" }, "require": { @@ -7994,7 +8266,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.2.6" + "source": "https://github.com/symfony/string/tree/v7.3.3" }, "funding": [ { @@ -8005,12 +8277,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-04-20T20:18:16+00:00" + "time": "2025-08-25T06:35:40+00:00" }, { "name": "textalk/websocket", diff --git a/docker-compose.yml b/docker-compose.yml index 6c7900ac78..da6362b4c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -71,6 +71,9 @@ services: - traefik.http.routers.appwrite_api_https.service=appwrite_api - traefik.http.routers.appwrite_api_https.tls=true volumes: + - /var/run/docker.sock:/var/run/docker.sock # Only needed for tests + - ./docker-compose.yml:/usr/src/code/docker-compose.yml # Only needed for tests + - ./.env:/usr/src/code/.env # Only needed for tests - appwrite-uploads:/storage/uploads:rw - appwrite-imports:/storage/imports:rw - appwrite-cache:/storage/cache:rw @@ -116,9 +119,12 @@ services: - _APP_OPTIONS_ROUTER_FORCE_HTTPS - _APP_OPENSSL_KEY_V1 - _APP_DOMAIN + - _APP_CONSOLE_DOMAIN - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -213,7 +219,7 @@ services: appwrite-console: <<: *x-logging container_name: appwrite-console - image: appwrite/console:6.0.8 + image: appwrite/console:7.0.2 restart: unless-stopped networks: - appwrite @@ -323,7 +329,8 @@ services: depends_on: - redis - mariadb - - request-catcher + - request-catcher-sms + - request-catcher-webhook environment: - _APP_ENV - _APP_WORKER_PER_CORE @@ -454,6 +461,7 @@ services: - redis - mariadb environment: + - _APP_BROWSER_HOST - _APP_ENV - _APP_WORKER_PER_CORE - _APP_OPENSSL_KEY_V1 @@ -481,6 +489,7 @@ services: - _APP_OPTIONS_FORCE_HTTPS - _APP_OPTIONS_ROUTER_FORCE_HTTPS - _APP_DOMAIN + - _APP_CONSOLE_DOMAIN - _APP_STORAGE_DEVICE - _APP_STORAGE_S3_ACCESS_KEY - _APP_STORAGE_S3_SECRET @@ -531,6 +540,8 @@ services: - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_EMAIL_CERTIFICATES - _APP_REDIS_HOST @@ -700,6 +711,8 @@ services: - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DNS - _APP_EMAIL_SECURITY - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -734,6 +747,8 @@ services: - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_OPENSSL_KEY_V1 - _APP_REDIS_HOST @@ -934,7 +949,7 @@ services: appwrite-assistant: container_name: appwrite-assistant - image: appwrite/assistant:0.7.0 + image: appwrite/assistant:0.8.3 networks: - appwrite environment: @@ -951,7 +966,7 @@ services: hostname: exc1 <<: *x-logging stop_signal: SIGINT - image: openruntimes/executor:0.7.16 + image: openruntimes/executor:0.11.0 restart: unless-stopped networks: - appwrite @@ -974,7 +989,7 @@ services: - OPR_EXECUTOR_ENV=$_APP_ENV - OPR_EXECUTOR_RUNTIMES=$_APP_FUNCTIONS_RUNTIMES,$_APP_SITES_RUNTIMES - OPR_EXECUTOR_SECRET=$_APP_EXECUTOR_SECRET - - OPR_EXECUTOR_RUNTIME_VERSIONS=v2,v5 + - OPR_EXECUTOR_RUNTIME_VERSIONS=v5 - OPR_EXECUTOR_LOGGING_CONFIG=$_APP_LOGGING_CONFIG - OPR_EXECUTOR_STORAGE_DEVICE=$_APP_STORAGE_DEVICE - OPR_EXECUTOR_STORAGE_S3_ACCESS_KEY=$_APP_STORAGE_S3_ACCESS_KEY @@ -1075,15 +1090,24 @@ services: networks: - appwrite - request-catcher: # used mainly for dev tests + request-catcher-webhook: # used mainly for dev tests (mock HTTP webhook) image: appwrite/requestcatcher:1.0.0 - container_name: appwrite-requestcatcher + container_name: appwrite-requestcatcher-webhook <<: *x-logging ports: - "9504:5000" networks: - appwrite + request-catcher-sms: # used mainly for dev tests (mock SMS auth secret) + image: appwrite/requestcatcher:1.0.0 + container_name: appwrite-requestcatcher-sms + <<: *x-logging + ports: + - "9507:5000" + networks: + - appwrite + adminer: image: adminer container_name: appwrite-adminer diff --git a/docs/examples/1.7.x/client-android/java/databases/create-document.md b/docs/examples/1.7.x/client-android/java/databases/create-document.md index 7fb129bb0b..4804d751e3 100644 --- a/docs/examples/1.7.x/client-android/java/databases/create-document.md +++ b/docs/examples/1.7.x/client-android/java/databases/create-document.md @@ -4,9 +4,7 @@ import io.appwrite.services.Databases; Client client = new Client(context) .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setSession("") // The user session to authenticate with - .setKey("") // - .setJWT(""); // Your secret JSON Web Token + .setProject(""); // Your project ID Databases databases = new Databases(client); diff --git a/docs/examples/1.7.x/client-android/java/databases/decrement-document-attribute.md b/docs/examples/1.7.x/client-android/java/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..de6a4ab48d --- /dev/null +++ b/docs/examples/1.7.x/client-android/java/databases/decrement-document-attribute.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.decrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 0, // value (optional) + 0, // min (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.7.x/client-android/java/databases/increment-document-attribute.md b/docs/examples/1.7.x/client-android/java/databases/increment-document-attribute.md new file mode 100644 index 0000000000..94ffa9d749 --- /dev/null +++ b/docs/examples/1.7.x/client-android/java/databases/increment-document-attribute.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject(""); // Your project ID + +Databases databases = new Databases(client); + +databases.incrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 0, // value (optional) + 0, // max (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.7.x/client-android/java/functions/create-execution.md b/docs/examples/1.7.x/client-android/java/functions/create-execution.md index c138b0ef86..06c50278a5 100644 --- a/docs/examples/1.7.x/client-android/java/functions/create-execution.md +++ b/docs/examples/1.7.x/client-android/java/functions/create-execution.md @@ -15,7 +15,7 @@ functions.createExecution( "", // path (optional) ExecutionMethod.GET, // method (optional) mapOf( "a" to "b" ), // headers (optional) - "", // scheduledAt (optional) + "", // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/1.7.x/client-android/kotlin/databases/create-document.md b/docs/examples/1.7.x/client-android/kotlin/databases/create-document.md index 0bafb315e7..849a636afb 100644 --- a/docs/examples/1.7.x/client-android/kotlin/databases/create-document.md +++ b/docs/examples/1.7.x/client-android/kotlin/databases/create-document.md @@ -4,9 +4,7 @@ import io.appwrite.services.Databases val client = Client(context) .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setSession("") // The user session to authenticate with - .setKey("") // - .setJWT("") // Your secret JSON Web Token + .setProject("") // Your project ID val databases = Databases(client) diff --git a/docs/examples/1.7.x/client-android/kotlin/databases/decrement-document-attribute.md b/docs/examples/1.7.x/client-android/kotlin/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..c500fa8687 --- /dev/null +++ b/docs/examples/1.7.x/client-android/kotlin/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.decrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 0, // (optional) + min = 0, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.7.x/client-android/kotlin/databases/increment-document-attribute.md b/docs/examples/1.7.x/client-android/kotlin/databases/increment-document-attribute.md new file mode 100644 index 0000000000..0ae6b02d3d --- /dev/null +++ b/docs/examples/1.7.x/client-android/kotlin/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +val databases = Databases(client) + +val result = databases.incrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 0, // (optional) + max = 0, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.7.x/client-android/kotlin/functions/create-execution.md b/docs/examples/1.7.x/client-android/kotlin/functions/create-execution.md index cb7c60bac1..5e1950b8d9 100644 --- a/docs/examples/1.7.x/client-android/kotlin/functions/create-execution.md +++ b/docs/examples/1.7.x/client-android/kotlin/functions/create-execution.md @@ -15,5 +15,5 @@ val result = functions.createExecution( path = "", // (optional) method = ExecutionMethod.GET, // (optional) headers = mapOf( "a" to "b" ), // (optional) - scheduledAt = "", // (optional) + scheduledAt = "", // (optional) ) \ No newline at end of file diff --git a/docs/examples/1.7.x/client-apple/examples/databases/create-document.md b/docs/examples/1.7.x/client-apple/examples/databases/create-document.md index 6c2baee728..51adb64bb3 100644 --- a/docs/examples/1.7.x/client-apple/examples/databases/create-document.md +++ b/docs/examples/1.7.x/client-apple/examples/databases/create-document.md @@ -2,9 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .setSession("") // The user session to authenticate with - .setKey("") // - .setJWT("") // Your secret JSON Web Token + .setProject("") // Your project ID let databases = Databases(client) diff --git a/docs/examples/1.7.x/client-apple/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/client-apple/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..8ef2637bf2 --- /dev/null +++ b/docs/examples/1.7.x/client-apple/examples/databases/decrement-document-attribute.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let document = try await databases.decrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 0, // optional + min: 0 // optional +) + diff --git a/docs/examples/1.7.x/client-apple/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/client-apple/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..f64b2cd76c --- /dev/null +++ b/docs/examples/1.7.x/client-apple/examples/databases/increment-document-attribute.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + +let databases = Databases(client) + +let document = try await databases.incrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 0, // optional + max: 0 // optional +) + diff --git a/docs/examples/1.7.x/client-flutter/examples/databases/create-document.md b/docs/examples/1.7.x/client-flutter/examples/databases/create-document.md index 4f286fff95..27efc34580 100644 --- a/docs/examples/1.7.x/client-flutter/examples/databases/create-document.md +++ b/docs/examples/1.7.x/client-flutter/examples/databases/create-document.md @@ -2,9 +2,7 @@ import 'package:appwrite/appwrite.dart'; Client client = Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setKey('') // - .setJWT(''); // Your secret JSON Web Token + .setProject(''); // Your project ID Databases databases = Databases(client); diff --git a/docs/examples/1.7.x/client-flutter/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/client-flutter/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..ec0d9ee300 --- /dev/null +++ b/docs/examples/1.7.x/client-flutter/examples/databases/decrement-document-attribute.md @@ -0,0 +1,16 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.decrementDocumentAttribute( + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 0, // optional + min: 0, // optional +); diff --git a/docs/examples/1.7.x/client-flutter/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/client-flutter/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..78f5b0cb6f --- /dev/null +++ b/docs/examples/1.7.x/client-flutter/examples/databases/increment-document-attribute.md @@ -0,0 +1,16 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.incrementDocumentAttribute( + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 0, // optional + max: 0, // optional +); diff --git a/docs/examples/1.7.x/client-graphql/examples/databases/create-document.md b/docs/examples/1.7.x/client-graphql/examples/databases/create-document.md index 4e2d90660b..4f525d6b1f 100644 --- a/docs/examples/1.7.x/client-graphql/examples/databases/create-document.md +++ b/docs/examples/1.7.x/client-graphql/examples/databases/create-document.md @@ -7,6 +7,7 @@ mutation { permissions: ["read("any")"] ) { _id + _sequence _collectionId _databaseId _createdAt diff --git a/docs/examples/1.7.x/client-graphql/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/client-graphql/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..2e7970049d --- /dev/null +++ b/docs/examples/1.7.x/client-graphql/examples/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +mutation { + databasesDecrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 0, + min: 0 + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.7.x/client-graphql/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/client-graphql/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..322ed69ced --- /dev/null +++ b/docs/examples/1.7.x/client-graphql/examples/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +mutation { + databasesIncrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 0, + max: 0 + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.7.x/client-graphql/examples/databases/update-document.md b/docs/examples/1.7.x/client-graphql/examples/databases/update-document.md index 5e80894620..aea605d9d7 100644 --- a/docs/examples/1.7.x/client-graphql/examples/databases/update-document.md +++ b/docs/examples/1.7.x/client-graphql/examples/databases/update-document.md @@ -7,6 +7,7 @@ mutation { permissions: ["read("any")"] ) { _id + _sequence _collectionId _databaseId _createdAt diff --git a/docs/examples/1.7.x/client-graphql/examples/databases/upsert-document.md b/docs/examples/1.7.x/client-graphql/examples/databases/upsert-document.md index 2ccab1c490..9d1e753081 100644 --- a/docs/examples/1.7.x/client-graphql/examples/databases/upsert-document.md +++ b/docs/examples/1.7.x/client-graphql/examples/databases/upsert-document.md @@ -7,6 +7,7 @@ mutation { permissions: ["read("any")"] ) { _id + _sequence _collectionId _databaseId _createdAt diff --git a/docs/examples/1.7.x/client-react-native/examples/databases/create-document.md b/docs/examples/1.7.x/client-react-native/examples/databases/create-document.md index ec768fcfaf..1b28231ed3 100644 --- a/docs/examples/1.7.x/client-react-native/examples/databases/create-document.md +++ b/docs/examples/1.7.x/client-react-native/examples/databases/create-document.md @@ -2,9 +2,7 @@ import { Client, Databases } from "react-native-appwrite"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setKey('') // - .setJWT(''); // Your secret JSON Web Token + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/1.7.x/client-react-native/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/client-react-native/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..4c9c2d9923 --- /dev/null +++ b/docs/examples/1.7.x/client-react-native/examples/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.decrementDocumentAttribute( + '', // databaseId + '', // collectionId + '', // documentId + '', // attribute + null, // value (optional) + null // min (optional) +); + +console.log(result); diff --git a/docs/examples/1.7.x/client-react-native/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/client-react-native/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..3a9d94904f --- /dev/null +++ b/docs/examples/1.7.x/client-react-native/examples/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.incrementDocumentAttribute( + '', // databaseId + '', // collectionId + '', // documentId + '', // attribute + null, // value (optional) + null // max (optional) +); + +console.log(result); diff --git a/docs/examples/1.7.x/client-rest/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/client-rest/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..7f056fb965 --- /dev/null +++ b/docs/examples/1.7.x/client-rest/examples/databases/decrement-document-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.7.0 +X-Appwrite-Project: +X-Appwrite-Session: +X-Appwrite-JWT: + +{ + "value": 0, + "min": 0 +} diff --git a/docs/examples/1.7.x/client-rest/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/client-rest/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..002d10238b --- /dev/null +++ b/docs/examples/1.7.x/client-rest/examples/databases/increment-document-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.7.0 +X-Appwrite-Project: +X-Appwrite-Session: +X-Appwrite-JWT: + +{ + "value": 0, + "max": 0 +} diff --git a/docs/examples/1.7.x/client-web/examples/databases/create-document.md b/docs/examples/1.7.x/client-web/examples/databases/create-document.md index 401a67488c..916cc92689 100644 --- a/docs/examples/1.7.x/client-web/examples/databases/create-document.md +++ b/docs/examples/1.7.x/client-web/examples/databases/create-document.md @@ -2,9 +2,7 @@ import { Client, Databases } from "appwrite"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setKey('') // - .setJWT(''); // Your secret JSON Web Token + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/1.7.x/client-web/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/client-web/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..10d785a9a8 --- /dev/null +++ b/docs/examples/1.7.x/client-web/examples/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.decrementDocumentAttribute( + '', // databaseId + '', // collectionId + '', // documentId + '', // attribute + null, // value (optional) + null // min (optional) +); + +console.log(result); diff --git a/docs/examples/1.7.x/client-web/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/client-web/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..4b32be959c --- /dev/null +++ b/docs/examples/1.7.x/client-web/examples/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.incrementDocumentAttribute( + '', // databaseId + '', // collectionId + '', // documentId + '', // attribute + null, // value (optional) + null // max (optional) +); + +console.log(result); diff --git a/docs/examples/1.7.x/console-cli/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/console-cli/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..e6607ea833 --- /dev/null +++ b/docs/examples/1.7.x/console-cli/examples/databases/decrement-document-attribute.md @@ -0,0 +1,7 @@ +appwrite databases decrementDocumentAttribute \ + --databaseId \ + --collectionId \ + --documentId \ + --attribute '' \ + + diff --git a/docs/examples/1.7.x/console-cli/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/console-cli/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..8a5150eebd --- /dev/null +++ b/docs/examples/1.7.x/console-cli/examples/databases/increment-document-attribute.md @@ -0,0 +1,7 @@ +appwrite databases incrementDocumentAttribute \ + --databaseId \ + --collectionId \ + --documentId \ + --attribute '' \ + + diff --git a/docs/examples/1.7.x/console-cli/examples/databases/upsert-document.md b/docs/examples/1.7.x/console-cli/examples/databases/upsert-document.md new file mode 100644 index 0000000000..40932014ba --- /dev/null +++ b/docs/examples/1.7.x/console-cli/examples/databases/upsert-document.md @@ -0,0 +1,6 @@ +appwrite databases upsertDocument \ + --databaseId \ + --collectionId \ + --documentId \ + --data '{ "key": "value" }' \ + diff --git a/docs/examples/1.7.x/console-cli/examples/databases/upsert-documents.md b/docs/examples/1.7.x/console-cli/examples/databases/upsert-documents.md index 3d0bd165d5..cb1677b14c 100644 --- a/docs/examples/1.7.x/console-cli/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/console-cli/examples/databases/upsert-documents.md @@ -1,4 +1,4 @@ appwrite databases upsertDocuments \ --databaseId \ --collectionId \ - + --documents one two three diff --git a/docs/examples/1.7.x/console-cli/examples/proxy/create-redirect-rule.md b/docs/examples/1.7.x/console-cli/examples/proxy/create-redirect-rule.md index f975ce686e..ec9098a748 100644 --- a/docs/examples/1.7.x/console-cli/examples/proxy/create-redirect-rule.md +++ b/docs/examples/1.7.x/console-cli/examples/proxy/create-redirect-rule.md @@ -1,4 +1,6 @@ appwrite proxy createRedirectRule \ --domain '' \ --url https://example.com \ - --statusCode 301 + --statusCode 301 \ + --resourceId \ + --resourceType site diff --git a/docs/examples/1.7.x/console-cli/examples/vcs/get-repository-contents.md b/docs/examples/1.7.x/console-cli/examples/vcs/get-repository-contents.md index 7d378d7efa..3ba8d75c91 100644 --- a/docs/examples/1.7.x/console-cli/examples/vcs/get-repository-contents.md +++ b/docs/examples/1.7.x/console-cli/examples/vcs/get-repository-contents.md @@ -2,3 +2,4 @@ appwrite vcs getRepositoryContents \ --installationId \ --providerRepositoryId \ + diff --git a/docs/examples/1.7.x/console-web/examples/databases/create-document.md b/docs/examples/1.7.x/console-web/examples/databases/create-document.md index 4524017dd5..1b96d07899 100644 --- a/docs/examples/1.7.x/console-web/examples/databases/create-document.md +++ b/docs/examples/1.7.x/console-web/examples/databases/create-document.md @@ -2,9 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // - .setKey('') // Your secret API key - .setJWT(''); // Your secret JSON Web Token + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/1.7.x/console-web/examples/databases/create-documents.md b/docs/examples/1.7.x/console-web/examples/databases/create-documents.md index 9651a99775..09f3007208 100644 --- a/docs/examples/1.7.x/console-web/examples/databases/create-documents.md +++ b/docs/examples/1.7.x/console-web/examples/databases/create-documents.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setKey(''); // Your secret API key + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/1.7.x/console-web/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/console-web/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..f090f53b49 --- /dev/null +++ b/docs/examples/1.7.x/console-web/examples/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.decrementDocumentAttribute( + '', // databaseId + '', // collectionId + '', // documentId + '', // attribute + null, // value (optional) + null // min (optional) +); + +console.log(result); diff --git a/docs/examples/1.7.x/console-web/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/console-web/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..62ebd6fe3c --- /dev/null +++ b/docs/examples/1.7.x/console-web/examples/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.incrementDocumentAttribute( + '', // databaseId + '', // collectionId + '', // documentId + '', // attribute + null, // value (optional) + null // max (optional) +); + +console.log(result); diff --git a/docs/examples/1.7.x/console-web/examples/databases/upsert-document.md b/docs/examples/1.7.x/console-web/examples/databases/upsert-document.md new file mode 100644 index 0000000000..3b89ed3aef --- /dev/null +++ b/docs/examples/1.7.x/console-web/examples/databases/upsert-document.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.upsertDocument( + '', // databaseId + '', // collectionId + '', // documentId + {}, // data + ["read("any")"] // permissions (optional) +); + +console.log(result); diff --git a/docs/examples/1.7.x/console-web/examples/databases/upsert-documents.md b/docs/examples/1.7.x/console-web/examples/databases/upsert-documents.md index c58bd1e99c..2d12f7caec 100644 --- a/docs/examples/1.7.x/console-web/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/console-web/examples/databases/upsert-documents.md @@ -9,7 +9,7 @@ const databases = new Databases(client); const result = await databases.upsertDocuments( '', // databaseId '', // collectionId - [] // documents (optional) + [] // documents ); console.log(result); diff --git a/docs/examples/1.7.x/console-web/examples/proxy/create-redirect-rule.md b/docs/examples/1.7.x/console-web/examples/proxy/create-redirect-rule.md index 43b3f79d8a..294e496987 100644 --- a/docs/examples/1.7.x/console-web/examples/proxy/create-redirect-rule.md +++ b/docs/examples/1.7.x/console-web/examples/proxy/create-redirect-rule.md @@ -1,4 +1,4 @@ -import { Client, Proxy, } from "@appwrite.io/console"; +import { Client, Proxy, , ProxyResourceType } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,9 @@ const proxy = new Proxy(client); const result = await proxy.createRedirectRule( '', // domain 'https://example.com', // url - .MovedPermanently301 // statusCode + .MovedPermanently301, // statusCode + '', // resourceId + ProxyResourceType.Site // resourceType ); console.log(result); diff --git a/docs/examples/1.7.x/console-web/examples/vcs/get-repository-contents.md b/docs/examples/1.7.x/console-web/examples/vcs/get-repository-contents.md index 8a04ba1ae4..6d0cbd19ee 100644 --- a/docs/examples/1.7.x/console-web/examples/vcs/get-repository-contents.md +++ b/docs/examples/1.7.x/console-web/examples/vcs/get-repository-contents.md @@ -9,7 +9,8 @@ const vcs = new Vcs(client); const result = await vcs.getRepositoryContents( '', // installationId '', // providerRepositoryId - '' // providerRootDirectory (optional) + '', // providerRootDirectory (optional) + '' // providerReference (optional) ); console.log(result); diff --git a/docs/examples/1.7.x/server-dart/examples/databases/create-document.md b/docs/examples/1.7.x/server-dart/examples/databases/create-document.md index 1c9af5112c..1d58fc586c 100644 --- a/docs/examples/1.7.x/server-dart/examples/databases/create-document.md +++ b/docs/examples/1.7.x/server-dart/examples/databases/create-document.md @@ -2,9 +2,8 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setKey('') // Your secret API key - .setJWT(''); // Your secret JSON Web Token + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with Databases databases = Databases(client); diff --git a/docs/examples/1.7.x/server-dart/examples/databases/create-documents.md b/docs/examples/1.7.x/server-dart/examples/databases/create-documents.md index 7b4409a0b1..ba0e34950b 100644 --- a/docs/examples/1.7.x/server-dart/examples/databases/create-documents.md +++ b/docs/examples/1.7.x/server-dart/examples/databases/create-documents.md @@ -2,6 +2,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID .setKey(''); // Your secret API key Databases databases = Databases(client); diff --git a/docs/examples/1.7.x/server-dart/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-dart/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..c8ec38dab8 --- /dev/null +++ b/docs/examples/1.7.x/server-dart/examples/databases/decrement-document-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Databases databases = Databases(client); + +Document result = await databases.decrementDocumentAttribute( + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 0, // (optional) + min: 0, // (optional) +); diff --git a/docs/examples/1.7.x/server-dart/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-dart/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..6e5134b03a --- /dev/null +++ b/docs/examples/1.7.x/server-dart/examples/databases/increment-document-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Databases databases = Databases(client); + +Document result = await databases.incrementDocumentAttribute( + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 0, // (optional) + max: 0, // (optional) +); diff --git a/docs/examples/1.7.x/server-dart/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-dart/examples/databases/upsert-document.md new file mode 100644 index 0000000000..93e306ebce --- /dev/null +++ b/docs/examples/1.7.x/server-dart/examples/databases/upsert-document.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.upsertDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: {}, + permissions: ["read("any")"], // (optional) +); diff --git a/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md index 46611b3b1e..cd35014f63 100644 --- a/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md @@ -10,5 +10,5 @@ Databases databases = Databases(client); DocumentList result = await databases.upsertDocuments( databaseId: '', collectionId: '', - documents: [], // (optional) + documents: [], ); diff --git a/docs/examples/1.7.x/server-deno/examples/databases/create-document.md b/docs/examples/1.7.x/server-deno/examples/databases/create-document.md index f18b4f30dc..be8a1bdac9 100644 --- a/docs/examples/1.7.x/server-deno/examples/databases/create-document.md +++ b/docs/examples/1.7.x/server-deno/examples/databases/create-document.md @@ -2,9 +2,8 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setKey('') // Your secret API key - .setJWT(''); // Your secret JSON Web Token + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const databases = new Databases(client); diff --git a/docs/examples/1.7.x/server-deno/examples/databases/create-documents.md b/docs/examples/1.7.x/server-deno/examples/databases/create-documents.md index f5e320e193..26c9796cf0 100644 --- a/docs/examples/1.7.x/server-deno/examples/databases/create-documents.md +++ b/docs/examples/1.7.x/server-deno/examples/databases/create-documents.md @@ -2,6 +2,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID .setKey(''); // Your secret API key const databases = new Databases(client); diff --git a/docs/examples/1.7.x/server-deno/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-deno/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..0142188185 --- /dev/null +++ b/docs/examples/1.7.x/server-deno/examples/databases/decrement-document-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.decrementDocumentAttribute( + '', // databaseId + '', // collectionId + '', // documentId + '', // attribute + null, // value (optional) + null // min (optional) +); diff --git a/docs/examples/1.7.x/server-deno/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-deno/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..9202a94bb9 --- /dev/null +++ b/docs/examples/1.7.x/server-deno/examples/databases/increment-document-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.incrementDocumentAttribute( + '', // databaseId + '', // collectionId + '', // documentId + '', // attribute + null, // value (optional) + null // max (optional) +); diff --git a/docs/examples/1.7.x/server-deno/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-deno/examples/databases/upsert-document.md new file mode 100644 index 0000000000..f05100e3df --- /dev/null +++ b/docs/examples/1.7.x/server-deno/examples/databases/upsert-document.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new Databases(client); + +const response = await databases.upsertDocument( + '', // databaseId + '', // collectionId + '', // documentId + {}, // data + ["read("any")"] // permissions (optional) +); diff --git a/docs/examples/1.7.x/server-deno/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-deno/examples/databases/upsert-documents.md index c0ee477875..0cd804bfb6 100644 --- a/docs/examples/1.7.x/server-deno/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-deno/examples/databases/upsert-documents.md @@ -10,5 +10,5 @@ const databases = new Databases(client); const response = await databases.upsertDocuments( '', // databaseId '', // collectionId - [] // documents (optional) + [] // documents ); diff --git a/docs/examples/1.7.x/server-dotnet/examples/databases/create-document.md b/docs/examples/1.7.x/server-dotnet/examples/databases/create-document.md index cb4bc62ced..52254e0c25 100644 --- a/docs/examples/1.7.x/server-dotnet/examples/databases/create-document.md +++ b/docs/examples/1.7.x/server-dotnet/examples/databases/create-document.md @@ -4,9 +4,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetSession("") // The user session to authenticate with - .SetKey("") // Your secret API key - .SetJWT(""); // Your secret JSON Web Token + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Databases databases = new Databases(client); diff --git a/docs/examples/1.7.x/server-dotnet/examples/databases/create-documents.md b/docs/examples/1.7.x/server-dotnet/examples/databases/create-documents.md index 495a3080fa..dad710f0df 100644 --- a/docs/examples/1.7.x/server-dotnet/examples/databases/create-documents.md +++ b/docs/examples/1.7.x/server-dotnet/examples/databases/create-documents.md @@ -4,6 +4,7 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID .SetKey(""); // Your secret API key Databases databases = new Databases(client); diff --git a/docs/examples/1.7.x/server-dotnet/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-dotnet/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..c327458f61 --- /dev/null +++ b/docs/examples/1.7.x/server-dotnet/examples/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Databases databases = new Databases(client); + +Document result = await databases.DecrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 0, // optional + min: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.7.x/server-dotnet/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-dotnet/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..be52584aaf --- /dev/null +++ b/docs/examples/1.7.x/server-dotnet/examples/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Databases databases = new Databases(client); + +Document result = await databases.IncrementDocumentAttribute( + databaseId: "", + collectionId: "", + documentId: "", + attribute: "", + value: 0, // optional + max: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-document.md new file mode 100644 index 0000000000..c0876bfa73 --- /dev/null +++ b/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-document.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.UpsertDocument( + databaseId: "", + collectionId: "", + documentId: "", + data: [object], + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-documents.md index d9db60ce2d..6c124c16e5 100644 --- a/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-documents.md @@ -12,5 +12,5 @@ Databases databases = new Databases(client); DocumentList result = await databases.UpsertDocuments( databaseId: "", collectionId: "", - documents: new List() // optional + documents: new List() ); \ No newline at end of file diff --git a/docs/examples/1.7.x/server-go/examples/account/create-anonymous-session.md b/docs/examples/1.7.x/server-go/examples/account/create-anonymous-session.md index a6b5b6a2cf..ff8aea9751 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-anonymous-session.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-anonymous-session.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateAnonymousSession( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/create-email-password-session.md b/docs/examples/1.7.x/server-go/examples/account/create-email-password-session.md index d876edc7ac..18d8dbc184 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-email-password-session.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-email-password-session.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateEmailPasswordSession( "email@example.com", "password", diff --git a/docs/examples/1.7.x/server-go/examples/account/create-email-token.md b/docs/examples/1.7.x/server-go/examples/account/create-email-token.md index aa832e7bf5..c057af5b9d 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-email-token.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-email-token.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateEmailToken( "", "email@example.com", diff --git a/docs/examples/1.7.x/server-go/examples/account/create-j-w-t.md b/docs/examples/1.7.x/server-go/examples/account/create-j-w-t.md index fad35ab519..665f365e20 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-j-w-t.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-j-w-t.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateJWT( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/create-magic-u-r-l-token.md b/docs/examples/1.7.x/server-go/examples/account/create-magic-u-r-l-token.md index 1e2090fd8e..cad88c183d 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-magic-u-r-l-token.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateMagicURLToken( "", "email@example.com", diff --git a/docs/examples/1.7.x/server-go/examples/account/create-mfa-authenticator.md b/docs/examples/1.7.x/server-go/examples/account/create-mfa-authenticator.md index 8d425404b5..336a91d944 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-mfa-authenticator.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-mfa-authenticator.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateMfaAuthenticator( "totp", ) diff --git a/docs/examples/1.7.x/server-go/examples/account/create-mfa-challenge.md b/docs/examples/1.7.x/server-go/examples/account/create-mfa-challenge.md index 3ac4a3babf..4e17eb5ad9 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-mfa-challenge.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-mfa-challenge.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateMfaChallenge( "email", ) diff --git a/docs/examples/1.7.x/server-go/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.7.x/server-go/examples/account/create-mfa-recovery-codes.md index 063a804f6e..714d6106a0 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-mfa-recovery-codes.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateMfaRecoveryCodes( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/create-o-auth2token.md b/docs/examples/1.7.x/server-go/examples/account/create-o-auth2token.md index f3b6997fff..56a2acdbf1 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-o-auth2token.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-o-auth2token.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateOAuth2Token( "amazon", account.WithCreateOAuth2TokenSuccess("https://example.com"), diff --git a/docs/examples/1.7.x/server-go/examples/account/create-phone-token.md b/docs/examples/1.7.x/server-go/examples/account/create-phone-token.md index c9e80de622..b6c2ec7db7 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-phone-token.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-phone-token.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreatePhoneToken( "", "+12065550100", diff --git a/docs/examples/1.7.x/server-go/examples/account/create-phone-verification.md b/docs/examples/1.7.x/server-go/examples/account/create-phone-verification.md index c7a6bf4bf5..699cdb222e 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-phone-verification.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-phone-verification.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreatePhoneVerification( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/create-recovery.md b/docs/examples/1.7.x/server-go/examples/account/create-recovery.md index 9d55755c37..923d2819a6 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-recovery.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-recovery.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateRecovery( "email@example.com", "https://example.com", diff --git a/docs/examples/1.7.x/server-go/examples/account/create-session.md b/docs/examples/1.7.x/server-go/examples/account/create-session.md index f93502a31f..f5949241ff 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-session.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-session.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateSession( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/account/create-verification.md b/docs/examples/1.7.x/server-go/examples/account/create-verification.md index afb98c7ec0..b3c7fd8004 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create-verification.md +++ b/docs/examples/1.7.x/server-go/examples/account/create-verification.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.CreateVerification( "https://example.com", ) diff --git a/docs/examples/1.7.x/server-go/examples/account/create.md b/docs/examples/1.7.x/server-go/examples/account/create.md index b834d47d0f..dc4fdfe8f6 100644 --- a/docs/examples/1.7.x/server-go/examples/account/create.md +++ b/docs/examples/1.7.x/server-go/examples/account/create.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.Create( "", "email@example.com", diff --git a/docs/examples/1.7.x/server-go/examples/account/delete-identity.md b/docs/examples/1.7.x/server-go/examples/account/delete-identity.md index 30d2534602..2155249894 100644 --- a/docs/examples/1.7.x/server-go/examples/account/delete-identity.md +++ b/docs/examples/1.7.x/server-go/examples/account/delete-identity.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.DeleteIdentity( "", ) diff --git a/docs/examples/1.7.x/server-go/examples/account/delete-mfa-authenticator.md b/docs/examples/1.7.x/server-go/examples/account/delete-mfa-authenticator.md index 7f3edec33d..6eb956bdec 100644 --- a/docs/examples/1.7.x/server-go/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/1.7.x/server-go/examples/account/delete-mfa-authenticator.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.DeleteMfaAuthenticator( "totp", ) diff --git a/docs/examples/1.7.x/server-go/examples/account/delete-session.md b/docs/examples/1.7.x/server-go/examples/account/delete-session.md index 398604ecdd..3a1a9514bb 100644 --- a/docs/examples/1.7.x/server-go/examples/account/delete-session.md +++ b/docs/examples/1.7.x/server-go/examples/account/delete-session.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.DeleteSession( "", ) diff --git a/docs/examples/1.7.x/server-go/examples/account/delete-sessions.md b/docs/examples/1.7.x/server-go/examples/account/delete-sessions.md index 97eda5899a..718d149241 100644 --- a/docs/examples/1.7.x/server-go/examples/account/delete-sessions.md +++ b/docs/examples/1.7.x/server-go/examples/account/delete-sessions.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.DeleteSessions( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.7.x/server-go/examples/account/get-mfa-recovery-codes.md index 0dd93bb765..fd07fe36d9 100644 --- a/docs/examples/1.7.x/server-go/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/1.7.x/server-go/examples/account/get-mfa-recovery-codes.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.GetMfaRecoveryCodes( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/get-prefs.md b/docs/examples/1.7.x/server-go/examples/account/get-prefs.md index b7985acbd7..911b5786ce 100644 --- a/docs/examples/1.7.x/server-go/examples/account/get-prefs.md +++ b/docs/examples/1.7.x/server-go/examples/account/get-prefs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.GetPrefs( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/get-session.md b/docs/examples/1.7.x/server-go/examples/account/get-session.md index d6d1ffe05f..dc42c3c12d 100644 --- a/docs/examples/1.7.x/server-go/examples/account/get-session.md +++ b/docs/examples/1.7.x/server-go/examples/account/get-session.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.GetSession( "", ) diff --git a/docs/examples/1.7.x/server-go/examples/account/get.md b/docs/examples/1.7.x/server-go/examples/account/get.md index 7e08024930..80fe2da7c0 100644 --- a/docs/examples/1.7.x/server-go/examples/account/get.md +++ b/docs/examples/1.7.x/server-go/examples/account/get.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.Get( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/list-identities.md b/docs/examples/1.7.x/server-go/examples/account/list-identities.md index 7a7f4bc09f..3bfa0a7b60 100644 --- a/docs/examples/1.7.x/server-go/examples/account/list-identities.md +++ b/docs/examples/1.7.x/server-go/examples/account/list-identities.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.ListIdentities( account.WithListIdentitiesQueries([]interface{}{}), ) diff --git a/docs/examples/1.7.x/server-go/examples/account/list-logs.md b/docs/examples/1.7.x/server-go/examples/account/list-logs.md index eec9ed33e0..67ee6de1c2 100644 --- a/docs/examples/1.7.x/server-go/examples/account/list-logs.md +++ b/docs/examples/1.7.x/server-go/examples/account/list-logs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.ListLogs( account.WithListLogsQueries([]interface{}{}), ) diff --git a/docs/examples/1.7.x/server-go/examples/account/list-mfa-factors.md b/docs/examples/1.7.x/server-go/examples/account/list-mfa-factors.md index 4dca59fff6..26fb516fed 100644 --- a/docs/examples/1.7.x/server-go/examples/account/list-mfa-factors.md +++ b/docs/examples/1.7.x/server-go/examples/account/list-mfa-factors.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.ListMfaFactors( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/list-sessions.md b/docs/examples/1.7.x/server-go/examples/account/list-sessions.md index 9f8a5f4799..96b8c10d4c 100644 --- a/docs/examples/1.7.x/server-go/examples/account/list-sessions.md +++ b/docs/examples/1.7.x/server-go/examples/account/list-sessions.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.ListSessions( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/update-email.md b/docs/examples/1.7.x/server-go/examples/account/update-email.md index 11f98265b6..7467080416 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-email.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-email.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdateEmail( "email@example.com", "password", diff --git a/docs/examples/1.7.x/server-go/examples/account/update-m-f-a.md b/docs/examples/1.7.x/server-go/examples/account/update-m-f-a.md index d3df3d4638..139eea3afd 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-m-f-a.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-m-f-a.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdateMFA( false, ) diff --git a/docs/examples/1.7.x/server-go/examples/account/update-magic-u-r-l-session.md b/docs/examples/1.7.x/server-go/examples/account/update-magic-u-r-l-session.md index fdc9d45c04..4cda48878b 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-magic-u-r-l-session.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdateMagicURLSession( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/account/update-mfa-authenticator.md b/docs/examples/1.7.x/server-go/examples/account/update-mfa-authenticator.md index fb225574d4..ce4ebaffe7 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-mfa-authenticator.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-mfa-authenticator.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdateMfaAuthenticator( "totp", "", diff --git a/docs/examples/1.7.x/server-go/examples/account/update-mfa-challenge.md b/docs/examples/1.7.x/server-go/examples/account/update-mfa-challenge.md index 1e95a60d34..d2bb0c92ec 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-mfa-challenge.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-mfa-challenge.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdateMfaChallenge( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.7.x/server-go/examples/account/update-mfa-recovery-codes.md index 08feede261..9902b143f5 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-mfa-recovery-codes.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdateMfaRecoveryCodes( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/update-name.md b/docs/examples/1.7.x/server-go/examples/account/update-name.md index 8424a26946..972873a17a 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-name.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-name.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdateName( "", ) diff --git a/docs/examples/1.7.x/server-go/examples/account/update-password.md b/docs/examples/1.7.x/server-go/examples/account/update-password.md index 561ff0a667..aedcd0ccbc 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-password.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-password.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdatePassword( "", account.WithUpdatePasswordOldPassword("password"), diff --git a/docs/examples/1.7.x/server-go/examples/account/update-phone-session.md b/docs/examples/1.7.x/server-go/examples/account/update-phone-session.md index 433043e439..c937d9cd0d 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-phone-session.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-phone-session.md @@ -7,12 +7,12 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdatePhoneSession( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/account/update-phone-verification.md b/docs/examples/1.7.x/server-go/examples/account/update-phone-verification.md index 46602a8be8..462d98db9a 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-phone-verification.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-phone-verification.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdatePhoneVerification( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/account/update-phone.md b/docs/examples/1.7.x/server-go/examples/account/update-phone.md index d753cb21d3..163ecedd22 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-phone.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-phone.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdatePhone( "+12065550100", "password", diff --git a/docs/examples/1.7.x/server-go/examples/account/update-prefs.md b/docs/examples/1.7.x/server-go/examples/account/update-prefs.md index 0319de200a..ed566ba519 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-prefs.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-prefs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdatePrefs( map[string]interface{}{}, ) diff --git a/docs/examples/1.7.x/server-go/examples/account/update-recovery.md b/docs/examples/1.7.x/server-go/examples/account/update-recovery.md index f40414e5e8..0d7820bfb9 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-recovery.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-recovery.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdateRecovery( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/account/update-session.md b/docs/examples/1.7.x/server-go/examples/account/update-session.md index 8e1725a71c..61029a7157 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-session.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-session.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdateSession( "", ) diff --git a/docs/examples/1.7.x/server-go/examples/account/update-status.md b/docs/examples/1.7.x/server-go/examples/account/update-status.md index a9a0e239b0..05f6449a72 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-status.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-status.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdateStatus( ) diff --git a/docs/examples/1.7.x/server-go/examples/account/update-verification.md b/docs/examples/1.7.x/server-go/examples/account/update-verification.md index 2fd356dcf8..1c781659e4 100644 --- a/docs/examples/1.7.x/server-go/examples/account/update-verification.md +++ b/docs/examples/1.7.x/server-go/examples/account/update-verification.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := account.NewAccount(client) + service := account.New(client) response, error := service.UpdateVerification( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/avatars/get-browser.md b/docs/examples/1.7.x/server-go/examples/avatars/get-browser.md index 34f3bf58f9..98f405d6dd 100644 --- a/docs/examples/1.7.x/server-go/examples/avatars/get-browser.md +++ b/docs/examples/1.7.x/server-go/examples/avatars/get-browser.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := avatars.NewAvatars(client) + service := avatars.New(client) response, error := service.GetBrowser( "aa", avatars.WithGetBrowserWidth(0), diff --git a/docs/examples/1.7.x/server-go/examples/avatars/get-credit-card.md b/docs/examples/1.7.x/server-go/examples/avatars/get-credit-card.md index 764debd877..efdfdbd5dc 100644 --- a/docs/examples/1.7.x/server-go/examples/avatars/get-credit-card.md +++ b/docs/examples/1.7.x/server-go/examples/avatars/get-credit-card.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := avatars.NewAvatars(client) + service := avatars.New(client) response, error := service.GetCreditCard( "amex", avatars.WithGetCreditCardWidth(0), diff --git a/docs/examples/1.7.x/server-go/examples/avatars/get-favicon.md b/docs/examples/1.7.x/server-go/examples/avatars/get-favicon.md index bdea40db2f..35ea339097 100644 --- a/docs/examples/1.7.x/server-go/examples/avatars/get-favicon.md +++ b/docs/examples/1.7.x/server-go/examples/avatars/get-favicon.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := avatars.NewAvatars(client) + service := avatars.New(client) response, error := service.GetFavicon( "https://example.com", ) diff --git a/docs/examples/1.7.x/server-go/examples/avatars/get-flag.md b/docs/examples/1.7.x/server-go/examples/avatars/get-flag.md index dfda1ed687..3af30f3cc3 100644 --- a/docs/examples/1.7.x/server-go/examples/avatars/get-flag.md +++ b/docs/examples/1.7.x/server-go/examples/avatars/get-flag.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := avatars.NewAvatars(client) + service := avatars.New(client) response, error := service.GetFlag( "af", avatars.WithGetFlagWidth(0), diff --git a/docs/examples/1.7.x/server-go/examples/avatars/get-image.md b/docs/examples/1.7.x/server-go/examples/avatars/get-image.md index a751abb927..f4e0324c9d 100644 --- a/docs/examples/1.7.x/server-go/examples/avatars/get-image.md +++ b/docs/examples/1.7.x/server-go/examples/avatars/get-image.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := avatars.NewAvatars(client) + service := avatars.New(client) response, error := service.GetImage( "https://example.com", avatars.WithGetImageWidth(0), diff --git a/docs/examples/1.7.x/server-go/examples/avatars/get-initials.md b/docs/examples/1.7.x/server-go/examples/avatars/get-initials.md index 21fa9282ae..a7519012e2 100644 --- a/docs/examples/1.7.x/server-go/examples/avatars/get-initials.md +++ b/docs/examples/1.7.x/server-go/examples/avatars/get-initials.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := avatars.NewAvatars(client) + service := avatars.New(client) response, error := service.GetInitials( avatars.WithGetInitialsName(""), avatars.WithGetInitialsWidth(0), diff --git a/docs/examples/1.7.x/server-go/examples/avatars/get-q-r.md b/docs/examples/1.7.x/server-go/examples/avatars/get-q-r.md index 8eeea5f6bf..edd84269e3 100644 --- a/docs/examples/1.7.x/server-go/examples/avatars/get-q-r.md +++ b/docs/examples/1.7.x/server-go/examples/avatars/get-q-r.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := avatars.NewAvatars(client) + service := avatars.New(client) response, error := service.GetQR( "", avatars.WithGetQRSize(1), diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-boolean-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/create-boolean-attribute.md index 73e118e3b7..43b7aff721 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-boolean-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-boolean-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateBooleanAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-collection.md b/docs/examples/1.7.x/server-go/examples/databases/create-collection.md index 815b21d6cb..f72c4b360d 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-collection.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-collection.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateCollection( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-datetime-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/create-datetime-attribute.md index edf716911d..7d0de22c7d 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-datetime-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-datetime-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateDatetimeAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-document.md b/docs/examples/1.7.x/server-go/examples/databases/create-document.md index 5a5280a107..fe96a0d601 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-document.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-document.md @@ -7,14 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetSession("") // The user session to authenticate with - client.SetKey("") // Your secret API key - client.SetJWT("") // Your secret JSON Web Token - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateDocument( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-documents.md b/docs/examples/1.7.x/server-go/examples/databases/create-documents.md index 4199c28230..9e4da5dac7 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-documents.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-documents.md @@ -7,12 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateDocuments( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-email-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/create-email-attribute.md index f564b4033a..7fa28adfb0 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-email-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-email-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateEmailAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-enum-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/create-enum-attribute.md index 0827d31e1a..4921e2120b 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-enum-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-enum-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateEnumAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-float-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/create-float-attribute.md index a262e1d3f3..b933bab5e5 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-float-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-float-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateFloatAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-index.md b/docs/examples/1.7.x/server-go/examples/databases/create-index.md index 83e97d8e36..0513490178 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-index.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-index.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateIndex( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-integer-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/create-integer-attribute.md index daa54f9ec6..d84771dee7 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-integer-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-integer-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateIntegerAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-ip-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/create-ip-attribute.md index 4c5c9c37c2..136a7e96e8 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-ip-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-ip-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateIpAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-relationship-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/create-relationship-attribute.md index e10aee8ddd..7fa8c9fad9 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-relationship-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-relationship-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateRelationshipAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-string-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/create-string-attribute.md index e4bd63ce35..25d3c1066a 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-string-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-string-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateStringAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create-url-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/create-url-attribute.md index 9d8b2e13f8..dd77c93207 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create-url-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create-url-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.CreateUrlAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/create.md b/docs/examples/1.7.x/server-go/examples/databases/create.md index 80f9f92c29..f51a5d70f3 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/create.md +++ b/docs/examples/1.7.x/server-go/examples/databases/create.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.Create( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..1d9c094030 --- /dev/null +++ b/docs/examples/1.7.x/server-go/examples/databases/decrement-document-attribute.md @@ -0,0 +1,31 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) + + service := databases.New(client) + response, error := service.DecrementDocumentAttribute( + "", + "", + "", + "", + databases.WithDecrementDocumentAttributeValue(0), + databases.WithDecrementDocumentAttributeMin(0), + ) + + if error != nil { + panic(error) + } + + fmt.Println(response) +} diff --git a/docs/examples/1.7.x/server-go/examples/databases/delete-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/delete-attribute.md index 746dae5d0b..c34c83a6a5 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/delete-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/delete-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.DeleteAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/delete-collection.md b/docs/examples/1.7.x/server-go/examples/databases/delete-collection.md index abf6a7ae20..01e7710c26 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/delete-collection.md +++ b/docs/examples/1.7.x/server-go/examples/databases/delete-collection.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.DeleteCollection( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/delete-document.md b/docs/examples/1.7.x/server-go/examples/databases/delete-document.md index e8131a73f5..1fc4092ac6 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/delete-document.md +++ b/docs/examples/1.7.x/server-go/examples/databases/delete-document.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.DeleteDocument( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/delete-documents.md b/docs/examples/1.7.x/server-go/examples/databases/delete-documents.md index 6527cee677..fe018b1bbf 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/delete-documents.md +++ b/docs/examples/1.7.x/server-go/examples/databases/delete-documents.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.DeleteDocuments( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/delete-index.md b/docs/examples/1.7.x/server-go/examples/databases/delete-index.md index 38e6bc94d0..07bbb6f80c 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/delete-index.md +++ b/docs/examples/1.7.x/server-go/examples/databases/delete-index.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.DeleteIndex( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/delete.md b/docs/examples/1.7.x/server-go/examples/databases/delete.md index 0e7fb0a058..60995b66f0 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/delete.md +++ b/docs/examples/1.7.x/server-go/examples/databases/delete.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.Delete( "", ) diff --git a/docs/examples/1.7.x/server-go/examples/databases/get-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/get-attribute.md index 64ba82e65c..560f34c018 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/get-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/get-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.GetAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/get-collection.md b/docs/examples/1.7.x/server-go/examples/databases/get-collection.md index ee166a4ff9..75de4c6882 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/get-collection.md +++ b/docs/examples/1.7.x/server-go/examples/databases/get-collection.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.GetCollection( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/get-document.md b/docs/examples/1.7.x/server-go/examples/databases/get-document.md index 657a3dcab3..8bdd26c351 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/get-document.md +++ b/docs/examples/1.7.x/server-go/examples/databases/get-document.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.GetDocument( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/get-index.md b/docs/examples/1.7.x/server-go/examples/databases/get-index.md index efc9c1f950..ef38678361 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/get-index.md +++ b/docs/examples/1.7.x/server-go/examples/databases/get-index.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.GetIndex( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/get.md b/docs/examples/1.7.x/server-go/examples/databases/get.md index b6d337111b..0d1eb87a29 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/get.md +++ b/docs/examples/1.7.x/server-go/examples/databases/get.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.Get( "", ) diff --git a/docs/examples/1.7.x/server-go/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..fa63e9c8df --- /dev/null +++ b/docs/examples/1.7.x/server-go/examples/databases/increment-document-attribute.md @@ -0,0 +1,31 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) + + service := databases.New(client) + response, error := service.IncrementDocumentAttribute( + "", + "", + "", + "", + databases.WithIncrementDocumentAttributeValue(0), + databases.WithIncrementDocumentAttributeMax(0), + ) + + if error != nil { + panic(error) + } + + fmt.Println(response) +} diff --git a/docs/examples/1.7.x/server-go/examples/databases/list-attributes.md b/docs/examples/1.7.x/server-go/examples/databases/list-attributes.md index 8095b75d19..e4748c6f90 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/list-attributes.md +++ b/docs/examples/1.7.x/server-go/examples/databases/list-attributes.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.ListAttributes( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/list-collections.md b/docs/examples/1.7.x/server-go/examples/databases/list-collections.md index 2303c98bde..91716dc40e 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/list-collections.md +++ b/docs/examples/1.7.x/server-go/examples/databases/list-collections.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.ListCollections( "", databases.WithListCollectionsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/databases/list-documents.md b/docs/examples/1.7.x/server-go/examples/databases/list-documents.md index 952a1b2b48..91d0408efc 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/list-documents.md +++ b/docs/examples/1.7.x/server-go/examples/databases/list-documents.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.ListDocuments( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/list-indexes.md b/docs/examples/1.7.x/server-go/examples/databases/list-indexes.md index 8593dd71b7..a5af8d2847 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/list-indexes.md +++ b/docs/examples/1.7.x/server-go/examples/databases/list-indexes.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.ListIndexes( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/list.md b/docs/examples/1.7.x/server-go/examples/databases/list.md index 798e33b6ea..f377c11df0 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/list.md +++ b/docs/examples/1.7.x/server-go/examples/databases/list.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.List( databases.WithListQueries([]interface{}{}), databases.WithListSearch(""), diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-boolean-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/update-boolean-attribute.md index 770617635d..87e16a0e01 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-boolean-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-boolean-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateBooleanAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-collection.md b/docs/examples/1.7.x/server-go/examples/databases/update-collection.md index 1f80eaa255..07077ff0c0 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-collection.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-collection.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateCollection( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-datetime-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/update-datetime-attribute.md index 252334b20f..24017ff8b4 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-datetime-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-datetime-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateDatetimeAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-document.md b/docs/examples/1.7.x/server-go/examples/databases/update-document.md index 5ec0e189e9..b36c9694db 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-document.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-document.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateDocument( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-documents.md b/docs/examples/1.7.x/server-go/examples/databases/update-documents.md index e654590691..e1b2a95bc9 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-documents.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-documents.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateDocuments( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-email-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/update-email-attribute.md index c2e0cf9552..e58ac912be 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-email-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-email-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateEmailAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-enum-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/update-enum-attribute.md index fb993f37cc..ea6ef4b5f8 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-enum-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-enum-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateEnumAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-float-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/update-float-attribute.md index 814da25bde..db0915a5e2 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-float-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-float-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateFloatAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-integer-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/update-integer-attribute.md index 961374e3db..ac956b61bc 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-integer-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-integer-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateIntegerAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-ip-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/update-ip-attribute.md index 4895feb54d..faaefd7180 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-ip-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-ip-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateIpAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-relationship-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/update-relationship-attribute.md index 6df9de2015..db8057a728 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-relationship-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-relationship-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateRelationshipAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-string-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/update-string-attribute.md index 0469527d04..f9876a2305 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-string-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-string-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateStringAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update-url-attribute.md b/docs/examples/1.7.x/server-go/examples/databases/update-url-attribute.md index 53e2a482ef..d97cf205ef 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update-url-attribute.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update-url-attribute.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpdateUrlAttribute( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/update.md b/docs/examples/1.7.x/server-go/examples/databases/update.md index 8f5c6896a6..c7fd49fcec 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/update.md +++ b/docs/examples/1.7.x/server-go/examples/databases/update.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.Update( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-go/examples/databases/upsert-document.md new file mode 100644 index 0000000000..e6241b9198 --- /dev/null +++ b/docs/examples/1.7.x/server-go/examples/databases/upsert-document.md @@ -0,0 +1,30 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) + + service := databases.New(client) + response, error := service.UpsertDocument( + "", + "", + "", + map[string]interface{}{}, + databases.WithUpsertDocumentPermissions(interface{}{"read("any")"}), + ) + + if error != nil { + panic(error) + } + + fmt.Println(response) +} diff --git a/docs/examples/1.7.x/server-go/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-go/examples/databases/upsert-documents.md index a8399f79c0..d2731cd128 100644 --- a/docs/examples/1.7.x/server-go/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-go/examples/databases/upsert-documents.md @@ -7,17 +7,17 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := databases.NewDatabases(client) + service := databases.New(client) response, error := service.UpsertDocuments( "", "", - databases.WithUpsertDocumentsDocuments([]interface{}{}), + []interface{}{}, ) if error != nil { diff --git a/docs/examples/1.7.x/server-go/examples/functions/create-deployment.md b/docs/examples/1.7.x/server-go/examples/functions/create-deployment.md index afcfeb3173..53cdbf2038 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/create-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/functions/create-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.CreateDeployment( "", file.NewInputFile("/path/to/file.png", "file.png"), diff --git a/docs/examples/1.7.x/server-go/examples/functions/create-duplicate-deployment.md b/docs/examples/1.7.x/server-go/examples/functions/create-duplicate-deployment.md index f632371703..367ebd723d 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/functions/create-duplicate-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.CreateDuplicateDeployment( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/create-execution.md b/docs/examples/1.7.x/server-go/examples/functions/create-execution.md index 356e851376..33657d2503 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/create-execution.md +++ b/docs/examples/1.7.x/server-go/examples/functions/create-execution.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.CreateExecution( "", functions.WithCreateExecutionBody(""), diff --git a/docs/examples/1.7.x/server-go/examples/functions/create-template-deployment.md b/docs/examples/1.7.x/server-go/examples/functions/create-template-deployment.md index b0b1ab8f4a..87940ce5d4 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/create-template-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/functions/create-template-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.CreateTemplateDeployment( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/create-variable.md b/docs/examples/1.7.x/server-go/examples/functions/create-variable.md index 961869e325..68e4b7728e 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/create-variable.md +++ b/docs/examples/1.7.x/server-go/examples/functions/create-variable.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.CreateVariable( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/create-vcs-deployment.md b/docs/examples/1.7.x/server-go/examples/functions/create-vcs-deployment.md index 06e583ebe1..76d98acd56 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/create-vcs-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/functions/create-vcs-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.CreateVcsDeployment( "", "branch", diff --git a/docs/examples/1.7.x/server-go/examples/functions/create.md b/docs/examples/1.7.x/server-go/examples/functions/create.md index c3b13d1ff7..63dc01c556 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/create.md +++ b/docs/examples/1.7.x/server-go/examples/functions/create.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.Create( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/delete-deployment.md b/docs/examples/1.7.x/server-go/examples/functions/delete-deployment.md index cf088e82c8..1763878c91 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/delete-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/functions/delete-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.DeleteDeployment( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/delete-execution.md b/docs/examples/1.7.x/server-go/examples/functions/delete-execution.md index e863e3ba57..045f24ff1d 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/delete-execution.md +++ b/docs/examples/1.7.x/server-go/examples/functions/delete-execution.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.DeleteExecution( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/delete-variable.md b/docs/examples/1.7.x/server-go/examples/functions/delete-variable.md index 7cb66a04ce..cbc3cdd57e 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/delete-variable.md +++ b/docs/examples/1.7.x/server-go/examples/functions/delete-variable.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.DeleteVariable( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/delete.md b/docs/examples/1.7.x/server-go/examples/functions/delete.md index ec006f2079..87bddcc6f3 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/delete.md +++ b/docs/examples/1.7.x/server-go/examples/functions/delete.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.Delete( "", ) diff --git a/docs/examples/1.7.x/server-go/examples/functions/get-deployment-download.md b/docs/examples/1.7.x/server-go/examples/functions/get-deployment-download.md index f867d4f903..226537bc68 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/get-deployment-download.md +++ b/docs/examples/1.7.x/server-go/examples/functions/get-deployment-download.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.GetDeploymentDownload( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/get-deployment.md b/docs/examples/1.7.x/server-go/examples/functions/get-deployment.md index 6b6824500a..d94d1a187a 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/get-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/functions/get-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.GetDeployment( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/get-execution.md b/docs/examples/1.7.x/server-go/examples/functions/get-execution.md index 627c95b5a7..739af771ee 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/get-execution.md +++ b/docs/examples/1.7.x/server-go/examples/functions/get-execution.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.GetExecution( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/get-variable.md b/docs/examples/1.7.x/server-go/examples/functions/get-variable.md index 003baf4011..f96c84ced3 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/get-variable.md +++ b/docs/examples/1.7.x/server-go/examples/functions/get-variable.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.GetVariable( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/get.md b/docs/examples/1.7.x/server-go/examples/functions/get.md index a18d0526de..bfa5333e41 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/get.md +++ b/docs/examples/1.7.x/server-go/examples/functions/get.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.Get( "", ) diff --git a/docs/examples/1.7.x/server-go/examples/functions/list-deployments.md b/docs/examples/1.7.x/server-go/examples/functions/list-deployments.md index b137c3047c..8d040ce546 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/list-deployments.md +++ b/docs/examples/1.7.x/server-go/examples/functions/list-deployments.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.ListDeployments( "", functions.WithListDeploymentsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/functions/list-executions.md b/docs/examples/1.7.x/server-go/examples/functions/list-executions.md index 758d3f80d7..aa7e551c90 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/list-executions.md +++ b/docs/examples/1.7.x/server-go/examples/functions/list-executions.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.ListExecutions( "", functions.WithListExecutionsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/functions/list-runtimes.md b/docs/examples/1.7.x/server-go/examples/functions/list-runtimes.md index 76e4414df2..4e251247d3 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/list-runtimes.md +++ b/docs/examples/1.7.x/server-go/examples/functions/list-runtimes.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.ListRuntimes( ) diff --git a/docs/examples/1.7.x/server-go/examples/functions/list-specifications.md b/docs/examples/1.7.x/server-go/examples/functions/list-specifications.md index c1abea5d17..9b554b1cde 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/list-specifications.md +++ b/docs/examples/1.7.x/server-go/examples/functions/list-specifications.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.ListSpecifications( ) diff --git a/docs/examples/1.7.x/server-go/examples/functions/list-variables.md b/docs/examples/1.7.x/server-go/examples/functions/list-variables.md index e27df96670..68df7f8aa2 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/list-variables.md +++ b/docs/examples/1.7.x/server-go/examples/functions/list-variables.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.ListVariables( "", ) diff --git a/docs/examples/1.7.x/server-go/examples/functions/list.md b/docs/examples/1.7.x/server-go/examples/functions/list.md index 36a55d72b2..bff9229c08 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/list.md +++ b/docs/examples/1.7.x/server-go/examples/functions/list.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.List( functions.WithListQueries([]interface{}{}), functions.WithListSearch(""), diff --git a/docs/examples/1.7.x/server-go/examples/functions/update-deployment-status.md b/docs/examples/1.7.x/server-go/examples/functions/update-deployment-status.md index d89d59200a..75dce2fe74 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/update-deployment-status.md +++ b/docs/examples/1.7.x/server-go/examples/functions/update-deployment-status.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.UpdateDeploymentStatus( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/update-function-deployment.md b/docs/examples/1.7.x/server-go/examples/functions/update-function-deployment.md index ee0ccf5e21..e8a1c8b2af 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/update-function-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/functions/update-function-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.UpdateFunctionDeployment( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/update-variable.md b/docs/examples/1.7.x/server-go/examples/functions/update-variable.md index 42ec29a914..658540d027 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/update-variable.md +++ b/docs/examples/1.7.x/server-go/examples/functions/update-variable.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.UpdateVariable( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/functions/update.md b/docs/examples/1.7.x/server-go/examples/functions/update.md index 318ba4dfd0..7c2771efc8 100644 --- a/docs/examples/1.7.x/server-go/examples/functions/update.md +++ b/docs/examples/1.7.x/server-go/examples/functions/update.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := functions.NewFunctions(client) + service := functions.New(client) response, error := service.Update( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/graphql/mutation.md b/docs/examples/1.7.x/server-go/examples/graphql/mutation.md index 092e817c93..12ac4aeae1 100644 --- a/docs/examples/1.7.x/server-go/examples/graphql/mutation.md +++ b/docs/examples/1.7.x/server-go/examples/graphql/mutation.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := graphql.NewGraphql(client) + service := graphql.New(client) response, error := service.Mutation( map[string]interface{}{}, ) diff --git a/docs/examples/1.7.x/server-go/examples/graphql/query.md b/docs/examples/1.7.x/server-go/examples/graphql/query.md index 511d6c452e..ff67e5e30f 100644 --- a/docs/examples/1.7.x/server-go/examples/graphql/query.md +++ b/docs/examples/1.7.x/server-go/examples/graphql/query.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := graphql.NewGraphql(client) + service := graphql.New(client) response, error := service.Query( map[string]interface{}{}, ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-antivirus.md b/docs/examples/1.7.x/server-go/examples/health/get-antivirus.md index 1640c01c0e..ee880a756c 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-antivirus.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-antivirus.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetAntivirus( ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-cache.md b/docs/examples/1.7.x/server-go/examples/health/get-cache.md index 976d51fbe7..976a5b5a50 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-cache.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-cache.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetCache( ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-certificate.md b/docs/examples/1.7.x/server-go/examples/health/get-certificate.md index 44d1d1bb92..03cbbc190e 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-certificate.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-certificate.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetCertificate( health.WithGetCertificateDomain(""), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-d-b.md b/docs/examples/1.7.x/server-go/examples/health/get-d-b.md index 8f681a04c1..2ab86d11c0 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-d-b.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-d-b.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetDB( ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-failed-jobs.md b/docs/examples/1.7.x/server-go/examples/health/get-failed-jobs.md index 814b8850e8..59d8baffca 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-failed-jobs.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-failed-jobs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetFailedJobs( "v1-database", health.WithGetFailedJobsThreshold(0), diff --git a/docs/examples/1.7.x/server-go/examples/health/get-pub-sub.md b/docs/examples/1.7.x/server-go/examples/health/get-pub-sub.md index 6a3d67e838..451c47c806 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-pub-sub.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-pub-sub.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetPubSub( ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-builds.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-builds.md index ebd1a2f3d8..e3a16fb1ae 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-builds.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-builds.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueBuilds( health.WithGetQueueBuildsThreshold(0), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-certificates.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-certificates.md index 473d953c15..42505bfc25 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-certificates.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-certificates.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueCertificates( health.WithGetQueueCertificatesThreshold(0), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-databases.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-databases.md index 83eb8584a5..1f1d3669fa 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-databases.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-databases.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueDatabases( health.WithGetQueueDatabasesName(""), health.WithGetQueueDatabasesThreshold(0), diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-deletes.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-deletes.md index e491446f94..83c40caa4c 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-deletes.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-deletes.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueDeletes( health.WithGetQueueDeletesThreshold(0), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-functions.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-functions.md index c7cf45a355..d79f07e313 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-functions.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-functions.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueFunctions( health.WithGetQueueFunctionsThreshold(0), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-logs.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-logs.md index b369c24277..b67123f8f8 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-logs.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-logs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueLogs( health.WithGetQueueLogsThreshold(0), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-mails.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-mails.md index cc944d0cad..efbdfe48bb 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-mails.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-mails.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueMails( health.WithGetQueueMailsThreshold(0), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-messaging.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-messaging.md index 65c6c34610..65c167fc18 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-messaging.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-messaging.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueMessaging( health.WithGetQueueMessagingThreshold(0), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-migrations.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-migrations.md index d0c3bd2573..8a009960b1 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-migrations.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-migrations.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueMigrations( health.WithGetQueueMigrationsThreshold(0), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-stats-resources.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-stats-resources.md index 5ed004c7cf..ba3c71317a 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-stats-resources.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-stats-resources.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueStatsResources( health.WithGetQueueStatsResourcesThreshold(0), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-usage.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-usage.md index 5202371d1e..cdc175887f 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-usage.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-usage.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueUsage( health.WithGetQueueUsageThreshold(0), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-queue-webhooks.md b/docs/examples/1.7.x/server-go/examples/health/get-queue-webhooks.md index 4782aef9ac..06791aa229 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-queue-webhooks.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-queue-webhooks.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetQueueWebhooks( health.WithGetQueueWebhooksThreshold(0), ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-storage-local.md b/docs/examples/1.7.x/server-go/examples/health/get-storage-local.md index e58b944497..4e88e0a555 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-storage-local.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-storage-local.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetStorageLocal( ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-storage.md b/docs/examples/1.7.x/server-go/examples/health/get-storage.md index 73ae964d51..3ec9ed8f6d 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-storage.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-storage.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetStorage( ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get-time.md b/docs/examples/1.7.x/server-go/examples/health/get-time.md index 43c0ca46a4..323746e93d 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get-time.md +++ b/docs/examples/1.7.x/server-go/examples/health/get-time.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.GetTime( ) diff --git a/docs/examples/1.7.x/server-go/examples/health/get.md b/docs/examples/1.7.x/server-go/examples/health/get.md index c9730f70dd..50443c9430 100644 --- a/docs/examples/1.7.x/server-go/examples/health/get.md +++ b/docs/examples/1.7.x/server-go/examples/health/get.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := health.NewHealth(client) + service := health.New(client) response, error := service.Get( ) diff --git a/docs/examples/1.7.x/server-go/examples/locale/get.md b/docs/examples/1.7.x/server-go/examples/locale/get.md index 055889b6ce..801df85bb4 100644 --- a/docs/examples/1.7.x/server-go/examples/locale/get.md +++ b/docs/examples/1.7.x/server-go/examples/locale/get.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := locale.NewLocale(client) + service := locale.New(client) response, error := service.Get( ) diff --git a/docs/examples/1.7.x/server-go/examples/locale/list-codes.md b/docs/examples/1.7.x/server-go/examples/locale/list-codes.md index a69a05d6cd..6625746b8a 100644 --- a/docs/examples/1.7.x/server-go/examples/locale/list-codes.md +++ b/docs/examples/1.7.x/server-go/examples/locale/list-codes.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := locale.NewLocale(client) + service := locale.New(client) response, error := service.ListCodes( ) diff --git a/docs/examples/1.7.x/server-go/examples/locale/list-continents.md b/docs/examples/1.7.x/server-go/examples/locale/list-continents.md index 0430fdbe99..f6e05db3c5 100644 --- a/docs/examples/1.7.x/server-go/examples/locale/list-continents.md +++ b/docs/examples/1.7.x/server-go/examples/locale/list-continents.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := locale.NewLocale(client) + service := locale.New(client) response, error := service.ListContinents( ) diff --git a/docs/examples/1.7.x/server-go/examples/locale/list-countries-e-u.md b/docs/examples/1.7.x/server-go/examples/locale/list-countries-e-u.md index 92bd24d1f8..9f85161f1e 100644 --- a/docs/examples/1.7.x/server-go/examples/locale/list-countries-e-u.md +++ b/docs/examples/1.7.x/server-go/examples/locale/list-countries-e-u.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := locale.NewLocale(client) + service := locale.New(client) response, error := service.ListCountriesEU( ) diff --git a/docs/examples/1.7.x/server-go/examples/locale/list-countries-phones.md b/docs/examples/1.7.x/server-go/examples/locale/list-countries-phones.md index 1615834103..e7438be997 100644 --- a/docs/examples/1.7.x/server-go/examples/locale/list-countries-phones.md +++ b/docs/examples/1.7.x/server-go/examples/locale/list-countries-phones.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := locale.NewLocale(client) + service := locale.New(client) response, error := service.ListCountriesPhones( ) diff --git a/docs/examples/1.7.x/server-go/examples/locale/list-countries.md b/docs/examples/1.7.x/server-go/examples/locale/list-countries.md index 25bbbd1538..5f00e6bca5 100644 --- a/docs/examples/1.7.x/server-go/examples/locale/list-countries.md +++ b/docs/examples/1.7.x/server-go/examples/locale/list-countries.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := locale.NewLocale(client) + service := locale.New(client) response, error := service.ListCountries( ) diff --git a/docs/examples/1.7.x/server-go/examples/locale/list-currencies.md b/docs/examples/1.7.x/server-go/examples/locale/list-currencies.md index e4bde5d9d9..6971eb12ec 100644 --- a/docs/examples/1.7.x/server-go/examples/locale/list-currencies.md +++ b/docs/examples/1.7.x/server-go/examples/locale/list-currencies.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := locale.NewLocale(client) + service := locale.New(client) response, error := service.ListCurrencies( ) diff --git a/docs/examples/1.7.x/server-go/examples/locale/list-languages.md b/docs/examples/1.7.x/server-go/examples/locale/list-languages.md index acce3181be..23bb409a61 100644 --- a/docs/examples/1.7.x/server-go/examples/locale/list-languages.md +++ b/docs/examples/1.7.x/server-go/examples/locale/list-languages.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := locale.NewLocale(client) + service := locale.New(client) response, error := service.ListLanguages( ) diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-apns-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/create-apns-provider.md index 620219e07d..36a5b747ce 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-apns-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-apns-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateApnsProvider( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-email.md b/docs/examples/1.7.x/server-go/examples/messaging/create-email.md index 3da6c88cf4..9915ae1398 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-email.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-email.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateEmail( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-fcm-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/create-fcm-provider.md index c70c340eb5..266b11ce5f 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-fcm-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-fcm-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateFcmProvider( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-mailgun-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/create-mailgun-provider.md index e265218ef4..655cdbf4c3 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-mailgun-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateMailgunProvider( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-msg91provider.md b/docs/examples/1.7.x/server-go/examples/messaging/create-msg91provider.md index 53660cbfa0..85c17ff242 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-msg91provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-msg91provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateMsg91Provider( "", "", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-push.md b/docs/examples/1.7.x/server-go/examples/messaging/create-push.md index 214d6ae0ed..86bd58bab6 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-push.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-push.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("") // Your project ID + client.WithKey("") // Your secret API key + ) - client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("") // Your project ID - client.SetKey("") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreatePush( "", messaging.WithCreatePushTitle(""), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/create-sendgrid-provider.md index 69375a23ca..5bc3bd3e9b 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-sendgrid-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateSendgridProvider( "<PROVIDER_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-sms.md b/docs/examples/1.7.x/server-go/examples/messaging/create-sms.md index 95c7738969..0afa78f5f6 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-sms.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-sms.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateSms( "<MESSAGE_ID>", "<CONTENT>", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-smtp-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/create-smtp-provider.md index 4c88b4ef7a..9d84f98a9f 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-smtp-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-smtp-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateSmtpProvider( "<PROVIDER_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-subscriber.md b/docs/examples/1.7.x/server-go/examples/messaging/create-subscriber.md index c4faa8544a..71a46d1cb2 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-subscriber.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-subscriber.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithJWT("<YOUR_JWT>") // Your secret JSON Web Token + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetJWT("<YOUR_JWT>") // Your secret JSON Web Token - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateSubscriber( "<TOPIC_ID>", "<SUBSCRIBER_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-telesign-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/create-telesign-provider.md index 11dd8c9bc6..e5afce8a43 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-telesign-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-telesign-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateTelesignProvider( "<PROVIDER_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-textmagic-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/create-textmagic-provider.md index a036549240..8e36b21dd3 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-textmagic-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateTextmagicProvider( "<PROVIDER_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-topic.md b/docs/examples/1.7.x/server-go/examples/messaging/create-topic.md index 0453089fbc..9ded515cf2 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-topic.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-topic.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateTopic( "<TOPIC_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-twilio-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/create-twilio-provider.md index cd8a993a6c..1a5d4c79b3 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-twilio-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-twilio-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateTwilioProvider( "<PROVIDER_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/create-vonage-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/create-vonage-provider.md index e17e8d885b..10d72a2a5b 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/create-vonage-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/create-vonage-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.CreateVonageProvider( "<PROVIDER_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/delete-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/delete-provider.md index 2c5b77d622..1b492df4a2 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/delete-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/delete-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.DeleteProvider( "<PROVIDER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/messaging/delete-subscriber.md b/docs/examples/1.7.x/server-go/examples/messaging/delete-subscriber.md index fec03f53f7..8bdbc6c26b 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/delete-subscriber.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/delete-subscriber.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithJWT("<YOUR_JWT>") // Your secret JSON Web Token + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetJWT("<YOUR_JWT>") // Your secret JSON Web Token - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.DeleteSubscriber( "<TOPIC_ID>", "<SUBSCRIBER_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/delete-topic.md b/docs/examples/1.7.x/server-go/examples/messaging/delete-topic.md index 3a9787b6ce..4bfc03f504 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/delete-topic.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/delete-topic.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.DeleteTopic( "<TOPIC_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/messaging/delete.md b/docs/examples/1.7.x/server-go/examples/messaging/delete.md index 4d5accd22f..da0cc65cec 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/delete.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/delete.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.Delete( "<MESSAGE_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/messaging/get-message.md b/docs/examples/1.7.x/server-go/examples/messaging/get-message.md index d6db3188c8..0273ce7373 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/get-message.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/get-message.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.GetMessage( "<MESSAGE_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/messaging/get-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/get-provider.md index ff2bab3acf..f3736147ea 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/get-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/get-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.GetProvider( "<PROVIDER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/messaging/get-subscriber.md b/docs/examples/1.7.x/server-go/examples/messaging/get-subscriber.md index 47fccf23cd..da46b98e6e 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/get-subscriber.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/get-subscriber.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.GetSubscriber( "<TOPIC_ID>", "<SUBSCRIBER_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/messaging/get-topic.md b/docs/examples/1.7.x/server-go/examples/messaging/get-topic.md index a332f55ba4..005acefe3d 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/get-topic.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/get-topic.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.GetTopic( "<TOPIC_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/messaging/list-message-logs.md b/docs/examples/1.7.x/server-go/examples/messaging/list-message-logs.md index b4a5528b41..2af8b23fc8 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/list-message-logs.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/list-message-logs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.ListMessageLogs( "<MESSAGE_ID>", messaging.WithListMessageLogsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/list-messages.md b/docs/examples/1.7.x/server-go/examples/messaging/list-messages.md index f1ca97d3fe..afc5646f02 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/list-messages.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/list-messages.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.ListMessages( messaging.WithListMessagesQueries([]interface{}{}), messaging.WithListMessagesSearch("<SEARCH>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/list-provider-logs.md b/docs/examples/1.7.x/server-go/examples/messaging/list-provider-logs.md index 945dbcfd4e..665916c968 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/list-provider-logs.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/list-provider-logs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.ListProviderLogs( "<PROVIDER_ID>", messaging.WithListProviderLogsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/list-providers.md b/docs/examples/1.7.x/server-go/examples/messaging/list-providers.md index 57c09a2061..20c23231b2 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/list-providers.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/list-providers.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.ListProviders( messaging.WithListProvidersQueries([]interface{}{}), messaging.WithListProvidersSearch("<SEARCH>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/list-subscriber-logs.md b/docs/examples/1.7.x/server-go/examples/messaging/list-subscriber-logs.md index cb2f050dd9..b794781ad1 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/list-subscriber-logs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.ListSubscriberLogs( "<SUBSCRIBER_ID>", messaging.WithListSubscriberLogsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/list-subscribers.md b/docs/examples/1.7.x/server-go/examples/messaging/list-subscribers.md index 045777d8c4..98c63eb0b6 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/list-subscribers.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/list-subscribers.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.ListSubscribers( "<TOPIC_ID>", messaging.WithListSubscribersQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/list-targets.md b/docs/examples/1.7.x/server-go/examples/messaging/list-targets.md index 9cc65e0d1c..3df399eab3 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/list-targets.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/list-targets.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.ListTargets( "<MESSAGE_ID>", messaging.WithListTargetsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/list-topic-logs.md b/docs/examples/1.7.x/server-go/examples/messaging/list-topic-logs.md index 2e928dbfc7..d972c202ed 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/list-topic-logs.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/list-topic-logs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.ListTopicLogs( "<TOPIC_ID>", messaging.WithListTopicLogsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/list-topics.md b/docs/examples/1.7.x/server-go/examples/messaging/list-topics.md index 69574ae02f..ca9dba1528 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/list-topics.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/list-topics.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.ListTopics( messaging.WithListTopicsQueries([]interface{}{}), messaging.WithListTopicsSearch("<SEARCH>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-apns-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/update-apns-provider.md index aac3e39c6e..74e4fa56f8 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-apns-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-apns-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateApnsProvider( "<PROVIDER_ID>", messaging.WithUpdateApnsProviderName("<NAME>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-email.md b/docs/examples/1.7.x/server-go/examples/messaging/update-email.md index f1e9f081d2..7dd06e3ea2 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-email.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-email.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateEmail( "<MESSAGE_ID>", messaging.WithUpdateEmailTopics([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-fcm-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/update-fcm-provider.md index 55e4b90363..c70327a022 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-fcm-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-fcm-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateFcmProvider( "<PROVIDER_ID>", messaging.WithUpdateFcmProviderName("<NAME>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-mailgun-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/update-mailgun-provider.md index 5bb229f348..80f078b056 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-mailgun-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateMailgunProvider( "<PROVIDER_ID>", messaging.WithUpdateMailgunProviderName("<NAME>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-msg91provider.md b/docs/examples/1.7.x/server-go/examples/messaging/update-msg91provider.md index d19c500262..70dbad455b 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-msg91provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-msg91provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateMsg91Provider( "<PROVIDER_ID>", messaging.WithUpdateMsg91ProviderName("<NAME>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-push.md b/docs/examples/1.7.x/server-go/examples/messaging/update-push.md index 856b95dc1b..e68bd77311 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-push.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-push.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdatePush( "<MESSAGE_ID>", messaging.WithUpdatePushTopics([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/update-sendgrid-provider.md index 5742b44874..9c442e26e5 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-sendgrid-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateSendgridProvider( "<PROVIDER_ID>", messaging.WithUpdateSendgridProviderName("<NAME>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-sms.md b/docs/examples/1.7.x/server-go/examples/messaging/update-sms.md index 09b3456d38..f62798e298 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-sms.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-sms.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateSms( "<MESSAGE_ID>", messaging.WithUpdateSmsTopics([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-smtp-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/update-smtp-provider.md index b99f86e123..ccfb91b1b9 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-smtp-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-smtp-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateSmtpProvider( "<PROVIDER_ID>", messaging.WithUpdateSmtpProviderName("<NAME>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-telesign-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/update-telesign-provider.md index 5fb99a68ec..77549380c8 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-telesign-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-telesign-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateTelesignProvider( "<PROVIDER_ID>", messaging.WithUpdateTelesignProviderName("<NAME>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-textmagic-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/update-textmagic-provider.md index 24e619cc7f..55350f7a1e 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-textmagic-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateTextmagicProvider( "<PROVIDER_ID>", messaging.WithUpdateTextmagicProviderName("<NAME>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-topic.md b/docs/examples/1.7.x/server-go/examples/messaging/update-topic.md index ab8902b4b2..a83b5e4852 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-topic.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-topic.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateTopic( "<TOPIC_ID>", messaging.WithUpdateTopicName("<NAME>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-twilio-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/update-twilio-provider.md index 316a2516d1..61b95dabf1 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-twilio-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-twilio-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateTwilioProvider( "<PROVIDER_ID>", messaging.WithUpdateTwilioProviderName("<NAME>"), diff --git a/docs/examples/1.7.x/server-go/examples/messaging/update-vonage-provider.md b/docs/examples/1.7.x/server-go/examples/messaging/update-vonage-provider.md index d17452140a..4cfc03c2b5 100644 --- a/docs/examples/1.7.x/server-go/examples/messaging/update-vonage-provider.md +++ b/docs/examples/1.7.x/server-go/examples/messaging/update-vonage-provider.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := messaging.NewMessaging(client) + service := messaging.New(client) response, error := service.UpdateVonageProvider( "<PROVIDER_ID>", messaging.WithUpdateVonageProviderName("<NAME>"), diff --git a/docs/examples/1.7.x/server-go/examples/sites/create-deployment.md b/docs/examples/1.7.x/server-go/examples/sites/create-deployment.md index 0e97c8083a..5a13b3e152 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/create-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/sites/create-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.CreateDeployment( "<SITE_ID>", file.NewInputFile("/path/to/file.png", "file.png"), diff --git a/docs/examples/1.7.x/server-go/examples/sites/create-duplicate-deployment.md b/docs/examples/1.7.x/server-go/examples/sites/create-duplicate-deployment.md index a128fda185..84b4932b36 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/create-duplicate-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/sites/create-duplicate-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.CreateDuplicateDeployment( "<SITE_ID>", "<DEPLOYMENT_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/create-template-deployment.md b/docs/examples/1.7.x/server-go/examples/sites/create-template-deployment.md index 2c1e8fb5c5..b67f65f6c9 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/create-template-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/sites/create-template-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.CreateTemplateDeployment( "<SITE_ID>", "<REPOSITORY>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/create-variable.md b/docs/examples/1.7.x/server-go/examples/sites/create-variable.md index 1660ad24a1..05148190e9 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/create-variable.md +++ b/docs/examples/1.7.x/server-go/examples/sites/create-variable.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.CreateVariable( "<SITE_ID>", "<KEY>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/create-vcs-deployment.md b/docs/examples/1.7.x/server-go/examples/sites/create-vcs-deployment.md index 2135f71edb..c13edc5900 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/create-vcs-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/sites/create-vcs-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.CreateVcsDeployment( "<SITE_ID>", "branch", diff --git a/docs/examples/1.7.x/server-go/examples/sites/create.md b/docs/examples/1.7.x/server-go/examples/sites/create.md index c683404d86..f87a3068a2 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/create.md +++ b/docs/examples/1.7.x/server-go/examples/sites/create.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.Create( "<SITE_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/delete-deployment.md b/docs/examples/1.7.x/server-go/examples/sites/delete-deployment.md index 83daf67634..5e5de1a888 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/delete-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/sites/delete-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.DeleteDeployment( "<SITE_ID>", "<DEPLOYMENT_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/delete-log.md b/docs/examples/1.7.x/server-go/examples/sites/delete-log.md index 6f17e84dc4..fe3add16fe 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/delete-log.md +++ b/docs/examples/1.7.x/server-go/examples/sites/delete-log.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.DeleteLog( "<SITE_ID>", "<LOG_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/delete-variable.md b/docs/examples/1.7.x/server-go/examples/sites/delete-variable.md index 80f8b7cda9..389d454c4c 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/delete-variable.md +++ b/docs/examples/1.7.x/server-go/examples/sites/delete-variable.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.DeleteVariable( "<SITE_ID>", "<VARIABLE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/delete.md b/docs/examples/1.7.x/server-go/examples/sites/delete.md index 4015d9c51e..184276dc4b 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/delete.md +++ b/docs/examples/1.7.x/server-go/examples/sites/delete.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.Delete( "<SITE_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/sites/get-deployment-download.md b/docs/examples/1.7.x/server-go/examples/sites/get-deployment-download.md index 1e97fba0c6..a90d358073 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/get-deployment-download.md +++ b/docs/examples/1.7.x/server-go/examples/sites/get-deployment-download.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.GetDeploymentDownload( "<SITE_ID>", "<DEPLOYMENT_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/get-deployment.md b/docs/examples/1.7.x/server-go/examples/sites/get-deployment.md index cf4be1f92e..17d066e8fe 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/get-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/sites/get-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.GetDeployment( "<SITE_ID>", "<DEPLOYMENT_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/get-log.md b/docs/examples/1.7.x/server-go/examples/sites/get-log.md index 2b19b2b8a8..ca0031546d 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/get-log.md +++ b/docs/examples/1.7.x/server-go/examples/sites/get-log.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.GetLog( "<SITE_ID>", "<LOG_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/get-variable.md b/docs/examples/1.7.x/server-go/examples/sites/get-variable.md index 6c8395a5db..55f8ddf6ca 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/get-variable.md +++ b/docs/examples/1.7.x/server-go/examples/sites/get-variable.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.GetVariable( "<SITE_ID>", "<VARIABLE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/get.md b/docs/examples/1.7.x/server-go/examples/sites/get.md index a2fae14dff..e876766da8 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/get.md +++ b/docs/examples/1.7.x/server-go/examples/sites/get.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.Get( "<SITE_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/sites/list-deployments.md b/docs/examples/1.7.x/server-go/examples/sites/list-deployments.md index f81580f39f..b6ab37ea79 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/list-deployments.md +++ b/docs/examples/1.7.x/server-go/examples/sites/list-deployments.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.ListDeployments( "<SITE_ID>", sites.WithListDeploymentsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/sites/list-frameworks.md b/docs/examples/1.7.x/server-go/examples/sites/list-frameworks.md index c134c0bf40..dae9a1814d 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/list-frameworks.md +++ b/docs/examples/1.7.x/server-go/examples/sites/list-frameworks.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.ListFrameworks( ) diff --git a/docs/examples/1.7.x/server-go/examples/sites/list-logs.md b/docs/examples/1.7.x/server-go/examples/sites/list-logs.md index 7d7a841b64..1c756cdbb6 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/list-logs.md +++ b/docs/examples/1.7.x/server-go/examples/sites/list-logs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.ListLogs( "<SITE_ID>", sites.WithListLogsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/sites/list-specifications.md b/docs/examples/1.7.x/server-go/examples/sites/list-specifications.md index 4136f61881..96d74c7fc3 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/list-specifications.md +++ b/docs/examples/1.7.x/server-go/examples/sites/list-specifications.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.ListSpecifications( ) diff --git a/docs/examples/1.7.x/server-go/examples/sites/list-variables.md b/docs/examples/1.7.x/server-go/examples/sites/list-variables.md index e3070ad75b..c6d329736d 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/list-variables.md +++ b/docs/examples/1.7.x/server-go/examples/sites/list-variables.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.ListVariables( "<SITE_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/sites/list.md b/docs/examples/1.7.x/server-go/examples/sites/list.md index d879280802..e43442226a 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/list.md +++ b/docs/examples/1.7.x/server-go/examples/sites/list.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.List( sites.WithListQueries([]interface{}{}), sites.WithListSearch("<SEARCH>"), diff --git a/docs/examples/1.7.x/server-go/examples/sites/update-deployment-status.md b/docs/examples/1.7.x/server-go/examples/sites/update-deployment-status.md index efb388e3c6..3c8cd3201d 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/update-deployment-status.md +++ b/docs/examples/1.7.x/server-go/examples/sites/update-deployment-status.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.UpdateDeploymentStatus( "<SITE_ID>", "<DEPLOYMENT_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/update-site-deployment.md b/docs/examples/1.7.x/server-go/examples/sites/update-site-deployment.md index 5904a76a74..806fbb35a6 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/update-site-deployment.md +++ b/docs/examples/1.7.x/server-go/examples/sites/update-site-deployment.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.UpdateSiteDeployment( "<SITE_ID>", "<DEPLOYMENT_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/update-variable.md b/docs/examples/1.7.x/server-go/examples/sites/update-variable.md index d50fe8c046..c2f0506b44 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/update-variable.md +++ b/docs/examples/1.7.x/server-go/examples/sites/update-variable.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.UpdateVariable( "<SITE_ID>", "<VARIABLE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/sites/update.md b/docs/examples/1.7.x/server-go/examples/sites/update.md index 4001eb4f48..3dd53e283a 100644 --- a/docs/examples/1.7.x/server-go/examples/sites/update.md +++ b/docs/examples/1.7.x/server-go/examples/sites/update.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := sites.NewSites(client) + service := sites.New(client) response, error := service.Update( "<SITE_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/storage/create-bucket.md b/docs/examples/1.7.x/server-go/examples/storage/create-bucket.md index 39dc1d06d9..a2679d9894 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/create-bucket.md +++ b/docs/examples/1.7.x/server-go/examples/storage/create-bucket.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.CreateBucket( "<BUCKET_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/storage/create-file.md b/docs/examples/1.7.x/server-go/examples/storage/create-file.md index 1ca815c92e..4d87231490 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/create-file.md +++ b/docs/examples/1.7.x/server-go/examples/storage/create-file.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.CreateFile( "<BUCKET_ID>", "<FILE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/storage/delete-bucket.md b/docs/examples/1.7.x/server-go/examples/storage/delete-bucket.md index 37a3f69b25..28832a1187 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/delete-bucket.md +++ b/docs/examples/1.7.x/server-go/examples/storage/delete-bucket.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.DeleteBucket( "<BUCKET_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/storage/delete-file.md b/docs/examples/1.7.x/server-go/examples/storage/delete-file.md index 522aacae72..e616054107 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/delete-file.md +++ b/docs/examples/1.7.x/server-go/examples/storage/delete-file.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.DeleteFile( "<BUCKET_ID>", "<FILE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/storage/get-bucket.md b/docs/examples/1.7.x/server-go/examples/storage/get-bucket.md index b76ac37d25..acb722546e 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/get-bucket.md +++ b/docs/examples/1.7.x/server-go/examples/storage/get-bucket.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.GetBucket( "<BUCKET_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/storage/get-file-download.md b/docs/examples/1.7.x/server-go/examples/storage/get-file-download.md index 9aa461de89..c0a1724eac 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/get-file-download.md +++ b/docs/examples/1.7.x/server-go/examples/storage/get-file-download.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.GetFileDownload( "<BUCKET_ID>", "<FILE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/storage/get-file-preview.md b/docs/examples/1.7.x/server-go/examples/storage/get-file-preview.md index 511cad1325..5d7d75a4f8 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/get-file-preview.md +++ b/docs/examples/1.7.x/server-go/examples/storage/get-file-preview.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.GetFilePreview( "<BUCKET_ID>", "<FILE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/storage/get-file-view.md b/docs/examples/1.7.x/server-go/examples/storage/get-file-view.md index 5832517534..ca59105821 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/get-file-view.md +++ b/docs/examples/1.7.x/server-go/examples/storage/get-file-view.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.GetFileView( "<BUCKET_ID>", "<FILE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/storage/get-file.md b/docs/examples/1.7.x/server-go/examples/storage/get-file.md index 824c86f054..b33170e93c 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/get-file.md +++ b/docs/examples/1.7.x/server-go/examples/storage/get-file.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.GetFile( "<BUCKET_ID>", "<FILE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/storage/list-buckets.md b/docs/examples/1.7.x/server-go/examples/storage/list-buckets.md index 00dd8d657b..79f4c4b3e4 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/list-buckets.md +++ b/docs/examples/1.7.x/server-go/examples/storage/list-buckets.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.ListBuckets( storage.WithListBucketsQueries([]interface{}{}), storage.WithListBucketsSearch("<SEARCH>"), diff --git a/docs/examples/1.7.x/server-go/examples/storage/list-files.md b/docs/examples/1.7.x/server-go/examples/storage/list-files.md index a84dfac6fd..2c2652a97e 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/list-files.md +++ b/docs/examples/1.7.x/server-go/examples/storage/list-files.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.ListFiles( "<BUCKET_ID>", storage.WithListFilesQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/storage/update-bucket.md b/docs/examples/1.7.x/server-go/examples/storage/update-bucket.md index 58efff687b..ac28e5b649 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/update-bucket.md +++ b/docs/examples/1.7.x/server-go/examples/storage/update-bucket.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.UpdateBucket( "<BUCKET_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/storage/update-file.md b/docs/examples/1.7.x/server-go/examples/storage/update-file.md index f1705138e9..d6887a82c1 100644 --- a/docs/examples/1.7.x/server-go/examples/storage/update-file.md +++ b/docs/examples/1.7.x/server-go/examples/storage/update-file.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := storage.NewStorage(client) + service := storage.New(client) response, error := service.UpdateFile( "<BUCKET_ID>", "<FILE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/teams/create-membership.md b/docs/examples/1.7.x/server-go/examples/teams/create-membership.md index 90c3d82348..e6cfb8b9c8 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/create-membership.md +++ b/docs/examples/1.7.x/server-go/examples/teams/create-membership.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.CreateMembership( "<TEAM_ID>", []interface{}{}, diff --git a/docs/examples/1.7.x/server-go/examples/teams/create.md b/docs/examples/1.7.x/server-go/examples/teams/create.md index 1898936941..773da7afcd 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/create.md +++ b/docs/examples/1.7.x/server-go/examples/teams/create.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.Create( "<TEAM_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/teams/delete-membership.md b/docs/examples/1.7.x/server-go/examples/teams/delete-membership.md index 78810817a9..5ffee885fb 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/delete-membership.md +++ b/docs/examples/1.7.x/server-go/examples/teams/delete-membership.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.DeleteMembership( "<TEAM_ID>", "<MEMBERSHIP_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/teams/delete.md b/docs/examples/1.7.x/server-go/examples/teams/delete.md index fb4771605d..c66c7056bd 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/delete.md +++ b/docs/examples/1.7.x/server-go/examples/teams/delete.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.Delete( "<TEAM_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/teams/get-membership.md b/docs/examples/1.7.x/server-go/examples/teams/get-membership.md index c61b9c57c3..466ab72059 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/get-membership.md +++ b/docs/examples/1.7.x/server-go/examples/teams/get-membership.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.GetMembership( "<TEAM_ID>", "<MEMBERSHIP_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/teams/get-prefs.md b/docs/examples/1.7.x/server-go/examples/teams/get-prefs.md index c237cd144a..d8400e420a 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/get-prefs.md +++ b/docs/examples/1.7.x/server-go/examples/teams/get-prefs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.GetPrefs( "<TEAM_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/teams/get.md b/docs/examples/1.7.x/server-go/examples/teams/get.md index c29e9fa786..0f503c7f5b 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/get.md +++ b/docs/examples/1.7.x/server-go/examples/teams/get.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.Get( "<TEAM_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/teams/list-memberships.md b/docs/examples/1.7.x/server-go/examples/teams/list-memberships.md index 1e8fb45ca7..90b2babcb0 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/list-memberships.md +++ b/docs/examples/1.7.x/server-go/examples/teams/list-memberships.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.ListMemberships( "<TEAM_ID>", teams.WithListMembershipsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/teams/list.md b/docs/examples/1.7.x/server-go/examples/teams/list.md index c4b109f1f3..e70ca11587 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/list.md +++ b/docs/examples/1.7.x/server-go/examples/teams/list.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.List( teams.WithListQueries([]interface{}{}), teams.WithListSearch("<SEARCH>"), diff --git a/docs/examples/1.7.x/server-go/examples/teams/update-membership-status.md b/docs/examples/1.7.x/server-go/examples/teams/update-membership-status.md index fbec3b8e84..c9e1215971 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/update-membership-status.md +++ b/docs/examples/1.7.x/server-go/examples/teams/update-membership-status.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.UpdateMembershipStatus( "<TEAM_ID>", "<MEMBERSHIP_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/teams/update-membership.md b/docs/examples/1.7.x/server-go/examples/teams/update-membership.md index 1b478a1913..8721a5ed6d 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/update-membership.md +++ b/docs/examples/1.7.x/server-go/examples/teams/update-membership.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.UpdateMembership( "<TEAM_ID>", "<MEMBERSHIP_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/teams/update-name.md b/docs/examples/1.7.x/server-go/examples/teams/update-name.md index a7b5da7c20..0d75a7bb32 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/update-name.md +++ b/docs/examples/1.7.x/server-go/examples/teams/update-name.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.UpdateName( "<TEAM_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/teams/update-prefs.md b/docs/examples/1.7.x/server-go/examples/teams/update-prefs.md index 6d395add21..e9631d5bf3 100644 --- a/docs/examples/1.7.x/server-go/examples/teams/update-prefs.md +++ b/docs/examples/1.7.x/server-go/examples/teams/update-prefs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithSession("") // The user session to authenticate with + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetSession("") // The user session to authenticate with - - service := teams.NewTeams(client) + service := teams.New(client) response, error := service.UpdatePrefs( "<TEAM_ID>", map[string]interface{}{}, diff --git a/docs/examples/1.7.x/server-go/examples/tokens/create-file-token.md b/docs/examples/1.7.x/server-go/examples/tokens/create-file-token.md index 8343e3e077..3109062d9e 100644 --- a/docs/examples/1.7.x/server-go/examples/tokens/create-file-token.md +++ b/docs/examples/1.7.x/server-go/examples/tokens/create-file-token.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := tokens.NewTokens(client) + service := tokens.New(client) response, error := service.CreateFileToken( "<BUCKET_ID>", "<FILE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/tokens/delete.md b/docs/examples/1.7.x/server-go/examples/tokens/delete.md index 73322e6c9b..a376bab09b 100644 --- a/docs/examples/1.7.x/server-go/examples/tokens/delete.md +++ b/docs/examples/1.7.x/server-go/examples/tokens/delete.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := tokens.NewTokens(client) + service := tokens.New(client) response, error := service.Delete( "<TOKEN_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/tokens/get.md b/docs/examples/1.7.x/server-go/examples/tokens/get.md index 64b53a24b9..4c01f68669 100644 --- a/docs/examples/1.7.x/server-go/examples/tokens/get.md +++ b/docs/examples/1.7.x/server-go/examples/tokens/get.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := tokens.NewTokens(client) + service := tokens.New(client) response, error := service.Get( "<TOKEN_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/tokens/list.md b/docs/examples/1.7.x/server-go/examples/tokens/list.md index e4864cd74a..99876af081 100644 --- a/docs/examples/1.7.x/server-go/examples/tokens/list.md +++ b/docs/examples/1.7.x/server-go/examples/tokens/list.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := tokens.NewTokens(client) + service := tokens.New(client) response, error := service.List( "<BUCKET_ID>", "<FILE_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/tokens/update.md b/docs/examples/1.7.x/server-go/examples/tokens/update.md index 94c30ece79..eaba8eaafb 100644 --- a/docs/examples/1.7.x/server-go/examples/tokens/update.md +++ b/docs/examples/1.7.x/server-go/examples/tokens/update.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := tokens.NewTokens(client) + service := tokens.New(client) response, error := service.Update( "<TOKEN_ID>", tokens.WithUpdateExpire(""), diff --git a/docs/examples/1.7.x/server-go/examples/users/create-argon2user.md b/docs/examples/1.7.x/server-go/examples/users/create-argon2user.md index 44eaafbcd4..28565ff01c 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-argon2user.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-argon2user.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreateArgon2User( "<USER_ID>", "email@example.com", diff --git a/docs/examples/1.7.x/server-go/examples/users/create-bcrypt-user.md b/docs/examples/1.7.x/server-go/examples/users/create-bcrypt-user.md index d818598c70..fedf00327e 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-bcrypt-user.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-bcrypt-user.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreateBcryptUser( "<USER_ID>", "email@example.com", diff --git a/docs/examples/1.7.x/server-go/examples/users/create-j-w-t.md b/docs/examples/1.7.x/server-go/examples/users/create-j-w-t.md index dc1e51b195..c335ab4ea1 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-j-w-t.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-j-w-t.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreateJWT( "<USER_ID>", users.WithCreateJWTSessionId("<SESSION_ID>"), diff --git a/docs/examples/1.7.x/server-go/examples/users/create-m-d5user.md b/docs/examples/1.7.x/server-go/examples/users/create-m-d5user.md index 1dba39c5fd..369aab7ac7 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-m-d5user.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-m-d5user.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreateMD5User( "<USER_ID>", "email@example.com", diff --git a/docs/examples/1.7.x/server-go/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.7.x/server-go/examples/users/create-mfa-recovery-codes.md index 3078f0993b..1c2097e571 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-mfa-recovery-codes.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreateMfaRecoveryCodes( "<USER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/users/create-p-h-pass-user.md b/docs/examples/1.7.x/server-go/examples/users/create-p-h-pass-user.md index c0380bd9f3..2a09bec811 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-p-h-pass-user.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-p-h-pass-user.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreatePHPassUser( "<USER_ID>", "email@example.com", diff --git a/docs/examples/1.7.x/server-go/examples/users/create-s-h-a-user.md b/docs/examples/1.7.x/server-go/examples/users/create-s-h-a-user.md index 93aa77e853..2bc05f91f9 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-s-h-a-user.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-s-h-a-user.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreateSHAUser( "<USER_ID>", "email@example.com", diff --git a/docs/examples/1.7.x/server-go/examples/users/create-scrypt-modified-user.md b/docs/examples/1.7.x/server-go/examples/users/create-scrypt-modified-user.md index cd48f6c83f..f815121290 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-scrypt-modified-user.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreateScryptModifiedUser( "<USER_ID>", "email@example.com", diff --git a/docs/examples/1.7.x/server-go/examples/users/create-scrypt-user.md b/docs/examples/1.7.x/server-go/examples/users/create-scrypt-user.md index 65d70e986f..f2fde655d2 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-scrypt-user.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-scrypt-user.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreateScryptUser( "<USER_ID>", "email@example.com", diff --git a/docs/examples/1.7.x/server-go/examples/users/create-session.md b/docs/examples/1.7.x/server-go/examples/users/create-session.md index 92304e647d..b868319613 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-session.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-session.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreateSession( "<USER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/users/create-target.md b/docs/examples/1.7.x/server-go/examples/users/create-target.md index db42e2c391..71c449c603 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-target.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-target.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreateTarget( "<USER_ID>", "<TARGET_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/users/create-token.md b/docs/examples/1.7.x/server-go/examples/users/create-token.md index 6181a8d9d4..d50c7efc28 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create-token.md +++ b/docs/examples/1.7.x/server-go/examples/users/create-token.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.CreateToken( "<USER_ID>", users.WithCreateTokenLength(4), diff --git a/docs/examples/1.7.x/server-go/examples/users/create.md b/docs/examples/1.7.x/server-go/examples/users/create.md index 0ab673bc73..7cd8920bb2 100644 --- a/docs/examples/1.7.x/server-go/examples/users/create.md +++ b/docs/examples/1.7.x/server-go/examples/users/create.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.Create( "<USER_ID>", users.WithCreateEmail("email@example.com"), diff --git a/docs/examples/1.7.x/server-go/examples/users/delete-identity.md b/docs/examples/1.7.x/server-go/examples/users/delete-identity.md index 1095a1763a..f35a7917cc 100644 --- a/docs/examples/1.7.x/server-go/examples/users/delete-identity.md +++ b/docs/examples/1.7.x/server-go/examples/users/delete-identity.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.DeleteIdentity( "<IDENTITY_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/users/delete-mfa-authenticator.md b/docs/examples/1.7.x/server-go/examples/users/delete-mfa-authenticator.md index d61c5db0c8..bb845b90c1 100644 --- a/docs/examples/1.7.x/server-go/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/1.7.x/server-go/examples/users/delete-mfa-authenticator.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.DeleteMfaAuthenticator( "<USER_ID>", "totp", diff --git a/docs/examples/1.7.x/server-go/examples/users/delete-session.md b/docs/examples/1.7.x/server-go/examples/users/delete-session.md index 2a0de4c271..62f4bd5a89 100644 --- a/docs/examples/1.7.x/server-go/examples/users/delete-session.md +++ b/docs/examples/1.7.x/server-go/examples/users/delete-session.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.DeleteSession( "<USER_ID>", "<SESSION_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/users/delete-sessions.md b/docs/examples/1.7.x/server-go/examples/users/delete-sessions.md index ea15501819..235b2b1e9e 100644 --- a/docs/examples/1.7.x/server-go/examples/users/delete-sessions.md +++ b/docs/examples/1.7.x/server-go/examples/users/delete-sessions.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.DeleteSessions( "<USER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/users/delete-target.md b/docs/examples/1.7.x/server-go/examples/users/delete-target.md index d4cd4e51a8..ce942a9ead 100644 --- a/docs/examples/1.7.x/server-go/examples/users/delete-target.md +++ b/docs/examples/1.7.x/server-go/examples/users/delete-target.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.DeleteTarget( "<USER_ID>", "<TARGET_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/users/delete.md b/docs/examples/1.7.x/server-go/examples/users/delete.md index 2c359e3ab0..1654957c95 100644 --- a/docs/examples/1.7.x/server-go/examples/users/delete.md +++ b/docs/examples/1.7.x/server-go/examples/users/delete.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.Delete( "<USER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.7.x/server-go/examples/users/get-mfa-recovery-codes.md index 485075546f..8b16231be7 100644 --- a/docs/examples/1.7.x/server-go/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/1.7.x/server-go/examples/users/get-mfa-recovery-codes.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.GetMfaRecoveryCodes( "<USER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/users/get-prefs.md b/docs/examples/1.7.x/server-go/examples/users/get-prefs.md index 0dba272388..4d3298fab8 100644 --- a/docs/examples/1.7.x/server-go/examples/users/get-prefs.md +++ b/docs/examples/1.7.x/server-go/examples/users/get-prefs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.GetPrefs( "<USER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/users/get-target.md b/docs/examples/1.7.x/server-go/examples/users/get-target.md index b1291d7490..481052d75d 100644 --- a/docs/examples/1.7.x/server-go/examples/users/get-target.md +++ b/docs/examples/1.7.x/server-go/examples/users/get-target.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.GetTarget( "<USER_ID>", "<TARGET_ID>", diff --git a/docs/examples/1.7.x/server-go/examples/users/get.md b/docs/examples/1.7.x/server-go/examples/users/get.md index c6aae29d5d..a4da4b741d 100644 --- a/docs/examples/1.7.x/server-go/examples/users/get.md +++ b/docs/examples/1.7.x/server-go/examples/users/get.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.Get( "<USER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/users/list-identities.md b/docs/examples/1.7.x/server-go/examples/users/list-identities.md index 063b9100fb..a9916f5fa3 100644 --- a/docs/examples/1.7.x/server-go/examples/users/list-identities.md +++ b/docs/examples/1.7.x/server-go/examples/users/list-identities.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.ListIdentities( users.WithListIdentitiesQueries([]interface{}{}), users.WithListIdentitiesSearch("<SEARCH>"), diff --git a/docs/examples/1.7.x/server-go/examples/users/list-logs.md b/docs/examples/1.7.x/server-go/examples/users/list-logs.md index 674668b965..bb36dc531c 100644 --- a/docs/examples/1.7.x/server-go/examples/users/list-logs.md +++ b/docs/examples/1.7.x/server-go/examples/users/list-logs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.ListLogs( "<USER_ID>", users.WithListLogsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/users/list-memberships.md b/docs/examples/1.7.x/server-go/examples/users/list-memberships.md index 08b9a884f4..1591603971 100644 --- a/docs/examples/1.7.x/server-go/examples/users/list-memberships.md +++ b/docs/examples/1.7.x/server-go/examples/users/list-memberships.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.ListMemberships( "<USER_ID>", users.WithListMembershipsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/users/list-mfa-factors.md b/docs/examples/1.7.x/server-go/examples/users/list-mfa-factors.md index 1c39b87a66..8709b21ae7 100644 --- a/docs/examples/1.7.x/server-go/examples/users/list-mfa-factors.md +++ b/docs/examples/1.7.x/server-go/examples/users/list-mfa-factors.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.ListMfaFactors( "<USER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/users/list-sessions.md b/docs/examples/1.7.x/server-go/examples/users/list-sessions.md index 835c23b1bc..be4202400c 100644 --- a/docs/examples/1.7.x/server-go/examples/users/list-sessions.md +++ b/docs/examples/1.7.x/server-go/examples/users/list-sessions.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.ListSessions( "<USER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/users/list-targets.md b/docs/examples/1.7.x/server-go/examples/users/list-targets.md index 84c2c312a9..ed78ade5a8 100644 --- a/docs/examples/1.7.x/server-go/examples/users/list-targets.md +++ b/docs/examples/1.7.x/server-go/examples/users/list-targets.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.ListTargets( "<USER_ID>", users.WithListTargetsQueries([]interface{}{}), diff --git a/docs/examples/1.7.x/server-go/examples/users/list.md b/docs/examples/1.7.x/server-go/examples/users/list.md index 247ad4c2e7..c74a59a7e2 100644 --- a/docs/examples/1.7.x/server-go/examples/users/list.md +++ b/docs/examples/1.7.x/server-go/examples/users/list.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.List( users.WithListQueries([]interface{}{}), users.WithListSearch("<SEARCH>"), diff --git a/docs/examples/1.7.x/server-go/examples/users/update-email-verification.md b/docs/examples/1.7.x/server-go/examples/users/update-email-verification.md index 70f5a10757..411cd831c5 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-email-verification.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-email-verification.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdateEmailVerification( "<USER_ID>", false, diff --git a/docs/examples/1.7.x/server-go/examples/users/update-email.md b/docs/examples/1.7.x/server-go/examples/users/update-email.md index 697783b967..1e01350731 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-email.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-email.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdateEmail( "<USER_ID>", "email@example.com", diff --git a/docs/examples/1.7.x/server-go/examples/users/update-labels.md b/docs/examples/1.7.x/server-go/examples/users/update-labels.md index a65d2ead9d..0b735cdef5 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-labels.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-labels.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdateLabels( "<USER_ID>", []interface{}{}, diff --git a/docs/examples/1.7.x/server-go/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.7.x/server-go/examples/users/update-mfa-recovery-codes.md index eb47e2ee09..d495b752de 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-mfa-recovery-codes.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdateMfaRecoveryCodes( "<USER_ID>", ) diff --git a/docs/examples/1.7.x/server-go/examples/users/update-mfa.md b/docs/examples/1.7.x/server-go/examples/users/update-mfa.md index 756863799f..cfcddbf5e1 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-mfa.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-mfa.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdateMfa( "<USER_ID>", false, diff --git a/docs/examples/1.7.x/server-go/examples/users/update-name.md b/docs/examples/1.7.x/server-go/examples/users/update-name.md index 8ef173c2e3..da9f3d5ac7 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-name.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-name.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdateName( "<USER_ID>", "<NAME>", diff --git a/docs/examples/1.7.x/server-go/examples/users/update-password.md b/docs/examples/1.7.x/server-go/examples/users/update-password.md index 2f9efac65f..d09f5bb92c 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-password.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-password.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdatePassword( "<USER_ID>", "", diff --git a/docs/examples/1.7.x/server-go/examples/users/update-phone-verification.md b/docs/examples/1.7.x/server-go/examples/users/update-phone-verification.md index c94fbd861e..fdf01898ea 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-phone-verification.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-phone-verification.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdatePhoneVerification( "<USER_ID>", false, diff --git a/docs/examples/1.7.x/server-go/examples/users/update-phone.md b/docs/examples/1.7.x/server-go/examples/users/update-phone.md index 77d20162f9..f4f5b5d01d 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-phone.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-phone.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdatePhone( "<USER_ID>", "+12065550100", diff --git a/docs/examples/1.7.x/server-go/examples/users/update-prefs.md b/docs/examples/1.7.x/server-go/examples/users/update-prefs.md index f7889a6337..75cb55b868 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-prefs.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-prefs.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdatePrefs( "<USER_ID>", map[string]interface{}{}, diff --git a/docs/examples/1.7.x/server-go/examples/users/update-status.md b/docs/examples/1.7.x/server-go/examples/users/update-status.md index 2349e4e0c9..964ed3bf92 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-status.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-status.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdateStatus( "<USER_ID>", false, diff --git a/docs/examples/1.7.x/server-go/examples/users/update-target.md b/docs/examples/1.7.x/server-go/examples/users/update-target.md index f8028b4483..2c1ab3b71e 100644 --- a/docs/examples/1.7.x/server-go/examples/users/update-target.md +++ b/docs/examples/1.7.x/server-go/examples/users/update-target.md @@ -7,13 +7,13 @@ import ( ) func main() { - client := client.NewClient() + client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + client.WithProject("<YOUR_PROJECT_ID>") // Your project ID + client.WithKey("<YOUR_API_KEY>") // Your secret API key + ) - client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - client.SetProject("<YOUR_PROJECT_ID>") // Your project ID - client.SetKey("<YOUR_API_KEY>") // Your secret API key - - service := users.NewUsers(client) + service := users.New(client) response, error := service.UpdateTarget( "<USER_ID>", "<TARGET_ID>", diff --git a/docs/examples/1.7.x/server-graphql/examples/databases/create-document.md b/docs/examples/1.7.x/server-graphql/examples/databases/create-document.md index 4e2d90660b..4f525d6b1f 100644 --- a/docs/examples/1.7.x/server-graphql/examples/databases/create-document.md +++ b/docs/examples/1.7.x/server-graphql/examples/databases/create-document.md @@ -7,6 +7,7 @@ mutation { permissions: ["read("any")"] ) { _id + _sequence _collectionId _databaseId _createdAt diff --git a/docs/examples/1.7.x/server-graphql/examples/databases/create-documents.md b/docs/examples/1.7.x/server-graphql/examples/databases/create-documents.md index 3e3a50f3ab..8ce79dcbb5 100644 --- a/docs/examples/1.7.x/server-graphql/examples/databases/create-documents.md +++ b/docs/examples/1.7.x/server-graphql/examples/databases/create-documents.md @@ -7,6 +7,7 @@ mutation { total documents { _id + _sequence _collectionId _databaseId _createdAt diff --git a/docs/examples/1.7.x/server-graphql/examples/databases/create-string-attribute.md b/docs/examples/1.7.x/server-graphql/examples/databases/create-string-attribute.md index 62d97d6962..489f9ce015 100644 --- a/docs/examples/1.7.x/server-graphql/examples/databases/create-string-attribute.md +++ b/docs/examples/1.7.x/server-graphql/examples/databases/create-string-attribute.md @@ -19,5 +19,6 @@ mutation { _updatedAt size default + encrypt } } diff --git a/docs/examples/1.7.x/server-graphql/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-graphql/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..2e7970049d --- /dev/null +++ b/docs/examples/1.7.x/server-graphql/examples/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +mutation { + databasesDecrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, + min: 0 + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.7.x/server-graphql/examples/databases/delete-documents.md b/docs/examples/1.7.x/server-graphql/examples/databases/delete-documents.md index ad5826f22a..5822d3b950 100644 --- a/docs/examples/1.7.x/server-graphql/examples/databases/delete-documents.md +++ b/docs/examples/1.7.x/server-graphql/examples/databases/delete-documents.md @@ -7,6 +7,7 @@ mutation { total documents { _id + _sequence _collectionId _databaseId _createdAt diff --git a/docs/examples/1.7.x/server-graphql/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-graphql/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..322ed69ced --- /dev/null +++ b/docs/examples/1.7.x/server-graphql/examples/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +mutation { + databasesIncrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, + max: 0 + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.7.x/server-graphql/examples/databases/update-document.md b/docs/examples/1.7.x/server-graphql/examples/databases/update-document.md index 5e80894620..aea605d9d7 100644 --- a/docs/examples/1.7.x/server-graphql/examples/databases/update-document.md +++ b/docs/examples/1.7.x/server-graphql/examples/databases/update-document.md @@ -7,6 +7,7 @@ mutation { permissions: ["read("any")"] ) { _id + _sequence _collectionId _databaseId _createdAt diff --git a/docs/examples/1.7.x/server-graphql/examples/databases/update-documents.md b/docs/examples/1.7.x/server-graphql/examples/databases/update-documents.md index c05acb16a0..83c0c07f84 100644 --- a/docs/examples/1.7.x/server-graphql/examples/databases/update-documents.md +++ b/docs/examples/1.7.x/server-graphql/examples/databases/update-documents.md @@ -8,6 +8,7 @@ mutation { total documents { _id + _sequence _collectionId _databaseId _createdAt diff --git a/docs/examples/1.7.x/server-graphql/examples/databases/update-string-attribute.md b/docs/examples/1.7.x/server-graphql/examples/databases/update-string-attribute.md index afafb307f5..f9398c9ca1 100644 --- a/docs/examples/1.7.x/server-graphql/examples/databases/update-string-attribute.md +++ b/docs/examples/1.7.x/server-graphql/examples/databases/update-string-attribute.md @@ -18,5 +18,6 @@ mutation { _updatedAt size default + encrypt } } diff --git a/docs/examples/1.7.x/server-graphql/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-graphql/examples/databases/upsert-document.md new file mode 100644 index 0000000000..9d1e753081 --- /dev/null +++ b/docs/examples/1.7.x/server-graphql/examples/databases/upsert-document.md @@ -0,0 +1,18 @@ +mutation { + databasesUpsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{}", + permissions: ["read("any")"] + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.7.x/server-graphql/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-graphql/examples/databases/upsert-documents.md index d6e7bba9a3..2bfb765915 100644 --- a/docs/examples/1.7.x/server-graphql/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-graphql/examples/databases/upsert-documents.md @@ -7,6 +7,7 @@ mutation { total documents { _id + _sequence _collectionId _databaseId _createdAt diff --git a/docs/examples/1.7.x/server-kotlin/java/databases/create-document.md b/docs/examples/1.7.x/server-kotlin/java/databases/create-document.md index 368b816219..5231be33d6 100644 --- a/docs/examples/1.7.x/server-kotlin/java/databases/create-document.md +++ b/docs/examples/1.7.x/server-kotlin/java/databases/create-document.md @@ -4,9 +4,8 @@ import io.appwrite.services.Databases; Client client = new Client() .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint - .setSession("") // The user session to authenticate with - .setKey("<YOUR_API_KEY>") // Your secret API key - .setJWT("<YOUR_JWT>"); // Your secret JSON Web Token + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with Databases databases = new Databases(client); diff --git a/docs/examples/1.7.x/server-kotlin/java/databases/create-documents.md b/docs/examples/1.7.x/server-kotlin/java/databases/create-documents.md index d816af366d..0de0c276ed 100644 --- a/docs/examples/1.7.x/server-kotlin/java/databases/create-documents.md +++ b/docs/examples/1.7.x/server-kotlin/java/databases/create-documents.md @@ -4,6 +4,7 @@ import io.appwrite.services.Databases; Client client = new Client() .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID .setKey("<YOUR_API_KEY>"); // Your secret API key Databases databases = new Databases(client); diff --git a/docs/examples/1.7.x/server-kotlin/java/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-kotlin/java/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..34b74726ff --- /dev/null +++ b/docs/examples/1.7.x/server-kotlin/java/databases/decrement-document-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.decrementDocumentAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "", // attribute + 0, // value (optional) + 0, // min (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.7.x/server-kotlin/java/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-kotlin/java/databases/increment-document-attribute.md new file mode 100644 index 0000000000..ca9c357f19 --- /dev/null +++ b/docs/examples/1.7.x/server-kotlin/java/databases/increment-document-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.incrementDocumentAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "", // attribute + 0, // value (optional) + 0, // max (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.7.x/server-kotlin/java/databases/upsert-document.md b/docs/examples/1.7.x/server-kotlin/java/databases/upsert-document.md new file mode 100644 index 0000000000..daa44141e2 --- /dev/null +++ b/docs/examples/1.7.x/server-kotlin/java/databases/upsert-document.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.upsertDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + mapOf( "a" to "b" ), // data + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.7.x/server-kotlin/java/databases/upsert-documents.md b/docs/examples/1.7.x/server-kotlin/java/databases/upsert-documents.md index e2f2a46337..95e9a33ef2 100644 --- a/docs/examples/1.7.x/server-kotlin/java/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-kotlin/java/databases/upsert-documents.md @@ -12,7 +12,7 @@ Databases databases = new Databases(client); databases.upsertDocuments( "<DATABASE_ID>", // databaseId "<COLLECTION_ID>", // collectionId - listOf(), // documents (optional) + listOf(), // documents new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/1.7.x/server-kotlin/java/functions/create-execution.md b/docs/examples/1.7.x/server-kotlin/java/functions/create-execution.md index 82d48fa55b..93efa0adf8 100644 --- a/docs/examples/1.7.x/server-kotlin/java/functions/create-execution.md +++ b/docs/examples/1.7.x/server-kotlin/java/functions/create-execution.md @@ -16,7 +16,7 @@ functions.createExecution( "<PATH>", // path (optional) ExecutionMethod.GET, // method (optional) mapOf( "a" to "b" ), // headers (optional) - "", // scheduledAt (optional) + "<SCHEDULED_AT>", // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/1.7.x/server-kotlin/kotlin/databases/create-document.md b/docs/examples/1.7.x/server-kotlin/kotlin/databases/create-document.md index 93da01eefa..695fdbdfaa 100644 --- a/docs/examples/1.7.x/server-kotlin/kotlin/databases/create-document.md +++ b/docs/examples/1.7.x/server-kotlin/kotlin/databases/create-document.md @@ -4,9 +4,8 @@ import io.appwrite.services.Databases val client = Client() .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID .setSession("") // The user session to authenticate with - .setKey("<YOUR_API_KEY>") // Your secret API key - .setJWT("<YOUR_JWT>") // Your secret JSON Web Token val databases = Databases(client) diff --git a/docs/examples/1.7.x/server-kotlin/kotlin/databases/create-documents.md b/docs/examples/1.7.x/server-kotlin/kotlin/databases/create-documents.md index 01692c62ad..41a98dc016 100644 --- a/docs/examples/1.7.x/server-kotlin/kotlin/databases/create-documents.md +++ b/docs/examples/1.7.x/server-kotlin/kotlin/databases/create-documents.md @@ -4,6 +4,7 @@ import io.appwrite.services.Databases val client = Client() .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID .setKey("<YOUR_API_KEY>") // Your secret API key val databases = Databases(client) diff --git a/docs/examples/1.7.x/server-kotlin/kotlin/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-kotlin/kotlin/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..05204d76c6 --- /dev/null +++ b/docs/examples/1.7.x/server-kotlin/kotlin/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.decrementDocumentAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + attribute = "", + value = 0, // optional + min = 0 // optional +) diff --git a/docs/examples/1.7.x/server-kotlin/kotlin/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-kotlin/kotlin/databases/increment-document-attribute.md new file mode 100644 index 0000000000..40c1224ae7 --- /dev/null +++ b/docs/examples/1.7.x/server-kotlin/kotlin/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.incrementDocumentAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + attribute = "", + value = 0, // optional + max = 0 // optional +) diff --git a/docs/examples/1.7.x/server-kotlin/kotlin/databases/upsert-document.md b/docs/examples/1.7.x/server-kotlin/kotlin/databases/upsert-document.md new file mode 100644 index 0000000000..d8be0e13db --- /dev/null +++ b/docs/examples/1.7.x/server-kotlin/kotlin/databases/upsert-document.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.upsertDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( "a" to "b" ), + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/1.7.x/server-kotlin/kotlin/databases/upsert-documents.md b/docs/examples/1.7.x/server-kotlin/kotlin/databases/upsert-documents.md index 7459b384a1..ca861c61b2 100644 --- a/docs/examples/1.7.x/server-kotlin/kotlin/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-kotlin/kotlin/databases/upsert-documents.md @@ -12,5 +12,5 @@ val databases = Databases(client) val response = databases.upsertDocuments( databaseId = "<DATABASE_ID>", collectionId = "<COLLECTION_ID>", - documents = listOf() // optional + documents = listOf() ) diff --git a/docs/examples/1.7.x/server-kotlin/kotlin/functions/create-execution.md b/docs/examples/1.7.x/server-kotlin/kotlin/functions/create-execution.md index 94bfa2310c..2734412232 100644 --- a/docs/examples/1.7.x/server-kotlin/kotlin/functions/create-execution.md +++ b/docs/examples/1.7.x/server-kotlin/kotlin/functions/create-execution.md @@ -16,5 +16,5 @@ val response = functions.createExecution( path = "<PATH>", // optional method = "GET", // optional headers = mapOf( "a" to "b" ), // optional - scheduledAt = "" // optional + scheduledAt = "<SCHEDULED_AT>" // optional ) diff --git a/docs/examples/1.7.x/server-nodejs/examples/databases/create-document.md b/docs/examples/1.7.x/server-nodejs/examples/databases/create-document.md index 44cfc3c199..a2e77b9241 100644 --- a/docs/examples/1.7.x/server-nodejs/examples/databases/create-document.md +++ b/docs/examples/1.7.x/server-nodejs/examples/databases/create-document.md @@ -2,9 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setKey('<YOUR_API_KEY>') // Your secret API key - .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with const databases = new sdk.Databases(client); diff --git a/docs/examples/1.7.x/server-nodejs/examples/databases/create-documents.md b/docs/examples/1.7.x/server-nodejs/examples/databases/create-documents.md index 1b2088221b..d73df44cd1 100644 --- a/docs/examples/1.7.x/server-nodejs/examples/databases/create-documents.md +++ b/docs/examples/1.7.x/server-nodejs/examples/databases/create-documents.md @@ -2,6 +2,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secret API key const databases = new sdk.Databases(client); diff --git a/docs/examples/1.7.x/server-nodejs/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-nodejs/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..6bfc5f17cd --- /dev/null +++ b/docs/examples/1.7.x/server-nodejs/examples/databases/decrement-document-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.decrementDocumentAttribute( + '<DATABASE_ID>', // databaseId + '<COLLECTION_ID>', // collectionId + '<DOCUMENT_ID>', // documentId + '', // attribute + null, // value (optional) + null // min (optional) +); diff --git a/docs/examples/1.7.x/server-nodejs/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-nodejs/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..0ba024514a --- /dev/null +++ b/docs/examples/1.7.x/server-nodejs/examples/databases/increment-document-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.incrementDocumentAttribute( + '<DATABASE_ID>', // databaseId + '<COLLECTION_ID>', // collectionId + '<DOCUMENT_ID>', // documentId + '', // attribute + null, // value (optional) + null // max (optional) +); diff --git a/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-document.md new file mode 100644 index 0000000000..fcc62d601c --- /dev/null +++ b/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-document.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.upsertDocument( + '<DATABASE_ID>', // databaseId + '<COLLECTION_ID>', // collectionId + '<DOCUMENT_ID>', // documentId + {}, // data + ["read("any")"] // permissions (optional) +); diff --git a/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-documents.md index 5b4795627d..425b7ba51f 100644 --- a/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-documents.md @@ -10,5 +10,5 @@ const databases = new sdk.Databases(client); const result = await databases.upsertDocuments( '<DATABASE_ID>', // databaseId '<COLLECTION_ID>', // collectionId - [] // documents (optional) + [] // documents ); diff --git a/docs/examples/1.7.x/server-php/examples/databases/create-document.md b/docs/examples/1.7.x/server-php/examples/databases/create-document.md index 8726b37719..bf1ee3f62a 100644 --- a/docs/examples/1.7.x/server-php/examples/databases/create-document.md +++ b/docs/examples/1.7.x/server-php/examples/databases/create-document.md @@ -5,9 +5,8 @@ use Appwrite\Services\Databases; $client = (new Client()) ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint - ->setSession('') // The user session to authenticate with - ->setKey('<YOUR_API_KEY>') // Your secret API key - ->setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with $databases = new Databases($client); diff --git a/docs/examples/1.7.x/server-php/examples/databases/create-documents.md b/docs/examples/1.7.x/server-php/examples/databases/create-documents.md index 96008e2495..bc05f67260 100644 --- a/docs/examples/1.7.x/server-php/examples/databases/create-documents.md +++ b/docs/examples/1.7.x/server-php/examples/databases/create-documents.md @@ -5,6 +5,7 @@ use Appwrite\Services\Databases; $client = (new Client()) ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID ->setKey('<YOUR_API_KEY>'); // Your secret API key $databases = new Databases($client); diff --git a/docs/examples/1.7.x/server-php/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-php/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..40e14af844 --- /dev/null +++ b/docs/examples/1.7.x/server-php/examples/databases/decrement-document-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->decrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + min: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.7.x/server-php/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-php/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..fb61d87295 --- /dev/null +++ b/docs/examples/1.7.x/server-php/examples/databases/increment-document-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->incrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + max: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.7.x/server-php/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-php/examples/databases/upsert-document.md new file mode 100644 index 0000000000..6cff8296a3 --- /dev/null +++ b/docs/examples/1.7.x/server-php/examples/databases/upsert-document.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->upsertDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [], + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.7.x/server-php/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-php/examples/databases/upsert-documents.md index 7b9459e8f4..d9f9efda5c 100644 --- a/docs/examples/1.7.x/server-php/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-php/examples/databases/upsert-documents.md @@ -13,5 +13,5 @@ $databases = new Databases($client); $result = $databases->upsertDocuments( databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', - documents: [] // optional + documents: [] ); \ No newline at end of file diff --git a/docs/examples/1.7.x/server-python/examples/databases/create-document.md b/docs/examples/1.7.x/server-python/examples/databases/create-document.md index 1a8500b0f2..1eaf0246f3 100644 --- a/docs/examples/1.7.x/server-python/examples/databases/create-document.md +++ b/docs/examples/1.7.x/server-python/examples/databases/create-document.md @@ -3,9 +3,8 @@ from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_session('') # The user session to authenticate with -client.set_key('<YOUR_API_KEY>') # Your secret API key -client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token databases = Databases(client) diff --git a/docs/examples/1.7.x/server-python/examples/databases/create-documents.md b/docs/examples/1.7.x/server-python/examples/databases/create-documents.md index 7c6ef24bdb..1b94e5165a 100644 --- a/docs/examples/1.7.x/server-python/examples/databases/create-documents.md +++ b/docs/examples/1.7.x/server-python/examples/databases/create-documents.md @@ -3,6 +3,7 @@ from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID client.set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases(client) diff --git a/docs/examples/1.7.x/server-python/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-python/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..397bdd4bde --- /dev/null +++ b/docs/examples/1.7.x/server-python/examples/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.decrement_document_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + attribute = '', + value = None, # optional + min = None # optional +) diff --git a/docs/examples/1.7.x/server-python/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-python/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..d5700e0b30 --- /dev/null +++ b/docs/examples/1.7.x/server-python/examples/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.increment_document_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + attribute = '', + value = None, # optional + max = None # optional +) diff --git a/docs/examples/1.7.x/server-python/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-python/examples/databases/upsert-document.md new file mode 100644 index 0000000000..c491ea4f44 --- /dev/null +++ b/docs/examples/1.7.x/server-python/examples/databases/upsert-document.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result = databases.upsert_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = {}, + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/1.7.x/server-python/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-python/examples/databases/upsert-documents.md index 99720649d6..5136d5fcb1 100644 --- a/docs/examples/1.7.x/server-python/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-python/examples/databases/upsert-documents.md @@ -11,5 +11,5 @@ databases = Databases(client) result = databases.upsert_documents( database_id = '<DATABASE_ID>', collection_id = '<COLLECTION_ID>', - documents = [] # optional + documents = [] ) diff --git a/docs/examples/1.7.x/server-rest/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-rest/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..1db075f1eb --- /dev/null +++ b/docs/examples/1.7.x/server-rest/examples/databases/decrement-document-attribute.md @@ -0,0 +1,13 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.7.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "value": 0, + "min": 0 +} diff --git a/docs/examples/1.7.x/server-rest/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-rest/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..1dda580f90 --- /dev/null +++ b/docs/examples/1.7.x/server-rest/examples/databases/increment-document-attribute.md @@ -0,0 +1,13 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.7.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "value": 0, + "max": 0 +} diff --git a/docs/examples/1.7.x/server-rest/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-rest/examples/databases/upsert-document.md new file mode 100644 index 0000000000..1885072eac --- /dev/null +++ b/docs/examples/1.7.x/server-rest/examples/databases/upsert-document.md @@ -0,0 +1,13 @@ +PUT /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.7.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "data": {}, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.7.x/server-ruby/examples/databases/create-document.md b/docs/examples/1.7.x/server-ruby/examples/databases/create-document.md index ce8dea79ef..e6831084a1 100644 --- a/docs/examples/1.7.x/server-ruby/examples/databases/create-document.md +++ b/docs/examples/1.7.x/server-ruby/examples/databases/create-document.md @@ -4,9 +4,8 @@ include Appwrite client = Client.new .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID .set_session('') # The user session to authenticate with - .set_key('<YOUR_API_KEY>') # Your secret API key - .set_jwt('<YOUR_JWT>') # Your secret JSON Web Token databases = Databases.new(client) diff --git a/docs/examples/1.7.x/server-ruby/examples/databases/create-documents.md b/docs/examples/1.7.x/server-ruby/examples/databases/create-documents.md index 469234c91e..16abc5e465 100644 --- a/docs/examples/1.7.x/server-ruby/examples/databases/create-documents.md +++ b/docs/examples/1.7.x/server-ruby/examples/databases/create-documents.md @@ -4,6 +4,7 @@ include Appwrite client = Client.new .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID .set_key('<YOUR_API_KEY>') # Your secret API key databases = Databases.new(client) diff --git a/docs/examples/1.7.x/server-ruby/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-ruby/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..9b5a5f4006 --- /dev/null +++ b/docs/examples/1.7.x/server-ruby/examples/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.decrement_document_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + attribute: '', + value: null, # optional + min: null # optional +) diff --git a/docs/examples/1.7.x/server-ruby/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-ruby/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..40d8ba2ab7 --- /dev/null +++ b/docs/examples/1.7.x/server-ruby/examples/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.increment_document_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + attribute: '', + value: null, # optional + max: null # optional +) diff --git a/docs/examples/1.7.x/server-ruby/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-ruby/examples/databases/upsert-document.md new file mode 100644 index 0000000000..238081864f --- /dev/null +++ b/docs/examples/1.7.x/server-ruby/examples/databases/upsert-document.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.upsert_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: {}, + permissions: ["read("any")"] # optional +) diff --git a/docs/examples/1.7.x/server-ruby/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-ruby/examples/databases/upsert-documents.md index 353e38fe2b..30c42aa439 100644 --- a/docs/examples/1.7.x/server-ruby/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-ruby/examples/databases/upsert-documents.md @@ -12,5 +12,5 @@ databases = Databases.new(client) result = databases.upsert_documents( database_id: '<DATABASE_ID>', collection_id: '<COLLECTION_ID>', - documents: [] # optional + documents: [] ) diff --git a/docs/examples/1.7.x/server-swift/examples/databases/create-document.md b/docs/examples/1.7.x/server-swift/examples/databases/create-document.md index 4ee21048ab..daeaf144e1 100644 --- a/docs/examples/1.7.x/server-swift/examples/databases/create-document.md +++ b/docs/examples/1.7.x/server-swift/examples/databases/create-document.md @@ -2,9 +2,8 @@ import Appwrite let client = Client() .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID .setSession("") // The user session to authenticate with - .setKey("<YOUR_API_KEY>") // Your secret API key - .setJWT("<YOUR_JWT>") // Your secret JSON Web Token let databases = Databases(client) diff --git a/docs/examples/1.7.x/server-swift/examples/databases/create-documents.md b/docs/examples/1.7.x/server-swift/examples/databases/create-documents.md index 39a58ab3fd..2e992d9e3a 100644 --- a/docs/examples/1.7.x/server-swift/examples/databases/create-documents.md +++ b/docs/examples/1.7.x/server-swift/examples/databases/create-documents.md @@ -2,6 +2,7 @@ import Appwrite let client = Client() .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID .setKey("<YOUR_API_KEY>") // Your secret API key let databases = Databases(client) diff --git a/docs/examples/1.7.x/server-swift/examples/databases/decrement-document-attribute.md b/docs/examples/1.7.x/server-swift/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..88ba9ae01b --- /dev/null +++ b/docs/examples/1.7.x/server-swift/examples/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let document = try await databases.decrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, // optional + min: 0 // optional +) + diff --git a/docs/examples/1.7.x/server-swift/examples/databases/increment-document-attribute.md b/docs/examples/1.7.x/server-swift/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..452b200e34 --- /dev/null +++ b/docs/examples/1.7.x/server-swift/examples/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let document = try await databases.incrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, // optional + max: 0 // optional +) + diff --git a/docs/examples/1.7.x/server-swift/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-swift/examples/databases/upsert-document.md new file mode 100644 index 0000000000..e78bd458a0 --- /dev/null +++ b/docs/examples/1.7.x/server-swift/examples/databases/upsert-document.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.upsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [:], + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.7.x/server-swift/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-swift/examples/databases/upsert-documents.md index 353cc5c502..544f02f9c0 100644 --- a/docs/examples/1.7.x/server-swift/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-swift/examples/databases/upsert-documents.md @@ -10,6 +10,6 @@ let databases = Databases(client) let documentList = try await databases.upsertDocuments( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", - documents: [] // optional + documents: [] ) diff --git a/docs/examples/1.8.x/client-android/java/account/create-anonymous-session.md b/docs/examples/1.8.x/client-android/java/account/create-anonymous-session.md new file mode 100644 index 0000000000..9d805882b8 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-anonymous-session.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createAnonymousSession(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/create-email-password-session.md b/docs/examples/1.8.x/client-android/java/account/create-email-password-session.md new file mode 100644 index 0000000000..428b6fddb6 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-email-password-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createEmailPasswordSession( + "email@example.com", // email + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create-email-token.md b/docs/examples/1.8.x/client-android/java/account/create-email-token.md new file mode 100644 index 0000000000..869f4a8991 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-email-token.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createEmailToken( + "<USER_ID>", // userId + "email@example.com", // email + false, // phrase (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create-jwt.md b/docs/examples/1.8.x/client-android/java/account/create-jwt.md new file mode 100644 index 0000000000..9e3bd287f3 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-jwt.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createJWT(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/create-magic-url-token.md b/docs/examples/1.8.x/client-android/java/account/create-magic-url-token.md new file mode 100644 index 0000000000..6253e00d58 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-magic-url-token.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createMagicURLToken( + "<USER_ID>", // userId + "email@example.com", // email + "https://example.com", // url (optional) + false, // phrase (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create-mfa-authenticator.md b/docs/examples/1.8.x/client-android/java/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..d236f46c6c --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-mfa-authenticator.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticatorType; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createMFAAuthenticator( + AuthenticatorType.TOTP, // type + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create-mfa-challenge.md b/docs/examples/1.8.x/client-android/java/account/create-mfa-challenge.md new file mode 100644 index 0000000000..222c0bdad2 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-mfa-challenge.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticationFactor; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createMFAChallenge( + AuthenticationFactor.EMAIL, // factor + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/client-android/java/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..792e0860f7 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-mfa-recovery-codes.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/create-o-auth-2-session.md b/docs/examples/1.8.x/client-android/java/account/create-o-auth-2-session.md new file mode 100644 index 0000000000..4420859ce3 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-o-auth-2-session.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.OAuthProvider; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createOAuth2Session( + OAuthProvider.AMAZON, // provider + "https://example.com", // success (optional) + "https://example.com", // failure (optional) + listOf(), // scopes (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create-o-auth-2-token.md b/docs/examples/1.8.x/client-android/java/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..e5590c8ceb --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-o-auth-2-token.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.OAuthProvider; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createOAuth2Token( + OAuthProvider.AMAZON, // provider + "https://example.com", // success (optional) + "https://example.com", // failure (optional) + listOf(), // scopes (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create-phone-token.md b/docs/examples/1.8.x/client-android/java/account/create-phone-token.md new file mode 100644 index 0000000000..19d90b3475 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-phone-token.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createPhoneToken( + "<USER_ID>", // userId + "+12065550100", // phone + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create-phone-verification.md b/docs/examples/1.8.x/client-android/java/account/create-phone-verification.md new file mode 100644 index 0000000000..8c16b6c268 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-phone-verification.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createPhoneVerification(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/create-push-target.md b/docs/examples/1.8.x/client-android/java/account/create-push-target.md new file mode 100644 index 0000000000..d434a5c6f6 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-push-target.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createPushTarget( + "<TARGET_ID>", // targetId + "<IDENTIFIER>", // identifier + "<PROVIDER_ID>", // providerId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create-recovery.md b/docs/examples/1.8.x/client-android/java/account/create-recovery.md new file mode 100644 index 0000000000..5592c6eb66 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-recovery.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createRecovery( + "email@example.com", // email + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create-session.md b/docs/examples/1.8.x/client-android/java/account/create-session.md new file mode 100644 index 0000000000..0c59a802b1 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createSession( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create-verification.md b/docs/examples/1.8.x/client-android/java/account/create-verification.md new file mode 100644 index 0000000000..e91acc85f9 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create-verification.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createVerification( + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/create.md b/docs/examples/1.8.x/client-android/java/account/create.md new file mode 100644 index 0000000000..ad04805ce3 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/create.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.create( + "<USER_ID>", // userId + "email@example.com", // email + "", // password + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/delete-identity.md b/docs/examples/1.8.x/client-android/java/account/delete-identity.md new file mode 100644 index 0000000000..d556722769 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/delete-identity.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.deleteIdentity( + "<IDENTITY_ID>", // identityId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/client-android/java/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..b5ff26cbec --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/delete-mfa-authenticator.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticatorType; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.deleteMFAAuthenticator( + AuthenticatorType.TOTP, // type + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/delete-push-target.md b/docs/examples/1.8.x/client-android/java/account/delete-push-target.md new file mode 100644 index 0000000000..00ab902792 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/delete-push-target.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.deletePushTarget( + "<TARGET_ID>", // targetId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/delete-session.md b/docs/examples/1.8.x/client-android/java/account/delete-session.md new file mode 100644 index 0000000000..99d2f8e888 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/delete-session.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.deleteSession( + "<SESSION_ID>", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/delete-sessions.md b/docs/examples/1.8.x/client-android/java/account/delete-sessions.md new file mode 100644 index 0000000000..e93f3e33ac --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/delete-sessions.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.deleteSessions(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/client-android/java/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..22bc1c1637 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/get-mfa-recovery-codes.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.getMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/get-prefs.md b/docs/examples/1.8.x/client-android/java/account/get-prefs.md new file mode 100644 index 0000000000..5bb11a4a95 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/get-prefs.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.getPrefs(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/get-session.md b/docs/examples/1.8.x/client-android/java/account/get-session.md new file mode 100644 index 0000000000..288cd3b3ba --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/get-session.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.getSession( + "<SESSION_ID>", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/get.md b/docs/examples/1.8.x/client-android/java/account/get.md new file mode 100644 index 0000000000..6b5eb3b7fa --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/get.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.get(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/list-identities.md b/docs/examples/1.8.x/client-android/java/account/list-identities.md new file mode 100644 index 0000000000..d4a6f9f31d --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/list-identities.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.listIdentities( + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/list-logs.md b/docs/examples/1.8.x/client-android/java/account/list-logs.md new file mode 100644 index 0000000000..951a479f98 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/list-logs.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.listLogs( + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/list-mfa-factors.md b/docs/examples/1.8.x/client-android/java/account/list-mfa-factors.md new file mode 100644 index 0000000000..06f20e1a5a --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/list-mfa-factors.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.listMFAFactors(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/list-sessions.md b/docs/examples/1.8.x/client-android/java/account/list-sessions.md new file mode 100644 index 0000000000..8946d96e7c --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/list-sessions.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.listSessions(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/update-email.md b/docs/examples/1.8.x/client-android/java/account/update-email.md new file mode 100644 index 0000000000..ac80e451d0 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-email.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateEmail( + "email@example.com", // email + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-magic-url-session.md b/docs/examples/1.8.x/client-android/java/account/update-magic-url-session.md new file mode 100644 index 0000000000..5893aa6e6b --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-magic-url-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateMagicURLSession( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-mfa-authenticator.md b/docs/examples/1.8.x/client-android/java/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..00ddd46b26 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-mfa-authenticator.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticatorType; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateMFAAuthenticator( + AuthenticatorType.TOTP, // type + "<OTP>", // otp + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-mfa-challenge.md b/docs/examples/1.8.x/client-android/java/account/update-mfa-challenge.md new file mode 100644 index 0000000000..10b5db49f8 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-mfa-challenge.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateMFAChallenge( + "<CHALLENGE_ID>", // challengeId + "<OTP>", // otp + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/client-android/java/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..c0d6c69fa0 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-mfa-recovery-codes.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/update-mfa.md b/docs/examples/1.8.x/client-android/java/account/update-mfa.md new file mode 100644 index 0000000000..b765cda94a --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-mfa.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateMFA( + false, // mfa + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-name.md b/docs/examples/1.8.x/client-android/java/account/update-name.md new file mode 100644 index 0000000000..47582c2b30 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-name.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateName( + "<NAME>", // name + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-password.md b/docs/examples/1.8.x/client-android/java/account/update-password.md new file mode 100644 index 0000000000..09f572eb31 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-password.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updatePassword( + "", // password + "password", // oldPassword (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-phone-session.md b/docs/examples/1.8.x/client-android/java/account/update-phone-session.md new file mode 100644 index 0000000000..2e1b880017 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-phone-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updatePhoneSession( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-phone-verification.md b/docs/examples/1.8.x/client-android/java/account/update-phone-verification.md new file mode 100644 index 0000000000..f93ae6906f --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-phone-verification.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updatePhoneVerification( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-phone.md b/docs/examples/1.8.x/client-android/java/account/update-phone.md new file mode 100644 index 0000000000..fae9bfaaec --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-phone.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updatePhone( + "+12065550100", // phone + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-prefs.md b/docs/examples/1.8.x/client-android/java/account/update-prefs.md new file mode 100644 index 0000000000..4bd6940c61 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-prefs.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updatePrefs( + mapOf( + "language" to "en", + "timezone" to "UTC", + "darkTheme" to true + ), // prefs + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-push-target.md b/docs/examples/1.8.x/client-android/java/account/update-push-target.md new file mode 100644 index 0000000000..197a9095a7 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-push-target.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updatePushTarget( + "<TARGET_ID>", // targetId + "<IDENTIFIER>", // identifier + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-recovery.md b/docs/examples/1.8.x/client-android/java/account/update-recovery.md new file mode 100644 index 0000000000..953bde4f26 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-recovery.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateRecovery( + "<USER_ID>", // userId + "<SECRET>", // secret + "", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-session.md b/docs/examples/1.8.x/client-android/java/account/update-session.md new file mode 100644 index 0000000000..ed82840836 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-session.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateSession( + "<SESSION_ID>", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/account/update-status.md b/docs/examples/1.8.x/client-android/java/account/update-status.md new file mode 100644 index 0000000000..9a283c092c --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-status.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateStatus(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/account/update-verification.md b/docs/examples/1.8.x/client-android/java/account/update-verification.md new file mode 100644 index 0000000000..caa3869e25 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/account/update-verification.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateVerification( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/avatars/get-browser.md b/docs/examples/1.8.x/client-android/java/avatars/get-browser.md new file mode 100644 index 0000000000..1b6632f30a --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/avatars/get-browser.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.Browser; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getBrowser( + Browser.AVANT_BROWSER, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/avatars/get-credit-card.md b/docs/examples/1.8.x/client-android/java/avatars/get-credit-card.md new file mode 100644 index 0000000000..e2ac2c26cd --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/avatars/get-credit-card.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.CreditCard; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getCreditCard( + CreditCard.AMERICAN_EXPRESS, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/avatars/get-favicon.md b/docs/examples/1.8.x/client-android/java/avatars/get-favicon.md new file mode 100644 index 0000000000..70373a607b --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/avatars/get-favicon.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getFavicon( + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/avatars/get-flag.md b/docs/examples/1.8.x/client-android/java/avatars/get-flag.md new file mode 100644 index 0000000000..689e27fe35 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/avatars/get-flag.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.Flag; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getFlag( + Flag.AFGHANISTAN, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/avatars/get-image.md b/docs/examples/1.8.x/client-android/java/avatars/get-image.md new file mode 100644 index 0000000000..71a90dd1c2 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/avatars/get-image.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getImage( + "https://example.com", // url + 0, // width (optional) + 0, // height (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/avatars/get-initials.md b/docs/examples/1.8.x/client-android/java/avatars/get-initials.md new file mode 100644 index 0000000000..ca16ee7e36 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/avatars/get-initials.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getInitials( + "<NAME>", // name (optional) + 0, // width (optional) + 0, // height (optional) + "", // background (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/avatars/get-qr.md b/docs/examples/1.8.x/client-android/java/avatars/get-qr.md new file mode 100644 index 0000000000..781acf6741 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/avatars/get-qr.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Avatars avatars = new Avatars(client); + +avatars.getQR( + "<TEXT>", // text + 1, // size (optional) + 0, // margin (optional) + false, // download (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/databases/create-document.md b/docs/examples/1.8.x/client-android/java/databases/create-document.md new file mode 100644 index 0000000000..bd0b57ac4c --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/databases/create-document.md @@ -0,0 +1,32 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Databases databases = new Databases(client); + +databases.createDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), // data + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/databases/decrement-document-attribute.md b/docs/examples/1.8.x/client-android/java/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..de6a4ab48d --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/databases/decrement-document-attribute.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Databases databases = new Databases(client); + +databases.decrementDocumentAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "", // attribute + 0, // value (optional) + 0, // min (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/databases/delete-document.md b/docs/examples/1.8.x/client-android/java/databases/delete-document.md new file mode 100644 index 0000000000..5288e53bed --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/databases/delete-document.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Databases databases = new Databases(client); + +databases.deleteDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/databases/get-document.md b/docs/examples/1.8.x/client-android/java/databases/get-document.md new file mode 100644 index 0000000000..e7ae2079ed --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/databases/get-document.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Databases databases = new Databases(client); + +databases.getDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/databases/increment-document-attribute.md b/docs/examples/1.8.x/client-android/java/databases/increment-document-attribute.md new file mode 100644 index 0000000000..94ffa9d749 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/databases/increment-document-attribute.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Databases databases = new Databases(client); + +databases.incrementDocumentAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "", // attribute + 0, // value (optional) + 0, // max (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/databases/list-documents.md b/docs/examples/1.8.x/client-android/java/databases/list-documents.md new file mode 100644 index 0000000000..606d67705d --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/databases/list-documents.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Databases databases = new Databases(client); + +databases.listDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/databases/update-document.md b/docs/examples/1.8.x/client-android/java/databases/update-document.md new file mode 100644 index 0000000000..baa827cdf5 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/databases/update-document.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Databases databases = new Databases(client); + +databases.updateDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + mapOf( "a" to "b" ), // data (optional) + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/databases/upsert-document.md b/docs/examples/1.8.x/client-android/java/databases/upsert-document.md new file mode 100644 index 0000000000..868576b982 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/databases/upsert-document.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Databases databases = new Databases(client); + +databases.upsertDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + mapOf( "a" to "b" ), // data + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/functions/create-execution.md b/docs/examples/1.8.x/client-android/java/functions/create-execution.md new file mode 100644 index 0000000000..06c50278a5 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/functions/create-execution.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Functions functions = new Functions(client); + +functions.createExecution( + "<FUNCTION_ID>", // functionId + "<BODY>", // body (optional) + false, // async (optional) + "<PATH>", // path (optional) + ExecutionMethod.GET, // method (optional) + mapOf( "a" to "b" ), // headers (optional) + "<SCHEDULED_AT>", // scheduledAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/functions/get-execution.md b/docs/examples/1.8.x/client-android/java/functions/get-execution.md new file mode 100644 index 0000000000..f3195fa126 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/functions/get-execution.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Functions functions = new Functions(client); + +functions.getExecution( + "<FUNCTION_ID>", // functionId + "<EXECUTION_ID>", // executionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/functions/list-executions.md b/docs/examples/1.8.x/client-android/java/functions/list-executions.md new file mode 100644 index 0000000000..0270cf0ead --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/functions/list-executions.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Functions functions = new Functions(client); + +functions.listExecutions( + "<FUNCTION_ID>", // functionId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/graphql/mutation.md b/docs/examples/1.8.x/client-android/java/graphql/mutation.md new file mode 100644 index 0000000000..25f095e1b1 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/graphql/mutation.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Graphql; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Graphql graphql = new Graphql(client); + +graphql.mutation( + mapOf( "a" to "b" ), // query + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/graphql/query.md b/docs/examples/1.8.x/client-android/java/graphql/query.md new file mode 100644 index 0000000000..6b2a04d0b6 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/graphql/query.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Graphql; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Graphql graphql = new Graphql(client); + +graphql.query( + mapOf( "a" to "b" ), // query + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/locale/get.md b/docs/examples/1.8.x/client-android/java/locale/get.md new file mode 100644 index 0000000000..89e1e88b26 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/locale/get.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Locale locale = new Locale(client); + +locale.get(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/locale/list-codes.md b/docs/examples/1.8.x/client-android/java/locale/list-codes.md new file mode 100644 index 0000000000..85a96fce77 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/locale/list-codes.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Locale locale = new Locale(client); + +locale.listCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/locale/list-continents.md b/docs/examples/1.8.x/client-android/java/locale/list-continents.md new file mode 100644 index 0000000000..6f4572d572 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/locale/list-continents.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Locale locale = new Locale(client); + +locale.listContinents(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/locale/list-countries-eu.md b/docs/examples/1.8.x/client-android/java/locale/list-countries-eu.md new file mode 100644 index 0000000000..51458a929d --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/locale/list-countries-eu.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Locale locale = new Locale(client); + +locale.listCountriesEU(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/locale/list-countries-phones.md b/docs/examples/1.8.x/client-android/java/locale/list-countries-phones.md new file mode 100644 index 0000000000..93438d2130 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/locale/list-countries-phones.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Locale locale = new Locale(client); + +locale.listCountriesPhones(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/locale/list-countries.md b/docs/examples/1.8.x/client-android/java/locale/list-countries.md new file mode 100644 index 0000000000..5cd5525e93 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/locale/list-countries.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Locale locale = new Locale(client); + +locale.listCountries(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/locale/list-currencies.md b/docs/examples/1.8.x/client-android/java/locale/list-currencies.md new file mode 100644 index 0000000000..d3ef02c865 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/locale/list-currencies.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Locale locale = new Locale(client); + +locale.listCurrencies(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/locale/list-languages.md b/docs/examples/1.8.x/client-android/java/locale/list-languages.md new file mode 100644 index 0000000000..0d724943a9 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/locale/list-languages.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Locale locale = new Locale(client); + +locale.listLanguages(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); +})); diff --git a/docs/examples/1.8.x/client-android/java/messaging/create-subscriber.md b/docs/examples/1.8.x/client-android/java/messaging/create-subscriber.md new file mode 100644 index 0000000000..5616435ab5 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/messaging/create-subscriber.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Messaging messaging = new Messaging(client); + +messaging.createSubscriber( + "<TOPIC_ID>", // topicId + "<SUBSCRIBER_ID>", // subscriberId + "<TARGET_ID>", // targetId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/messaging/delete-subscriber.md b/docs/examples/1.8.x/client-android/java/messaging/delete-subscriber.md new file mode 100644 index 0000000000..9adae5e7df --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/messaging/delete-subscriber.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Messaging messaging = new Messaging(client); + +messaging.deleteSubscriber( + "<TOPIC_ID>", // topicId + "<SUBSCRIBER_ID>", // subscriberId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/storage/create-file.md b/docs/examples/1.8.x/client-android/java/storage/create-file.md new file mode 100644 index 0000000000..598e683150 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/storage/create-file.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.models.InputFile; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Storage storage = new Storage(client); + +storage.createFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + InputFile.fromPath("file.png"), // file + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/storage/delete-file.md b/docs/examples/1.8.x/client-android/java/storage/delete-file.md new file mode 100644 index 0000000000..5c63ae7cd5 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/storage/delete-file.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Storage storage = new Storage(client); + +storage.deleteFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/storage/get-file-download.md b/docs/examples/1.8.x/client-android/java/storage/get-file-download.md new file mode 100644 index 0000000000..73a8617fdd --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/storage/get-file-download.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Storage storage = new Storage(client); + +storage.getFileDownload( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + "<TOKEN>", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/storage/get-file-preview.md b/docs/examples/1.8.x/client-android/java/storage/get-file-preview.md new file mode 100644 index 0000000000..67b92ebf85 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/storage/get-file-preview.md @@ -0,0 +1,35 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Storage storage = new Storage(client); + +storage.getFilePreview( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + 0, // width (optional) + 0, // height (optional) + ImageGravity.CENTER, // gravity (optional) + -1, // quality (optional) + 0, // borderWidth (optional) + "", // borderColor (optional) + 0, // borderRadius (optional) + 0, // opacity (optional) + -360, // rotation (optional) + "", // background (optional) + ImageFormat.JPG, // output (optional) + "<TOKEN>", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/storage/get-file-view.md b/docs/examples/1.8.x/client-android/java/storage/get-file-view.md new file mode 100644 index 0000000000..b042b1f451 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/storage/get-file-view.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Storage storage = new Storage(client); + +storage.getFileView( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + "<TOKEN>", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/storage/get-file.md b/docs/examples/1.8.x/client-android/java/storage/get-file.md new file mode 100644 index 0000000000..c9cc00d8f7 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/storage/get-file.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Storage storage = new Storage(client); + +storage.getFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/storage/list-files.md b/docs/examples/1.8.x/client-android/java/storage/list-files.md new file mode 100644 index 0000000000..a87286c6d6 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/storage/list-files.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Storage storage = new Storage(client); + +storage.listFiles( + "<BUCKET_ID>", // bucketId + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/storage/update-file.md b/docs/examples/1.8.x/client-android/java/storage/update-file.md new file mode 100644 index 0000000000..14fa77939d --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/storage/update-file.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Storage storage = new Storage(client); + +storage.updateFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + "<NAME>", // name (optional) + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/tablesdb/create-row.md b/docs/examples/1.8.x/client-android/java/tablesdb/create-row.md new file mode 100644 index 0000000000..8273573ddd --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/tablesdb/create-row.md @@ -0,0 +1,32 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), // data + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/client-android/java/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..73f2128a8f --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/tablesdb/decrement-row-column.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.decrementRowColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + "", // column + 0, // value (optional) + 0, // min (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/tablesdb/delete-row.md b/docs/examples/1.8.x/client-android/java/tablesdb/delete-row.md new file mode 100644 index 0000000000..d4c351bc32 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/tablesdb/delete-row.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/tablesdb/get-row.md b/docs/examples/1.8.x/client-android/java/tablesdb/get-row.md new file mode 100644 index 0000000000..191fc896e9 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/tablesdb/get-row.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/tablesdb/increment-row-column.md b/docs/examples/1.8.x/client-android/java/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..dc2120ea07 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/tablesdb/increment-row-column.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.incrementRowColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + "", // column + 0, // value (optional) + 0, // max (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/tablesdb/list-rows.md b/docs/examples/1.8.x/client-android/java/tablesdb/list-rows.md new file mode 100644 index 0000000000..dc50574f1e --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/tablesdb/list-rows.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listRows( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/tablesdb/update-row.md b/docs/examples/1.8.x/client-android/java/tablesdb/update-row.md new file mode 100644 index 0000000000..0f1fabc91e --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/tablesdb/update-row.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + mapOf( "a" to "b" ), // data (optional) + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/tablesdb/upsert-row.md b/docs/examples/1.8.x/client-android/java/tablesdb/upsert-row.md new file mode 100644 index 0000000000..22c0e94b44 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/tablesdb/upsert-row.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.upsertRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + mapOf( "a" to "b" ), // data (optional) + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/create-membership.md b/docs/examples/1.8.x/client-android/java/teams/create-membership.md new file mode 100644 index 0000000000..bb5293ef63 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/create-membership.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.createMembership( + "<TEAM_ID>", // teamId + listOf(), // roles + "email@example.com", // email (optional) + "<USER_ID>", // userId (optional) + "+12065550100", // phone (optional) + "https://example.com", // url (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/create.md b/docs/examples/1.8.x/client-android/java/teams/create.md new file mode 100644 index 0000000000..ae2fdf32c8 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/create.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.create( + "<TEAM_ID>", // teamId + "<NAME>", // name + listOf(), // roles (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/delete-membership.md b/docs/examples/1.8.x/client-android/java/teams/delete-membership.md new file mode 100644 index 0000000000..c8bb088cc6 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/delete-membership.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.deleteMembership( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/delete.md b/docs/examples/1.8.x/client-android/java/teams/delete.md new file mode 100644 index 0000000000..74f6a4f997 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/delete.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.delete( + "<TEAM_ID>", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/get-membership.md b/docs/examples/1.8.x/client-android/java/teams/get-membership.md new file mode 100644 index 0000000000..e9dc5786d6 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/get-membership.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.getMembership( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/get-prefs.md b/docs/examples/1.8.x/client-android/java/teams/get-prefs.md new file mode 100644 index 0000000000..8ba14355a1 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/get-prefs.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.getPrefs( + "<TEAM_ID>", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/get.md b/docs/examples/1.8.x/client-android/java/teams/get.md new file mode 100644 index 0000000000..f00057a822 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/get.md @@ -0,0 +1,22 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.get( + "<TEAM_ID>", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/list-memberships.md b/docs/examples/1.8.x/client-android/java/teams/list-memberships.md new file mode 100644 index 0000000000..216ca40e6d --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/list-memberships.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.listMemberships( + "<TEAM_ID>", // teamId + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/list.md b/docs/examples/1.8.x/client-android/java/teams/list.md new file mode 100644 index 0000000000..b69f21ed43 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/list.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.list( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/update-membership-status.md b/docs/examples/1.8.x/client-android/java/teams/update-membership-status.md new file mode 100644 index 0000000000..4b31ed55ec --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/update-membership-status.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.updateMembershipStatus( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/update-membership.md b/docs/examples/1.8.x/client-android/java/teams/update-membership.md new file mode 100644 index 0000000000..481be43107 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/update-membership.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.updateMembership( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + listOf(), // roles + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/update-name.md b/docs/examples/1.8.x/client-android/java/teams/update-name.md new file mode 100644 index 0000000000..207bcc81e3 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/update-name.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.updateName( + "<TEAM_ID>", // teamId + "<NAME>", // name + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/java/teams/update-prefs.md b/docs/examples/1.8.x/client-android/java/teams/update-prefs.md new file mode 100644 index 0000000000..5a0186ff31 --- /dev/null +++ b/docs/examples/1.8.x/client-android/java/teams/update-prefs.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Teams teams = new Teams(client); + +teams.updatePrefs( + "<TEAM_ID>", // teamId + mapOf( "a" to "b" ), // prefs + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + Log.d("Appwrite", result.toString()); + }) +); + diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-anonymous-session.md b/docs/examples/1.8.x/client-android/kotlin/account/create-anonymous-session.md new file mode 100644 index 0000000000..d2966a18cd --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-anonymous-session.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createAnonymousSession() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-email-password-session.md b/docs/examples/1.8.x/client-android/kotlin/account/create-email-password-session.md new file mode 100644 index 0000000000..a327cf280e --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-email-password-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createEmailPasswordSession( + email = "email@example.com", + password = "password", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-email-token.md b/docs/examples/1.8.x/client-android/kotlin/account/create-email-token.md new file mode 100644 index 0000000000..37c9e1b380 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-email-token.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createEmailToken( + userId = "<USER_ID>", + email = "email@example.com", + phrase = false, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-jwt.md b/docs/examples/1.8.x/client-android/kotlin/account/create-jwt.md new file mode 100644 index 0000000000..c87eaf3128 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-jwt.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createJWT() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-magic-url-token.md b/docs/examples/1.8.x/client-android/kotlin/account/create-magic-url-token.md new file mode 100644 index 0000000000..76f4c91884 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-magic-url-token.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createMagicURLToken( + userId = "<USER_ID>", + email = "email@example.com", + url = "https://example.com", // (optional) + phrase = false, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-mfa-authenticator.md b/docs/examples/1.8.x/client-android/kotlin/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..934de1cc1c --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-mfa-authenticator.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createMFAAuthenticator( + type = AuthenticatorType.TOTP, +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-mfa-challenge.md b/docs/examples/1.8.x/client-android/kotlin/account/create-mfa-challenge.md new file mode 100644 index 0000000000..f79c49891a --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-mfa-challenge.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticationFactor + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createMFAChallenge( + factor = AuthenticationFactor.EMAIL, +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/client-android/kotlin/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..cc5696646c --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createMFARecoveryCodes() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-o-auth-2-session.md b/docs/examples/1.8.x/client-android/kotlin/account/create-o-auth-2-session.md new file mode 100644 index 0000000000..61ea634ad7 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-o-auth-2-session.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.OAuthProvider + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +account.createOAuth2Session( + provider = OAuthProvider.AMAZON, + success = "https://example.com", // (optional) + failure = "https://example.com", // (optional) + scopes = listOf(), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-o-auth-2-token.md b/docs/examples/1.8.x/client-android/kotlin/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..cdd2ef3445 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-o-auth-2-token.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.OAuthProvider + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +account.createOAuth2Token( + provider = OAuthProvider.AMAZON, + success = "https://example.com", // (optional) + failure = "https://example.com", // (optional) + scopes = listOf(), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-phone-token.md b/docs/examples/1.8.x/client-android/kotlin/account/create-phone-token.md new file mode 100644 index 0000000000..4eb1a9ac4e --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-phone-token.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createPhoneToken( + userId = "<USER_ID>", + phone = "+12065550100", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-phone-verification.md b/docs/examples/1.8.x/client-android/kotlin/account/create-phone-verification.md new file mode 100644 index 0000000000..f7594668fa --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-phone-verification.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createPhoneVerification() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-push-target.md b/docs/examples/1.8.x/client-android/kotlin/account/create-push-target.md new file mode 100644 index 0000000000..59b252be15 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-push-target.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createPushTarget( + targetId = "<TARGET_ID>", + identifier = "<IDENTIFIER>", + providerId = "<PROVIDER_ID>", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-recovery.md b/docs/examples/1.8.x/client-android/kotlin/account/create-recovery.md new file mode 100644 index 0000000000..7e13138111 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-recovery.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createRecovery( + email = "email@example.com", + url = "https://example.com", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-session.md b/docs/examples/1.8.x/client-android/kotlin/account/create-session.md new file mode 100644 index 0000000000..ab9e20e7e2 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createSession( + userId = "<USER_ID>", + secret = "<SECRET>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create-verification.md b/docs/examples/1.8.x/client-android/kotlin/account/create-verification.md new file mode 100644 index 0000000000..669b00ba18 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create-verification.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.createVerification( + url = "https://example.com", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/create.md b/docs/examples/1.8.x/client-android/kotlin/account/create.md new file mode 100644 index 0000000000..16f3a60ded --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/create.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.create( + userId = "<USER_ID>", + email = "email@example.com", + password = "", + name = "<NAME>", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/delete-identity.md b/docs/examples/1.8.x/client-android/kotlin/account/delete-identity.md new file mode 100644 index 0000000000..c8d7463685 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/delete-identity.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.deleteIdentity( + identityId = "<IDENTITY_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/client-android/kotlin/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..b140a11f55 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/delete-mfa-authenticator.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.deleteMFAAuthenticator( + type = AuthenticatorType.TOTP, +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/delete-push-target.md b/docs/examples/1.8.x/client-android/kotlin/account/delete-push-target.md new file mode 100644 index 0000000000..8e0b418c90 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/delete-push-target.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.deletePushTarget( + targetId = "<TARGET_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/delete-session.md b/docs/examples/1.8.x/client-android/kotlin/account/delete-session.md new file mode 100644 index 0000000000..6af414be27 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/delete-session.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.deleteSession( + sessionId = "<SESSION_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/delete-sessions.md b/docs/examples/1.8.x/client-android/kotlin/account/delete-sessions.md new file mode 100644 index 0000000000..f7e6c71c10 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/delete-sessions.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.deleteSessions() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/client-android/kotlin/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..f9d36122bb --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/get-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.getMFARecoveryCodes() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/get-prefs.md b/docs/examples/1.8.x/client-android/kotlin/account/get-prefs.md new file mode 100644 index 0000000000..85dbb18b43 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/get-prefs.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.getPrefs() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/get-session.md b/docs/examples/1.8.x/client-android/kotlin/account/get-session.md new file mode 100644 index 0000000000..4de64a1487 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/get-session.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.getSession( + sessionId = "<SESSION_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/get.md b/docs/examples/1.8.x/client-android/kotlin/account/get.md new file mode 100644 index 0000000000..3e85e79ad0 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/get.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.get() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/list-identities.md b/docs/examples/1.8.x/client-android/kotlin/account/list-identities.md new file mode 100644 index 0000000000..5908a44a9c --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/list-identities.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.listIdentities( + queries = listOf(), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/list-logs.md b/docs/examples/1.8.x/client-android/kotlin/account/list-logs.md new file mode 100644 index 0000000000..385ccc0116 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/list-logs.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.listLogs( + queries = listOf(), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/list-mfa-factors.md b/docs/examples/1.8.x/client-android/kotlin/account/list-mfa-factors.md new file mode 100644 index 0000000000..56d1c4dbc4 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/list-mfa-factors.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.listMFAFactors() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/list-sessions.md b/docs/examples/1.8.x/client-android/kotlin/account/list-sessions.md new file mode 100644 index 0000000000..573dd865e2 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/list-sessions.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.listSessions() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-email.md b/docs/examples/1.8.x/client-android/kotlin/account/update-email.md new file mode 100644 index 0000000000..0862f112c0 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-email.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updateEmail( + email = "email@example.com", + password = "password", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-magic-url-session.md b/docs/examples/1.8.x/client-android/kotlin/account/update-magic-url-session.md new file mode 100644 index 0000000000..2c1a0b0a38 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-magic-url-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updateMagicURLSession( + userId = "<USER_ID>", + secret = "<SECRET>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-mfa-authenticator.md b/docs/examples/1.8.x/client-android/kotlin/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..4f6ecd7d39 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-mfa-authenticator.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updateMFAAuthenticator( + type = AuthenticatorType.TOTP, + otp = "<OTP>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-mfa-challenge.md b/docs/examples/1.8.x/client-android/kotlin/account/update-mfa-challenge.md new file mode 100644 index 0000000000..d5cbc1fdab --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-mfa-challenge.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updateMFAChallenge( + challengeId = "<CHALLENGE_ID>", + otp = "<OTP>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/client-android/kotlin/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..0277ca7587 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updateMFARecoveryCodes() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-mfa.md b/docs/examples/1.8.x/client-android/kotlin/account/update-mfa.md new file mode 100644 index 0000000000..f214e78f44 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-mfa.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updateMFA( + mfa = false, +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-name.md b/docs/examples/1.8.x/client-android/kotlin/account/update-name.md new file mode 100644 index 0000000000..2cb5327ebe --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-name.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updateName( + name = "<NAME>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-password.md b/docs/examples/1.8.x/client-android/kotlin/account/update-password.md new file mode 100644 index 0000000000..140ca8b219 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-password.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updatePassword( + password = "", + oldPassword = "password", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-phone-session.md b/docs/examples/1.8.x/client-android/kotlin/account/update-phone-session.md new file mode 100644 index 0000000000..b3911dd5e0 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-phone-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updatePhoneSession( + userId = "<USER_ID>", + secret = "<SECRET>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-phone-verification.md b/docs/examples/1.8.x/client-android/kotlin/account/update-phone-verification.md new file mode 100644 index 0000000000..ad0d5d73eb --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-phone-verification.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updatePhoneVerification( + userId = "<USER_ID>", + secret = "<SECRET>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-phone.md b/docs/examples/1.8.x/client-android/kotlin/account/update-phone.md new file mode 100644 index 0000000000..84ff508184 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-phone.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updatePhone( + phone = "+12065550100", + password = "password", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-prefs.md b/docs/examples/1.8.x/client-android/kotlin/account/update-prefs.md new file mode 100644 index 0000000000..ded80e9462 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-prefs.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updatePrefs( + prefs = mapOf( + "language" to "en", + "timezone" to "UTC", + "darkTheme" to true + ), +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-push-target.md b/docs/examples/1.8.x/client-android/kotlin/account/update-push-target.md new file mode 100644 index 0000000000..5c3816860f --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-push-target.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updatePushTarget( + targetId = "<TARGET_ID>", + identifier = "<IDENTIFIER>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-recovery.md b/docs/examples/1.8.x/client-android/kotlin/account/update-recovery.md new file mode 100644 index 0000000000..d505d1afb1 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-recovery.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updateRecovery( + userId = "<USER_ID>", + secret = "<SECRET>", + password = "", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-session.md b/docs/examples/1.8.x/client-android/kotlin/account/update-session.md new file mode 100644 index 0000000000..6fc9a9f9d2 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-session.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updateSession( + sessionId = "<SESSION_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-status.md b/docs/examples/1.8.x/client-android/kotlin/account/update-status.md new file mode 100644 index 0000000000..b86a25ad4d --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-status.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updateStatus() diff --git a/docs/examples/1.8.x/client-android/kotlin/account/update-verification.md b/docs/examples/1.8.x/client-android/kotlin/account/update-verification.md new file mode 100644 index 0000000000..028eb7c4ce --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/account/update-verification.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val result = account.updateVerification( + userId = "<USER_ID>", + secret = "<SECRET>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/avatars/get-browser.md b/docs/examples/1.8.x/client-android/kotlin/avatars/get-browser.md new file mode 100644 index 0000000000..d04adfbbdc --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/avatars/get-browser.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.Browser + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getBrowser( + code = Browser.AVANT_BROWSER, + width = 0, // (optional) + height = 0, // (optional) + quality = -1, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/avatars/get-credit-card.md b/docs/examples/1.8.x/client-android/kotlin/avatars/get-credit-card.md new file mode 100644 index 0000000000..91c88da5dd --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/avatars/get-credit-card.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.CreditCard + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getCreditCard( + code = CreditCard.AMERICAN_EXPRESS, + width = 0, // (optional) + height = 0, // (optional) + quality = -1, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/avatars/get-favicon.md b/docs/examples/1.8.x/client-android/kotlin/avatars/get-favicon.md new file mode 100644 index 0000000000..01df8cb54b --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/avatars/get-favicon.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getFavicon( + url = "https://example.com", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/avatars/get-flag.md b/docs/examples/1.8.x/client-android/kotlin/avatars/get-flag.md new file mode 100644 index 0000000000..1dbc1cdf4b --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/avatars/get-flag.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.Flag + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getFlag( + code = Flag.AFGHANISTAN, + width = 0, // (optional) + height = 0, // (optional) + quality = -1, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/avatars/get-image.md b/docs/examples/1.8.x/client-android/kotlin/avatars/get-image.md new file mode 100644 index 0000000000..64166c0a6d --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/avatars/get-image.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getImage( + url = "https://example.com", + width = 0, // (optional) + height = 0, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/avatars/get-initials.md b/docs/examples/1.8.x/client-android/kotlin/avatars/get-initials.md new file mode 100644 index 0000000000..883da02744 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/avatars/get-initials.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getInitials( + name = "<NAME>", // (optional) + width = 0, // (optional) + height = 0, // (optional) + background = "", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/avatars/get-qr.md b/docs/examples/1.8.x/client-android/kotlin/avatars/get-qr.md new file mode 100644 index 0000000000..fa8a38cabb --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/avatars/get-qr.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val avatars = Avatars(client) + +val result = avatars.getQR( + text = "<TEXT>", + size = 1, // (optional) + margin = 0, // (optional) + download = false, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/databases/create-document.md b/docs/examples/1.8.x/client-android/kotlin/databases/create-document.md new file mode 100644 index 0000000000..7f0aaf81f4 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/databases/create-document.md @@ -0,0 +1,23 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val databases = Databases(client) + +val result = databases.createDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf("read("any")"), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/databases/decrement-document-attribute.md b/docs/examples/1.8.x/client-android/kotlin/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..c500fa8687 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val databases = Databases(client) + +val result = databases.decrementDocumentAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + attribute = "", + value = 0, // (optional) + min = 0, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/databases/delete-document.md b/docs/examples/1.8.x/client-android/kotlin/databases/delete-document.md new file mode 100644 index 0000000000..052bf97f89 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/databases/delete-document.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val databases = Databases(client) + +val result = databases.deleteDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/databases/get-document.md b/docs/examples/1.8.x/client-android/kotlin/databases/get-document.md new file mode 100644 index 0000000000..157af2b562 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/databases/get-document.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val databases = Databases(client) + +val result = databases.getDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + queries = listOf(), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/databases/increment-document-attribute.md b/docs/examples/1.8.x/client-android/kotlin/databases/increment-document-attribute.md new file mode 100644 index 0000000000..0ae6b02d3d --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val databases = Databases(client) + +val result = databases.incrementDocumentAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + attribute = "", + value = 0, // (optional) + max = 0, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/databases/list-documents.md b/docs/examples/1.8.x/client-android/kotlin/databases/list-documents.md new file mode 100644 index 0000000000..1cc785fab1 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/databases/list-documents.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val databases = Databases(client) + +val result = databases.listDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf(), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/databases/update-document.md b/docs/examples/1.8.x/client-android/kotlin/databases/update-document.md new file mode 100644 index 0000000000..d61fdea5b1 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/databases/update-document.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val databases = Databases(client) + +val result = databases.updateDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( "a" to "b" ), // (optional) + permissions = listOf("read("any")"), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/databases/upsert-document.md b/docs/examples/1.8.x/client-android/kotlin/databases/upsert-document.md new file mode 100644 index 0000000000..a31dfc8797 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/databases/upsert-document.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val databases = Databases(client) + +val result = databases.upsertDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( "a" to "b" ), + permissions = listOf("read("any")"), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/functions/create-execution.md b/docs/examples/1.8.x/client-android/kotlin/functions/create-execution.md new file mode 100644 index 0000000000..5e1950b8d9 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/functions/create-execution.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val functions = Functions(client) + +val result = functions.createExecution( + functionId = "<FUNCTION_ID>", + body = "<BODY>", // (optional) + async = false, // (optional) + path = "<PATH>", // (optional) + method = ExecutionMethod.GET, // (optional) + headers = mapOf( "a" to "b" ), // (optional) + scheduledAt = "<SCHEDULED_AT>", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/functions/get-execution.md b/docs/examples/1.8.x/client-android/kotlin/functions/get-execution.md new file mode 100644 index 0000000000..267be53cbb --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/functions/get-execution.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val functions = Functions(client) + +val result = functions.getExecution( + functionId = "<FUNCTION_ID>", + executionId = "<EXECUTION_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/functions/list-executions.md b/docs/examples/1.8.x/client-android/kotlin/functions/list-executions.md new file mode 100644 index 0000000000..37ea8b8228 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/functions/list-executions.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val functions = Functions(client) + +val result = functions.listExecutions( + functionId = "<FUNCTION_ID>", + queries = listOf(), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/graphql/mutation.md b/docs/examples/1.8.x/client-android/kotlin/graphql/mutation.md new file mode 100644 index 0000000000..a3a762203d --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/graphql/mutation.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Graphql + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val graphql = Graphql(client) + +val result = graphql.mutation( + query = mapOf( "a" to "b" ), +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/graphql/query.md b/docs/examples/1.8.x/client-android/kotlin/graphql/query.md new file mode 100644 index 0000000000..13f149cbf0 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/graphql/query.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Graphql + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val graphql = Graphql(client) + +val result = graphql.query( + query = mapOf( "a" to "b" ), +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/locale/get.md b/docs/examples/1.8.x/client-android/kotlin/locale/get.md new file mode 100644 index 0000000000..a116aed349 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/locale/get.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val locale = Locale(client) + +val result = locale.get() diff --git a/docs/examples/1.8.x/client-android/kotlin/locale/list-codes.md b/docs/examples/1.8.x/client-android/kotlin/locale/list-codes.md new file mode 100644 index 0000000000..0b63b06e3e --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/locale/list-codes.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val locale = Locale(client) + +val result = locale.listCodes() diff --git a/docs/examples/1.8.x/client-android/kotlin/locale/list-continents.md b/docs/examples/1.8.x/client-android/kotlin/locale/list-continents.md new file mode 100644 index 0000000000..98acdc9b6a --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/locale/list-continents.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val locale = Locale(client) + +val result = locale.listContinents() diff --git a/docs/examples/1.8.x/client-android/kotlin/locale/list-countries-eu.md b/docs/examples/1.8.x/client-android/kotlin/locale/list-countries-eu.md new file mode 100644 index 0000000000..c01602598b --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/locale/list-countries-eu.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val locale = Locale(client) + +val result = locale.listCountriesEU() diff --git a/docs/examples/1.8.x/client-android/kotlin/locale/list-countries-phones.md b/docs/examples/1.8.x/client-android/kotlin/locale/list-countries-phones.md new file mode 100644 index 0000000000..d95c1c6ff6 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/locale/list-countries-phones.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val locale = Locale(client) + +val result = locale.listCountriesPhones() diff --git a/docs/examples/1.8.x/client-android/kotlin/locale/list-countries.md b/docs/examples/1.8.x/client-android/kotlin/locale/list-countries.md new file mode 100644 index 0000000000..4775161159 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/locale/list-countries.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val locale = Locale(client) + +val result = locale.listCountries() diff --git a/docs/examples/1.8.x/client-android/kotlin/locale/list-currencies.md b/docs/examples/1.8.x/client-android/kotlin/locale/list-currencies.md new file mode 100644 index 0000000000..6d0a04f808 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/locale/list-currencies.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val locale = Locale(client) + +val result = locale.listCurrencies() diff --git a/docs/examples/1.8.x/client-android/kotlin/locale/list-languages.md b/docs/examples/1.8.x/client-android/kotlin/locale/list-languages.md new file mode 100644 index 0000000000..de588aa077 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/locale/list-languages.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val locale = Locale(client) + +val result = locale.listLanguages() diff --git a/docs/examples/1.8.x/client-android/kotlin/messaging/create-subscriber.md b/docs/examples/1.8.x/client-android/kotlin/messaging/create-subscriber.md new file mode 100644 index 0000000000..b7e244f041 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/messaging/create-subscriber.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val messaging = Messaging(client) + +val result = messaging.createSubscriber( + topicId = "<TOPIC_ID>", + subscriberId = "<SUBSCRIBER_ID>", + targetId = "<TARGET_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/messaging/delete-subscriber.md b/docs/examples/1.8.x/client-android/kotlin/messaging/delete-subscriber.md new file mode 100644 index 0000000000..9e102d6faa --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/messaging/delete-subscriber.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val messaging = Messaging(client) + +val result = messaging.deleteSubscriber( + topicId = "<TOPIC_ID>", + subscriberId = "<SUBSCRIBER_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/storage/create-file.md b/docs/examples/1.8.x/client-android/kotlin/storage/create-file.md new file mode 100644 index 0000000000..1c78c51e67 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/storage/create-file.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.models.InputFile +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val storage = Storage(client) + +val result = storage.createFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + file = InputFile.fromPath("file.png"), + permissions = listOf("read("any")"), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/storage/delete-file.md b/docs/examples/1.8.x/client-android/kotlin/storage/delete-file.md new file mode 100644 index 0000000000..ca40f41b71 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/storage/delete-file.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val storage = Storage(client) + +val result = storage.deleteFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/storage/get-file-download.md b/docs/examples/1.8.x/client-android/kotlin/storage/get-file-download.md new file mode 100644 index 0000000000..89c6e8a992 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/storage/get-file-download.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val storage = Storage(client) + +val result = storage.getFileDownload( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + token = "<TOKEN>", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/storage/get-file-preview.md b/docs/examples/1.8.x/client-android/kotlin/storage/get-file-preview.md new file mode 100644 index 0000000000..d766dc7174 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/storage/get-file-preview.md @@ -0,0 +1,26 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val storage = Storage(client) + +val result = storage.getFilePreview( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + width = 0, // (optional) + height = 0, // (optional) + gravity = ImageGravity.CENTER, // (optional) + quality = -1, // (optional) + borderWidth = 0, // (optional) + borderColor = "", // (optional) + borderRadius = 0, // (optional) + opacity = 0, // (optional) + rotation = -360, // (optional) + background = "", // (optional) + output = ImageFormat.JPG, // (optional) + token = "<TOKEN>", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/storage/get-file-view.md b/docs/examples/1.8.x/client-android/kotlin/storage/get-file-view.md new file mode 100644 index 0000000000..513e1f9a90 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/storage/get-file-view.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val storage = Storage(client) + +val result = storage.getFileView( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + token = "<TOKEN>", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/storage/get-file.md b/docs/examples/1.8.x/client-android/kotlin/storage/get-file.md new file mode 100644 index 0000000000..1e9943059b --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/storage/get-file.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val storage = Storage(client) + +val result = storage.getFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/storage/list-files.md b/docs/examples/1.8.x/client-android/kotlin/storage/list-files.md new file mode 100644 index 0000000000..06f6cda4eb --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/storage/list-files.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val storage = Storage(client) + +val result = storage.listFiles( + bucketId = "<BUCKET_ID>", + queries = listOf(), // (optional) + search = "<SEARCH>", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/storage/update-file.md b/docs/examples/1.8.x/client-android/kotlin/storage/update-file.md new file mode 100644 index 0000000000..116d156ead --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/storage/update-file.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val storage = Storage(client) + +val result = storage.updateFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + name = "<NAME>", // (optional) + permissions = listOf("read("any")"), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/tablesdb/create-row.md b/docs/examples/1.8.x/client-android/kotlin/tablesdb/create-row.md new file mode 100644 index 0000000000..eb44cc48d6 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/tablesdb/create-row.md @@ -0,0 +1,23 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.createRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf("read("any")"), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/client-android/kotlin/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..645e9f4a66 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/tablesdb/decrement-row-column.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.decrementRowColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + column = "", + value = 0, // (optional) + min = 0, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/tablesdb/delete-row.md b/docs/examples/1.8.x/client-android/kotlin/tablesdb/delete-row.md new file mode 100644 index 0000000000..3fcd409295 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/tablesdb/delete-row.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.deleteRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/tablesdb/get-row.md b/docs/examples/1.8.x/client-android/kotlin/tablesdb/get-row.md new file mode 100644 index 0000000000..b754cba915 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/tablesdb/get-row.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.getRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + queries = listOf(), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/tablesdb/increment-row-column.md b/docs/examples/1.8.x/client-android/kotlin/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..230408abac --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/tablesdb/increment-row-column.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.incrementRowColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + column = "", + value = 0, // (optional) + max = 0, // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/tablesdb/list-rows.md b/docs/examples/1.8.x/client-android/kotlin/tablesdb/list-rows.md new file mode 100644 index 0000000000..05d9ca33b3 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/tablesdb/list-rows.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.listRows( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + queries = listOf(), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/tablesdb/update-row.md b/docs/examples/1.8.x/client-android/kotlin/tablesdb/update-row.md new file mode 100644 index 0000000000..f99f8f275e --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/tablesdb/update-row.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.updateRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + data = mapOf( "a" to "b" ), // (optional) + permissions = listOf("read("any")"), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/tablesdb/upsert-row.md b/docs/examples/1.8.x/client-android/kotlin/tablesdb/upsert-row.md new file mode 100644 index 0000000000..d82406a7f8 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/tablesdb/upsert-row.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val tablesDB = TablesDB(client) + +val result = tablesDB.upsertRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + data = mapOf( "a" to "b" ), // (optional) + permissions = listOf("read("any")"), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/create-membership.md b/docs/examples/1.8.x/client-android/kotlin/teams/create-membership.md new file mode 100644 index 0000000000..70eb7ddd19 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/create-membership.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.createMembership( + teamId = "<TEAM_ID>", + roles = listOf(), + email = "email@example.com", // (optional) + userId = "<USER_ID>", // (optional) + phone = "+12065550100", // (optional) + url = "https://example.com", // (optional) + name = "<NAME>", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/create.md b/docs/examples/1.8.x/client-android/kotlin/teams/create.md new file mode 100644 index 0000000000..dfa4df446e --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/create.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.create( + teamId = "<TEAM_ID>", + name = "<NAME>", + roles = listOf(), // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/delete-membership.md b/docs/examples/1.8.x/client-android/kotlin/teams/delete-membership.md new file mode 100644 index 0000000000..adf1119761 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/delete-membership.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.deleteMembership( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/delete.md b/docs/examples/1.8.x/client-android/kotlin/teams/delete.md new file mode 100644 index 0000000000..e144a78e3d --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/delete.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.delete( + teamId = "<TEAM_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/get-membership.md b/docs/examples/1.8.x/client-android/kotlin/teams/get-membership.md new file mode 100644 index 0000000000..8fb8c54c3b --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/get-membership.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.getMembership( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/get-prefs.md b/docs/examples/1.8.x/client-android/kotlin/teams/get-prefs.md new file mode 100644 index 0000000000..5e892fb49d --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/get-prefs.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.getPrefs( + teamId = "<TEAM_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/get.md b/docs/examples/1.8.x/client-android/kotlin/teams/get.md new file mode 100644 index 0000000000..dbb487d3d6 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/get.md @@ -0,0 +1,13 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.get( + teamId = "<TEAM_ID>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/list-memberships.md b/docs/examples/1.8.x/client-android/kotlin/teams/list-memberships.md new file mode 100644 index 0000000000..e305403a52 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/list-memberships.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.listMemberships( + teamId = "<TEAM_ID>", + queries = listOf(), // (optional) + search = "<SEARCH>", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/list.md b/docs/examples/1.8.x/client-android/kotlin/teams/list.md new file mode 100644 index 0000000000..984858d26c --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/list.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.list( + queries = listOf(), // (optional) + search = "<SEARCH>", // (optional) +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/update-membership-status.md b/docs/examples/1.8.x/client-android/kotlin/teams/update-membership-status.md new file mode 100644 index 0000000000..c3770c7f1e --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/update-membership-status.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.updateMembershipStatus( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>", + userId = "<USER_ID>", + secret = "<SECRET>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/update-membership.md b/docs/examples/1.8.x/client-android/kotlin/teams/update-membership.md new file mode 100644 index 0000000000..86216a8692 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/update-membership.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.updateMembership( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>", + roles = listOf(), +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/update-name.md b/docs/examples/1.8.x/client-android/kotlin/teams/update-name.md new file mode 100644 index 0000000000..abeb6dc7c1 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/update-name.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.updateName( + teamId = "<TEAM_ID>", + name = "<NAME>", +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-android/kotlin/teams/update-prefs.md b/docs/examples/1.8.x/client-android/kotlin/teams/update-prefs.md new file mode 100644 index 0000000000..d0066a94b3 --- /dev/null +++ b/docs/examples/1.8.x/client-android/kotlin/teams/update-prefs.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client(context) + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val teams = Teams(client) + +val result = teams.updatePrefs( + teamId = "<TEAM_ID>", + prefs = mapOf( "a" to "b" ), +) \ No newline at end of file diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/client-apple/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..22020a16d9 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-anonymous-session.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.createAnonymousSession() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-email-password-session.md b/docs/examples/1.8.x/client-apple/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..5f541a8a15 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-email-password-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.createEmailPasswordSession( + email: "email@example.com", + password: "password" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-email-token.md b/docs/examples/1.8.x/client-apple/examples/account/create-email-token.md new file mode 100644 index 0000000000..cf82afde8f --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-email-token.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.createEmailToken( + userId: "<USER_ID>", + email: "email@example.com", + phrase: false // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-jwt.md b/docs/examples/1.8.x/client-apple/examples/account/create-jwt.md new file mode 100644 index 0000000000..fbcd50401c --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-jwt.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let jwt = try await account.createJWT() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/client-apple/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..27bbe4137e --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-magic-url-token.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.createMagicURLToken( + userId: "<USER_ID>", + email: "email@example.com", + url: "https://example.com", // optional + phrase: false // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/client-apple/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..cfe0082fba --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-mfa-authenticator.md @@ -0,0 +1,13 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let mfaType = try await account.createMFAAuthenticator( + type: .totp +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/client-apple/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..27f1bc1784 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-mfa-challenge.md @@ -0,0 +1,13 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let mfaChallenge = try await account.createMFAChallenge( + factor: .email +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/client-apple/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..2674a40760 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let mfaRecoveryCodes = try await account.createMFARecoveryCodes() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-o-auth-2-session.md b/docs/examples/1.8.x/client-apple/examples/account/create-o-auth-2-session.md new file mode 100644 index 0000000000..756112e701 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-o-auth-2-session.md @@ -0,0 +1,16 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let success = try await account.createOAuth2Session( + provider: .amazon, + success: "https://example.com", // optional + failure: "https://example.com", // optional + scopes: [] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/client-apple/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..21b54e8c9a --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-o-auth-2-token.md @@ -0,0 +1,16 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let success = try await account.createOAuth2Token( + provider: .amazon, + success: "https://example.com", // optional + failure: "https://example.com", // optional + scopes: [] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-phone-token.md b/docs/examples/1.8.x/client-apple/examples/account/create-phone-token.md new file mode 100644 index 0000000000..12b2d4b223 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-phone-token.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.createPhoneToken( + userId: "<USER_ID>", + phone: "+12065550100" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-phone-verification.md b/docs/examples/1.8.x/client-apple/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..f0eb94b6fc --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-phone-verification.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.createPhoneVerification() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-push-target.md b/docs/examples/1.8.x/client-apple/examples/account/create-push-target.md new file mode 100644 index 0000000000..ce2d194272 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-push-target.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let target = try await account.createPushTarget( + targetId: "<TARGET_ID>", + identifier: "<IDENTIFIER>", + providerId: "<PROVIDER_ID>" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-recovery.md b/docs/examples/1.8.x/client-apple/examples/account/create-recovery.md new file mode 100644 index 0000000000..ccfd5ac519 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-recovery.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.createRecovery( + email: "email@example.com", + url: "https://example.com" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-session.md b/docs/examples/1.8.x/client-apple/examples/account/create-session.md new file mode 100644 index 0000000000..2065692a16 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.createSession( + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create-verification.md b/docs/examples/1.8.x/client-apple/examples/account/create-verification.md new file mode 100644 index 0000000000..d3ca74c7c0 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create-verification.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.createVerification( + url: "https://example.com" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/create.md b/docs/examples/1.8.x/client-apple/examples/account/create.md new file mode 100644 index 0000000000..79b4db64ba --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/create.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let user = try await account.create( + userId: "<USER_ID>", + email: "email@example.com", + password: "", + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/delete-identity.md b/docs/examples/1.8.x/client-apple/examples/account/delete-identity.md new file mode 100644 index 0000000000..04a3ee5f47 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/delete-identity.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let result = try await account.deleteIdentity( + identityId: "<IDENTITY_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/client-apple/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..adfa363bcc --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,13 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let result = try await account.deleteMFAAuthenticator( + type: .totp +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/delete-push-target.md b/docs/examples/1.8.x/client-apple/examples/account/delete-push-target.md new file mode 100644 index 0000000000..a96a1b1d05 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/delete-push-target.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let result = try await account.deletePushTarget( + targetId: "<TARGET_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/delete-session.md b/docs/examples/1.8.x/client-apple/examples/account/delete-session.md new file mode 100644 index 0000000000..ea353e8723 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/delete-session.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let result = try await account.deleteSession( + sessionId: "<SESSION_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/delete-sessions.md b/docs/examples/1.8.x/client-apple/examples/account/delete-sessions.md new file mode 100644 index 0000000000..51a86bdcc3 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/delete-sessions.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let result = try await account.deleteSessions() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/client-apple/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..efee499ea7 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let mfaRecoveryCodes = try await account.getMFARecoveryCodes() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/get-prefs.md b/docs/examples/1.8.x/client-apple/examples/account/get-prefs.md new file mode 100644 index 0000000000..65ce5f5908 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/get-prefs.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let preferences = try await account.getPrefs() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/get-session.md b/docs/examples/1.8.x/client-apple/examples/account/get-session.md new file mode 100644 index 0000000000..bd491ff4d7 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/get-session.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.getSession( + sessionId: "<SESSION_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/get.md b/docs/examples/1.8.x/client-apple/examples/account/get.md new file mode 100644 index 0000000000..1b1213e1da --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/get.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let user = try await account.get() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/list-identities.md b/docs/examples/1.8.x/client-apple/examples/account/list-identities.md new file mode 100644 index 0000000000..1d3a999d4a --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/list-identities.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let identityList = try await account.listIdentities( + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/list-logs.md b/docs/examples/1.8.x/client-apple/examples/account/list-logs.md new file mode 100644 index 0000000000..2c42307f96 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/list-logs.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let logList = try await account.listLogs( + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/client-apple/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..d81e77e7ac --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/list-mfa-factors.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let mfaFactors = try await account.listMFAFactors() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/list-sessions.md b/docs/examples/1.8.x/client-apple/examples/account/list-sessions.md new file mode 100644 index 0000000000..99f6930cd2 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/list-sessions.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let sessionList = try await account.listSessions() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-email.md b/docs/examples/1.8.x/client-apple/examples/account/update-email.md new file mode 100644 index 0000000000..037133282b --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-email.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let user = try await account.updateEmail( + email: "email@example.com", + password: "password" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/client-apple/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..507006b230 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-magic-url-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.updateMagicURLSession( + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/client-apple/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..5245be2ec3 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-mfa-authenticator.md @@ -0,0 +1,14 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let user = try await account.updateMFAAuthenticator( + type: .totp, + otp: "<OTP>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/client-apple/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..473393eecd --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-mfa-challenge.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.updateMFAChallenge( + challengeId: "<CHALLENGE_ID>", + otp: "<OTP>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/client-apple/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..fbd6847e89 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let mfaRecoveryCodes = try await account.updateMFARecoveryCodes() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-mfa.md b/docs/examples/1.8.x/client-apple/examples/account/update-mfa.md new file mode 100644 index 0000000000..fe2b04f9a3 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-mfa.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let user = try await account.updateMFA( + mfa: false +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-name.md b/docs/examples/1.8.x/client-apple/examples/account/update-name.md new file mode 100644 index 0000000000..7f8abf54fb --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-name.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let user = try await account.updateName( + name: "<NAME>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-password.md b/docs/examples/1.8.x/client-apple/examples/account/update-password.md new file mode 100644 index 0000000000..7fa03caebc --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-password.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let user = try await account.updatePassword( + password: "", + oldPassword: "password" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-phone-session.md b/docs/examples/1.8.x/client-apple/examples/account/update-phone-session.md new file mode 100644 index 0000000000..f6776d1de1 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-phone-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.updatePhoneSession( + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-phone-verification.md b/docs/examples/1.8.x/client-apple/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..0bf2db1f0a --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-phone-verification.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.updatePhoneVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-phone.md b/docs/examples/1.8.x/client-apple/examples/account/update-phone.md new file mode 100644 index 0000000000..604fc85377 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-phone.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let user = try await account.updatePhone( + phone: "+12065550100", + password: "password" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-prefs.md b/docs/examples/1.8.x/client-apple/examples/account/update-prefs.md new file mode 100644 index 0000000000..c81f481f61 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-prefs.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let user = try await account.updatePrefs( + prefs: [ + "language": "en", + "timezone": "UTC", + "darkTheme": true + ] +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-push-target.md b/docs/examples/1.8.x/client-apple/examples/account/update-push-target.md new file mode 100644 index 0000000000..549c4d6c16 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-push-target.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let target = try await account.updatePushTarget( + targetId: "<TARGET_ID>", + identifier: "<IDENTIFIER>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-recovery.md b/docs/examples/1.8.x/client-apple/examples/account/update-recovery.md new file mode 100644 index 0000000000..536da69b8a --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-recovery.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.updateRecovery( + userId: "<USER_ID>", + secret: "<SECRET>", + password: "" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-session.md b/docs/examples/1.8.x/client-apple/examples/account/update-session.md new file mode 100644 index 0000000000..8999b0a310 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-session.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.updateSession( + sessionId: "<SESSION_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-status.md b/docs/examples/1.8.x/client-apple/examples/account/update-status.md new file mode 100644 index 0000000000..892858dfbc --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-status.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let user = try await account.updateStatus() + diff --git a/docs/examples/1.8.x/client-apple/examples/account/update-verification.md b/docs/examples/1.8.x/client-apple/examples/account/update-verification.md new file mode 100644 index 0000000000..094e10f33c --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/account/update-verification.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.updateVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/avatars/get-browser.md b/docs/examples/1.8.x/client-apple/examples/avatars/get-browser.md new file mode 100644 index 0000000000..ee0cc99f91 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/avatars/get-browser.md @@ -0,0 +1,16 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getBrowser( + code: .avantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/client-apple/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..779fce3f60 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/avatars/get-credit-card.md @@ -0,0 +1,16 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getCreditCard( + code: .americanExpress, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/avatars/get-favicon.md b/docs/examples/1.8.x/client-apple/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..b7dc6830c3 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/avatars/get-favicon.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getFavicon( + url: "https://example.com" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/avatars/get-flag.md b/docs/examples/1.8.x/client-apple/examples/avatars/get-flag.md new file mode 100644 index 0000000000..ba1d77be27 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/avatars/get-flag.md @@ -0,0 +1,16 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getFlag( + code: .afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/avatars/get-image.md b/docs/examples/1.8.x/client-apple/examples/avatars/get-image.md new file mode 100644 index 0000000000..0fe71e1765 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/avatars/get-image.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getImage( + url: "https://example.com", + width: 0, // optional + height: 0 // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/avatars/get-initials.md b/docs/examples/1.8.x/client-apple/examples/avatars/get-initials.md new file mode 100644 index 0000000000..2bbfbe6a47 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/avatars/get-initials.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getInitials( + name: "<NAME>", // optional + width: 0, // optional + height: 0, // optional + background: "" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/avatars/get-qr.md b/docs/examples/1.8.x/client-apple/examples/avatars/get-qr.md new file mode 100644 index 0000000000..3cc650c1b9 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/avatars/get-qr.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let avatars = Avatars(client) + +let bytes = try await avatars.getQR( + text: "<TEXT>", + size: 1, // optional + margin: 0, // optional + download: false // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/databases/create-document.md b/docs/examples/1.8.x/client-apple/examples/databases/create-document.md new file mode 100644 index 0000000000..c044eee17a --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/databases/create-document.md @@ -0,0 +1,22 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let databases = Databases(client) + +let document = try await databases.createDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/client-apple/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..8ef2637bf2 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/databases/decrement-document-attribute.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let databases = Databases(client) + +let document = try await databases.decrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, // optional + min: 0 // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/databases/delete-document.md b/docs/examples/1.8.x/client-apple/examples/databases/delete-document.md new file mode 100644 index 0000000000..301203dc7f --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/databases/delete-document.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let databases = Databases(client) + +let result = try await databases.deleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/databases/get-document.md b/docs/examples/1.8.x/client-apple/examples/databases/get-document.md new file mode 100644 index 0000000000..6e4dc55c6d --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/databases/get-document.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let databases = Databases(client) + +let document = try await databases.getDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/client-apple/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..f64b2cd76c --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/databases/increment-document-attribute.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let databases = Databases(client) + +let document = try await databases.incrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, // optional + max: 0 // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/databases/list-documents.md b/docs/examples/1.8.x/client-apple/examples/databases/list-documents.md new file mode 100644 index 0000000000..0d624f3a92 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/databases/list-documents.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let databases = Databases(client) + +let documentList = try await databases.listDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/databases/update-document.md b/docs/examples/1.8.x/client-apple/examples/databases/update-document.md new file mode 100644 index 0000000000..af224c8e09 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/databases/update-document.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let databases = Databases(client) + +let document = try await databases.updateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [:], // optional + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/databases/upsert-document.md b/docs/examples/1.8.x/client-apple/examples/databases/upsert-document.md new file mode 100644 index 0000000000..3e1bf83a66 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/databases/upsert-document.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let databases = Databases(client) + +let document = try await databases.upsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [:], + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/functions/create-execution.md b/docs/examples/1.8.x/client-apple/examples/functions/create-execution.md new file mode 100644 index 0000000000..b7311df846 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/functions/create-execution.md @@ -0,0 +1,19 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let functions = Functions(client) + +let execution = try await functions.createExecution( + functionId: "<FUNCTION_ID>", + body: "<BODY>", // optional + async: false, // optional + path: "<PATH>", // optional + method: .gET, // optional + headers: [:], // optional + scheduledAt: "<SCHEDULED_AT>" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/functions/get-execution.md b/docs/examples/1.8.x/client-apple/examples/functions/get-execution.md new file mode 100644 index 0000000000..787f297b2c --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/functions/get-execution.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let functions = Functions(client) + +let execution = try await functions.getExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/functions/list-executions.md b/docs/examples/1.8.x/client-apple/examples/functions/list-executions.md new file mode 100644 index 0000000000..1636d96c6d --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/functions/list-executions.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let functions = Functions(client) + +let executionList = try await functions.listExecutions( + functionId: "<FUNCTION_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/graphql/mutation.md b/docs/examples/1.8.x/client-apple/examples/graphql/mutation.md new file mode 100644 index 0000000000..6cd2e588f9 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/graphql/mutation.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let graphql = Graphql(client) + +let any = try await graphql.mutation( + query: [:] +) + diff --git a/docs/examples/1.8.x/client-apple/examples/graphql/query.md b/docs/examples/1.8.x/client-apple/examples/graphql/query.md new file mode 100644 index 0000000000..47e4c243fa --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/graphql/query.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let graphql = Graphql(client) + +let any = try await graphql.query( + query: [:] +) + diff --git a/docs/examples/1.8.x/client-apple/examples/locale/get.md b/docs/examples/1.8.x/client-apple/examples/locale/get.md new file mode 100644 index 0000000000..9c48317a1d --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/locale/get.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let locale = Locale(client) + +let locale = try await locale.get() + diff --git a/docs/examples/1.8.x/client-apple/examples/locale/list-codes.md b/docs/examples/1.8.x/client-apple/examples/locale/list-codes.md new file mode 100644 index 0000000000..21d693a7b8 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/locale/list-codes.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let locale = Locale(client) + +let localeCodeList = try await locale.listCodes() + diff --git a/docs/examples/1.8.x/client-apple/examples/locale/list-continents.md b/docs/examples/1.8.x/client-apple/examples/locale/list-continents.md new file mode 100644 index 0000000000..bd44915a34 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/locale/list-continents.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let locale = Locale(client) + +let continentList = try await locale.listContinents() + diff --git a/docs/examples/1.8.x/client-apple/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/client-apple/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..2dc24e5a63 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/locale/list-countries-eu.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let locale = Locale(client) + +let countryList = try await locale.listCountriesEU() + diff --git a/docs/examples/1.8.x/client-apple/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/client-apple/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..f3ab6b1f6d --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/locale/list-countries-phones.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let locale = Locale(client) + +let phoneList = try await locale.listCountriesPhones() + diff --git a/docs/examples/1.8.x/client-apple/examples/locale/list-countries.md b/docs/examples/1.8.x/client-apple/examples/locale/list-countries.md new file mode 100644 index 0000000000..dadcd3ee26 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/locale/list-countries.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let locale = Locale(client) + +let countryList = try await locale.listCountries() + diff --git a/docs/examples/1.8.x/client-apple/examples/locale/list-currencies.md b/docs/examples/1.8.x/client-apple/examples/locale/list-currencies.md new file mode 100644 index 0000000000..dc20ead45e --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/locale/list-currencies.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let locale = Locale(client) + +let currencyList = try await locale.listCurrencies() + diff --git a/docs/examples/1.8.x/client-apple/examples/locale/list-languages.md b/docs/examples/1.8.x/client-apple/examples/locale/list-languages.md new file mode 100644 index 0000000000..92c1d7b1dc --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/locale/list-languages.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let locale = Locale(client) + +let languageList = try await locale.listLanguages() + diff --git a/docs/examples/1.8.x/client-apple/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/client-apple/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..f85d5e6fb1 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/messaging/create-subscriber.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let messaging = Messaging(client) + +let subscriber = try await messaging.createSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>", + targetId: "<TARGET_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/client-apple/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..f1cdda95c7 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/messaging/delete-subscriber.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let messaging = Messaging(client) + +let result = try await messaging.deleteSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/storage/create-file.md b/docs/examples/1.8.x/client-apple/examples/storage/create-file.md new file mode 100644 index 0000000000..2db9b20e1b --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/storage/create-file.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let storage = Storage(client) + +let file = try await storage.createFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + file: InputFile.fromPath("file.png"), + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/storage/delete-file.md b/docs/examples/1.8.x/client-apple/examples/storage/delete-file.md new file mode 100644 index 0000000000..ca721a4a41 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/storage/delete-file.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let storage = Storage(client) + +let result = try await storage.deleteFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/storage/get-file-download.md b/docs/examples/1.8.x/client-apple/examples/storage/get-file-download.md new file mode 100644 index 0000000000..9338958ede --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/storage/get-file-download.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let storage = Storage(client) + +let bytes = try await storage.getFileDownload( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/storage/get-file-preview.md b/docs/examples/1.8.x/client-apple/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..1395d7e782 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/storage/get-file-preview.md @@ -0,0 +1,26 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let storage = Storage(client) + +let bytes = try await storage.getFilePreview( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + width: 0, // optional + height: 0, // optional + gravity: .center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: "", // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: "", // optional + output: .jpg, // optional + token: "<TOKEN>" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/storage/get-file-view.md b/docs/examples/1.8.x/client-apple/examples/storage/get-file-view.md new file mode 100644 index 0000000000..bc5ad02727 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/storage/get-file-view.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let storage = Storage(client) + +let bytes = try await storage.getFileView( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/storage/get-file.md b/docs/examples/1.8.x/client-apple/examples/storage/get-file.md new file mode 100644 index 0000000000..2730b4d528 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/storage/get-file.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let storage = Storage(client) + +let file = try await storage.getFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/storage/list-files.md b/docs/examples/1.8.x/client-apple/examples/storage/list-files.md new file mode 100644 index 0000000000..48bd0d065f --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/storage/list-files.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let storage = Storage(client) + +let fileList = try await storage.listFiles( + bucketId: "<BUCKET_ID>", + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/storage/update-file.md b/docs/examples/1.8.x/client-apple/examples/storage/update-file.md new file mode 100644 index 0000000000..adef969845 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/storage/update-file.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let storage = Storage(client) + +let file = try await storage.updateFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + name: "<NAME>", // optional + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/tablesdb/create-row.md b/docs/examples/1.8.x/client-apple/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..2ee601340f --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/tablesdb/create-row.md @@ -0,0 +1,22 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.createRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/client-apple/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..ab8ac5b0b8 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.decrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "", + value: 0, // optional + min: 0 // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/client-apple/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..b527acaed9 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/tablesdb/delete-row.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/tablesdb/get-row.md b/docs/examples/1.8.x/client-apple/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..bc2e2c6b55 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/tablesdb/get-row.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.getRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/client-apple/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..550d6685af --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/tablesdb/increment-row-column.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.incrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "", + value: 0, // optional + max: 0 // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/client-apple/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..94853c24a0 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/tablesdb/list-rows.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.listRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/tablesdb/update-row.md b/docs/examples/1.8.x/client-apple/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..87a8f27313 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/tablesdb/update-row.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.updateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: [:], // optional + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/client-apple/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..ed95da7b62 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/tablesdb/upsert-row.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.upsertRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: [:], // optional + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/create-membership.md b/docs/examples/1.8.x/client-apple/examples/teams/create-membership.md new file mode 100644 index 0000000000..3c6d093c64 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/create-membership.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let membership = try await teams.createMembership( + teamId: "<TEAM_ID>", + roles: [], + email: "email@example.com", // optional + userId: "<USER_ID>", // optional + phone: "+12065550100", // optional + url: "https://example.com", // optional + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/create.md b/docs/examples/1.8.x/client-apple/examples/teams/create.md new file mode 100644 index 0000000000..b9f5ea4080 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/create.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let team = try await teams.create( + teamId: "<TEAM_ID>", + name: "<NAME>", + roles: [] // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/delete-membership.md b/docs/examples/1.8.x/client-apple/examples/teams/delete-membership.md new file mode 100644 index 0000000000..7c21410bf3 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/delete-membership.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let result = try await teams.deleteMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/delete.md b/docs/examples/1.8.x/client-apple/examples/teams/delete.md new file mode 100644 index 0000000000..1787b4c749 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/delete.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let result = try await teams.delete( + teamId: "<TEAM_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/get-membership.md b/docs/examples/1.8.x/client-apple/examples/teams/get-membership.md new file mode 100644 index 0000000000..837a92dd04 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/get-membership.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let membership = try await teams.getMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/get-prefs.md b/docs/examples/1.8.x/client-apple/examples/teams/get-prefs.md new file mode 100644 index 0000000000..b5b17a3bc2 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/get-prefs.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let preferences = try await teams.getPrefs( + teamId: "<TEAM_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/get.md b/docs/examples/1.8.x/client-apple/examples/teams/get.md new file mode 100644 index 0000000000..af358fbb67 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/get.md @@ -0,0 +1,12 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let team = try await teams.get( + teamId: "<TEAM_ID>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/list-memberships.md b/docs/examples/1.8.x/client-apple/examples/teams/list-memberships.md new file mode 100644 index 0000000000..5c8669a3d8 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/list-memberships.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let membershipList = try await teams.listMemberships( + teamId: "<TEAM_ID>", + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/list.md b/docs/examples/1.8.x/client-apple/examples/teams/list.md new file mode 100644 index 0000000000..be81e9c5aa --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/list.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let teamList = try await teams.list( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/update-membership-status.md b/docs/examples/1.8.x/client-apple/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..1f3cb39d92 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/update-membership-status.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let membership = try await teams.updateMembershipStatus( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/update-membership.md b/docs/examples/1.8.x/client-apple/examples/teams/update-membership.md new file mode 100644 index 0000000000..eaa61799c2 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/update-membership.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let membership = try await teams.updateMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + roles: [] +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/update-name.md b/docs/examples/1.8.x/client-apple/examples/teams/update-name.md new file mode 100644 index 0000000000..ce5188b950 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/update-name.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let team = try await teams.updateName( + teamId: "<TEAM_ID>", + name: "<NAME>" +) + diff --git a/docs/examples/1.8.x/client-apple/examples/teams/update-prefs.md b/docs/examples/1.8.x/client-apple/examples/teams/update-prefs.md new file mode 100644 index 0000000000..e20ec2ea18 --- /dev/null +++ b/docs/examples/1.8.x/client-apple/examples/teams/update-prefs.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let teams = Teams(client) + +let preferences = try await teams.updatePrefs( + teamId: "<TEAM_ID>", + prefs: [:] +) + diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/client-flutter/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..cdcd98ddb2 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-anonymous-session.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.createAnonymousSession(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-email-password-session.md b/docs/examples/1.8.x/client-flutter/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..66bc2ab5f4 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-email-password-session.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.createEmailPasswordSession( + email: 'email@example.com', + password: 'password', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-email-token.md b/docs/examples/1.8.x/client-flutter/examples/account/create-email-token.md new file mode 100644 index 0000000000..2640894502 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-email-token.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.createEmailToken( + userId: '<USER_ID>', + email: 'email@example.com', + phrase: false, // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-jwt.md b/docs/examples/1.8.x/client-flutter/examples/account/create-jwt.md new file mode 100644 index 0000000000..b9cbc8f5a5 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-jwt.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Jwt result = await account.createJWT(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/client-flutter/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..454a951022 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-magic-url-token.md @@ -0,0 +1,14 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.createMagicURLToken( + userId: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false, // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/client-flutter/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..b9d7e967b2 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-mfa-authenticator.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +MfaType result = await account.createMFAAuthenticator( + type: AuthenticatorType.totp, +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/client-flutter/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..09ce17b27c --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-mfa-challenge.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +MfaChallenge result = await account.createMFAChallenge( + factor: AuthenticationFactor.email, +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/client-flutter/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..9b69ad1bd9 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +MfaRecoveryCodes result = await account.createMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-o-auth-2-session.md b/docs/examples/1.8.x/client-flutter/examples/account/create-o-auth-2-session.md new file mode 100644 index 0000000000..ab53f4a777 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-o-auth-2-session.md @@ -0,0 +1,14 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +await account.createOAuth2Session( + provider: OAuthProvider.amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/client-flutter/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..d6b6c72c7e --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-o-auth-2-token.md @@ -0,0 +1,14 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +await account.createOAuth2Token( + provider: OAuthProvider.amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-phone-token.md b/docs/examples/1.8.x/client-flutter/examples/account/create-phone-token.md new file mode 100644 index 0000000000..ff0187f0dc --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-phone-token.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.createPhoneToken( + userId: '<USER_ID>', + phone: '+12065550100', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-phone-verification.md b/docs/examples/1.8.x/client-flutter/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..11e215a060 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-phone-verification.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.createPhoneVerification(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-push-target.md b/docs/examples/1.8.x/client-flutter/examples/account/create-push-target.md new file mode 100644 index 0000000000..fd1755e3c5 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-push-target.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Target result = await account.createPushTarget( + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-recovery.md b/docs/examples/1.8.x/client-flutter/examples/account/create-recovery.md new file mode 100644 index 0000000000..44985beb80 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-recovery.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.createRecovery( + email: 'email@example.com', + url: 'https://example.com', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-session.md b/docs/examples/1.8.x/client-flutter/examples/account/create-session.md new file mode 100644 index 0000000000..e54e68a317 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-session.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.createSession( + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create-verification.md b/docs/examples/1.8.x/client-flutter/examples/account/create-verification.md new file mode 100644 index 0000000000..8f96997249 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create-verification.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.createVerification( + url: 'https://example.com', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/create.md b/docs/examples/1.8.x/client-flutter/examples/account/create.md new file mode 100644 index 0000000000..ae0d526944 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/create.md @@ -0,0 +1,14 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +User result = await account.create( + userId: '<USER_ID>', + email: 'email@example.com', + password: '', + name: '<NAME>', // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/delete-identity.md b/docs/examples/1.8.x/client-flutter/examples/account/delete-identity.md new file mode 100644 index 0000000000..849fa726a4 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/delete-identity.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +await account.deleteIdentity( + identityId: '<IDENTITY_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/client-flutter/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..b938ca68e9 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +await account.deleteMFAAuthenticator( + type: AuthenticatorType.totp, +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/delete-push-target.md b/docs/examples/1.8.x/client-flutter/examples/account/delete-push-target.md new file mode 100644 index 0000000000..6393d4ed4e --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/delete-push-target.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +await account.deletePushTarget( + targetId: '<TARGET_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/delete-session.md b/docs/examples/1.8.x/client-flutter/examples/account/delete-session.md new file mode 100644 index 0000000000..55abb18c85 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/delete-session.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +await account.deleteSession( + sessionId: '<SESSION_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/delete-sessions.md b/docs/examples/1.8.x/client-flutter/examples/account/delete-sessions.md new file mode 100644 index 0000000000..c50b611cac --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/delete-sessions.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +await account.deleteSessions(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/client-flutter/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..09bff7ffbd --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +MfaRecoveryCodes result = await account.getMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/get-prefs.md b/docs/examples/1.8.x/client-flutter/examples/account/get-prefs.md new file mode 100644 index 0000000000..9332da3a63 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/get-prefs.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Preferences result = await account.getPrefs(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/get-session.md b/docs/examples/1.8.x/client-flutter/examples/account/get-session.md new file mode 100644 index 0000000000..d68afcecd2 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/get-session.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.getSession( + sessionId: '<SESSION_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/get.md b/docs/examples/1.8.x/client-flutter/examples/account/get.md new file mode 100644 index 0000000000..a318617f78 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/get.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +User result = await account.get(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/list-identities.md b/docs/examples/1.8.x/client-flutter/examples/account/list-identities.md new file mode 100644 index 0000000000..9d2ad83c17 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/list-identities.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +IdentityList result = await account.listIdentities( + queries: [], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/list-logs.md b/docs/examples/1.8.x/client-flutter/examples/account/list-logs.md new file mode 100644 index 0000000000..6d9b120991 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/list-logs.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +LogList result = await account.listLogs( + queries: [], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/client-flutter/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..5e87cbaac5 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/list-mfa-factors.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +MfaFactors result = await account.listMFAFactors(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/list-sessions.md b/docs/examples/1.8.x/client-flutter/examples/account/list-sessions.md new file mode 100644 index 0000000000..fd1d0e080c --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/list-sessions.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +SessionList result = await account.listSessions(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-email.md b/docs/examples/1.8.x/client-flutter/examples/account/update-email.md new file mode 100644 index 0000000000..0f3d998284 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-email.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +User result = await account.updateEmail( + email: 'email@example.com', + password: 'password', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/client-flutter/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..d0f91eb0a4 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-magic-url-session.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.updateMagicURLSession( + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/client-flutter/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..96bdcc1bc3 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-mfa-authenticator.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +User result = await account.updateMFAAuthenticator( + type: AuthenticatorType.totp, + otp: '<OTP>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/client-flutter/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..b917e4119c --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-mfa-challenge.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.updateMFAChallenge( + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/client-flutter/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..377149bf60 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +MfaRecoveryCodes result = await account.updateMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-mfa.md b/docs/examples/1.8.x/client-flutter/examples/account/update-mfa.md new file mode 100644 index 0000000000..fc81c565ed --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-mfa.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +User result = await account.updateMFA( + mfa: false, +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-name.md b/docs/examples/1.8.x/client-flutter/examples/account/update-name.md new file mode 100644 index 0000000000..303a12351f --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-name.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +User result = await account.updateName( + name: '<NAME>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-password.md b/docs/examples/1.8.x/client-flutter/examples/account/update-password.md new file mode 100644 index 0000000000..835d2383ca --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-password.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +User result = await account.updatePassword( + password: '', + oldPassword: 'password', // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-phone-session.md b/docs/examples/1.8.x/client-flutter/examples/account/update-phone-session.md new file mode 100644 index 0000000000..36801792f6 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-phone-session.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.updatePhoneSession( + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-phone-verification.md b/docs/examples/1.8.x/client-flutter/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..f5bbb773d0 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-phone-verification.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.updatePhoneVerification( + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-phone.md b/docs/examples/1.8.x/client-flutter/examples/account/update-phone.md new file mode 100644 index 0000000000..6390d14245 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-phone.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +User result = await account.updatePhone( + phone: '+12065550100', + password: 'password', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-prefs.md b/docs/examples/1.8.x/client-flutter/examples/account/update-prefs.md new file mode 100644 index 0000000000..a084c13e89 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-prefs.md @@ -0,0 +1,15 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +User result = await account.updatePrefs( + prefs: { + "language": "en", + "timezone": "UTC", + "darkTheme": true + }, +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-push-target.md b/docs/examples/1.8.x/client-flutter/examples/account/update-push-target.md new file mode 100644 index 0000000000..c695ea0984 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-push-target.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Target result = await account.updatePushTarget( + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-recovery.md b/docs/examples/1.8.x/client-flutter/examples/account/update-recovery.md new file mode 100644 index 0000000000..5ca0239f47 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-recovery.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.updateRecovery( + userId: '<USER_ID>', + secret: '<SECRET>', + password: '', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-session.md b/docs/examples/1.8.x/client-flutter/examples/account/update-session.md new file mode 100644 index 0000000000..4c78ebb187 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-session.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.updateSession( + sessionId: '<SESSION_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-status.md b/docs/examples/1.8.x/client-flutter/examples/account/update-status.md new file mode 100644 index 0000000000..289a3f0a96 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-status.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +User result = await account.updateStatus(); diff --git a/docs/examples/1.8.x/client-flutter/examples/account/update-verification.md b/docs/examples/1.8.x/client-flutter/examples/account/update-verification.md new file mode 100644 index 0000000000..15c7ed1928 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/account/update-verification.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.updateVerification( + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/avatars/get-browser.md b/docs/examples/1.8.x/client-flutter/examples/avatars/get-browser.md new file mode 100644 index 0000000000..e97d24ab4f --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/avatars/get-browser.md @@ -0,0 +1,33 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +UInt8List bytes = await avatars.getBrowser( + code: Browser.avantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +) + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getBrowser( + code: Browser.avantBrowser, + width:0 , // optional + height:0 , // optional + quality:-1 , // optional +), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data) + : CircularProgressIndicator(); + } +); diff --git a/docs/examples/1.8.x/client-flutter/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/client-flutter/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..9ec42588b4 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/avatars/get-credit-card.md @@ -0,0 +1,33 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +UInt8List bytes = await avatars.getCreditCard( + code: CreditCard.americanExpress, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +) + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getCreditCard( + code: CreditCard.americanExpress, + width:0 , // optional + height:0 , // optional + quality:-1 , // optional +), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data) + : CircularProgressIndicator(); + } +); diff --git a/docs/examples/1.8.x/client-flutter/examples/avatars/get-favicon.md b/docs/examples/1.8.x/client-flutter/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..0df5ed0d2a --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/avatars/get-favicon.md @@ -0,0 +1,27 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +UInt8List bytes = await avatars.getFavicon( + url: 'https://example.com', +) + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getFavicon( + url:'https://example.com' , +), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data) + : CircularProgressIndicator(); + } +); diff --git a/docs/examples/1.8.x/client-flutter/examples/avatars/get-flag.md b/docs/examples/1.8.x/client-flutter/examples/avatars/get-flag.md new file mode 100644 index 0000000000..99d43409a0 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/avatars/get-flag.md @@ -0,0 +1,33 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +UInt8List bytes = await avatars.getFlag( + code: Flag.afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1, // optional +) + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getFlag( + code: Flag.afghanistan, + width:0 , // optional + height:0 , // optional + quality:-1 , // optional +), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data) + : CircularProgressIndicator(); + } +); diff --git a/docs/examples/1.8.x/client-flutter/examples/avatars/get-image.md b/docs/examples/1.8.x/client-flutter/examples/avatars/get-image.md new file mode 100644 index 0000000000..5b9d1b58c1 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/avatars/get-image.md @@ -0,0 +1,31 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +UInt8List bytes = await avatars.getImage( + url: 'https://example.com', + width: 0, // optional + height: 0, // optional +) + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getImage( + url:'https://example.com' , + width:0 , // optional + height:0 , // optional +), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data) + : CircularProgressIndicator(); + } +); diff --git a/docs/examples/1.8.x/client-flutter/examples/avatars/get-initials.md b/docs/examples/1.8.x/client-flutter/examples/avatars/get-initials.md new file mode 100644 index 0000000000..0c5b62a309 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/avatars/get-initials.md @@ -0,0 +1,33 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +UInt8List bytes = await avatars.getInitials( + name: '<NAME>', // optional + width: 0, // optional + height: 0, // optional + background: '', // optional +) + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getInitials( + name:'<NAME>' , // optional + width:0 , // optional + height:0 , // optional + background:'' , // optional +), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data) + : CircularProgressIndicator(); + } +); diff --git a/docs/examples/1.8.x/client-flutter/examples/avatars/get-qr.md b/docs/examples/1.8.x/client-flutter/examples/avatars/get-qr.md new file mode 100644 index 0000000000..d9a533c886 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/avatars/get-qr.md @@ -0,0 +1,33 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Avatars avatars = Avatars(client); + +// Downloading file +UInt8List bytes = await avatars.getQR( + text: '<TEXT>', + size: 1, // optional + margin: 0, // optional + download: false, // optional +) + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: avatars.getQR( + text:'<TEXT>' , + size:1 , // optional + margin:0 , // optional + download:false , // optional +), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data) + : CircularProgressIndicator(); + } +); diff --git a/docs/examples/1.8.x/client-flutter/examples/databases/create-document.md b/docs/examples/1.8.x/client-flutter/examples/databases/create-document.md new file mode 100644 index 0000000000..3becbcf1fc --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/databases/create-document.md @@ -0,0 +1,21 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.createDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/client-flutter/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..ec0d9ee300 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/databases/decrement-document-attribute.md @@ -0,0 +1,16 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.decrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: 0, // optional + min: 0, // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/databases/delete-document.md b/docs/examples/1.8.x/client-flutter/examples/databases/delete-document.md new file mode 100644 index 0000000000..3354917c20 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/databases/delete-document.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Databases databases = Databases(client); + +await databases.deleteDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/databases/get-document.md b/docs/examples/1.8.x/client-flutter/examples/databases/get-document.md new file mode 100644 index 0000000000..f85c1f9b5a --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/databases/get-document.md @@ -0,0 +1,14 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.getDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/client-flutter/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..78f5b0cb6f --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/databases/increment-document-attribute.md @@ -0,0 +1,16 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.incrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: 0, // optional + max: 0, // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/databases/list-documents.md b/docs/examples/1.8.x/client-flutter/examples/databases/list-documents.md new file mode 100644 index 0000000000..31fec1f522 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/databases/list-documents.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Databases databases = Databases(client); + +DocumentList result = await databases.listDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/databases/update-document.md b/docs/examples/1.8.x/client-flutter/examples/databases/update-document.md new file mode 100644 index 0000000000..1f444d875a --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/databases/update-document.md @@ -0,0 +1,15 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.updateDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: ["read("any")"], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/databases/upsert-document.md b/docs/examples/1.8.x/client-flutter/examples/databases/upsert-document.md new file mode 100644 index 0000000000..398a99cb1d --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/databases/upsert-document.md @@ -0,0 +1,15 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Databases databases = Databases(client); + +Document result = await databases.upsertDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, + permissions: ["read("any")"], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/functions/create-execution.md b/docs/examples/1.8.x/client-flutter/examples/functions/create-execution.md new file mode 100644 index 0000000000..bbd7cd37a6 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/functions/create-execution.md @@ -0,0 +1,17 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Functions functions = Functions(client); + +Execution result = await functions.createExecution( + functionId: '<FUNCTION_ID>', + body: '<BODY>', // optional + xasync: false, // optional + path: '<PATH>', // optional + method: ExecutionMethod.gET, // optional + headers: {}, // optional + scheduledAt: '<SCHEDULED_AT>', // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/functions/get-execution.md b/docs/examples/1.8.x/client-flutter/examples/functions/get-execution.md new file mode 100644 index 0000000000..714933be32 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/functions/get-execution.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Functions functions = Functions(client); + +Execution result = await functions.getExecution( + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/functions/list-executions.md b/docs/examples/1.8.x/client-flutter/examples/functions/list-executions.md new file mode 100644 index 0000000000..232f3250d3 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/functions/list-executions.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Functions functions = Functions(client); + +ExecutionList result = await functions.listExecutions( + functionId: '<FUNCTION_ID>', + queries: [], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/graphql/mutation.md b/docs/examples/1.8.x/client-flutter/examples/graphql/mutation.md new file mode 100644 index 0000000000..60f0c29703 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/graphql/mutation.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Graphql graphql = Graphql(client); + +Any result = await graphql.mutation( + query: {}, +); diff --git a/docs/examples/1.8.x/client-flutter/examples/graphql/query.md b/docs/examples/1.8.x/client-flutter/examples/graphql/query.md new file mode 100644 index 0000000000..d90c3432e9 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/graphql/query.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Graphql graphql = Graphql(client); + +Any result = await graphql.query( + query: {}, +); diff --git a/docs/examples/1.8.x/client-flutter/examples/locale/get.md b/docs/examples/1.8.x/client-flutter/examples/locale/get.md new file mode 100644 index 0000000000..b284699046 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/locale/get.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Locale locale = Locale(client); + +Locale result = await locale.get(); diff --git a/docs/examples/1.8.x/client-flutter/examples/locale/list-codes.md b/docs/examples/1.8.x/client-flutter/examples/locale/list-codes.md new file mode 100644 index 0000000000..0227471571 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/locale/list-codes.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Locale locale = Locale(client); + +LocaleCodeList result = await locale.listCodes(); diff --git a/docs/examples/1.8.x/client-flutter/examples/locale/list-continents.md b/docs/examples/1.8.x/client-flutter/examples/locale/list-continents.md new file mode 100644 index 0000000000..1098bd1d58 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/locale/list-continents.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Locale locale = Locale(client); + +ContinentList result = await locale.listContinents(); diff --git a/docs/examples/1.8.x/client-flutter/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/client-flutter/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..7d6571f4ee --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/locale/list-countries-eu.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Locale locale = Locale(client); + +CountryList result = await locale.listCountriesEU(); diff --git a/docs/examples/1.8.x/client-flutter/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/client-flutter/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..395f240fd7 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/locale/list-countries-phones.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Locale locale = Locale(client); + +PhoneList result = await locale.listCountriesPhones(); diff --git a/docs/examples/1.8.x/client-flutter/examples/locale/list-countries.md b/docs/examples/1.8.x/client-flutter/examples/locale/list-countries.md new file mode 100644 index 0000000000..a322eb2078 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/locale/list-countries.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Locale locale = Locale(client); + +CountryList result = await locale.listCountries(); diff --git a/docs/examples/1.8.x/client-flutter/examples/locale/list-currencies.md b/docs/examples/1.8.x/client-flutter/examples/locale/list-currencies.md new file mode 100644 index 0000000000..8884bf45b2 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/locale/list-currencies.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Locale locale = Locale(client); + +CurrencyList result = await locale.listCurrencies(); diff --git a/docs/examples/1.8.x/client-flutter/examples/locale/list-languages.md b/docs/examples/1.8.x/client-flutter/examples/locale/list-languages.md new file mode 100644 index 0000000000..0444d94151 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/locale/list-languages.md @@ -0,0 +1,9 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Locale locale = Locale(client); + +LanguageList result = await locale.listLanguages(); diff --git a/docs/examples/1.8.x/client-flutter/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/client-flutter/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..2a278a0481 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/messaging/create-subscriber.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Messaging messaging = Messaging(client); + +Subscriber result = await messaging.createSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/client-flutter/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..02c1f61535 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/messaging/delete-subscriber.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Messaging messaging = Messaging(client); + +await messaging.deleteSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/storage/create-file.md b/docs/examples/1.8.x/client-flutter/examples/storage/create-file.md new file mode 100644 index 0000000000..661f6b8b1e --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/storage/create-file.md @@ -0,0 +1,15 @@ +import 'dart:io'; +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Storage storage = Storage(client); + +File result = await storage.createFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), + permissions: ["read("any")"], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/storage/delete-file.md b/docs/examples/1.8.x/client-flutter/examples/storage/delete-file.md new file mode 100644 index 0000000000..b2c6a78f75 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/storage/delete-file.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Storage storage = Storage(client); + +await storage.deleteFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/storage/get-file-download.md b/docs/examples/1.8.x/client-flutter/examples/storage/get-file-download.md new file mode 100644 index 0000000000..5bef06ee7d --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/storage/get-file-download.md @@ -0,0 +1,31 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Storage storage = Storage(client); + +// Downloading file +UInt8List bytes = await storage.getFileDownload( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>', // optional +) + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: storage.getFileDownload( + bucketId:'<BUCKET_ID>' , + fileId:'<FILE_ID>' , + token:'<TOKEN>' , // optional +), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data) + : CircularProgressIndicator(); + } +); diff --git a/docs/examples/1.8.x/client-flutter/examples/storage/get-file-preview.md b/docs/examples/1.8.x/client-flutter/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..96338bd25a --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/storage/get-file-preview.md @@ -0,0 +1,53 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Storage storage = Storage(client); + +// Downloading file +UInt8List bytes = await storage.getFilePreview( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // optional + height: 0, // optional + gravity: ImageGravity.center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: '', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: '', // optional + output: ImageFormat.jpg, // optional + token: '<TOKEN>', // optional +) + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: storage.getFilePreview( + bucketId:'<BUCKET_ID>' , + fileId:'<FILE_ID>' , + width:0 , // optional + height:0 , // optional + gravity: ImageGravity.center, // optional + quality:-1 , // optional + borderWidth:0 , // optional + borderColor:'' , // optional + borderRadius:0 , // optional + opacity:0 , // optional + rotation:-360 , // optional + background:'' , // optional + output: ImageFormat.jpg, // optional + token:'<TOKEN>' , // optional +), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data) + : CircularProgressIndicator(); + } +); diff --git a/docs/examples/1.8.x/client-flutter/examples/storage/get-file-view.md b/docs/examples/1.8.x/client-flutter/examples/storage/get-file-view.md new file mode 100644 index 0000000000..6587f086bd --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/storage/get-file-view.md @@ -0,0 +1,31 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Storage storage = Storage(client); + +// Downloading file +UInt8List bytes = await storage.getFileView( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>', // optional +) + +final file = File('path_to_file/filename.ext'); +file.writeAsBytesSync(bytes); + +// Displaying image preview +FutureBuilder( + future: storage.getFileView( + bucketId:'<BUCKET_ID>' , + fileId:'<FILE_ID>' , + token:'<TOKEN>' , // optional +), // Works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory(snapshot.data) + : CircularProgressIndicator(); + } +); diff --git a/docs/examples/1.8.x/client-flutter/examples/storage/get-file.md b/docs/examples/1.8.x/client-flutter/examples/storage/get-file.md new file mode 100644 index 0000000000..f4b541ffd1 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/storage/get-file.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Storage storage = Storage(client); + +File result = await storage.getFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/storage/list-files.md b/docs/examples/1.8.x/client-flutter/examples/storage/list-files.md new file mode 100644 index 0000000000..7950005b6a --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/storage/list-files.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Storage storage = Storage(client); + +FileList result = await storage.listFiles( + bucketId: '<BUCKET_ID>', + queries: [], // optional + search: '<SEARCH>', // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/storage/update-file.md b/docs/examples/1.8.x/client-flutter/examples/storage/update-file.md new file mode 100644 index 0000000000..8e598121c1 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/storage/update-file.md @@ -0,0 +1,14 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Storage storage = Storage(client); + +File result = await storage.updateFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // optional + permissions: ["read("any")"], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/tablesdb/create-row.md b/docs/examples/1.8.x/client-flutter/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..038bb2bac6 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/tablesdb/create-row.md @@ -0,0 +1,21 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.createRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/client-flutter/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..4f3b4bdb61 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,16 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.decrementRowColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: 0, // optional + min: 0, // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/client-flutter/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..cc902fa198 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/tablesdb/delete-row.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/tablesdb/get-row.md b/docs/examples/1.8.x/client-flutter/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..29e6eaab93 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/tablesdb/get-row.md @@ -0,0 +1,14 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.getRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/client-flutter/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..e05dc76753 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/tablesdb/increment-row-column.md @@ -0,0 +1,16 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.incrementRowColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: 0, // optional + max: 0, // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/client-flutter/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..7763e2ae3d --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/tablesdb/list-rows.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +RowList result = await tablesDB.listRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/tablesdb/update-row.md b/docs/examples/1.8.x/client-flutter/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..c2cc84d7f6 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/tablesdb/update-row.md @@ -0,0 +1,15 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.updateRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/client-flutter/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..6a958a1898 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/tablesdb/upsert-row.md @@ -0,0 +1,15 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.upsertRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/create-membership.md b/docs/examples/1.8.x/client-flutter/examples/teams/create-membership.md new file mode 100644 index 0000000000..8026521408 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/create-membership.md @@ -0,0 +1,17 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +Membership result = await teams.createMembership( + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // optional + userId: '<USER_ID>', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '<NAME>', // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/create.md b/docs/examples/1.8.x/client-flutter/examples/teams/create.md new file mode 100644 index 0000000000..637e216a04 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/create.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +Team result = await teams.create( + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [], // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/delete-membership.md b/docs/examples/1.8.x/client-flutter/examples/teams/delete-membership.md new file mode 100644 index 0000000000..0f1941d88b --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/delete-membership.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +await teams.deleteMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/delete.md b/docs/examples/1.8.x/client-flutter/examples/teams/delete.md new file mode 100644 index 0000000000..74c74c9cf1 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/delete.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +await teams.delete( + teamId: '<TEAM_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/get-membership.md b/docs/examples/1.8.x/client-flutter/examples/teams/get-membership.md new file mode 100644 index 0000000000..468e02cf32 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/get-membership.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +Membership result = await teams.getMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/get-prefs.md b/docs/examples/1.8.x/client-flutter/examples/teams/get-prefs.md new file mode 100644 index 0000000000..a22c78869c --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/get-prefs.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +Preferences result = await teams.getPrefs( + teamId: '<TEAM_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/get.md b/docs/examples/1.8.x/client-flutter/examples/teams/get.md new file mode 100644 index 0000000000..5e8c3463ea --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/get.md @@ -0,0 +1,11 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +Team result = await teams.get( + teamId: '<TEAM_ID>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/list-memberships.md b/docs/examples/1.8.x/client-flutter/examples/teams/list-memberships.md new file mode 100644 index 0000000000..374dd49069 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/list-memberships.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +MembershipList result = await teams.listMemberships( + teamId: '<TEAM_ID>', + queries: [], // optional + search: '<SEARCH>', // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/list.md b/docs/examples/1.8.x/client-flutter/examples/teams/list.md new file mode 100644 index 0000000000..3aa972fb5f --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/list.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +TeamList result = await teams.list( + queries: [], // optional + search: '<SEARCH>', // optional +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/update-membership-status.md b/docs/examples/1.8.x/client-flutter/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..1ce3eacb79 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/update-membership-status.md @@ -0,0 +1,14 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +Membership result = await teams.updateMembershipStatus( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/update-membership.md b/docs/examples/1.8.x/client-flutter/examples/teams/update-membership.md new file mode 100644 index 0000000000..bc2bbae75c --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/update-membership.md @@ -0,0 +1,13 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +Membership result = await teams.updateMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [], +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/update-name.md b/docs/examples/1.8.x/client-flutter/examples/teams/update-name.md new file mode 100644 index 0000000000..8f1794587e --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/update-name.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +Team result = await teams.updateName( + teamId: '<TEAM_ID>', + name: '<NAME>', +); diff --git a/docs/examples/1.8.x/client-flutter/examples/teams/update-prefs.md b/docs/examples/1.8.x/client-flutter/examples/teams/update-prefs.md new file mode 100644 index 0000000000..7b33c8c313 --- /dev/null +++ b/docs/examples/1.8.x/client-flutter/examples/teams/update-prefs.md @@ -0,0 +1,12 @@ +import 'package:appwrite/appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Teams teams = Teams(client); + +Preferences result = await teams.updatePrefs( + teamId: '<TEAM_ID>', + prefs: {}, +); diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/client-graphql/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..92c12acee5 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-anonymous-session.md @@ -0,0 +1,33 @@ +mutation { + accountCreateAnonymousSession { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-email-password-session.md b/docs/examples/1.8.x/client-graphql/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..931bb4add0 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-email-password-session.md @@ -0,0 +1,36 @@ +mutation { + accountCreateEmailPasswordSession( + email: "email@example.com", + password: "password" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-email-token.md b/docs/examples/1.8.x/client-graphql/examples/account/create-email-token.md new file mode 100644 index 0000000000..de320b45ed --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-email-token.md @@ -0,0 +1,14 @@ +mutation { + accountCreateEmailToken( + userId: "<USER_ID>", + email: "email@example.com", + phrase: false + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-jwt.md b/docs/examples/1.8.x/client-graphql/examples/account/create-jwt.md new file mode 100644 index 0000000000..a5204f1256 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-jwt.md @@ -0,0 +1,5 @@ +mutation { + accountCreateJWT { + jwt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/client-graphql/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..4024a5b3a9 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-magic-url-token.md @@ -0,0 +1,15 @@ +mutation { + accountCreateMagicURLToken( + userId: "<USER_ID>", + email: "email@example.com", + url: "https://example.com", + phrase: false + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/client-graphql/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..8605340168 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-mfa-authenticator.md @@ -0,0 +1,8 @@ +mutation { + accountCreateMFAAuthenticator( + type: "totp" + ) { + secret + uri + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/client-graphql/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..aff5a10123 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-mfa-challenge.md @@ -0,0 +1,10 @@ +mutation { + accountCreateMFAChallenge( + factor: "email" + ) { + _id + _createdAt + userId + expire + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/client-graphql/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..4cb6d36d42 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,5 @@ +mutation { + accountCreateMFARecoveryCodes { + recoveryCodes + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-phone-token.md b/docs/examples/1.8.x/client-graphql/examples/account/create-phone-token.md new file mode 100644 index 0000000000..b56c4eb4e4 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-phone-token.md @@ -0,0 +1,13 @@ +mutation { + accountCreatePhoneToken( + userId: "<USER_ID>", + phone: "+12065550100" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-phone-verification.md b/docs/examples/1.8.x/client-graphql/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..a4cad59b1a --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-phone-verification.md @@ -0,0 +1,10 @@ +mutation { + accountCreatePhoneVerification { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-push-target.md b/docs/examples/1.8.x/client-graphql/examples/account/create-push-target.md new file mode 100644 index 0000000000..63802a782e --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-push-target.md @@ -0,0 +1,17 @@ +mutation { + accountCreatePushTarget( + targetId: "<TARGET_ID>", + identifier: "<IDENTIFIER>", + providerId: "<PROVIDER_ID>" + ) { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-recovery.md b/docs/examples/1.8.x/client-graphql/examples/account/create-recovery.md new file mode 100644 index 0000000000..ad31fd82d7 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-recovery.md @@ -0,0 +1,13 @@ +mutation { + accountCreateRecovery( + email: "email@example.com", + url: "https://example.com" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-session.md b/docs/examples/1.8.x/client-graphql/examples/account/create-session.md new file mode 100644 index 0000000000..f473d14207 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-session.md @@ -0,0 +1,36 @@ +mutation { + accountCreateSession( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create-verification.md b/docs/examples/1.8.x/client-graphql/examples/account/create-verification.md new file mode 100644 index 0000000000..df50dda529 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create-verification.md @@ -0,0 +1,12 @@ +mutation { + accountCreateVerification( + url: "https://example.com" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/create.md b/docs/examples/1.8.x/client-graphql/examples/account/create.md new file mode 100644 index 0000000000..0d39394a3d --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/create.md @@ -0,0 +1,40 @@ +mutation { + accountCreate( + userId: "<USER_ID>", + email: "email@example.com", + password: "", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/delete-identity.md b/docs/examples/1.8.x/client-graphql/examples/account/delete-identity.md new file mode 100644 index 0000000000..f3c2e2e7b9 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/delete-identity.md @@ -0,0 +1,7 @@ +mutation { + accountDeleteIdentity( + identityId: "<IDENTITY_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/client-graphql/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..03e876e3f9 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,7 @@ +mutation { + accountDeleteMFAAuthenticator( + type: "totp" + ) { + status + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/delete-push-target.md b/docs/examples/1.8.x/client-graphql/examples/account/delete-push-target.md new file mode 100644 index 0000000000..894c0b2e02 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/delete-push-target.md @@ -0,0 +1,7 @@ +mutation { + accountDeletePushTarget( + targetId: "<TARGET_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/delete-session.md b/docs/examples/1.8.x/client-graphql/examples/account/delete-session.md new file mode 100644 index 0000000000..09aff38fdd --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/delete-session.md @@ -0,0 +1,7 @@ +mutation { + accountDeleteSession( + sessionId: "<SESSION_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/delete-sessions.md b/docs/examples/1.8.x/client-graphql/examples/account/delete-sessions.md new file mode 100644 index 0000000000..b0d61daa81 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/delete-sessions.md @@ -0,0 +1,5 @@ +mutation { + accountDeleteSessions { + status + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/client-graphql/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/account/get-prefs.md b/docs/examples/1.8.x/client-graphql/examples/account/get-prefs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/account/get-session.md b/docs/examples/1.8.x/client-graphql/examples/account/get-session.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/account/get.md b/docs/examples/1.8.x/client-graphql/examples/account/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/account/list-identities.md b/docs/examples/1.8.x/client-graphql/examples/account/list-identities.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/account/list-logs.md b/docs/examples/1.8.x/client-graphql/examples/account/list-logs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/client-graphql/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/account/list-sessions.md b/docs/examples/1.8.x/client-graphql/examples/account/list-sessions.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-email.md b/docs/examples/1.8.x/client-graphql/examples/account/update-email.md new file mode 100644 index 0000000000..c879e24a43 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-email.md @@ -0,0 +1,38 @@ +mutation { + accountUpdateEmail( + email: "email@example.com", + password: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/client-graphql/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..075bc91d17 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-magic-url-session.md @@ -0,0 +1,36 @@ +mutation { + accountUpdateMagicURLSession( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/client-graphql/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..b3021b70b8 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-mfa-authenticator.md @@ -0,0 +1,38 @@ +mutation { + accountUpdateMFAAuthenticator( + type: "totp", + otp: "<OTP>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/client-graphql/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..bf389f1eff --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-mfa-challenge.md @@ -0,0 +1,36 @@ +mutation { + accountUpdateMFAChallenge( + challengeId: "<CHALLENGE_ID>", + otp: "<OTP>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/client-graphql/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..dc46be71ad --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,5 @@ +mutation { + accountUpdateMFARecoveryCodes { + recoveryCodes + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-mfa.md b/docs/examples/1.8.x/client-graphql/examples/account/update-mfa.md new file mode 100644 index 0000000000..787c2e0860 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-mfa.md @@ -0,0 +1,37 @@ +mutation { + accountUpdateMFA( + mfa: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-name.md b/docs/examples/1.8.x/client-graphql/examples/account/update-name.md new file mode 100644 index 0000000000..8ba2c99d9c --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-name.md @@ -0,0 +1,37 @@ +mutation { + accountUpdateName( + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-password.md b/docs/examples/1.8.x/client-graphql/examples/account/update-password.md new file mode 100644 index 0000000000..f3619a10d2 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-password.md @@ -0,0 +1,38 @@ +mutation { + accountUpdatePassword( + password: "", + oldPassword: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-phone-session.md b/docs/examples/1.8.x/client-graphql/examples/account/update-phone-session.md new file mode 100644 index 0000000000..199e774ab0 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-phone-session.md @@ -0,0 +1,36 @@ +mutation { + accountUpdatePhoneSession( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-phone-verification.md b/docs/examples/1.8.x/client-graphql/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..dd62298bb9 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-phone-verification.md @@ -0,0 +1,13 @@ +mutation { + accountUpdatePhoneVerification( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-phone.md b/docs/examples/1.8.x/client-graphql/examples/account/update-phone.md new file mode 100644 index 0000000000..adecb71168 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-phone.md @@ -0,0 +1,38 @@ +mutation { + accountUpdatePhone( + phone: "+12065550100", + password: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-prefs.md b/docs/examples/1.8.x/client-graphql/examples/account/update-prefs.md new file mode 100644 index 0000000000..8138cf0227 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-prefs.md @@ -0,0 +1,37 @@ +mutation { + accountUpdatePrefs( + prefs: "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-push-target.md b/docs/examples/1.8.x/client-graphql/examples/account/update-push-target.md new file mode 100644 index 0000000000..3c402cdf12 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-push-target.md @@ -0,0 +1,16 @@ +mutation { + accountUpdatePushTarget( + targetId: "<TARGET_ID>", + identifier: "<IDENTIFIER>" + ) { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-recovery.md b/docs/examples/1.8.x/client-graphql/examples/account/update-recovery.md new file mode 100644 index 0000000000..2d15fdcaa1 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-recovery.md @@ -0,0 +1,14 @@ +mutation { + accountUpdateRecovery( + userId: "<USER_ID>", + secret: "<SECRET>", + password: "" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-session.md b/docs/examples/1.8.x/client-graphql/examples/account/update-session.md new file mode 100644 index 0000000000..29a8979872 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-session.md @@ -0,0 +1,35 @@ +mutation { + accountUpdateSession( + sessionId: "<SESSION_ID>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-status.md b/docs/examples/1.8.x/client-graphql/examples/account/update-status.md new file mode 100644 index 0000000000..c17f556842 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-status.md @@ -0,0 +1,35 @@ +mutation { + accountUpdateStatus { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/account/update-verification.md b/docs/examples/1.8.x/client-graphql/examples/account/update-verification.md new file mode 100644 index 0000000000..11e63c7da3 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/account/update-verification.md @@ -0,0 +1,13 @@ +mutation { + accountUpdateVerification( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/avatars/get-browser.md b/docs/examples/1.8.x/client-graphql/examples/avatars/get-browser.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/client-graphql/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/avatars/get-favicon.md b/docs/examples/1.8.x/client-graphql/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/avatars/get-flag.md b/docs/examples/1.8.x/client-graphql/examples/avatars/get-flag.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/avatars/get-image.md b/docs/examples/1.8.x/client-graphql/examples/avatars/get-image.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/avatars/get-initials.md b/docs/examples/1.8.x/client-graphql/examples/avatars/get-initials.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/avatars/get-qr.md b/docs/examples/1.8.x/client-graphql/examples/avatars/get-qr.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/databases/create-document.md b/docs/examples/1.8.x/client-graphql/examples/databases/create-document.md new file mode 100644 index 0000000000..39e4bba1cb --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/databases/create-document.md @@ -0,0 +1,18 @@ +mutation { + databasesCreateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read("any")"] + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/client-graphql/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..2e7970049d --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +mutation { + databasesDecrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, + min: 0 + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/databases/delete-document.md b/docs/examples/1.8.x/client-graphql/examples/databases/delete-document.md new file mode 100644 index 0000000000..848371bca0 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/databases/delete-document.md @@ -0,0 +1,9 @@ +mutation { + databasesDeleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/databases/get-document.md b/docs/examples/1.8.x/client-graphql/examples/databases/get-document.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/client-graphql/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..322ed69ced --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +mutation { + databasesIncrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, + max: 0 + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/databases/list-documents.md b/docs/examples/1.8.x/client-graphql/examples/databases/list-documents.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/databases/update-document.md b/docs/examples/1.8.x/client-graphql/examples/databases/update-document.md new file mode 100644 index 0000000000..aea605d9d7 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/databases/update-document.md @@ -0,0 +1,18 @@ +mutation { + databasesUpdateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{}", + permissions: ["read("any")"] + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/databases/upsert-document.md b/docs/examples/1.8.x/client-graphql/examples/databases/upsert-document.md new file mode 100644 index 0000000000..9d1e753081 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/databases/upsert-document.md @@ -0,0 +1,18 @@ +mutation { + databasesUpsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{}", + permissions: ["read("any")"] + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/functions/create-execution.md b/docs/examples/1.8.x/client-graphql/examples/functions/create-execution.md new file mode 100644 index 0000000000..ff0ecbe739 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/functions/create-execution.md @@ -0,0 +1,36 @@ +mutation { + functionsCreateExecution( + functionId: "<FUNCTION_ID>", + body: "<BODY>", + async: false, + path: "<PATH>", + method: "GET", + headers: "{}", + scheduledAt: "<SCHEDULED_AT>" + ) { + _id + _createdAt + _updatedAt + _permissions + functionId + deploymentId + trigger + status + requestMethod + requestPath + requestHeaders { + name + value + } + responseStatusCode + responseBody + responseHeaders { + name + value + } + logs + errors + duration + scheduledAt + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/functions/get-execution.md b/docs/examples/1.8.x/client-graphql/examples/functions/get-execution.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/functions/list-executions.md b/docs/examples/1.8.x/client-graphql/examples/functions/list-executions.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/locale/get.md b/docs/examples/1.8.x/client-graphql/examples/locale/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/locale/list-codes.md b/docs/examples/1.8.x/client-graphql/examples/locale/list-codes.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/locale/list-continents.md b/docs/examples/1.8.x/client-graphql/examples/locale/list-continents.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/client-graphql/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/client-graphql/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/locale/list-countries.md b/docs/examples/1.8.x/client-graphql/examples/locale/list-countries.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/locale/list-currencies.md b/docs/examples/1.8.x/client-graphql/examples/locale/list-currencies.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/locale/list-languages.md b/docs/examples/1.8.x/client-graphql/examples/locale/list-languages.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/client-graphql/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..bab53612b7 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/messaging/create-subscriber.md @@ -0,0 +1,27 @@ +mutation { + messagingCreateSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>", + targetId: "<TARGET_ID>" + ) { + _id + _createdAt + _updatedAt + targetId + target { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + userId + userName + topicId + providerType + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/client-graphql/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..ededffcaac --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/messaging/delete-subscriber.md @@ -0,0 +1,8 @@ +mutation { + messagingDeleteSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/storage/create-file.md b/docs/examples/1.8.x/client-graphql/examples/storage/create-file.md new file mode 100644 index 0000000000..50161e433f --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/storage/create-file.md @@ -0,0 +1,25 @@ +POST /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="operations" + +{ "query": "mutation { storageCreateFile(bucketId: $bucketId, fileId: $fileId, file: $file, permissions: $permissions) { id }" }, "variables": { "bucketId": "<BUCKET_ID>", "fileId": "<FILE_ID>", "file": null, "permissions": ["read("any")"] } } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="map" + +{ "0": ["variables.file"], } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="0"; filename="file.ext" + +File contents + +--cec8e8123c05ba25-- diff --git a/docs/examples/1.8.x/client-graphql/examples/storage/delete-file.md b/docs/examples/1.8.x/client-graphql/examples/storage/delete-file.md new file mode 100644 index 0000000000..17ec89931a --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/storage/delete-file.md @@ -0,0 +1,8 @@ +mutation { + storageDeleteFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/storage/get-file-download.md b/docs/examples/1.8.x/client-graphql/examples/storage/get-file-download.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/storage/get-file-preview.md b/docs/examples/1.8.x/client-graphql/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/storage/get-file-view.md b/docs/examples/1.8.x/client-graphql/examples/storage/get-file-view.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/storage/get-file.md b/docs/examples/1.8.x/client-graphql/examples/storage/get-file.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/storage/list-files.md b/docs/examples/1.8.x/client-graphql/examples/storage/list-files.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/storage/update-file.md b/docs/examples/1.8.x/client-graphql/examples/storage/update-file.md new file mode 100644 index 0000000000..b7832048c7 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/storage/update-file.md @@ -0,0 +1,20 @@ +mutation { + storageUpdateFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + name: "<NAME>", + permissions: ["read("any")"] + ) { + _id + bucketId + _createdAt + _updatedAt + _permissions + name + signature + mimeType + sizeOriginal + chunksTotal + chunksUploaded + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/tablesdb/create-row.md b/docs/examples/1.8.x/client-graphql/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..c7d2ec7d03 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/tablesdb/create-row.md @@ -0,0 +1,18 @@ +mutation { + tablesDBCreateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read("any")"] + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/client-graphql/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..398ec19901 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,19 @@ +mutation { + tablesDBDecrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "", + value: 0, + min: 0 + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/client-graphql/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..1a08b0f60d --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/tablesdb/delete-row.md @@ -0,0 +1,9 @@ +mutation { + tablesDBDeleteRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/tablesdb/get-row.md b/docs/examples/1.8.x/client-graphql/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/client-graphql/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..b7ff87f387 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/tablesdb/increment-row-column.md @@ -0,0 +1,19 @@ +mutation { + tablesDBIncrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "", + value: 0, + max: 0 + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/client-graphql/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/tablesdb/update-row.md b/docs/examples/1.8.x/client-graphql/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..5a5b288ab8 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/tablesdb/update-row.md @@ -0,0 +1,18 @@ +mutation { + tablesDBUpdateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: "{}", + permissions: ["read("any")"] + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/client-graphql/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..cc3b63de4a --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/tablesdb/upsert-row.md @@ -0,0 +1,18 @@ +mutation { + tablesDBUpsertRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: "{}", + permissions: ["read("any")"] + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/create-membership.md b/docs/examples/1.8.x/client-graphql/examples/teams/create-membership.md new file mode 100644 index 0000000000..fe741f080d --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/teams/create-membership.md @@ -0,0 +1,25 @@ +mutation { + teamsCreateMembership( + teamId: "<TEAM_ID>", + roles: [], + email: "email@example.com", + userId: "<USER_ID>", + phone: "+12065550100", + url: "https://example.com", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + teamId + teamName + invited + joined + confirm + mfa + roles + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/create.md b/docs/examples/1.8.x/client-graphql/examples/teams/create.md new file mode 100644 index 0000000000..1f2a7ab3f2 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/teams/create.md @@ -0,0 +1,16 @@ +mutation { + teamsCreate( + teamId: "<TEAM_ID>", + name: "<NAME>", + roles: [] + ) { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/delete-membership.md b/docs/examples/1.8.x/client-graphql/examples/teams/delete-membership.md new file mode 100644 index 0000000000..e391b6f6fa --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/teams/delete-membership.md @@ -0,0 +1,8 @@ +mutation { + teamsDeleteMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/delete.md b/docs/examples/1.8.x/client-graphql/examples/teams/delete.md new file mode 100644 index 0000000000..df0d36c5b5 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/teams/delete.md @@ -0,0 +1,7 @@ +mutation { + teamsDelete( + teamId: "<TEAM_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/get-membership.md b/docs/examples/1.8.x/client-graphql/examples/teams/get-membership.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/get-prefs.md b/docs/examples/1.8.x/client-graphql/examples/teams/get-prefs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/get.md b/docs/examples/1.8.x/client-graphql/examples/teams/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/list-memberships.md b/docs/examples/1.8.x/client-graphql/examples/teams/list-memberships.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/list.md b/docs/examples/1.8.x/client-graphql/examples/teams/list.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/update-membership-status.md b/docs/examples/1.8.x/client-graphql/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..9b24450a86 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/teams/update-membership-status.md @@ -0,0 +1,22 @@ +mutation { + teamsUpdateMembershipStatus( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + teamId + teamName + invited + joined + confirm + mfa + roles + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/update-membership.md b/docs/examples/1.8.x/client-graphql/examples/teams/update-membership.md new file mode 100644 index 0000000000..1c6a04f078 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/teams/update-membership.md @@ -0,0 +1,21 @@ +mutation { + teamsUpdateMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + roles: [] + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + teamId + teamName + invited + joined + confirm + mfa + roles + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/update-name.md b/docs/examples/1.8.x/client-graphql/examples/teams/update-name.md new file mode 100644 index 0000000000..c40543b5cd --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/teams/update-name.md @@ -0,0 +1,15 @@ +mutation { + teamsUpdateName( + teamId: "<TEAM_ID>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } +} diff --git a/docs/examples/1.8.x/client-graphql/examples/teams/update-prefs.md b/docs/examples/1.8.x/client-graphql/examples/teams/update-prefs.md new file mode 100644 index 0000000000..95737e33f9 --- /dev/null +++ b/docs/examples/1.8.x/client-graphql/examples/teams/update-prefs.md @@ -0,0 +1,8 @@ +mutation { + teamsUpdatePrefs( + teamId: "<TEAM_ID>", + prefs: "{}" + ) { + data + } +} diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/client-react-native/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..4baad33e9d --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-anonymous-session.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createAnonymousSession(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-email-password-session.md b/docs/examples/1.8.x/client-react-native/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..47fb5573b1 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-email-password-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailPasswordSession({ + email: 'email@example.com', + password: 'password' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-email-token.md b/docs/examples/1.8.x/client-react-native/examples/account/create-email-token.md new file mode 100644 index 0000000000..aef74a8e46 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-email-token.md @@ -0,0 +1,15 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailToken({ + userId: '<USER_ID>', + email: 'email@example.com', + phrase: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-jwt.md b/docs/examples/1.8.x/client-react-native/examples/account/create-jwt.md new file mode 100644 index 0000000000..217dc78785 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-jwt.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createJWT(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/client-react-native/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..5c30ef538e --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-magic-url-token.md @@ -0,0 +1,16 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMagicURLToken({ + userId: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/client-react-native/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..d859850f2f --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-mfa-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticatorType } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAAuthenticator({ + type: AuthenticatorType.Totp +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/client-react-native/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..c7e5f6216a --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-mfa-challenge.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticationFactor } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAChallenge({ + factor: AuthenticationFactor.Email +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/client-react-native/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..22d6a579d6 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMFARecoveryCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-o-auth-2-session.md b/docs/examples/1.8.x/client-react-native/examples/account/create-o-auth-2-session.md new file mode 100644 index 0000000000..4212803ca8 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-o-auth-2-session.md @@ -0,0 +1,15 @@ +import { Client, Account, OAuthProvider } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +account.createOAuth2Session({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [] // optional +}); + diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/client-react-native/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..8989e489c2 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-o-auth-2-token.md @@ -0,0 +1,15 @@ +import { Client, Account, OAuthProvider } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +account.createOAuth2Token({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [] // optional +}); + diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-phone-token.md b/docs/examples/1.8.x/client-react-native/examples/account/create-phone-token.md new file mode 100644 index 0000000000..68eaa38dbd --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-phone-token.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneToken({ + userId: '<USER_ID>', + phone: '+12065550100' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-phone-verification.md b/docs/examples/1.8.x/client-react-native/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..62bcc48113 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-phone-verification.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneVerification(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-push-target.md b/docs/examples/1.8.x/client-react-native/examples/account/create-push-target.md new file mode 100644 index 0000000000..d3fae6fd84 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-push-target.md @@ -0,0 +1,15 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createPushTarget({ + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-recovery.md b/docs/examples/1.8.x/client-react-native/examples/account/create-recovery.md new file mode 100644 index 0000000000..01c5c387e8 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-recovery.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createRecovery({ + email: 'email@example.com', + url: 'https://example.com' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-session.md b/docs/examples/1.8.x/client-react-native/examples/account/create-session.md new file mode 100644 index 0000000000..b6741518d1 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create-verification.md b/docs/examples/1.8.x/client-react-native/examples/account/create-verification.md new file mode 100644 index 0000000000..f4a210be05 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create-verification.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createVerification({ + url: 'https://example.com' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/create.md b/docs/examples/1.8.x/client-react-native/examples/account/create.md new file mode 100644 index 0000000000..2c6850a101 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/create.md @@ -0,0 +1,16 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.create({ + userId: '<USER_ID>', + email: 'email@example.com', + password: '', + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/delete-identity.md b/docs/examples/1.8.x/client-react-native/examples/account/delete-identity.md new file mode 100644 index 0000000000..0d9a971225 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/delete-identity.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteIdentity({ + identityId: '<IDENTITY_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/client-react-native/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..90a6e347a8 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticatorType } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteMFAAuthenticator({ + type: AuthenticatorType.Totp +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/delete-push-target.md b/docs/examples/1.8.x/client-react-native/examples/account/delete-push-target.md new file mode 100644 index 0000000000..dff171b305 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/delete-push-target.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deletePushTarget({ + targetId: '<TARGET_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/delete-session.md b/docs/examples/1.8.x/client-react-native/examples/account/delete-session.md new file mode 100644 index 0000000000..f1ce4a0a88 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/delete-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSession({ + sessionId: '<SESSION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/delete-sessions.md b/docs/examples/1.8.x/client-react-native/examples/account/delete-sessions.md new file mode 100644 index 0000000000..830eb273a8 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/delete-sessions.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSessions(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/client-react-native/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..94896eb752 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.getMFARecoveryCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/get-prefs.md b/docs/examples/1.8.x/client-react-native/examples/account/get-prefs.md new file mode 100644 index 0000000000..b26a7b09f0 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/get-prefs.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.getPrefs(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/get-session.md b/docs/examples/1.8.x/client-react-native/examples/account/get-session.md new file mode 100644 index 0000000000..4c0fdfc0b5 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/get-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.getSession({ + sessionId: '<SESSION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/get.md b/docs/examples/1.8.x/client-react-native/examples/account/get.md new file mode 100644 index 0000000000..21d2401601 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/get.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.get(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/list-identities.md b/docs/examples/1.8.x/client-react-native/examples/account/list-identities.md new file mode 100644 index 0000000000..2a3bbae35d --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/list-identities.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listIdentities({ + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/list-logs.md b/docs/examples/1.8.x/client-react-native/examples/account/list-logs.md new file mode 100644 index 0000000000..4bb9f9fd88 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/list-logs.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listLogs({ + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/client-react-native/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..98ba939768 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/list-mfa-factors.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listMFAFactors(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/list-sessions.md b/docs/examples/1.8.x/client-react-native/examples/account/list-sessions.md new file mode 100644 index 0000000000..68232be292 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/list-sessions.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listSessions(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-email.md b/docs/examples/1.8.x/client-react-native/examples/account/update-email.md new file mode 100644 index 0000000000..325fa472fe --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-email.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateEmail({ + email: 'email@example.com', + password: 'password' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/client-react-native/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..4feaa59f52 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-magic-url-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMagicURLSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/client-react-native/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..58f2329564 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-mfa-authenticator.md @@ -0,0 +1,14 @@ +import { Client, Account, AuthenticatorType } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAAuthenticator({ + type: AuthenticatorType.Totp, + otp: '<OTP>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/client-react-native/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..c2ce59f6ef --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-mfa-challenge.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAChallenge({ + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/client-react-native/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..1f7b4f0d96 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFARecoveryCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-mfa.md b/docs/examples/1.8.x/client-react-native/examples/account/update-mfa.md new file mode 100644 index 0000000000..26d26ffe97 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-mfa.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFA({ + mfa: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-name.md b/docs/examples/1.8.x/client-react-native/examples/account/update-name.md new file mode 100644 index 0000000000..f58f26baae --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-name.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateName({ + name: '<NAME>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-password.md b/docs/examples/1.8.x/client-react-native/examples/account/update-password.md new file mode 100644 index 0000000000..89f99d9790 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-password.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePassword({ + password: '', + oldPassword: 'password' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-phone-session.md b/docs/examples/1.8.x/client-react-native/examples/account/update-phone-session.md new file mode 100644 index 0000000000..b3a3ffffb3 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-phone-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-phone-verification.md b/docs/examples/1.8.x/client-react-native/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..2f1be2f345 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-phone-verification.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneVerification({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-phone.md b/docs/examples/1.8.x/client-react-native/examples/account/update-phone.md new file mode 100644 index 0000000000..4e123547cb --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-phone.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhone({ + phone: '+12065550100', + password: 'password' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-prefs.md b/docs/examples/1.8.x/client-react-native/examples/account/update-prefs.md new file mode 100644 index 0000000000..b4a8e0ab2e --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-prefs.md @@ -0,0 +1,17 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePrefs({ + prefs: { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-push-target.md b/docs/examples/1.8.x/client-react-native/examples/account/update-push-target.md new file mode 100644 index 0000000000..c61f65612f --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-push-target.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePushTarget({ + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-recovery.md b/docs/examples/1.8.x/client-react-native/examples/account/update-recovery.md new file mode 100644 index 0000000000..9e0c439714 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-recovery.md @@ -0,0 +1,15 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateRecovery({ + userId: '<USER_ID>', + secret: '<SECRET>', + password: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-session.md b/docs/examples/1.8.x/client-react-native/examples/account/update-session.md new file mode 100644 index 0000000000..948514d6f6 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateSession({ + sessionId: '<SESSION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-status.md b/docs/examples/1.8.x/client-react-native/examples/account/update-status.md new file mode 100644 index 0000000000..8d3a2b0698 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-status.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateStatus(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/account/update-verification.md b/docs/examples/1.8.x/client-react-native/examples/account/update-verification.md new file mode 100644 index 0000000000..287a7feaf7 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/account/update-verification.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateVerification({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/avatars/get-browser.md b/docs/examples/1.8.x/client-react-native/examples/avatars/get-browser.md new file mode 100644 index 0000000000..6506f2e715 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/avatars/get-browser.md @@ -0,0 +1,16 @@ +import { Client, Avatars, Browser } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getBrowser({ + code: Browser.AvantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/client-react-native/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..05d3a53b4c --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/avatars/get-credit-card.md @@ -0,0 +1,16 @@ +import { Client, Avatars, CreditCard } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getCreditCard({ + code: CreditCard.AmericanExpress, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/avatars/get-favicon.md b/docs/examples/1.8.x/client-react-native/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..d3931e3ef4 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/avatars/get-favicon.md @@ -0,0 +1,13 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFavicon({ + url: 'https://example.com' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/avatars/get-flag.md b/docs/examples/1.8.x/client-react-native/examples/avatars/get-flag.md new file mode 100644 index 0000000000..651771a0ef --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/avatars/get-flag.md @@ -0,0 +1,16 @@ +import { Client, Avatars, Flag } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFlag({ + code: Flag.Afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/avatars/get-image.md b/docs/examples/1.8.x/client-react-native/examples/avatars/get-image.md new file mode 100644 index 0000000000..e3b89c31d7 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/avatars/get-image.md @@ -0,0 +1,15 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getImage({ + url: 'https://example.com', + width: 0, // optional + height: 0 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/avatars/get-initials.md b/docs/examples/1.8.x/client-react-native/examples/avatars/get-initials.md new file mode 100644 index 0000000000..3abc399a24 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/avatars/get-initials.md @@ -0,0 +1,16 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getInitials({ + name: '<NAME>', // optional + width: 0, // optional + height: 0, // optional + background: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/avatars/get-qr.md b/docs/examples/1.8.x/client-react-native/examples/avatars/get-qr.md new file mode 100644 index 0000000000..3cbe72a920 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/avatars/get-qr.md @@ -0,0 +1,16 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getQR({ + text: '<TEXT>', + size: 1, // optional + margin: 0, // optional + download: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/databases/create-document.md b/docs/examples/1.8.x/client-react-native/examples/databases/create-document.md new file mode 100644 index 0000000000..e7cffc13d4 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/databases/create-document.md @@ -0,0 +1,23 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/client-react-native/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..ddf43c9758 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.decrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: 0, // optional + min: 0 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/databases/delete-document.md b/docs/examples/1.8.x/client-react-native/examples/databases/delete-document.md new file mode 100644 index 0000000000..828cefdda8 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/databases/delete-document.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/databases/get-document.md b/docs/examples/1.8.x/client-react-native/examples/databases/get-document.md new file mode 100644 index 0000000000..7d28ee03d5 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/databases/get-document.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/client-react-native/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..c129c38a25 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.incrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: 0, // optional + max: 0 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/databases/list-documents.md b/docs/examples/1.8.x/client-react-native/examples/databases/list-documents.md new file mode 100644 index 0000000000..8d210b08e9 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/databases/list-documents.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/databases/update-document.md b/docs/examples/1.8.x/client-react-native/examples/databases/update-document.md new file mode 100644 index 0000000000..ce4a6f2222 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/databases/update-document.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/databases/upsert-document.md b/docs/examples/1.8.x/client-react-native/examples/databases/upsert-document.md new file mode 100644 index 0000000000..a351ed7d4d --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/databases/upsert-document.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.upsertDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/functions/create-execution.md b/docs/examples/1.8.x/client-react-native/examples/functions/create-execution.md new file mode 100644 index 0000000000..b9e6682f3e --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/functions/create-execution.md @@ -0,0 +1,19 @@ +import { Client, Functions, ExecutionMethod } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createExecution({ + functionId: '<FUNCTION_ID>', + body: '<BODY>', // optional + async: false, // optional + path: '<PATH>', // optional + method: ExecutionMethod.GET, // optional + headers: {}, // optional + scheduledAt: '<SCHEDULED_AT>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/functions/get-execution.md b/docs/examples/1.8.x/client-react-native/examples/functions/get-execution.md new file mode 100644 index 0000000000..2ef4e9f817 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/functions/get-execution.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getExecution({ + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/functions/list-executions.md b/docs/examples/1.8.x/client-react-native/examples/functions/list-executions.md new file mode 100644 index 0000000000..7b046dde82 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/functions/list-executions.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listExecutions({ + functionId: '<FUNCTION_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/graphql/mutation.md b/docs/examples/1.8.x/client-react-native/examples/graphql/mutation.md new file mode 100644 index 0000000000..dbc27ff120 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/graphql/mutation.md @@ -0,0 +1,13 @@ +import { Client, Graphql } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.mutation({ + query: {} +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/graphql/query.md b/docs/examples/1.8.x/client-react-native/examples/graphql/query.md new file mode 100644 index 0000000000..560b7e5cf1 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/graphql/query.md @@ -0,0 +1,13 @@ +import { Client, Graphql } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.query({ + query: {} +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/locale/get.md b/docs/examples/1.8.x/client-react-native/examples/locale/get.md new file mode 100644 index 0000000000..34c1672c53 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/locale/get.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.get(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/locale/list-codes.md b/docs/examples/1.8.x/client-react-native/examples/locale/list-codes.md new file mode 100644 index 0000000000..29cec5a5cf --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/locale/list-codes.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/locale/list-continents.md b/docs/examples/1.8.x/client-react-native/examples/locale/list-continents.md new file mode 100644 index 0000000000..c98ba19af3 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/locale/list-continents.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listContinents(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/client-react-native/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..7fb71a548d --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/locale/list-countries-eu.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesEU(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/client-react-native/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..612debc5ab --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/locale/list-countries-phones.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesPhones(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/locale/list-countries.md b/docs/examples/1.8.x/client-react-native/examples/locale/list-countries.md new file mode 100644 index 0000000000..8b1f636fa6 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/locale/list-countries.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountries(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/locale/list-currencies.md b/docs/examples/1.8.x/client-react-native/examples/locale/list-currencies.md new file mode 100644 index 0000000000..4b96a5fdbc --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/locale/list-currencies.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCurrencies(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/locale/list-languages.md b/docs/examples/1.8.x/client-react-native/examples/locale/list-languages.md new file mode 100644 index 0000000000..54166afb1e --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/locale/list-languages.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listLanguages(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/client-react-native/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..2057f1da59 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/messaging/create-subscriber.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/client-react-native/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..38545f6280 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/messaging/delete-subscriber.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/storage/create-file.md b/docs/examples/1.8.x/client-react-native/examples/storage/create-file.md new file mode 100644 index 0000000000..965c8d42cf --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/storage/create-file.md @@ -0,0 +1,16 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.createFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: InputFile.fromPath('/path/to/file', 'filename'), + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/storage/delete-file.md b/docs/examples/1.8.x/client-react-native/examples/storage/delete-file.md new file mode 100644 index 0000000000..776ec7fa18 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/storage/delete-file.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.deleteFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/storage/get-file-download.md b/docs/examples/1.8.x/client-react-native/examples/storage/get-file-download.md new file mode 100644 index 0000000000..317141c87d --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/storage/get-file-download.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileDownload({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/storage/get-file-preview.md b/docs/examples/1.8.x/client-react-native/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..94623fb011 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/storage/get-file-preview.md @@ -0,0 +1,26 @@ +import { Client, Storage, ImageGravity, ImageFormat } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFilePreview({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // optional + height: 0, // optional + gravity: ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: '', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: '', // optional + output: ImageFormat.Jpg, // optional + token: '<TOKEN>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/storage/get-file-view.md b/docs/examples/1.8.x/client-react-native/examples/storage/get-file-view.md new file mode 100644 index 0000000000..bacd1088c9 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/storage/get-file-view.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileView({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/storage/get-file.md b/docs/examples/1.8.x/client-react-native/examples/storage/get-file.md new file mode 100644 index 0000000000..f284182479 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/storage/get-file.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/storage/list-files.md b/docs/examples/1.8.x/client-react-native/examples/storage/list-files.md new file mode 100644 index 0000000000..4c6e159d38 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/storage/list-files.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.listFiles({ + bucketId: '<BUCKET_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/storage/update-file.md b/docs/examples/1.8.x/client-react-native/examples/storage/update-file.md new file mode 100644 index 0000000000..2a8092f86d --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/storage/update-file.md @@ -0,0 +1,16 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.updateFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/tablesdb/create-row.md b/docs/examples/1.8.x/client-react-native/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..a02a8376d5 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/tablesdb/create-row.md @@ -0,0 +1,23 @@ +import { Client, TablesDB } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/client-react-native/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..e00eeb84bf --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.decrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: 0, // optional + min: 0 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/client-react-native/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..624f1a191f --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/tablesdb/delete-row.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/tablesdb/get-row.md b/docs/examples/1.8.x/client-react-native/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..081db46f18 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/tablesdb/get-row.md @@ -0,0 +1,16 @@ +import { Client, TablesDB } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/client-react-native/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..d4b2cf98ad --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/tablesdb/increment-row-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.incrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: 0, // optional + max: 0 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/client-react-native/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..6148e97e90 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/tablesdb/list-rows.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/tablesdb/update-row.md b/docs/examples/1.8.x/client-react-native/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..01ed6e6acc --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/tablesdb/update-row.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/client-react-native/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..72fad15ac4 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/tablesdb/upsert-row.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.upsertRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/create-membership.md b/docs/examples/1.8.x/client-react-native/examples/teams/create-membership.md new file mode 100644 index 0000000000..e89d2deddb --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/create-membership.md @@ -0,0 +1,19 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.createMembership({ + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // optional + userId: '<USER_ID>', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/create.md b/docs/examples/1.8.x/client-react-native/examples/teams/create.md new file mode 100644 index 0000000000..6c8dbbba49 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/create.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.create({ + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/delete-membership.md b/docs/examples/1.8.x/client-react-native/examples/teams/delete-membership.md new file mode 100644 index 0000000000..b881c5ac8c --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/delete-membership.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.deleteMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/delete.md b/docs/examples/1.8.x/client-react-native/examples/teams/delete.md new file mode 100644 index 0000000000..8c98139c5b --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/delete.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.delete({ + teamId: '<TEAM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/get-membership.md b/docs/examples/1.8.x/client-react-native/examples/teams/get-membership.md new file mode 100644 index 0000000000..46cdc4126c --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/get-membership.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/get-prefs.md b/docs/examples/1.8.x/client-react-native/examples/teams/get-prefs.md new file mode 100644 index 0000000000..0e3b4894cb --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/get-prefs.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getPrefs({ + teamId: '<TEAM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/get.md b/docs/examples/1.8.x/client-react-native/examples/teams/get.md new file mode 100644 index 0000000000..6305365688 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/get.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.get({ + teamId: '<TEAM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/list-memberships.md b/docs/examples/1.8.x/client-react-native/examples/teams/list-memberships.md new file mode 100644 index 0000000000..12f71549b5 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/list-memberships.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.listMemberships({ + teamId: '<TEAM_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/list.md b/docs/examples/1.8.x/client-react-native/examples/teams/list.md new file mode 100644 index 0000000000..f9ca4c4054 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/list.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/update-membership-status.md b/docs/examples/1.8.x/client-react-native/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..0aba8065c4 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/update-membership-status.md @@ -0,0 +1,16 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembershipStatus({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/update-membership.md b/docs/examples/1.8.x/client-react-native/examples/teams/update-membership.md new file mode 100644 index 0000000000..ada2863419 --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/update-membership.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [] +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/update-name.md b/docs/examples/1.8.x/client-react-native/examples/teams/update-name.md new file mode 100644 index 0000000000..251ff26ada --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/update-name.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateName({ + teamId: '<TEAM_ID>', + name: '<NAME>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-react-native/examples/teams/update-prefs.md b/docs/examples/1.8.x/client-react-native/examples/teams/update-prefs.md new file mode 100644 index 0000000000..490450210f --- /dev/null +++ b/docs/examples/1.8.x/client-react-native/examples/teams/update-prefs.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updatePrefs({ + teamId: '<TEAM_ID>', + prefs: {} +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/client-rest/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..b62c82a6a8 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-anonymous-session.md @@ -0,0 +1,6 @@ +POST /v1/account/sessions/anonymous HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-email-password-session.md b/docs/examples/1.8.x/client-rest/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..1103d2ebfb --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-email-password-session.md @@ -0,0 +1,10 @@ +POST /v1/account/sessions/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "email": "email@example.com", + "password": "password" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-email-token.md b/docs/examples/1.8.x/client-rest/examples/account/create-email-token.md new file mode 100644 index 0000000000..552b724b9c --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-email-token.md @@ -0,0 +1,11 @@ +POST /v1/account/tokens/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "phrase": false +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-jwt.md b/docs/examples/1.8.x/client-rest/examples/account/create-jwt.md new file mode 100644 index 0000000000..62a7dee7e9 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-jwt.md @@ -0,0 +1,6 @@ +POST /v1/account/jwts HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/client-rest/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..29d68bd0fa --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-magic-url-token.md @@ -0,0 +1,12 @@ +POST /v1/account/tokens/magic-url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "url": "https://example.com", + "phrase": false +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/client-rest/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..62a068b6cf --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-mfa-authenticator.md @@ -0,0 +1,8 @@ +POST /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/client-rest/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..dd5ef4c731 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-mfa-challenge.md @@ -0,0 +1,9 @@ +POST /v1/account/mfa/challenge HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "factor": "email" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/client-rest/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..f09323df0b --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,8 @@ +POST /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-o-auth-2-session.md b/docs/examples/1.8.x/client-rest/examples/account/create-o-auth-2-session.md new file mode 100644 index 0000000000..d136722ec8 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-o-auth-2-session.md @@ -0,0 +1,4 @@ +GET /v1/account/sessions/oauth2/{provider} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/client-rest/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..8a0cab614f --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-o-auth-2-token.md @@ -0,0 +1,4 @@ +GET /v1/account/tokens/oauth2/{provider} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-phone-token.md b/docs/examples/1.8.x/client-rest/examples/account/create-phone-token.md new file mode 100644 index 0000000000..5127c8377a --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-phone-token.md @@ -0,0 +1,10 @@ +POST /v1/account/tokens/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "phone": "+12065550100" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-phone-verification.md b/docs/examples/1.8.x/client-rest/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..57b3b7d160 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-phone-verification.md @@ -0,0 +1,8 @@ +POST /v1/account/verification/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-push-target.md b/docs/examples/1.8.x/client-rest/examples/account/create-push-target.md new file mode 100644 index 0000000000..459a2a2ecc --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-push-target.md @@ -0,0 +1,12 @@ +POST /v1/account/targets/push HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: + +{ + "targetId": "<TARGET_ID>", + "identifier": "<IDENTIFIER>", + "providerId": "<PROVIDER_ID>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-recovery.md b/docs/examples/1.8.x/client-rest/examples/account/create-recovery.md new file mode 100644 index 0000000000..ea0146228b --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-recovery.md @@ -0,0 +1,12 @@ +POST /v1/account/recovery HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "email": "email@example.com", + "url": "https://example.com" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-session.md b/docs/examples/1.8.x/client-rest/examples/account/create-session.md new file mode 100644 index 0000000000..0acc50cda6 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-session.md @@ -0,0 +1,10 @@ +POST /v1/account/sessions/token HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/create-verification.md b/docs/examples/1.8.x/client-rest/examples/account/create-verification.md new file mode 100644 index 0000000000..ed5479dbe5 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create-verification.md @@ -0,0 +1,11 @@ +POST /v1/account/verification HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "url": "https://example.com" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/create.md b/docs/examples/1.8.x/client-rest/examples/account/create.md new file mode 100644 index 0000000000..fa06bfcc1a --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/create.md @@ -0,0 +1,12 @@ +POST /v1/account HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/delete-identity.md b/docs/examples/1.8.x/client-rest/examples/account/delete-identity.md new file mode 100644 index 0000000000..bacca18870 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/delete-identity.md @@ -0,0 +1,8 @@ +DELETE /v1/account/identities/{identityId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/client-rest/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..a0eb5a0869 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,8 @@ +DELETE /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/delete-push-target.md b/docs/examples/1.8.x/client-rest/examples/account/delete-push-target.md new file mode 100644 index 0000000000..9ec6e20d27 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/delete-push-target.md @@ -0,0 +1,7 @@ +DELETE /v1/account/targets/{targetId}/push HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: + diff --git a/docs/examples/1.8.x/client-rest/examples/account/delete-session.md b/docs/examples/1.8.x/client-rest/examples/account/delete-session.md new file mode 100644 index 0000000000..c9b0f48d6f --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/delete-session.md @@ -0,0 +1,8 @@ +DELETE /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/delete-sessions.md b/docs/examples/1.8.x/client-rest/examples/account/delete-sessions.md new file mode 100644 index 0000000000..0b3fcd1c45 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/delete-sessions.md @@ -0,0 +1,8 @@ +DELETE /v1/account/sessions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/client-rest/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..2ab10a2475 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,6 @@ +GET /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/account/get-prefs.md b/docs/examples/1.8.x/client-rest/examples/account/get-prefs.md new file mode 100644 index 0000000000..a038dacbfd --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/get-prefs.md @@ -0,0 +1,6 @@ +GET /v1/account/prefs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/account/get-session.md b/docs/examples/1.8.x/client-rest/examples/account/get-session.md new file mode 100644 index 0000000000..3e372a05ef --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/get-session.md @@ -0,0 +1,6 @@ +GET /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/account/get.md b/docs/examples/1.8.x/client-rest/examples/account/get.md new file mode 100644 index 0000000000..104b643074 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/get.md @@ -0,0 +1,6 @@ +GET /v1/account HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/account/list-identities.md b/docs/examples/1.8.x/client-rest/examples/account/list-identities.md new file mode 100644 index 0000000000..5acb221584 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/list-identities.md @@ -0,0 +1,6 @@ +GET /v1/account/identities HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/account/list-logs.md b/docs/examples/1.8.x/client-rest/examples/account/list-logs.md new file mode 100644 index 0000000000..8314123c9e --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/list-logs.md @@ -0,0 +1,6 @@ +GET /v1/account/logs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/client-rest/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..c591143d4e --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/list-mfa-factors.md @@ -0,0 +1,6 @@ +GET /v1/account/mfa/factors HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/account/list-sessions.md b/docs/examples/1.8.x/client-rest/examples/account/list-sessions.md new file mode 100644 index 0000000000..89ef6962c9 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/list-sessions.md @@ -0,0 +1,6 @@ +GET /v1/account/sessions HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-email.md b/docs/examples/1.8.x/client-rest/examples/account/update-email.md new file mode 100644 index 0000000000..382327e31b --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-email.md @@ -0,0 +1,12 @@ +PATCH /v1/account/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "email": "email@example.com", + "password": "password" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/client-rest/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..1a82afbfcc --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-magic-url-session.md @@ -0,0 +1,10 @@ +PUT /v1/account/sessions/magic-url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/client-rest/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..780472291c --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-mfa-authenticator.md @@ -0,0 +1,11 @@ +PUT /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "otp": "<OTP>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/client-rest/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..b6a7e92b28 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-mfa-challenge.md @@ -0,0 +1,12 @@ +PUT /v1/account/mfa/challenge HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "challengeId": "<CHALLENGE_ID>", + "otp": "<OTP>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/client-rest/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..74e9225f3e --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,8 @@ +PATCH /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-mfa.md b/docs/examples/1.8.x/client-rest/examples/account/update-mfa.md new file mode 100644 index 0000000000..a22b169751 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-mfa.md @@ -0,0 +1,11 @@ +PATCH /v1/account/mfa HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "mfa": false +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-name.md b/docs/examples/1.8.x/client-rest/examples/account/update-name.md new file mode 100644 index 0000000000..4c9c0e302c --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-name.md @@ -0,0 +1,11 @@ +PATCH /v1/account/name HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-password.md b/docs/examples/1.8.x/client-rest/examples/account/update-password.md new file mode 100644 index 0000000000..c26f18a4f3 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-password.md @@ -0,0 +1,12 @@ +PATCH /v1/account/password HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "password": "", + "oldPassword": "password" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-phone-session.md b/docs/examples/1.8.x/client-rest/examples/account/update-phone-session.md new file mode 100644 index 0000000000..54872eecd2 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-phone-session.md @@ -0,0 +1,10 @@ +PUT /v1/account/sessions/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-phone-verification.md b/docs/examples/1.8.x/client-rest/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..1d4dc22520 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-phone-verification.md @@ -0,0 +1,12 @@ +PUT /v1/account/verification/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-phone.md b/docs/examples/1.8.x/client-rest/examples/account/update-phone.md new file mode 100644 index 0000000000..791caadb0d --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-phone.md @@ -0,0 +1,12 @@ +PATCH /v1/account/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "phone": "+12065550100", + "password": "password" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-prefs.md b/docs/examples/1.8.x/client-rest/examples/account/update-prefs.md new file mode 100644 index 0000000000..0d7e4eab0c --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-prefs.md @@ -0,0 +1,15 @@ +PATCH /v1/account/prefs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "prefs": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-push-target.md b/docs/examples/1.8.x/client-rest/examples/account/update-push-target.md new file mode 100644 index 0000000000..95210b5a1c --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-push-target.md @@ -0,0 +1,10 @@ +PUT /v1/account/targets/{targetId}/push HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: + +{ + "identifier": "<IDENTIFIER>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-recovery.md b/docs/examples/1.8.x/client-rest/examples/account/update-recovery.md new file mode 100644 index 0000000000..68919c29fb --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-recovery.md @@ -0,0 +1,13 @@ +PUT /v1/account/recovery HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>", + "password": "" +} diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-session.md b/docs/examples/1.8.x/client-rest/examples/account/update-session.md new file mode 100644 index 0000000000..8e2257aeed --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-session.md @@ -0,0 +1,8 @@ +PATCH /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-status.md b/docs/examples/1.8.x/client-rest/examples/account/update-status.md new file mode 100644 index 0000000000..557697fe5f --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-status.md @@ -0,0 +1,8 @@ +PATCH /v1/account/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/account/update-verification.md b/docs/examples/1.8.x/client-rest/examples/account/update-verification.md new file mode 100644 index 0000000000..a4dcbf76a3 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/account/update-verification.md @@ -0,0 +1,12 @@ +PUT /v1/account/verification HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/avatars/get-browser.md b/docs/examples/1.8.x/client-rest/examples/avatars/get-browser.md new file mode 100644 index 0000000000..9de9d99173 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/avatars/get-browser.md @@ -0,0 +1,6 @@ +GET /v1/avatars/browsers/{code} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/client-rest/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..ed30226d3b --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/avatars/get-credit-card.md @@ -0,0 +1,6 @@ +GET /v1/avatars/credit-cards/{code} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/avatars/get-favicon.md b/docs/examples/1.8.x/client-rest/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..8eaca9452e --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/avatars/get-favicon.md @@ -0,0 +1,6 @@ +GET /v1/avatars/favicon HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/avatars/get-flag.md b/docs/examples/1.8.x/client-rest/examples/avatars/get-flag.md new file mode 100644 index 0000000000..07172e89d8 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/avatars/get-flag.md @@ -0,0 +1,6 @@ +GET /v1/avatars/flags/{code} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/avatars/get-image.md b/docs/examples/1.8.x/client-rest/examples/avatars/get-image.md new file mode 100644 index 0000000000..98d4898e6f --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/avatars/get-image.md @@ -0,0 +1,6 @@ +GET /v1/avatars/image HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/avatars/get-initials.md b/docs/examples/1.8.x/client-rest/examples/avatars/get-initials.md new file mode 100644 index 0000000000..93a70a80ab --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/avatars/get-initials.md @@ -0,0 +1,6 @@ +GET /v1/avatars/initials HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/avatars/get-qr.md b/docs/examples/1.8.x/client-rest/examples/avatars/get-qr.md new file mode 100644 index 0000000000..39e513c810 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/avatars/get-qr.md @@ -0,0 +1,6 @@ +GET /v1/avatars/qr HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/databases/create-document.md b/docs/examples/1.8.x/client-rest/examples/databases/create-document.md new file mode 100644 index 0000000000..12f2159402 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/databases/create-document.md @@ -0,0 +1,19 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "documentId": "<DOCUMENT_ID>", + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/client-rest/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/client-rest/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..85ee70588b --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/databases/decrement-document-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "value": 0, + "min": 0 +} diff --git a/docs/examples/1.8.x/client-rest/examples/databases/delete-document.md b/docs/examples/1.8.x/client-rest/examples/databases/delete-document.md new file mode 100644 index 0000000000..2ee4f92ec4 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/databases/delete-document.md @@ -0,0 +1,8 @@ +DELETE /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/databases/get-document.md b/docs/examples/1.8.x/client-rest/examples/databases/get-document.md new file mode 100644 index 0000000000..dac5e48131 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/databases/get-document.md @@ -0,0 +1,6 @@ +GET /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/client-rest/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..68b091a31e --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/databases/increment-document-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "value": 0, + "max": 0 +} diff --git a/docs/examples/1.8.x/client-rest/examples/databases/list-documents.md b/docs/examples/1.8.x/client-rest/examples/databases/list-documents.md new file mode 100644 index 0000000000..e5c4936d6f --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/databases/list-documents.md @@ -0,0 +1,6 @@ +GET /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/databases/update-document.md b/docs/examples/1.8.x/client-rest/examples/databases/update-document.md new file mode 100644 index 0000000000..ffc5d36011 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/databases/update-document.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "data": {}, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/client-rest/examples/databases/upsert-document.md b/docs/examples/1.8.x/client-rest/examples/databases/upsert-document.md new file mode 100644 index 0000000000..d2baeac6a8 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/databases/upsert-document.md @@ -0,0 +1,12 @@ +PUT /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "data": {}, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/client-rest/examples/functions/create-execution.md b/docs/examples/1.8.x/client-rest/examples/functions/create-execution.md new file mode 100644 index 0000000000..4ae83f3096 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/functions/create-execution.md @@ -0,0 +1,16 @@ +POST /v1/functions/{functionId}/executions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "body": "<BODY>", + "async": false, + "path": "<PATH>", + "method": "GET", + "headers": {}, + "scheduledAt": "<SCHEDULED_AT>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/functions/get-execution.md b/docs/examples/1.8.x/client-rest/examples/functions/get-execution.md new file mode 100644 index 0000000000..e2f3e97d10 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/functions/get-execution.md @@ -0,0 +1,6 @@ +GET /v1/functions/{functionId}/executions/{executionId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/functions/list-executions.md b/docs/examples/1.8.x/client-rest/examples/functions/list-executions.md new file mode 100644 index 0000000000..445ed1fa83 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/functions/list-executions.md @@ -0,0 +1,6 @@ +GET /v1/functions/{functionId}/executions HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/graphql/mutation.md b/docs/examples/1.8.x/client-rest/examples/graphql/mutation.md new file mode 100644 index 0000000000..4080765d58 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/graphql/mutation.md @@ -0,0 +1,12 @@ +POST /v1/graphql/mutation HTTP/1.1 +Host: cloud.appwrite.io +X-Sdk-Graphql: true +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "query": {} +} diff --git a/docs/examples/1.8.x/client-rest/examples/graphql/query.md b/docs/examples/1.8.x/client-rest/examples/graphql/query.md new file mode 100644 index 0000000000..b05ce724c8 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/graphql/query.md @@ -0,0 +1,12 @@ +POST /v1/graphql HTTP/1.1 +Host: cloud.appwrite.io +X-Sdk-Graphql: true +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "query": {} +} diff --git a/docs/examples/1.8.x/client-rest/examples/locale/get.md b/docs/examples/1.8.x/client-rest/examples/locale/get.md new file mode 100644 index 0000000000..8f8a1741e6 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/locale/get.md @@ -0,0 +1,6 @@ +GET /v1/locale HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/locale/list-codes.md b/docs/examples/1.8.x/client-rest/examples/locale/list-codes.md new file mode 100644 index 0000000000..61110f6527 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/locale/list-codes.md @@ -0,0 +1,6 @@ +GET /v1/locale/codes HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/locale/list-continents.md b/docs/examples/1.8.x/client-rest/examples/locale/list-continents.md new file mode 100644 index 0000000000..cb96cc4e16 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/locale/list-continents.md @@ -0,0 +1,6 @@ +GET /v1/locale/continents HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/client-rest/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..d4de74a879 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/locale/list-countries-eu.md @@ -0,0 +1,6 @@ +GET /v1/locale/countries/eu HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/client-rest/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..0e1ed67a7d --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/locale/list-countries-phones.md @@ -0,0 +1,6 @@ +GET /v1/locale/countries/phones HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/locale/list-countries.md b/docs/examples/1.8.x/client-rest/examples/locale/list-countries.md new file mode 100644 index 0000000000..58e487a875 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/locale/list-countries.md @@ -0,0 +1,6 @@ +GET /v1/locale/countries HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/locale/list-currencies.md b/docs/examples/1.8.x/client-rest/examples/locale/list-currencies.md new file mode 100644 index 0000000000..a3a9b96c48 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/locale/list-currencies.md @@ -0,0 +1,6 @@ +GET /v1/locale/currencies HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/locale/list-languages.md b/docs/examples/1.8.x/client-rest/examples/locale/list-languages.md new file mode 100644 index 0000000000..8c7cbabddf --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/locale/list-languages.md @@ -0,0 +1,6 @@ +GET /v1/locale/languages HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/client-rest/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..708ec0782a --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/messaging/create-subscriber.md @@ -0,0 +1,12 @@ +POST /v1/messaging/topics/{topicId}/subscribers HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-JWT: <YOUR_JWT> +X-Appwrite-Session: + +{ + "subscriberId": "<SUBSCRIBER_ID>", + "targetId": "<TARGET_ID>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/client-rest/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..1cb9c3e516 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/messaging/delete-subscriber.md @@ -0,0 +1,8 @@ +DELETE /v1/messaging/topics/{topicId}/subscribers/{subscriberId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-JWT: <YOUR_JWT> +X-Appwrite-Session: + diff --git a/docs/examples/1.8.x/client-rest/examples/storage/create-file.md b/docs/examples/1.8.x/client-rest/examples/storage/create-file.md new file mode 100644 index 0000000000..150801a22f --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/storage/create-file.md @@ -0,0 +1,25 @@ +POST /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="fileId" + +"<FILE_ID>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="file" + +cf 94 84 24 8d c4 91 10 0f dc 54 26 6c 8e 4b bc e8 ee 55 94 29 e7 94 89 19 26 28 01 26 29 3f 16... + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="permissions[]" + +["read(\"any\")"] + +--cec8e8123c05ba25-- diff --git a/docs/examples/1.8.x/client-rest/examples/storage/delete-file.md b/docs/examples/1.8.x/client-rest/examples/storage/delete-file.md new file mode 100644 index 0000000000..e00392a525 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/storage/delete-file.md @@ -0,0 +1,8 @@ +DELETE /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/storage/get-file-download.md b/docs/examples/1.8.x/client-rest/examples/storage/get-file-download.md new file mode 100644 index 0000000000..92991d0727 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/storage/get-file-download.md @@ -0,0 +1,6 @@ +GET /v1/storage/buckets/{bucketId}/files/{fileId}/download HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/storage/get-file-preview.md b/docs/examples/1.8.x/client-rest/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..e84dd4dd85 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/storage/get-file-preview.md @@ -0,0 +1,6 @@ +GET /v1/storage/buckets/{bucketId}/files/{fileId}/preview HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/storage/get-file-view.md b/docs/examples/1.8.x/client-rest/examples/storage/get-file-view.md new file mode 100644 index 0000000000..f482706f6f --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/storage/get-file-view.md @@ -0,0 +1,6 @@ +GET /v1/storage/buckets/{bucketId}/files/{fileId}/view HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/storage/get-file.md b/docs/examples/1.8.x/client-rest/examples/storage/get-file.md new file mode 100644 index 0000000000..4f929caadf --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/storage/get-file.md @@ -0,0 +1,6 @@ +GET /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/storage/list-files.md b/docs/examples/1.8.x/client-rest/examples/storage/list-files.md new file mode 100644 index 0000000000..977bb9e713 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/storage/list-files.md @@ -0,0 +1,6 @@ +GET /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/storage/update-file.md b/docs/examples/1.8.x/client-rest/examples/storage/update-file.md new file mode 100644 index 0000000000..fed35bb860 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/storage/update-file.md @@ -0,0 +1,12 @@ +PUT /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "name": "<NAME>", + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/client-rest/examples/tablesdb/create-row.md b/docs/examples/1.8.x/client-rest/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..34d8ab5152 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/tablesdb/create-row.md @@ -0,0 +1,19 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "rowId": "<ROW_ID>", + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/client-rest/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/client-rest/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..676e090150 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,12 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "value": 0, + "min": 0 +} diff --git a/docs/examples/1.8.x/client-rest/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/client-rest/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..f3ba056f7e --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/tablesdb/delete-row.md @@ -0,0 +1,8 @@ +DELETE /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/tablesdb/get-row.md b/docs/examples/1.8.x/client-rest/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..8c2187f696 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/tablesdb/get-row.md @@ -0,0 +1,6 @@ +GET /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/client-rest/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..5172cb420b --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/tablesdb/increment-row-column.md @@ -0,0 +1,12 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "value": 0, + "max": 0 +} diff --git a/docs/examples/1.8.x/client-rest/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/client-rest/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..0d69509ca6 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/tablesdb/list-rows.md @@ -0,0 +1,6 @@ +GET /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/tablesdb/update-row.md b/docs/examples/1.8.x/client-rest/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..40d276a0fe --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/tablesdb/update-row.md @@ -0,0 +1,12 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "data": {}, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/client-rest/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/client-rest/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..581790fc01 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/tablesdb/upsert-row.md @@ -0,0 +1,12 @@ +PUT /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "data": {}, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/client-rest/examples/teams/create-membership.md b/docs/examples/1.8.x/client-rest/examples/teams/create-membership.md new file mode 100644 index 0000000000..f96f20c2b8 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/create-membership.md @@ -0,0 +1,16 @@ +POST /v1/teams/{teamId}/memberships HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "email": "email@example.com", + "userId": "<USER_ID>", + "phone": "+12065550100", + "roles": [], + "url": "https://example.com", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/teams/create.md b/docs/examples/1.8.x/client-rest/examples/teams/create.md new file mode 100644 index 0000000000..33cf95ba01 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/create.md @@ -0,0 +1,13 @@ +POST /v1/teams HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "teamId": "<TEAM_ID>", + "name": "<NAME>", + "roles": [] +} diff --git a/docs/examples/1.8.x/client-rest/examples/teams/delete-membership.md b/docs/examples/1.8.x/client-rest/examples/teams/delete-membership.md new file mode 100644 index 0000000000..8da481d5cf --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/delete-membership.md @@ -0,0 +1,8 @@ +DELETE /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/teams/delete.md b/docs/examples/1.8.x/client-rest/examples/teams/delete.md new file mode 100644 index 0000000000..d1dc59c23a --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/delete.md @@ -0,0 +1,8 @@ +DELETE /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/client-rest/examples/teams/get-membership.md b/docs/examples/1.8.x/client-rest/examples/teams/get-membership.md new file mode 100644 index 0000000000..6e7379b0d7 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/get-membership.md @@ -0,0 +1,6 @@ +GET /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/teams/get-prefs.md b/docs/examples/1.8.x/client-rest/examples/teams/get-prefs.md new file mode 100644 index 0000000000..e541fd3fd8 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/get-prefs.md @@ -0,0 +1,6 @@ +GET /v1/teams/{teamId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/teams/get.md b/docs/examples/1.8.x/client-rest/examples/teams/get.md new file mode 100644 index 0000000000..32d9156267 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/get.md @@ -0,0 +1,6 @@ +GET /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/teams/list-memberships.md b/docs/examples/1.8.x/client-rest/examples/teams/list-memberships.md new file mode 100644 index 0000000000..4e364053b3 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/list-memberships.md @@ -0,0 +1,6 @@ +GET /v1/teams/{teamId}/memberships HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/teams/list.md b/docs/examples/1.8.x/client-rest/examples/teams/list.md new file mode 100644 index 0000000000..e5f0439a13 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/list.md @@ -0,0 +1,6 @@ +GET /v1/teams HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/client-rest/examples/teams/update-membership-status.md b/docs/examples/1.8.x/client-rest/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..da2c9189cd --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/update-membership-status.md @@ -0,0 +1,12 @@ +PATCH /v1/teams/{teamId}/memberships/{membershipId}/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/teams/update-membership.md b/docs/examples/1.8.x/client-rest/examples/teams/update-membership.md new file mode 100644 index 0000000000..b1010ea460 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/update-membership.md @@ -0,0 +1,11 @@ +PATCH /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "roles": [] +} diff --git a/docs/examples/1.8.x/client-rest/examples/teams/update-name.md b/docs/examples/1.8.x/client-rest/examples/teams/update-name.md new file mode 100644 index 0000000000..cd92d686ce --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/update-name.md @@ -0,0 +1,11 @@ +PUT /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/client-rest/examples/teams/update-prefs.md b/docs/examples/1.8.x/client-rest/examples/teams/update-prefs.md new file mode 100644 index 0000000000..e17dcdb260 --- /dev/null +++ b/docs/examples/1.8.x/client-rest/examples/teams/update-prefs.md @@ -0,0 +1,11 @@ +PUT /v1/teams/{teamId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "prefs": {} +} diff --git a/docs/examples/1.8.x/client-web/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/client-web/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..42279c0312 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-anonymous-session.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createAnonymousSession(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-email-password-session.md b/docs/examples/1.8.x/client-web/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..26a745a6b2 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-email-password-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailPasswordSession({ + email: 'email@example.com', + password: 'password' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-email-token.md b/docs/examples/1.8.x/client-web/examples/account/create-email-token.md new file mode 100644 index 0000000000..e0c4cdaaf8 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-email-token.md @@ -0,0 +1,15 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailToken({ + userId: '<USER_ID>', + email: 'email@example.com', + phrase: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-jwt.md b/docs/examples/1.8.x/client-web/examples/account/create-jwt.md new file mode 100644 index 0000000000..ff17d60661 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-jwt.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createJWT(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/client-web/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..16d35672b4 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-magic-url-token.md @@ -0,0 +1,16 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMagicURLToken({ + userId: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/client-web/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..154be4e185 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-mfa-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticatorType } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAAuthenticator({ + type: AuthenticatorType.Totp +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/client-web/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..1328305538 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-mfa-challenge.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticationFactor } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAChallenge({ + factor: AuthenticationFactor.Email +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/client-web/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..d9041f273d --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMFARecoveryCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-o-auth-2-session.md b/docs/examples/1.8.x/client-web/examples/account/create-o-auth-2-session.md new file mode 100644 index 0000000000..b451e25e5e --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-o-auth-2-session.md @@ -0,0 +1,15 @@ +import { Client, Account, OAuthProvider } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +account.createOAuth2Session({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [] // optional +}); + diff --git a/docs/examples/1.8.x/client-web/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/client-web/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..0fce114dc6 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-o-auth-2-token.md @@ -0,0 +1,15 @@ +import { Client, Account, OAuthProvider } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +account.createOAuth2Token({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [] // optional +}); + diff --git a/docs/examples/1.8.x/client-web/examples/account/create-phone-token.md b/docs/examples/1.8.x/client-web/examples/account/create-phone-token.md new file mode 100644 index 0000000000..60d032ef51 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-phone-token.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneToken({ + userId: '<USER_ID>', + phone: '+12065550100' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-phone-verification.md b/docs/examples/1.8.x/client-web/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..00373a3dd4 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-phone-verification.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneVerification(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-push-target.md b/docs/examples/1.8.x/client-web/examples/account/create-push-target.md new file mode 100644 index 0000000000..1f973e1b46 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-push-target.md @@ -0,0 +1,15 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createPushTarget({ + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-recovery.md b/docs/examples/1.8.x/client-web/examples/account/create-recovery.md new file mode 100644 index 0000000000..2195ed93d5 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-recovery.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createRecovery({ + email: 'email@example.com', + url: 'https://example.com' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-session.md b/docs/examples/1.8.x/client-web/examples/account/create-session.md new file mode 100644 index 0000000000..4858f9f2e0 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create-verification.md b/docs/examples/1.8.x/client-web/examples/account/create-verification.md new file mode 100644 index 0000000000..0325e40581 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create-verification.md @@ -0,0 +1,13 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createVerification({ + url: 'https://example.com' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/create.md b/docs/examples/1.8.x/client-web/examples/account/create.md new file mode 100644 index 0000000000..dbb374daf3 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/create.md @@ -0,0 +1,16 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.create({ + userId: '<USER_ID>', + email: 'email@example.com', + password: '', + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/delete-identity.md b/docs/examples/1.8.x/client-web/examples/account/delete-identity.md new file mode 100644 index 0000000000..48434496d2 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/delete-identity.md @@ -0,0 +1,13 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteIdentity({ + identityId: '<IDENTITY_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/client-web/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..2b1a8785fd --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticatorType } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteMFAAuthenticator({ + type: AuthenticatorType.Totp +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/delete-push-target.md b/docs/examples/1.8.x/client-web/examples/account/delete-push-target.md new file mode 100644 index 0000000000..1a09b32ad1 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/delete-push-target.md @@ -0,0 +1,13 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deletePushTarget({ + targetId: '<TARGET_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/delete-session.md b/docs/examples/1.8.x/client-web/examples/account/delete-session.md new file mode 100644 index 0000000000..bf17ffce8b --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/delete-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSession({ + sessionId: '<SESSION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/delete-sessions.md b/docs/examples/1.8.x/client-web/examples/account/delete-sessions.md new file mode 100644 index 0000000000..c0fdf13924 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/delete-sessions.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSessions(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/client-web/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..527ebd9dab --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.getMFARecoveryCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/get-prefs.md b/docs/examples/1.8.x/client-web/examples/account/get-prefs.md new file mode 100644 index 0000000000..f283832896 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/get-prefs.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.getPrefs(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/get-session.md b/docs/examples/1.8.x/client-web/examples/account/get-session.md new file mode 100644 index 0000000000..8c4bdd79f6 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/get-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.getSession({ + sessionId: '<SESSION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/get.md b/docs/examples/1.8.x/client-web/examples/account/get.md new file mode 100644 index 0000000000..ea605914ce --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/get.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.get(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/list-identities.md b/docs/examples/1.8.x/client-web/examples/account/list-identities.md new file mode 100644 index 0000000000..28cc409f26 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/list-identities.md @@ -0,0 +1,13 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listIdentities({ + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/list-logs.md b/docs/examples/1.8.x/client-web/examples/account/list-logs.md new file mode 100644 index 0000000000..ec763f9a08 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/list-logs.md @@ -0,0 +1,13 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listLogs({ + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/client-web/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..80151d977c --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/list-mfa-factors.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listMFAFactors(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/list-sessions.md b/docs/examples/1.8.x/client-web/examples/account/list-sessions.md new file mode 100644 index 0000000000..453e606517 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/list-sessions.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listSessions(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-email.md b/docs/examples/1.8.x/client-web/examples/account/update-email.md new file mode 100644 index 0000000000..96dcec5bdf --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-email.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateEmail({ + email: 'email@example.com', + password: 'password' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/client-web/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..c126f7ce80 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-magic-url-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMagicURLSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/client-web/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..f5ce65eeab --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-mfa-authenticator.md @@ -0,0 +1,14 @@ +import { Client, Account, AuthenticatorType } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAAuthenticator({ + type: AuthenticatorType.Totp, + otp: '<OTP>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/client-web/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..016533c09b --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-mfa-challenge.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAChallenge({ + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/client-web/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..3ab0385027 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFARecoveryCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-mfa.md b/docs/examples/1.8.x/client-web/examples/account/update-mfa.md new file mode 100644 index 0000000000..4d20604da4 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-mfa.md @@ -0,0 +1,13 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFA({ + mfa: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-name.md b/docs/examples/1.8.x/client-web/examples/account/update-name.md new file mode 100644 index 0000000000..6a9ba82cdc --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-name.md @@ -0,0 +1,13 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateName({ + name: '<NAME>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-password.md b/docs/examples/1.8.x/client-web/examples/account/update-password.md new file mode 100644 index 0000000000..743335b8ba --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-password.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePassword({ + password: '', + oldPassword: 'password' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-phone-session.md b/docs/examples/1.8.x/client-web/examples/account/update-phone-session.md new file mode 100644 index 0000000000..39d0d36533 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-phone-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-phone-verification.md b/docs/examples/1.8.x/client-web/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..6be1b777a4 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-phone-verification.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneVerification({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-phone.md b/docs/examples/1.8.x/client-web/examples/account/update-phone.md new file mode 100644 index 0000000000..912b2e5256 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-phone.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhone({ + phone: '+12065550100', + password: 'password' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-prefs.md b/docs/examples/1.8.x/client-web/examples/account/update-prefs.md new file mode 100644 index 0000000000..8ca2678a7a --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-prefs.md @@ -0,0 +1,17 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePrefs({ + prefs: { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-push-target.md b/docs/examples/1.8.x/client-web/examples/account/update-push-target.md new file mode 100644 index 0000000000..57fdd6b1ef --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-push-target.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePushTarget({ + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-recovery.md b/docs/examples/1.8.x/client-web/examples/account/update-recovery.md new file mode 100644 index 0000000000..d975647a30 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-recovery.md @@ -0,0 +1,15 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateRecovery({ + userId: '<USER_ID>', + secret: '<SECRET>', + password: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-session.md b/docs/examples/1.8.x/client-web/examples/account/update-session.md new file mode 100644 index 0000000000..4c9890b216 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateSession({ + sessionId: '<SESSION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-status.md b/docs/examples/1.8.x/client-web/examples/account/update-status.md new file mode 100644 index 0000000000..932f167033 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-status.md @@ -0,0 +1,11 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateStatus(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/account/update-verification.md b/docs/examples/1.8.x/client-web/examples/account/update-verification.md new file mode 100644 index 0000000000..b5fea5c9d6 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/account/update-verification.md @@ -0,0 +1,14 @@ +import { Client, Account } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateVerification({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/avatars/get-browser.md b/docs/examples/1.8.x/client-web/examples/avatars/get-browser.md new file mode 100644 index 0000000000..a0deff3fbc --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/avatars/get-browser.md @@ -0,0 +1,16 @@ +import { Client, Avatars, Browser } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getBrowser({ + code: Browser.AvantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/client-web/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..af0599ace5 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/avatars/get-credit-card.md @@ -0,0 +1,16 @@ +import { Client, Avatars, CreditCard } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getCreditCard({ + code: CreditCard.AmericanExpress, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/avatars/get-favicon.md b/docs/examples/1.8.x/client-web/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..2e976c6436 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/avatars/get-favicon.md @@ -0,0 +1,13 @@ +import { Client, Avatars } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFavicon({ + url: 'https://example.com' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/avatars/get-flag.md b/docs/examples/1.8.x/client-web/examples/avatars/get-flag.md new file mode 100644 index 0000000000..76e7733e8c --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/avatars/get-flag.md @@ -0,0 +1,16 @@ +import { Client, Avatars, Flag } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFlag({ + code: Flag.Afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/avatars/get-image.md b/docs/examples/1.8.x/client-web/examples/avatars/get-image.md new file mode 100644 index 0000000000..b8fe0f08b1 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/avatars/get-image.md @@ -0,0 +1,15 @@ +import { Client, Avatars } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getImage({ + url: 'https://example.com', + width: 0, // optional + height: 0 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/avatars/get-initials.md b/docs/examples/1.8.x/client-web/examples/avatars/get-initials.md new file mode 100644 index 0000000000..01c183031b --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/avatars/get-initials.md @@ -0,0 +1,16 @@ +import { Client, Avatars } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getInitials({ + name: '<NAME>', // optional + width: 0, // optional + height: 0, // optional + background: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/avatars/get-qr.md b/docs/examples/1.8.x/client-web/examples/avatars/get-qr.md new file mode 100644 index 0000000000..53202d8cd4 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/avatars/get-qr.md @@ -0,0 +1,16 @@ +import { Client, Avatars } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getQR({ + text: '<TEXT>', + size: 1, // optional + margin: 0, // optional + download: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/databases/create-document.md b/docs/examples/1.8.x/client-web/examples/databases/create-document.md new file mode 100644 index 0000000000..08606c9b4f --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/databases/create-document.md @@ -0,0 +1,23 @@ +import { Client, Databases } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/client-web/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..98629c4e6c --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.decrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + min: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/databases/delete-document.md b/docs/examples/1.8.x/client-web/examples/databases/delete-document.md new file mode 100644 index 0000000000..4192085653 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/databases/delete-document.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/databases/get-document.md b/docs/examples/1.8.x/client-web/examples/databases/get-document.md new file mode 100644 index 0000000000..b3a7558907 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/databases/get-document.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/client-web/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..8adb5d8091 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.incrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + max: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/databases/list-documents.md b/docs/examples/1.8.x/client-web/examples/databases/list-documents.md new file mode 100644 index 0000000000..fb1d508fed --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/databases/list-documents.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/databases/update-document.md b/docs/examples/1.8.x/client-web/examples/databases/update-document.md new file mode 100644 index 0000000000..bf3554812d --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/databases/update-document.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/databases/upsert-document.md b/docs/examples/1.8.x/client-web/examples/databases/upsert-document.md new file mode 100644 index 0000000000..c56bc5534d --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/databases/upsert-document.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.upsertDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/functions/create-execution.md b/docs/examples/1.8.x/client-web/examples/functions/create-execution.md new file mode 100644 index 0000000000..b8c955b8ec --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/functions/create-execution.md @@ -0,0 +1,19 @@ +import { Client, Functions, ExecutionMethod } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createExecution({ + functionId: '<FUNCTION_ID>', + body: '<BODY>', // optional + async: false, // optional + path: '<PATH>', // optional + method: ExecutionMethod.GET, // optional + headers: {}, // optional + scheduledAt: '<SCHEDULED_AT>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/functions/get-execution.md b/docs/examples/1.8.x/client-web/examples/functions/get-execution.md new file mode 100644 index 0000000000..1e9a367df5 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/functions/get-execution.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getExecution({ + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/functions/list-executions.md b/docs/examples/1.8.x/client-web/examples/functions/list-executions.md new file mode 100644 index 0000000000..159882c512 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/functions/list-executions.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listExecutions({ + functionId: '<FUNCTION_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/graphql/mutation.md b/docs/examples/1.8.x/client-web/examples/graphql/mutation.md new file mode 100644 index 0000000000..5771af061a --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/graphql/mutation.md @@ -0,0 +1,13 @@ +import { Client, Graphql } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.mutation({ + query: {} +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/graphql/query.md b/docs/examples/1.8.x/client-web/examples/graphql/query.md new file mode 100644 index 0000000000..c367d07d3e --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/graphql/query.md @@ -0,0 +1,13 @@ +import { Client, Graphql } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.query({ + query: {} +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/locale/get.md b/docs/examples/1.8.x/client-web/examples/locale/get.md new file mode 100644 index 0000000000..bdd74722f4 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/locale/get.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.get(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/locale/list-codes.md b/docs/examples/1.8.x/client-web/examples/locale/list-codes.md new file mode 100644 index 0000000000..547bb056c0 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/locale/list-codes.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/locale/list-continents.md b/docs/examples/1.8.x/client-web/examples/locale/list-continents.md new file mode 100644 index 0000000000..217ffc116c --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/locale/list-continents.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listContinents(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/client-web/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..515a3040ab --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/locale/list-countries-eu.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesEU(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/client-web/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..72a6a31d08 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/locale/list-countries-phones.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesPhones(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/locale/list-countries.md b/docs/examples/1.8.x/client-web/examples/locale/list-countries.md new file mode 100644 index 0000000000..a127521f36 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/locale/list-countries.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountries(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/locale/list-currencies.md b/docs/examples/1.8.x/client-web/examples/locale/list-currencies.md new file mode 100644 index 0000000000..e6ff0e1fce --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/locale/list-currencies.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCurrencies(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/locale/list-languages.md b/docs/examples/1.8.x/client-web/examples/locale/list-languages.md new file mode 100644 index 0000000000..03b4e7d2c1 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/locale/list-languages.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listLanguages(); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/client-web/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..59b760358e --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/messaging/create-subscriber.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/client-web/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..dfe2d0688c --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/messaging/delete-subscriber.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/storage/create-file.md b/docs/examples/1.8.x/client-web/examples/storage/create-file.md new file mode 100644 index 0000000000..999fcb20ac --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/storage/create-file.md @@ -0,0 +1,16 @@ +import { Client, Storage } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.createFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: document.getElementById('uploader').files[0], + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/storage/delete-file.md b/docs/examples/1.8.x/client-web/examples/storage/delete-file.md new file mode 100644 index 0000000000..101b87860b --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/storage/delete-file.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.deleteFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/storage/get-file-download.md b/docs/examples/1.8.x/client-web/examples/storage/get-file-download.md new file mode 100644 index 0000000000..8454be442a --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/storage/get-file-download.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileDownload({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/storage/get-file-preview.md b/docs/examples/1.8.x/client-web/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..c4e855b207 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/storage/get-file-preview.md @@ -0,0 +1,26 @@ +import { Client, Storage, ImageGravity, ImageFormat } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFilePreview({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // optional + height: 0, // optional + gravity: ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: '', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: '', // optional + output: ImageFormat.Jpg, // optional + token: '<TOKEN>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/storage/get-file-view.md b/docs/examples/1.8.x/client-web/examples/storage/get-file-view.md new file mode 100644 index 0000000000..edc28f146b --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/storage/get-file-view.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileView({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/storage/get-file.md b/docs/examples/1.8.x/client-web/examples/storage/get-file.md new file mode 100644 index 0000000000..41c41b63d1 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/storage/get-file.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/storage/list-files.md b/docs/examples/1.8.x/client-web/examples/storage/list-files.md new file mode 100644 index 0000000000..154212dfec --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/storage/list-files.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.listFiles({ + bucketId: '<BUCKET_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/storage/update-file.md b/docs/examples/1.8.x/client-web/examples/storage/update-file.md new file mode 100644 index 0000000000..96e1dc5ee2 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/storage/update-file.md @@ -0,0 +1,16 @@ +import { Client, Storage } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.updateFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/tablesdb/create-row.md b/docs/examples/1.8.x/client-web/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..1dd1fe4241 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/tablesdb/create-row.md @@ -0,0 +1,23 @@ +import { Client, TablesDB } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/client-web/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..59f66d973f --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.decrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, // optional + min: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/client-web/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..637114d413 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/tablesdb/delete-row.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/tablesdb/get-row.md b/docs/examples/1.8.x/client-web/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..4e436432b7 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/tablesdb/get-row.md @@ -0,0 +1,16 @@ +import { Client, TablesDB } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/client-web/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..a7f3a8c312 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/tablesdb/increment-row-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.incrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, // optional + max: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/client-web/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..63149aaba4 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/tablesdb/list-rows.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/tablesdb/update-row.md b/docs/examples/1.8.x/client-web/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..1dba006762 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/tablesdb/update-row.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/client-web/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..1add1c45b9 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/tablesdb/upsert-row.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.upsertRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/create-membership.md b/docs/examples/1.8.x/client-web/examples/teams/create-membership.md new file mode 100644 index 0000000000..c72da99abe --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/create-membership.md @@ -0,0 +1,19 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.createMembership({ + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // optional + userId: '<USER_ID>', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/create.md b/docs/examples/1.8.x/client-web/examples/teams/create.md new file mode 100644 index 0000000000..a156156b0c --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/create.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.create({ + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/delete-membership.md b/docs/examples/1.8.x/client-web/examples/teams/delete-membership.md new file mode 100644 index 0000000000..95e5fde3a4 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/delete-membership.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.deleteMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/delete.md b/docs/examples/1.8.x/client-web/examples/teams/delete.md new file mode 100644 index 0000000000..7299f0f791 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/delete.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.delete({ + teamId: '<TEAM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/get-membership.md b/docs/examples/1.8.x/client-web/examples/teams/get-membership.md new file mode 100644 index 0000000000..a6d4186b65 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/get-membership.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/get-prefs.md b/docs/examples/1.8.x/client-web/examples/teams/get-prefs.md new file mode 100644 index 0000000000..98c7605639 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/get-prefs.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getPrefs({ + teamId: '<TEAM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/get.md b/docs/examples/1.8.x/client-web/examples/teams/get.md new file mode 100644 index 0000000000..c910429fd6 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/get.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.get({ + teamId: '<TEAM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/list-memberships.md b/docs/examples/1.8.x/client-web/examples/teams/list-memberships.md new file mode 100644 index 0000000000..d4e342044d --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/list-memberships.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.listMemberships({ + teamId: '<TEAM_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/list.md b/docs/examples/1.8.x/client-web/examples/teams/list.md new file mode 100644 index 0000000000..df57f25dfd --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/list.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/update-membership-status.md b/docs/examples/1.8.x/client-web/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..8fe61083a8 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/update-membership-status.md @@ -0,0 +1,16 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembershipStatus({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/update-membership.md b/docs/examples/1.8.x/client-web/examples/teams/update-membership.md new file mode 100644 index 0000000000..5db27e064d --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/update-membership.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [] +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/update-name.md b/docs/examples/1.8.x/client-web/examples/teams/update-name.md new file mode 100644 index 0000000000..db1ff4c4ca --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/update-name.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateName({ + teamId: '<TEAM_ID>', + name: '<NAME>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/client-web/examples/teams/update-prefs.md b/docs/examples/1.8.x/client-web/examples/teams/update-prefs.md new file mode 100644 index 0000000000..0844353546 --- /dev/null +++ b/docs/examples/1.8.x/client-web/examples/teams/update-prefs.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "appwrite"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updatePrefs({ + teamId: '<TEAM_ID>', + prefs: {} +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/console-cli/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..b6f2432c21 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-anonymous-session.md @@ -0,0 +1 @@ +appwrite account create-anonymous-session diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-email-password-session.md b/docs/examples/1.8.x/console-cli/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..b13874c732 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-email-password-session.md @@ -0,0 +1,3 @@ +appwrite account create-email-password-session \ + --email email@example.com \ + --password password diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-email-token.md b/docs/examples/1.8.x/console-cli/examples/account/create-email-token.md new file mode 100644 index 0000000000..1902e8b24a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-email-token.md @@ -0,0 +1,3 @@ +appwrite account create-email-token \ + --user-id <USER_ID> \ + --email email@example.com diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-jwt.md b/docs/examples/1.8.x/console-cli/examples/account/create-jwt.md new file mode 100644 index 0000000000..f2d656958a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-jwt.md @@ -0,0 +1 @@ +appwrite account create-jwt diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/console-cli/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..4f16a8b289 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-magic-url-token.md @@ -0,0 +1,3 @@ +appwrite account create-magic-url-token \ + --user-id <USER_ID> \ + --email email@example.com diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/console-cli/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..a45427677d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-mfa-authenticator.md @@ -0,0 +1,2 @@ +appwrite account create-mfa-authenticator \ + --type totp diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/console-cli/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..24bab3d672 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-mfa-challenge.md @@ -0,0 +1,2 @@ +appwrite account create-mfa-challenge \ + --factor email diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/console-cli/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..4f165d9080 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1 @@ +appwrite account create-mfa-recovery-codes diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-o-auth-2-session.md b/docs/examples/1.8.x/console-cli/examples/account/create-o-auth-2-session.md new file mode 100644 index 0000000000..fda2faacaa --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-o-auth-2-session.md @@ -0,0 +1,2 @@ +appwrite account create-o-auth-2-session \ + --provider amazon diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/console-cli/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..7fff73f564 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-o-auth-2-token.md @@ -0,0 +1,2 @@ +appwrite account create-o-auth-2-token \ + --provider amazon diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-phone-token.md b/docs/examples/1.8.x/console-cli/examples/account/create-phone-token.md new file mode 100644 index 0000000000..619478c65f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-phone-token.md @@ -0,0 +1,3 @@ +appwrite account create-phone-token \ + --user-id <USER_ID> \ + --phone +12065550100 diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-phone-verification.md b/docs/examples/1.8.x/console-cli/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..b5a95ed987 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-phone-verification.md @@ -0,0 +1 @@ +appwrite account create-phone-verification diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-push-target.md b/docs/examples/1.8.x/console-cli/examples/account/create-push-target.md new file mode 100644 index 0000000000..1ba6fe304e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-push-target.md @@ -0,0 +1,3 @@ +appwrite account create-push-target \ + --target-id <TARGET_ID> \ + --identifier <IDENTIFIER> diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-recovery.md b/docs/examples/1.8.x/console-cli/examples/account/create-recovery.md new file mode 100644 index 0000000000..d6977de8d4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-recovery.md @@ -0,0 +1,3 @@ +appwrite account create-recovery \ + --email email@example.com \ + --url https://example.com diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-session.md b/docs/examples/1.8.x/console-cli/examples/account/create-session.md new file mode 100644 index 0000000000..eefeb3504e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-session.md @@ -0,0 +1,3 @@ +appwrite account create-session \ + --user-id <USER_ID> \ + --secret <SECRET> diff --git a/docs/examples/1.8.x/console-cli/examples/account/create-verification.md b/docs/examples/1.8.x/console-cli/examples/account/create-verification.md new file mode 100644 index 0000000000..6e972f2f7a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create-verification.md @@ -0,0 +1,2 @@ +appwrite account create-verification \ + --url https://example.com diff --git a/docs/examples/1.8.x/console-cli/examples/account/create.md b/docs/examples/1.8.x/console-cli/examples/account/create.md new file mode 100644 index 0000000000..56eca76d49 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/create.md @@ -0,0 +1,4 @@ +appwrite account create \ + --user-id <USER_ID> \ + --email email@example.com \ + --password '' diff --git a/docs/examples/1.8.x/console-cli/examples/account/delete-identity.md b/docs/examples/1.8.x/console-cli/examples/account/delete-identity.md new file mode 100644 index 0000000000..650ab7bf1c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/delete-identity.md @@ -0,0 +1,2 @@ +appwrite account delete-identity \ + --identity-id <IDENTITY_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/console-cli/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..e3689b17a0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,2 @@ +appwrite account delete-mfa-authenticator \ + --type totp diff --git a/docs/examples/1.8.x/console-cli/examples/account/delete-push-target.md b/docs/examples/1.8.x/console-cli/examples/account/delete-push-target.md new file mode 100644 index 0000000000..04f94f64dd --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/delete-push-target.md @@ -0,0 +1,2 @@ +appwrite account delete-push-target \ + --target-id <TARGET_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/account/delete-session.md b/docs/examples/1.8.x/console-cli/examples/account/delete-session.md new file mode 100644 index 0000000000..6476fd9aa5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/delete-session.md @@ -0,0 +1,2 @@ +appwrite account delete-session \ + --session-id <SESSION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/account/delete-sessions.md b/docs/examples/1.8.x/console-cli/examples/account/delete-sessions.md new file mode 100644 index 0000000000..7381069181 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/delete-sessions.md @@ -0,0 +1 @@ +appwrite account delete-sessions diff --git a/docs/examples/1.8.x/console-cli/examples/account/delete.md b/docs/examples/1.8.x/console-cli/examples/account/delete.md new file mode 100644 index 0000000000..dac412f7c2 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/delete.md @@ -0,0 +1 @@ +appwrite account delete diff --git a/docs/examples/1.8.x/console-cli/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/console-cli/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..01a2f35e5c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1 @@ +appwrite account get-mfa-recovery-codes diff --git a/docs/examples/1.8.x/console-cli/examples/account/get-prefs.md b/docs/examples/1.8.x/console-cli/examples/account/get-prefs.md new file mode 100644 index 0000000000..5796c083ed --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/get-prefs.md @@ -0,0 +1 @@ +appwrite account get-prefs diff --git a/docs/examples/1.8.x/console-cli/examples/account/get-session.md b/docs/examples/1.8.x/console-cli/examples/account/get-session.md new file mode 100644 index 0000000000..9901eb244e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/get-session.md @@ -0,0 +1,2 @@ +appwrite account get-session \ + --session-id <SESSION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/account/get.md b/docs/examples/1.8.x/console-cli/examples/account/get.md new file mode 100644 index 0000000000..c8b46e34c7 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/get.md @@ -0,0 +1 @@ +appwrite account get diff --git a/docs/examples/1.8.x/console-cli/examples/account/list-identities.md b/docs/examples/1.8.x/console-cli/examples/account/list-identities.md new file mode 100644 index 0000000000..095dcc479e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/list-identities.md @@ -0,0 +1 @@ +appwrite account list-identities diff --git a/docs/examples/1.8.x/console-cli/examples/account/list-logs.md b/docs/examples/1.8.x/console-cli/examples/account/list-logs.md new file mode 100644 index 0000000000..73fb9b629d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/list-logs.md @@ -0,0 +1 @@ +appwrite account list-logs diff --git a/docs/examples/1.8.x/console-cli/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/console-cli/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..6930f34747 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/list-mfa-factors.md @@ -0,0 +1 @@ +appwrite account list-mfa-factors diff --git a/docs/examples/1.8.x/console-cli/examples/account/list-sessions.md b/docs/examples/1.8.x/console-cli/examples/account/list-sessions.md new file mode 100644 index 0000000000..1aca27baf4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/list-sessions.md @@ -0,0 +1 @@ +appwrite account list-sessions diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-email.md b/docs/examples/1.8.x/console-cli/examples/account/update-email.md new file mode 100644 index 0000000000..9753a064fc --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-email.md @@ -0,0 +1,3 @@ +appwrite account update-email \ + --email email@example.com \ + --password password diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/console-cli/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..0bf9ed7d76 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-magic-url-session.md @@ -0,0 +1,3 @@ +appwrite account update-magic-url-session \ + --user-id <USER_ID> \ + --secret <SECRET> diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/console-cli/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..838297ba43 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-mfa-authenticator.md @@ -0,0 +1,3 @@ +appwrite account update-mfa-authenticator \ + --type totp \ + --otp <OTP> diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/console-cli/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..4a5c8fbf63 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-mfa-challenge.md @@ -0,0 +1,3 @@ +appwrite account update-mfa-challenge \ + --challenge-id <CHALLENGE_ID> \ + --otp <OTP> diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/console-cli/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..9e9ab074bd --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1 @@ +appwrite account update-mfa-recovery-codes diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-mfa.md b/docs/examples/1.8.x/console-cli/examples/account/update-mfa.md new file mode 100644 index 0000000000..fa122d9bde --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-mfa.md @@ -0,0 +1,2 @@ +appwrite account update-mfa \ + --mfa false diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-name.md b/docs/examples/1.8.x/console-cli/examples/account/update-name.md new file mode 100644 index 0000000000..c858d0e378 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-name.md @@ -0,0 +1,2 @@ +appwrite account update-name \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-password.md b/docs/examples/1.8.x/console-cli/examples/account/update-password.md new file mode 100644 index 0000000000..e4bbdfc4e9 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-password.md @@ -0,0 +1,2 @@ +appwrite account update-password \ + --password '' diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-phone-session.md b/docs/examples/1.8.x/console-cli/examples/account/update-phone-session.md new file mode 100644 index 0000000000..599a905367 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-phone-session.md @@ -0,0 +1,3 @@ +appwrite account update-phone-session \ + --user-id <USER_ID> \ + --secret <SECRET> diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-phone-verification.md b/docs/examples/1.8.x/console-cli/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..59dde678eb --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-phone-verification.md @@ -0,0 +1,3 @@ +appwrite account update-phone-verification \ + --user-id <USER_ID> \ + --secret <SECRET> diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-phone.md b/docs/examples/1.8.x/console-cli/examples/account/update-phone.md new file mode 100644 index 0000000000..5c257c8455 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-phone.md @@ -0,0 +1,3 @@ +appwrite account update-phone \ + --phone +12065550100 \ + --password password diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-prefs.md b/docs/examples/1.8.x/console-cli/examples/account/update-prefs.md new file mode 100644 index 0000000000..7b00d7bcfc --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-prefs.md @@ -0,0 +1,2 @@ +appwrite account update-prefs \ + --prefs '{ "key": "value" }' diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-push-target.md b/docs/examples/1.8.x/console-cli/examples/account/update-push-target.md new file mode 100644 index 0000000000..f71232af3e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-push-target.md @@ -0,0 +1,3 @@ +appwrite account update-push-target \ + --target-id <TARGET_ID> \ + --identifier <IDENTIFIER> diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-recovery.md b/docs/examples/1.8.x/console-cli/examples/account/update-recovery.md new file mode 100644 index 0000000000..c2a97bda55 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-recovery.md @@ -0,0 +1,4 @@ +appwrite account update-recovery \ + --user-id <USER_ID> \ + --secret <SECRET> \ + --password '' diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-session.md b/docs/examples/1.8.x/console-cli/examples/account/update-session.md new file mode 100644 index 0000000000..36833c4674 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-session.md @@ -0,0 +1,2 @@ +appwrite account update-session \ + --session-id <SESSION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-status.md b/docs/examples/1.8.x/console-cli/examples/account/update-status.md new file mode 100644 index 0000000000..d27174920b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-status.md @@ -0,0 +1 @@ +appwrite account update-status diff --git a/docs/examples/1.8.x/console-cli/examples/account/update-verification.md b/docs/examples/1.8.x/console-cli/examples/account/update-verification.md new file mode 100644 index 0000000000..d7276c6325 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/account/update-verification.md @@ -0,0 +1,3 @@ +appwrite account update-verification \ + --user-id <USER_ID> \ + --secret <SECRET> diff --git a/docs/examples/1.8.x/console-cli/examples/avatars/get-browser.md b/docs/examples/1.8.x/console-cli/examples/avatars/get-browser.md new file mode 100644 index 0000000000..b9dce0b974 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/avatars/get-browser.md @@ -0,0 +1,2 @@ +appwrite avatars get-browser \ + --code aa diff --git a/docs/examples/1.8.x/console-cli/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/console-cli/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..0a8317a9fb --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/avatars/get-credit-card.md @@ -0,0 +1,2 @@ +appwrite avatars get-credit-card \ + --code amex diff --git a/docs/examples/1.8.x/console-cli/examples/avatars/get-favicon.md b/docs/examples/1.8.x/console-cli/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..c2f4c806ae --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/avatars/get-favicon.md @@ -0,0 +1,2 @@ +appwrite avatars get-favicon \ + --url https://example.com diff --git a/docs/examples/1.8.x/console-cli/examples/avatars/get-flag.md b/docs/examples/1.8.x/console-cli/examples/avatars/get-flag.md new file mode 100644 index 0000000000..15a3daf85e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/avatars/get-flag.md @@ -0,0 +1,2 @@ +appwrite avatars get-flag \ + --code af diff --git a/docs/examples/1.8.x/console-cli/examples/avatars/get-image.md b/docs/examples/1.8.x/console-cli/examples/avatars/get-image.md new file mode 100644 index 0000000000..942574acea --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/avatars/get-image.md @@ -0,0 +1,2 @@ +appwrite avatars get-image \ + --url https://example.com diff --git a/docs/examples/1.8.x/console-cli/examples/avatars/get-initials.md b/docs/examples/1.8.x/console-cli/examples/avatars/get-initials.md new file mode 100644 index 0000000000..f9d5110590 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/avatars/get-initials.md @@ -0,0 +1 @@ +appwrite avatars get-initials diff --git a/docs/examples/1.8.x/console-cli/examples/avatars/get-qr.md b/docs/examples/1.8.x/console-cli/examples/avatars/get-qr.md new file mode 100644 index 0000000000..75fb094a08 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/avatars/get-qr.md @@ -0,0 +1,2 @@ +appwrite avatars get-qr \ + --text <TEXT> diff --git a/docs/examples/1.8.x/console-cli/examples/console/get-resource.md b/docs/examples/1.8.x/console-cli/examples/console/get-resource.md new file mode 100644 index 0000000000..5251dd6ac6 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/console/get-resource.md @@ -0,0 +1,3 @@ +appwrite console get-resource \ + --value <VALUE> \ + --type rules diff --git a/docs/examples/1.8.x/console-cli/examples/console/variables.md b/docs/examples/1.8.x/console-cli/examples/console/variables.md new file mode 100644 index 0000000000..1c67cf5ad8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/console/variables.md @@ -0,0 +1 @@ +appwrite console variables diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..ce4d65fa15 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-boolean-attribute.md @@ -0,0 +1,5 @@ +appwrite databases create-boolean-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-collection.md b/docs/examples/1.8.x/console-cli/examples/databases/create-collection.md new file mode 100644 index 0000000000..89a754ce24 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-collection.md @@ -0,0 +1,4 @@ +appwrite databases create-collection \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..b445d0841a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-datetime-attribute.md @@ -0,0 +1,5 @@ +appwrite databases create-datetime-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-document.md b/docs/examples/1.8.x/console-cli/examples/databases/create-document.md new file mode 100644 index 0000000000..a45335ad4e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-document.md @@ -0,0 +1,5 @@ +appwrite databases create-document \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --document-id <DOCUMENT_ID> \ + --data '{ "key": "value" }' diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-documents.md b/docs/examples/1.8.x/console-cli/examples/databases/create-documents.md new file mode 100644 index 0000000000..3512b684a7 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-documents.md @@ -0,0 +1,4 @@ +appwrite databases create-documents \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --documents one two three diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..e4e9a0ba18 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-email-attribute.md @@ -0,0 +1,5 @@ +appwrite databases create-email-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..2d4c72be0f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-enum-attribute.md @@ -0,0 +1,6 @@ +appwrite databases create-enum-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --elements one two three \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..0b9988b3a4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-float-attribute.md @@ -0,0 +1,5 @@ +appwrite databases create-float-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-index.md b/docs/examples/1.8.x/console-cli/examples/databases/create-index.md new file mode 100644 index 0000000000..cd8fc1dc4f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-index.md @@ -0,0 +1,6 @@ +appwrite databases create-index \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --type key \ + --attributes one two three diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..4c2207e891 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-integer-attribute.md @@ -0,0 +1,5 @@ +appwrite databases create-integer-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..a1cd44e80c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-ip-attribute.md @@ -0,0 +1,5 @@ +appwrite databases create-ip-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..f0d81ede67 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-line-attribute.md @@ -0,0 +1,5 @@ +appwrite databases create-line-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..926c7318e0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-point-attribute.md @@ -0,0 +1,5 @@ +appwrite databases create-point-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..f0a00c744f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-polygon-attribute.md @@ -0,0 +1,5 @@ +appwrite databases create-polygon-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..700316239c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-relationship-attribute.md @@ -0,0 +1,5 @@ +appwrite databases create-relationship-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --related-collection-id <RELATED_COLLECTION_ID> \ + --type oneToOne diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..ed464c59dc --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-string-attribute.md @@ -0,0 +1,6 @@ +appwrite databases create-string-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --size 1 \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..6968e8c621 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create-url-attribute.md @@ -0,0 +1,5 @@ +appwrite databases create-url-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/create.md b/docs/examples/1.8.x/console-cli/examples/databases/create.md new file mode 100644 index 0000000000..47b0438352 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/create.md @@ -0,0 +1,3 @@ +appwrite databases create \ + --database-id <DATABASE_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..0b9b8a6b75 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/decrement-document-attribute.md @@ -0,0 +1,5 @@ +appwrite databases decrement-document-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --document-id <DOCUMENT_ID> \ + --attribute '' diff --git a/docs/examples/1.8.x/console-cli/examples/databases/delete-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..0d68358642 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/delete-attribute.md @@ -0,0 +1,4 @@ +appwrite databases delete-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' diff --git a/docs/examples/1.8.x/console-cli/examples/databases/delete-collection.md b/docs/examples/1.8.x/console-cli/examples/databases/delete-collection.md new file mode 100644 index 0000000000..d120865c8d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/delete-collection.md @@ -0,0 +1,3 @@ +appwrite databases delete-collection \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/delete-document.md b/docs/examples/1.8.x/console-cli/examples/databases/delete-document.md new file mode 100644 index 0000000000..8e900198e7 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/delete-document.md @@ -0,0 +1,4 @@ +appwrite databases delete-document \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --document-id <DOCUMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/delete-documents.md b/docs/examples/1.8.x/console-cli/examples/databases/delete-documents.md new file mode 100644 index 0000000000..b334ed7212 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/delete-documents.md @@ -0,0 +1,3 @@ +appwrite databases delete-documents \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/delete-index.md b/docs/examples/1.8.x/console-cli/examples/databases/delete-index.md new file mode 100644 index 0000000000..2de11d36f3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/delete-index.md @@ -0,0 +1,4 @@ +appwrite databases delete-index \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' diff --git a/docs/examples/1.8.x/console-cli/examples/databases/delete.md b/docs/examples/1.8.x/console-cli/examples/databases/delete.md new file mode 100644 index 0000000000..474377798c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/delete.md @@ -0,0 +1,2 @@ +appwrite databases delete \ + --database-id <DATABASE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/get-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/get-attribute.md new file mode 100644 index 0000000000..70cee2c6ad --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/get-attribute.md @@ -0,0 +1,4 @@ +appwrite databases get-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' diff --git a/docs/examples/1.8.x/console-cli/examples/databases/get-collection-usage.md b/docs/examples/1.8.x/console-cli/examples/databases/get-collection-usage.md new file mode 100644 index 0000000000..c9881e2738 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/get-collection-usage.md @@ -0,0 +1,3 @@ +appwrite databases get-collection-usage \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/get-collection.md b/docs/examples/1.8.x/console-cli/examples/databases/get-collection.md new file mode 100644 index 0000000000..17cbdbef1f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/get-collection.md @@ -0,0 +1,3 @@ +appwrite databases get-collection \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/get-document.md b/docs/examples/1.8.x/console-cli/examples/databases/get-document.md new file mode 100644 index 0000000000..beb44c14c1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/get-document.md @@ -0,0 +1,4 @@ +appwrite databases get-document \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --document-id <DOCUMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/get-index.md b/docs/examples/1.8.x/console-cli/examples/databases/get-index.md new file mode 100644 index 0000000000..50b5961af4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/get-index.md @@ -0,0 +1,4 @@ +appwrite databases get-index \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' diff --git a/docs/examples/1.8.x/console-cli/examples/databases/get-usage.md b/docs/examples/1.8.x/console-cli/examples/databases/get-usage.md new file mode 100644 index 0000000000..e3c8748121 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/get-usage.md @@ -0,0 +1,2 @@ +appwrite databases get-usage \ + --database-id <DATABASE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/get.md b/docs/examples/1.8.x/console-cli/examples/databases/get.md new file mode 100644 index 0000000000..83cec7dcbc --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/get.md @@ -0,0 +1,2 @@ +appwrite databases get \ + --database-id <DATABASE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..d51e44db23 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/increment-document-attribute.md @@ -0,0 +1,5 @@ +appwrite databases increment-document-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --document-id <DOCUMENT_ID> \ + --attribute '' diff --git a/docs/examples/1.8.x/console-cli/examples/databases/list-attributes.md b/docs/examples/1.8.x/console-cli/examples/databases/list-attributes.md new file mode 100644 index 0000000000..c531111eb6 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/list-attributes.md @@ -0,0 +1,3 @@ +appwrite databases list-attributes \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/list-collection-logs.md b/docs/examples/1.8.x/console-cli/examples/databases/list-collection-logs.md new file mode 100644 index 0000000000..27f3a9bc5e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/list-collection-logs.md @@ -0,0 +1,3 @@ +appwrite databases list-collection-logs \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/list-collections.md b/docs/examples/1.8.x/console-cli/examples/databases/list-collections.md new file mode 100644 index 0000000000..55576eb401 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/list-collections.md @@ -0,0 +1,2 @@ +appwrite databases list-collections \ + --database-id <DATABASE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/list-document-logs.md b/docs/examples/1.8.x/console-cli/examples/databases/list-document-logs.md new file mode 100644 index 0000000000..9f8fb22eb8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/list-document-logs.md @@ -0,0 +1,4 @@ +appwrite databases list-document-logs \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --document-id <DOCUMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/list-documents.md b/docs/examples/1.8.x/console-cli/examples/databases/list-documents.md new file mode 100644 index 0000000000..69e921c012 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/list-documents.md @@ -0,0 +1,3 @@ +appwrite databases list-documents \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/list-indexes.md b/docs/examples/1.8.x/console-cli/examples/databases/list-indexes.md new file mode 100644 index 0000000000..f12c1e9354 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/list-indexes.md @@ -0,0 +1,3 @@ +appwrite databases list-indexes \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/list-logs.md b/docs/examples/1.8.x/console-cli/examples/databases/list-logs.md new file mode 100644 index 0000000000..293df55327 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/list-logs.md @@ -0,0 +1,2 @@ +appwrite databases list-logs \ + --database-id <DATABASE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/list-usage.md b/docs/examples/1.8.x/console-cli/examples/databases/list-usage.md new file mode 100644 index 0000000000..6bff75fa89 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/list-usage.md @@ -0,0 +1 @@ +appwrite databases list-usage diff --git a/docs/examples/1.8.x/console-cli/examples/databases/list.md b/docs/examples/1.8.x/console-cli/examples/databases/list.md new file mode 100644 index 0000000000..6681edc994 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/list.md @@ -0,0 +1 @@ +appwrite databases list diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..578a5dc526 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-boolean-attribute.md @@ -0,0 +1,6 @@ +appwrite databases update-boolean-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false \ + --default false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-collection.md b/docs/examples/1.8.x/console-cli/examples/databases/update-collection.md new file mode 100644 index 0000000000..0bad4850e4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-collection.md @@ -0,0 +1,4 @@ +appwrite databases update-collection \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..53459e0218 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-datetime-attribute.md @@ -0,0 +1,6 @@ +appwrite databases update-datetime-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false \ + --default '' diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-document.md b/docs/examples/1.8.x/console-cli/examples/databases/update-document.md new file mode 100644 index 0000000000..29f14612a4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-document.md @@ -0,0 +1,4 @@ +appwrite databases update-document \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --document-id <DOCUMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-documents.md b/docs/examples/1.8.x/console-cli/examples/databases/update-documents.md new file mode 100644 index 0000000000..f4f85eb79d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-documents.md @@ -0,0 +1,3 @@ +appwrite databases update-documents \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..20ea219202 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-email-attribute.md @@ -0,0 +1,6 @@ +appwrite databases update-email-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false \ + --default email@example.com diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..dfae8d27f3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-enum-attribute.md @@ -0,0 +1,7 @@ +appwrite databases update-enum-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --elements one two three \ + --required false \ + --default <DEFAULT> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..caeaa96f31 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-float-attribute.md @@ -0,0 +1,6 @@ +appwrite databases update-float-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false \ + --default null diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..2ab6e12104 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-integer-attribute.md @@ -0,0 +1,6 @@ +appwrite databases update-integer-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false \ + --default null diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..44b4010570 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-ip-attribute.md @@ -0,0 +1,6 @@ +appwrite databases update-ip-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false \ + --default '' diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..37059ecef1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-line-attribute.md @@ -0,0 +1,5 @@ +appwrite databases update-line-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..bcc983a432 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-point-attribute.md @@ -0,0 +1,5 @@ +appwrite databases update-point-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..6e1e1001da --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-polygon-attribute.md @@ -0,0 +1,5 @@ +appwrite databases update-polygon-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..d3f27d78e2 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-relationship-attribute.md @@ -0,0 +1,4 @@ +appwrite databases update-relationship-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..0e0dd714bd --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-string-attribute.md @@ -0,0 +1,6 @@ +appwrite databases update-string-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false \ + --default <DEFAULT> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/console-cli/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..76e6feb15b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update-url-attribute.md @@ -0,0 +1,6 @@ +appwrite databases update-url-attribute \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --key '' \ + --required false \ + --default https://example.com diff --git a/docs/examples/1.8.x/console-cli/examples/databases/update.md b/docs/examples/1.8.x/console-cli/examples/databases/update.md new file mode 100644 index 0000000000..e3e1de755c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/update.md @@ -0,0 +1,3 @@ +appwrite databases update \ + --database-id <DATABASE_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/databases/upsert-document.md b/docs/examples/1.8.x/console-cli/examples/databases/upsert-document.md new file mode 100644 index 0000000000..558ffeb5c4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/upsert-document.md @@ -0,0 +1,5 @@ +appwrite databases upsert-document \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --document-id <DOCUMENT_ID> \ + --data '{ "key": "value" }' diff --git a/docs/examples/1.8.x/console-cli/examples/databases/upsert-documents.md b/docs/examples/1.8.x/console-cli/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..e58c202da0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/databases/upsert-documents.md @@ -0,0 +1,4 @@ +appwrite databases upsert-documents \ + --database-id <DATABASE_ID> \ + --collection-id <COLLECTION_ID> \ + --documents one two three diff --git a/docs/examples/1.8.x/console-cli/examples/functions/create-deployment.md b/docs/examples/1.8.x/console-cli/examples/functions/create-deployment.md new file mode 100644 index 0000000000..465951c3ce --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/create-deployment.md @@ -0,0 +1,4 @@ +appwrite functions create-deployment \ + --function-id <FUNCTION_ID> \ + --code 'path/to/file.png' \ + --activate false diff --git a/docs/examples/1.8.x/console-cli/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/console-cli/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..7d5c28bcd6 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,3 @@ +appwrite functions create-duplicate-deployment \ + --function-id <FUNCTION_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/create-execution.md b/docs/examples/1.8.x/console-cli/examples/functions/create-execution.md new file mode 100644 index 0000000000..fd3b3dd62a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/create-execution.md @@ -0,0 +1,2 @@ +appwrite functions create-execution \ + --function-id <FUNCTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/console-cli/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..f3c8487cf7 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/create-template-deployment.md @@ -0,0 +1,6 @@ +appwrite functions create-template-deployment \ + --function-id <FUNCTION_ID> \ + --repository <REPOSITORY> \ + --owner <OWNER> \ + --root-directory <ROOT_DIRECTORY> \ + --version <VERSION> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/create-variable.md b/docs/examples/1.8.x/console-cli/examples/functions/create-variable.md new file mode 100644 index 0000000000..50edcaaa72 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/create-variable.md @@ -0,0 +1,4 @@ +appwrite functions create-variable \ + --function-id <FUNCTION_ID> \ + --key <KEY> \ + --value <VALUE> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/console-cli/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..8e846222c8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/create-vcs-deployment.md @@ -0,0 +1,4 @@ +appwrite functions create-vcs-deployment \ + --function-id <FUNCTION_ID> \ + --type branch \ + --reference <REFERENCE> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/create.md b/docs/examples/1.8.x/console-cli/examples/functions/create.md new file mode 100644 index 0000000000..bdca30d803 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/create.md @@ -0,0 +1,4 @@ +appwrite functions create \ + --function-id <FUNCTION_ID> \ + --name <NAME> \ + --runtime node-14.5 diff --git a/docs/examples/1.8.x/console-cli/examples/functions/delete-deployment.md b/docs/examples/1.8.x/console-cli/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..4f50b92780 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/delete-deployment.md @@ -0,0 +1,3 @@ +appwrite functions delete-deployment \ + --function-id <FUNCTION_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/delete-execution.md b/docs/examples/1.8.x/console-cli/examples/functions/delete-execution.md new file mode 100644 index 0000000000..a11c4cb7ed --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/delete-execution.md @@ -0,0 +1,3 @@ +appwrite functions delete-execution \ + --function-id <FUNCTION_ID> \ + --execution-id <EXECUTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/delete-variable.md b/docs/examples/1.8.x/console-cli/examples/functions/delete-variable.md new file mode 100644 index 0000000000..aebe85704f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/delete-variable.md @@ -0,0 +1,3 @@ +appwrite functions delete-variable \ + --function-id <FUNCTION_ID> \ + --variable-id <VARIABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/delete.md b/docs/examples/1.8.x/console-cli/examples/functions/delete.md new file mode 100644 index 0000000000..abf27334fc --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/delete.md @@ -0,0 +1,2 @@ +appwrite functions delete \ + --function-id <FUNCTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/console-cli/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..b9bfcabf65 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/get-deployment-download.md @@ -0,0 +1,3 @@ +appwrite functions get-deployment-download \ + --function-id <FUNCTION_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/get-deployment.md b/docs/examples/1.8.x/console-cli/examples/functions/get-deployment.md new file mode 100644 index 0000000000..4a658074fd --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/get-deployment.md @@ -0,0 +1,3 @@ +appwrite functions get-deployment \ + --function-id <FUNCTION_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/get-execution.md b/docs/examples/1.8.x/console-cli/examples/functions/get-execution.md new file mode 100644 index 0000000000..ac2ad14278 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/get-execution.md @@ -0,0 +1,3 @@ +appwrite functions get-execution \ + --function-id <FUNCTION_ID> \ + --execution-id <EXECUTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/get-template.md b/docs/examples/1.8.x/console-cli/examples/functions/get-template.md new file mode 100644 index 0000000000..2ab2afbcf4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/get-template.md @@ -0,0 +1,2 @@ +appwrite functions get-template \ + --template-id <TEMPLATE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/get-usage.md b/docs/examples/1.8.x/console-cli/examples/functions/get-usage.md new file mode 100644 index 0000000000..a3f061d1f5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/get-usage.md @@ -0,0 +1,2 @@ +appwrite functions get-usage \ + --function-id <FUNCTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/get-variable.md b/docs/examples/1.8.x/console-cli/examples/functions/get-variable.md new file mode 100644 index 0000000000..06a3a496a3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/get-variable.md @@ -0,0 +1,3 @@ +appwrite functions get-variable \ + --function-id <FUNCTION_ID> \ + --variable-id <VARIABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/get.md b/docs/examples/1.8.x/console-cli/examples/functions/get.md new file mode 100644 index 0000000000..fafa87ec39 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/get.md @@ -0,0 +1,2 @@ +appwrite functions get \ + --function-id <FUNCTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/list-deployments.md b/docs/examples/1.8.x/console-cli/examples/functions/list-deployments.md new file mode 100644 index 0000000000..5bb2c60192 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/list-deployments.md @@ -0,0 +1,2 @@ +appwrite functions list-deployments \ + --function-id <FUNCTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/list-executions.md b/docs/examples/1.8.x/console-cli/examples/functions/list-executions.md new file mode 100644 index 0000000000..a008947741 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/list-executions.md @@ -0,0 +1,2 @@ +appwrite functions list-executions \ + --function-id <FUNCTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/list-runtimes.md b/docs/examples/1.8.x/console-cli/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..a0430d6cc3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/list-runtimes.md @@ -0,0 +1 @@ +appwrite functions list-runtimes diff --git a/docs/examples/1.8.x/console-cli/examples/functions/list-specifications.md b/docs/examples/1.8.x/console-cli/examples/functions/list-specifications.md new file mode 100644 index 0000000000..4fac74ec31 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/list-specifications.md @@ -0,0 +1 @@ +appwrite functions list-specifications diff --git a/docs/examples/1.8.x/console-cli/examples/functions/list-templates.md b/docs/examples/1.8.x/console-cli/examples/functions/list-templates.md new file mode 100644 index 0000000000..22209fe198 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/list-templates.md @@ -0,0 +1 @@ +appwrite functions list-templates diff --git a/docs/examples/1.8.x/console-cli/examples/functions/list-usage.md b/docs/examples/1.8.x/console-cli/examples/functions/list-usage.md new file mode 100644 index 0000000000..de28c5c9d0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/list-usage.md @@ -0,0 +1 @@ +appwrite functions list-usage diff --git a/docs/examples/1.8.x/console-cli/examples/functions/list-variables.md b/docs/examples/1.8.x/console-cli/examples/functions/list-variables.md new file mode 100644 index 0000000000..03e1162551 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/list-variables.md @@ -0,0 +1,2 @@ +appwrite functions list-variables \ + --function-id <FUNCTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/list.md b/docs/examples/1.8.x/console-cli/examples/functions/list.md new file mode 100644 index 0000000000..2d9f0ba7ff --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/list.md @@ -0,0 +1 @@ +appwrite functions list diff --git a/docs/examples/1.8.x/console-cli/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/console-cli/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..6f0bc1e550 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/update-deployment-status.md @@ -0,0 +1,3 @@ +appwrite functions update-deployment-status \ + --function-id <FUNCTION_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/console-cli/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..d3534b4e9b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/update-function-deployment.md @@ -0,0 +1,3 @@ +appwrite functions update-function-deployment \ + --function-id <FUNCTION_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/update-variable.md b/docs/examples/1.8.x/console-cli/examples/functions/update-variable.md new file mode 100644 index 0000000000..c1d87f29fb --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/update-variable.md @@ -0,0 +1,4 @@ +appwrite functions update-variable \ + --function-id <FUNCTION_ID> \ + --variable-id <VARIABLE_ID> \ + --key <KEY> diff --git a/docs/examples/1.8.x/console-cli/examples/functions/update.md b/docs/examples/1.8.x/console-cli/examples/functions/update.md new file mode 100644 index 0000000000..c436ef054c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/functions/update.md @@ -0,0 +1,3 @@ +appwrite functions update \ + --function-id <FUNCTION_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/graphql/mutation.md b/docs/examples/1.8.x/console-cli/examples/graphql/mutation.md new file mode 100644 index 0000000000..678fcc2e40 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/graphql/mutation.md @@ -0,0 +1,2 @@ +appwrite graphql mutation \ + --query '{ "key": "value" }' diff --git a/docs/examples/1.8.x/console-cli/examples/graphql/query.md b/docs/examples/1.8.x/console-cli/examples/graphql/query.md new file mode 100644 index 0000000000..157115a1fc --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/graphql/query.md @@ -0,0 +1,2 @@ +appwrite graphql query \ + --query '{ "key": "value" }' diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-antivirus.md b/docs/examples/1.8.x/console-cli/examples/health/get-antivirus.md new file mode 100644 index 0000000000..2ef8b6f3d7 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-antivirus.md @@ -0,0 +1 @@ +appwrite health get-antivirus diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-cache.md b/docs/examples/1.8.x/console-cli/examples/health/get-cache.md new file mode 100644 index 0000000000..b1ff13104e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-cache.md @@ -0,0 +1 @@ +appwrite health get-cache diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-certificate.md b/docs/examples/1.8.x/console-cli/examples/health/get-certificate.md new file mode 100644 index 0000000000..1765216107 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-certificate.md @@ -0,0 +1 @@ +appwrite health get-certificate diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-db.md b/docs/examples/1.8.x/console-cli/examples/health/get-db.md new file mode 100644 index 0000000000..c5e9cb378e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-db.md @@ -0,0 +1 @@ +appwrite health get-db diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/console-cli/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..9704875bb5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-failed-jobs.md @@ -0,0 +1,2 @@ +appwrite health get-failed-jobs \ + --name v1-database diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-pub-sub.md b/docs/examples/1.8.x/console-cli/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..29e93a2b14 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-pub-sub.md @@ -0,0 +1 @@ +appwrite health get-pub-sub diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-builds.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..657b98880c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-builds.md @@ -0,0 +1 @@ +appwrite health get-queue-builds diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..a7c1c64a9f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-certificates.md @@ -0,0 +1 @@ +appwrite health get-queue-certificates diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-databases.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..17d15badfd --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-databases.md @@ -0,0 +1 @@ +appwrite health get-queue-databases diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..78ddc3223d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-deletes.md @@ -0,0 +1 @@ +appwrite health get-queue-deletes diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-functions.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..8109a8e8a2 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-functions.md @@ -0,0 +1 @@ +appwrite health get-queue-functions diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-logs.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..5ff48cc8ed --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-logs.md @@ -0,0 +1 @@ +appwrite health get-queue-logs diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-mails.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..e44b1b629f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-mails.md @@ -0,0 +1 @@ +appwrite health get-queue-mails diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..5249c73550 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-messaging.md @@ -0,0 +1 @@ +appwrite health get-queue-messaging diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..11b07a101b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-migrations.md @@ -0,0 +1 @@ +appwrite health get-queue-migrations diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..2e511862ca --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-stats-resources.md @@ -0,0 +1 @@ +appwrite health get-queue-stats-resources diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-usage.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..1790e0fb1d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-usage.md @@ -0,0 +1 @@ +appwrite health get-queue-usage diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/console-cli/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..e1753347b1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-queue-webhooks.md @@ -0,0 +1 @@ +appwrite health get-queue-webhooks diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-storage-local.md b/docs/examples/1.8.x/console-cli/examples/health/get-storage-local.md new file mode 100644 index 0000000000..512d135f0e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-storage-local.md @@ -0,0 +1 @@ +appwrite health get-storage-local diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-storage.md b/docs/examples/1.8.x/console-cli/examples/health/get-storage.md new file mode 100644 index 0000000000..170bcfc43d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-storage.md @@ -0,0 +1 @@ +appwrite health get-storage diff --git a/docs/examples/1.8.x/console-cli/examples/health/get-time.md b/docs/examples/1.8.x/console-cli/examples/health/get-time.md new file mode 100644 index 0000000000..feb3901ef5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get-time.md @@ -0,0 +1 @@ +appwrite health get-time diff --git a/docs/examples/1.8.x/console-cli/examples/health/get.md b/docs/examples/1.8.x/console-cli/examples/health/get.md new file mode 100644 index 0000000000..94c08e5aa3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/health/get.md @@ -0,0 +1 @@ +appwrite health get diff --git a/docs/examples/1.8.x/console-cli/examples/locale/get.md b/docs/examples/1.8.x/console-cli/examples/locale/get.md new file mode 100644 index 0000000000..2002a06c20 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/locale/get.md @@ -0,0 +1 @@ +appwrite locale get diff --git a/docs/examples/1.8.x/console-cli/examples/locale/list-codes.md b/docs/examples/1.8.x/console-cli/examples/locale/list-codes.md new file mode 100644 index 0000000000..ac96ac14af --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/locale/list-codes.md @@ -0,0 +1 @@ +appwrite locale list-codes diff --git a/docs/examples/1.8.x/console-cli/examples/locale/list-continents.md b/docs/examples/1.8.x/console-cli/examples/locale/list-continents.md new file mode 100644 index 0000000000..18267872c0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/locale/list-continents.md @@ -0,0 +1 @@ +appwrite locale list-continents diff --git a/docs/examples/1.8.x/console-cli/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/console-cli/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..eba8886a54 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/locale/list-countries-eu.md @@ -0,0 +1 @@ +appwrite locale list-countries-eu diff --git a/docs/examples/1.8.x/console-cli/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/console-cli/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..ea27155238 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/locale/list-countries-phones.md @@ -0,0 +1 @@ +appwrite locale list-countries-phones diff --git a/docs/examples/1.8.x/console-cli/examples/locale/list-countries.md b/docs/examples/1.8.x/console-cli/examples/locale/list-countries.md new file mode 100644 index 0000000000..652446136b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/locale/list-countries.md @@ -0,0 +1 @@ +appwrite locale list-countries diff --git a/docs/examples/1.8.x/console-cli/examples/locale/list-currencies.md b/docs/examples/1.8.x/console-cli/examples/locale/list-currencies.md new file mode 100644 index 0000000000..bbc0f363fe --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/locale/list-currencies.md @@ -0,0 +1 @@ +appwrite locale list-currencies diff --git a/docs/examples/1.8.x/console-cli/examples/locale/list-languages.md b/docs/examples/1.8.x/console-cli/examples/locale/list-languages.md new file mode 100644 index 0000000000..a0cfe918af --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/locale/list-languages.md @@ -0,0 +1 @@ +appwrite locale list-languages diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..fd5aaa9927 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-apns-provider.md @@ -0,0 +1,3 @@ +appwrite messaging create-apns-provider \ + --provider-id <PROVIDER_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-email.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-email.md new file mode 100644 index 0000000000..e8ffc11633 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-email.md @@ -0,0 +1,4 @@ +appwrite messaging create-email \ + --message-id <MESSAGE_ID> \ + --subject <SUBJECT> \ + --content <CONTENT> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..487bb03981 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-fcm-provider.md @@ -0,0 +1,3 @@ +appwrite messaging create-fcm-provider \ + --provider-id <PROVIDER_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..2616f0074c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,3 @@ +appwrite messaging create-mailgun-provider \ + --provider-id <PROVIDER_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..d4f975d3c8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,3 @@ +appwrite messaging create-msg-91-provider \ + --provider-id <PROVIDER_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-push.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-push.md new file mode 100644 index 0000000000..d5740b9394 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-push.md @@ -0,0 +1,2 @@ +appwrite messaging create-push \ + --message-id <MESSAGE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..2a478fdb29 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,3 @@ +appwrite messaging create-sendgrid-provider \ + --provider-id <PROVIDER_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-sms.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-sms.md new file mode 100644 index 0000000000..3633d06570 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-sms.md @@ -0,0 +1,3 @@ +appwrite messaging create-sms \ + --message-id <MESSAGE_ID> \ + --content <CONTENT> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..9a4178352d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-smtp-provider.md @@ -0,0 +1,4 @@ +appwrite messaging create-smtp-provider \ + --provider-id <PROVIDER_ID> \ + --name <NAME> \ + --host <HOST> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..5fe7682f73 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-subscriber.md @@ -0,0 +1,4 @@ +appwrite messaging create-subscriber \ + --topic-id <TOPIC_ID> \ + --subscriber-id <SUBSCRIBER_ID> \ + --target-id <TARGET_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..052028d6c5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-telesign-provider.md @@ -0,0 +1,3 @@ +appwrite messaging create-telesign-provider \ + --provider-id <PROVIDER_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..6ff37b016d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,3 @@ +appwrite messaging create-textmagic-provider \ + --provider-id <PROVIDER_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-topic.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-topic.md new file mode 100644 index 0000000000..3a28bb163d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-topic.md @@ -0,0 +1,3 @@ +appwrite messaging create-topic \ + --topic-id <TOPIC_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..2b2f00dc44 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-twilio-provider.md @@ -0,0 +1,3 @@ +appwrite messaging create-twilio-provider \ + --provider-id <PROVIDER_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..56fb3e679f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/create-vonage-provider.md @@ -0,0 +1,3 @@ +appwrite messaging create-vonage-provider \ + --provider-id <PROVIDER_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/delete-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..75671a99e4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/delete-provider.md @@ -0,0 +1,2 @@ +appwrite messaging delete-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/console-cli/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..d433e3a599 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/delete-subscriber.md @@ -0,0 +1,3 @@ +appwrite messaging delete-subscriber \ + --topic-id <TOPIC_ID> \ + --subscriber-id <SUBSCRIBER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/delete-topic.md b/docs/examples/1.8.x/console-cli/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..0c2887c076 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/delete-topic.md @@ -0,0 +1,2 @@ +appwrite messaging delete-topic \ + --topic-id <TOPIC_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/delete.md b/docs/examples/1.8.x/console-cli/examples/messaging/delete.md new file mode 100644 index 0000000000..eb5d2a62f1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/delete.md @@ -0,0 +1,2 @@ +appwrite messaging delete \ + --message-id <MESSAGE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/get-message.md b/docs/examples/1.8.x/console-cli/examples/messaging/get-message.md new file mode 100644 index 0000000000..2de245efd1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/get-message.md @@ -0,0 +1,2 @@ +appwrite messaging get-message \ + --message-id <MESSAGE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/get-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/get-provider.md new file mode 100644 index 0000000000..b115c52c2a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/get-provider.md @@ -0,0 +1,2 @@ +appwrite messaging get-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/console-cli/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..88c2ab60e2 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/get-subscriber.md @@ -0,0 +1,3 @@ +appwrite messaging get-subscriber \ + --topic-id <TOPIC_ID> \ + --subscriber-id <SUBSCRIBER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/get-topic.md b/docs/examples/1.8.x/console-cli/examples/messaging/get-topic.md new file mode 100644 index 0000000000..7628bedf00 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/get-topic.md @@ -0,0 +1,2 @@ +appwrite messaging get-topic \ + --topic-id <TOPIC_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/console-cli/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..9cc6dc559d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/list-message-logs.md @@ -0,0 +1,2 @@ +appwrite messaging list-message-logs \ + --message-id <MESSAGE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/list-messages.md b/docs/examples/1.8.x/console-cli/examples/messaging/list-messages.md new file mode 100644 index 0000000000..1e8a726f9a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/list-messages.md @@ -0,0 +1 @@ +appwrite messaging list-messages diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/console-cli/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..95e514ec8a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/list-provider-logs.md @@ -0,0 +1,2 @@ +appwrite messaging list-provider-logs \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/list-providers.md b/docs/examples/1.8.x/console-cli/examples/messaging/list-providers.md new file mode 100644 index 0000000000..d075be571c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/list-providers.md @@ -0,0 +1 @@ +appwrite messaging list-providers diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/console-cli/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..4858c6c7d9 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,2 @@ +appwrite messaging list-subscriber-logs \ + --subscriber-id <SUBSCRIBER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/console-cli/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..c122c6845c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/list-subscribers.md @@ -0,0 +1,2 @@ +appwrite messaging list-subscribers \ + --topic-id <TOPIC_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/list-targets.md b/docs/examples/1.8.x/console-cli/examples/messaging/list-targets.md new file mode 100644 index 0000000000..e161e9338a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/list-targets.md @@ -0,0 +1,2 @@ +appwrite messaging list-targets \ + --message-id <MESSAGE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/console-cli/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..121f2795c1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/list-topic-logs.md @@ -0,0 +1,2 @@ +appwrite messaging list-topic-logs \ + --topic-id <TOPIC_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/list-topics.md b/docs/examples/1.8.x/console-cli/examples/messaging/list-topics.md new file mode 100644 index 0000000000..0337b3d197 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/list-topics.md @@ -0,0 +1 @@ +appwrite messaging list-topics diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..7bd5db2624 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-apns-provider.md @@ -0,0 +1,2 @@ +appwrite messaging update-apns-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-email.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-email.md new file mode 100644 index 0000000000..7e318ad492 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-email.md @@ -0,0 +1,2 @@ +appwrite messaging update-email \ + --message-id <MESSAGE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..4d41680639 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-fcm-provider.md @@ -0,0 +1,2 @@ +appwrite messaging update-fcm-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..9d07afead8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,2 @@ +appwrite messaging update-mailgun-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..e4bc24b4ef --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,2 @@ +appwrite messaging update-msg-91-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-push.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-push.md new file mode 100644 index 0000000000..c11d462943 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-push.md @@ -0,0 +1,2 @@ +appwrite messaging update-push \ + --message-id <MESSAGE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..77e9fcd2df --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,2 @@ +appwrite messaging update-sendgrid-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-sms.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-sms.md new file mode 100644 index 0000000000..888df629d6 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-sms.md @@ -0,0 +1,2 @@ +appwrite messaging update-sms \ + --message-id <MESSAGE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..23bb89998f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-smtp-provider.md @@ -0,0 +1,2 @@ +appwrite messaging update-smtp-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..69eee1f57b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-telesign-provider.md @@ -0,0 +1,2 @@ +appwrite messaging update-telesign-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..ff23b82155 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,2 @@ +appwrite messaging update-textmagic-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-topic.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-topic.md new file mode 100644 index 0000000000..ea7bc458e3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-topic.md @@ -0,0 +1,2 @@ +appwrite messaging update-topic \ + --topic-id <TOPIC_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..25f2910d26 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-twilio-provider.md @@ -0,0 +1,2 @@ +appwrite messaging update-twilio-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/console-cli/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..7b87a9422b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/messaging/update-vonage-provider.md @@ -0,0 +1,2 @@ +appwrite messaging update-vonage-provider \ + --provider-id <PROVIDER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/create-appwrite-migration.md b/docs/examples/1.8.x/console-cli/examples/migrations/create-appwrite-migration.md new file mode 100644 index 0000000000..34fee2f307 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/create-appwrite-migration.md @@ -0,0 +1,5 @@ +appwrite migrations create-appwrite-migration \ + --resources one two three \ + --endpoint https://example.com \ + --project-id <PROJECT_ID> \ + --api-key <API_KEY> diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/create-csv-migration.md b/docs/examples/1.8.x/console-cli/examples/migrations/create-csv-migration.md new file mode 100644 index 0000000000..4b72b6f689 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/create-csv-migration.md @@ -0,0 +1,4 @@ +appwrite migrations create-csv-migration \ + --bucket-id <BUCKET_ID> \ + --file-id <FILE_ID> \ + --resource-id [ID1:ID2] diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/create-firebase-migration.md b/docs/examples/1.8.x/console-cli/examples/migrations/create-firebase-migration.md new file mode 100644 index 0000000000..81337b4cf4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/create-firebase-migration.md @@ -0,0 +1,3 @@ +appwrite migrations create-firebase-migration \ + --resources one two three \ + --service-account <SERVICE_ACCOUNT> diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/create-n-host-migration.md b/docs/examples/1.8.x/console-cli/examples/migrations/create-n-host-migration.md new file mode 100644 index 0000000000..2bcba6ad8c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/create-n-host-migration.md @@ -0,0 +1,8 @@ +appwrite migrations create-n-host-migration \ + --resources one two three \ + --subdomain <SUBDOMAIN> \ + --region <REGION> \ + --admin-secret <ADMIN_SECRET> \ + --database <DATABASE> \ + --username <USERNAME> \ + --password <PASSWORD> diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/create-supabase-migration.md b/docs/examples/1.8.x/console-cli/examples/migrations/create-supabase-migration.md new file mode 100644 index 0000000000..a186b17212 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/create-supabase-migration.md @@ -0,0 +1,7 @@ +appwrite migrations create-supabase-migration \ + --resources one two three \ + --endpoint https://example.com \ + --api-key <API_KEY> \ + --database-host <DATABASE_HOST> \ + --username <USERNAME> \ + --password <PASSWORD> diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/delete.md b/docs/examples/1.8.x/console-cli/examples/migrations/delete.md new file mode 100644 index 0000000000..b7ad0f07ba --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/delete.md @@ -0,0 +1,2 @@ +appwrite migrations delete \ + --migration-id <MIGRATION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/get-appwrite-report.md b/docs/examples/1.8.x/console-cli/examples/migrations/get-appwrite-report.md new file mode 100644 index 0000000000..3f54fed2bc --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/get-appwrite-report.md @@ -0,0 +1,5 @@ +appwrite migrations get-appwrite-report \ + --resources one two three \ + --endpoint https://example.com \ + --project-id <PROJECT_ID> \ + --key <KEY> diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/get-firebase-report.md b/docs/examples/1.8.x/console-cli/examples/migrations/get-firebase-report.md new file mode 100644 index 0000000000..33e7e732f4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/get-firebase-report.md @@ -0,0 +1,3 @@ +appwrite migrations get-firebase-report \ + --resources one two three \ + --service-account <SERVICE_ACCOUNT> diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/get-n-host-report.md b/docs/examples/1.8.x/console-cli/examples/migrations/get-n-host-report.md new file mode 100644 index 0000000000..2d1ed043ef --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/get-n-host-report.md @@ -0,0 +1,8 @@ +appwrite migrations get-n-host-report \ + --resources one two three \ + --subdomain <SUBDOMAIN> \ + --region <REGION> \ + --admin-secret <ADMIN_SECRET> \ + --database <DATABASE> \ + --username <USERNAME> \ + --password <PASSWORD> diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/get-supabase-report.md b/docs/examples/1.8.x/console-cli/examples/migrations/get-supabase-report.md new file mode 100644 index 0000000000..789c66a543 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/get-supabase-report.md @@ -0,0 +1,7 @@ +appwrite migrations get-supabase-report \ + --resources one two three \ + --endpoint https://example.com \ + --api-key <API_KEY> \ + --database-host <DATABASE_HOST> \ + --username <USERNAME> \ + --password <PASSWORD> diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/get.md b/docs/examples/1.8.x/console-cli/examples/migrations/get.md new file mode 100644 index 0000000000..46959a3ef0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/get.md @@ -0,0 +1,2 @@ +appwrite migrations get \ + --migration-id <MIGRATION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/list.md b/docs/examples/1.8.x/console-cli/examples/migrations/list.md new file mode 100644 index 0000000000..659c9fd46f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/list.md @@ -0,0 +1 @@ +appwrite migrations list diff --git a/docs/examples/1.8.x/console-cli/examples/migrations/retry.md b/docs/examples/1.8.x/console-cli/examples/migrations/retry.md new file mode 100644 index 0000000000..d656dd9956 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/migrations/retry.md @@ -0,0 +1,2 @@ +appwrite migrations retry \ + --migration-id <MIGRATION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/project/create-variable.md b/docs/examples/1.8.x/console-cli/examples/project/create-variable.md new file mode 100644 index 0000000000..113c0bafc9 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/project/create-variable.md @@ -0,0 +1,3 @@ +appwrite project create-variable \ + --key <KEY> \ + --value <VALUE> diff --git a/docs/examples/1.8.x/console-cli/examples/project/delete-variable.md b/docs/examples/1.8.x/console-cli/examples/project/delete-variable.md new file mode 100644 index 0000000000..a4213dca5d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/project/delete-variable.md @@ -0,0 +1,2 @@ +appwrite project delete-variable \ + --variable-id <VARIABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/project/get-usage.md b/docs/examples/1.8.x/console-cli/examples/project/get-usage.md new file mode 100644 index 0000000000..75cc4b99a3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/project/get-usage.md @@ -0,0 +1,3 @@ +appwrite project get-usage \ + --start-date '' \ + --end-date '' diff --git a/docs/examples/1.8.x/console-cli/examples/project/get-variable.md b/docs/examples/1.8.x/console-cli/examples/project/get-variable.md new file mode 100644 index 0000000000..2833758541 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/project/get-variable.md @@ -0,0 +1,2 @@ +appwrite project get-variable \ + --variable-id <VARIABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/project/list-variables.md b/docs/examples/1.8.x/console-cli/examples/project/list-variables.md new file mode 100644 index 0000000000..dc6251c497 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/project/list-variables.md @@ -0,0 +1 @@ +appwrite project list-variables diff --git a/docs/examples/1.8.x/console-cli/examples/project/update-variable.md b/docs/examples/1.8.x/console-cli/examples/project/update-variable.md new file mode 100644 index 0000000000..5f12a12be1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/project/update-variable.md @@ -0,0 +1,3 @@ +appwrite project update-variable \ + --variable-id <VARIABLE_ID> \ + --key <KEY> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/create-dev-key.md b/docs/examples/1.8.x/console-cli/examples/projects/create-dev-key.md new file mode 100644 index 0000000000..b90e0ca85c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/create-dev-key.md @@ -0,0 +1,4 @@ +appwrite projects create-dev-key \ + --project-id <PROJECT_ID> \ + --name <NAME> \ + --expire '' diff --git a/docs/examples/1.8.x/console-cli/examples/projects/create-jwt.md b/docs/examples/1.8.x/console-cli/examples/projects/create-jwt.md new file mode 100644 index 0000000000..df708a53ed --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/create-jwt.md @@ -0,0 +1,3 @@ +appwrite projects create-jwt \ + --project-id <PROJECT_ID> \ + --scopes one two three diff --git a/docs/examples/1.8.x/console-cli/examples/projects/create-key.md b/docs/examples/1.8.x/console-cli/examples/projects/create-key.md new file mode 100644 index 0000000000..0650ccd1d2 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/create-key.md @@ -0,0 +1,4 @@ +appwrite projects create-key \ + --project-id <PROJECT_ID> \ + --name <NAME> \ + --scopes one two three diff --git a/docs/examples/1.8.x/console-cli/examples/projects/create-platform.md b/docs/examples/1.8.x/console-cli/examples/projects/create-platform.md new file mode 100644 index 0000000000..94f5234156 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/create-platform.md @@ -0,0 +1,4 @@ +appwrite projects create-platform \ + --project-id <PROJECT_ID> \ + --type web \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/create-smtp-test.md b/docs/examples/1.8.x/console-cli/examples/projects/create-smtp-test.md new file mode 100644 index 0000000000..c83aebfb30 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/create-smtp-test.md @@ -0,0 +1,6 @@ +appwrite projects create-smtp-test \ + --project-id <PROJECT_ID> \ + --emails one two three \ + --sender-name <SENDER_NAME> \ + --sender-email email@example.com \ + --host '' diff --git a/docs/examples/1.8.x/console-cli/examples/projects/create-webhook.md b/docs/examples/1.8.x/console-cli/examples/projects/create-webhook.md new file mode 100644 index 0000000000..0983d31497 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/create-webhook.md @@ -0,0 +1,6 @@ +appwrite projects create-webhook \ + --project-id <PROJECT_ID> \ + --name <NAME> \ + --events one two three \ + --url '' \ + --security false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/create.md b/docs/examples/1.8.x/console-cli/examples/projects/create.md new file mode 100644 index 0000000000..5bdd1ffda1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/create.md @@ -0,0 +1,4 @@ +appwrite projects create \ + --project-id '' \ + --name <NAME> \ + --team-id <TEAM_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/delete-dev-key.md b/docs/examples/1.8.x/console-cli/examples/projects/delete-dev-key.md new file mode 100644 index 0000000000..3e911eab69 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/delete-dev-key.md @@ -0,0 +1,3 @@ +appwrite projects delete-dev-key \ + --project-id <PROJECT_ID> \ + --key-id <KEY_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/delete-email-template.md b/docs/examples/1.8.x/console-cli/examples/projects/delete-email-template.md new file mode 100644 index 0000000000..81cf403c6d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/delete-email-template.md @@ -0,0 +1,4 @@ +appwrite projects delete-email-template \ + --project-id <PROJECT_ID> \ + --type verification \ + --locale af diff --git a/docs/examples/1.8.x/console-cli/examples/projects/delete-key.md b/docs/examples/1.8.x/console-cli/examples/projects/delete-key.md new file mode 100644 index 0000000000..eccb09b911 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/delete-key.md @@ -0,0 +1,3 @@ +appwrite projects delete-key \ + --project-id <PROJECT_ID> \ + --key-id <KEY_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/delete-platform.md b/docs/examples/1.8.x/console-cli/examples/projects/delete-platform.md new file mode 100644 index 0000000000..7f68e7d6f9 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/delete-platform.md @@ -0,0 +1,3 @@ +appwrite projects delete-platform \ + --project-id <PROJECT_ID> \ + --platform-id <PLATFORM_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/delete-sms-template.md b/docs/examples/1.8.x/console-cli/examples/projects/delete-sms-template.md new file mode 100644 index 0000000000..666de541d9 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/delete-sms-template.md @@ -0,0 +1,4 @@ +appwrite projects delete-sms-template \ + --project-id <PROJECT_ID> \ + --type verification \ + --locale af diff --git a/docs/examples/1.8.x/console-cli/examples/projects/delete-webhook.md b/docs/examples/1.8.x/console-cli/examples/projects/delete-webhook.md new file mode 100644 index 0000000000..70e686556e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/delete-webhook.md @@ -0,0 +1,3 @@ +appwrite projects delete-webhook \ + --project-id <PROJECT_ID> \ + --webhook-id <WEBHOOK_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/delete.md b/docs/examples/1.8.x/console-cli/examples/projects/delete.md new file mode 100644 index 0000000000..3127385598 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/delete.md @@ -0,0 +1,2 @@ +appwrite projects delete \ + --project-id <PROJECT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/get-dev-key.md b/docs/examples/1.8.x/console-cli/examples/projects/get-dev-key.md new file mode 100644 index 0000000000..57b2c2275c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/get-dev-key.md @@ -0,0 +1,3 @@ +appwrite projects get-dev-key \ + --project-id <PROJECT_ID> \ + --key-id <KEY_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/get-email-template.md b/docs/examples/1.8.x/console-cli/examples/projects/get-email-template.md new file mode 100644 index 0000000000..ea6d5422a8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/get-email-template.md @@ -0,0 +1,4 @@ +appwrite projects get-email-template \ + --project-id <PROJECT_ID> \ + --type verification \ + --locale af diff --git a/docs/examples/1.8.x/console-cli/examples/projects/get-key.md b/docs/examples/1.8.x/console-cli/examples/projects/get-key.md new file mode 100644 index 0000000000..cfd5013536 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/get-key.md @@ -0,0 +1,3 @@ +appwrite projects get-key \ + --project-id <PROJECT_ID> \ + --key-id <KEY_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/get-platform.md b/docs/examples/1.8.x/console-cli/examples/projects/get-platform.md new file mode 100644 index 0000000000..62077309b6 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/get-platform.md @@ -0,0 +1,3 @@ +appwrite projects get-platform \ + --project-id <PROJECT_ID> \ + --platform-id <PLATFORM_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/get-sms-template.md b/docs/examples/1.8.x/console-cli/examples/projects/get-sms-template.md new file mode 100644 index 0000000000..bbb755b085 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/get-sms-template.md @@ -0,0 +1,4 @@ +appwrite projects get-sms-template \ + --project-id <PROJECT_ID> \ + --type verification \ + --locale af diff --git a/docs/examples/1.8.x/console-cli/examples/projects/get-webhook.md b/docs/examples/1.8.x/console-cli/examples/projects/get-webhook.md new file mode 100644 index 0000000000..d725bee7bf --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/get-webhook.md @@ -0,0 +1,3 @@ +appwrite projects get-webhook \ + --project-id <PROJECT_ID> \ + --webhook-id <WEBHOOK_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/get.md b/docs/examples/1.8.x/console-cli/examples/projects/get.md new file mode 100644 index 0000000000..0665b37e0a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/get.md @@ -0,0 +1,2 @@ +appwrite projects get \ + --project-id <PROJECT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/list-dev-keys.md b/docs/examples/1.8.x/console-cli/examples/projects/list-dev-keys.md new file mode 100644 index 0000000000..f6f9a844c5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/list-dev-keys.md @@ -0,0 +1,2 @@ +appwrite projects list-dev-keys \ + --project-id <PROJECT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/list-keys.md b/docs/examples/1.8.x/console-cli/examples/projects/list-keys.md new file mode 100644 index 0000000000..aa70a5c5eb --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/list-keys.md @@ -0,0 +1,2 @@ +appwrite projects list-keys \ + --project-id <PROJECT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/list-platforms.md b/docs/examples/1.8.x/console-cli/examples/projects/list-platforms.md new file mode 100644 index 0000000000..e7fbfb2831 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/list-platforms.md @@ -0,0 +1,2 @@ +appwrite projects list-platforms \ + --project-id <PROJECT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/list-webhooks.md b/docs/examples/1.8.x/console-cli/examples/projects/list-webhooks.md new file mode 100644 index 0000000000..ab4012a11a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/list-webhooks.md @@ -0,0 +1,2 @@ +appwrite projects list-webhooks \ + --project-id <PROJECT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/list.md b/docs/examples/1.8.x/console-cli/examples/projects/list.md new file mode 100644 index 0000000000..f84f712fb5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/list.md @@ -0,0 +1 @@ +appwrite projects list diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-api-status-all.md b/docs/examples/1.8.x/console-cli/examples/projects/update-api-status-all.md new file mode 100644 index 0000000000..bbbec4500d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-api-status-all.md @@ -0,0 +1,3 @@ +appwrite projects update-api-status-all \ + --project-id <PROJECT_ID> \ + --status false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-api-status.md b/docs/examples/1.8.x/console-cli/examples/projects/update-api-status.md new file mode 100644 index 0000000000..7e269ba2ec --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-api-status.md @@ -0,0 +1,4 @@ +appwrite projects update-api-status \ + --project-id <PROJECT_ID> \ + --api rest \ + --status false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-auth-duration.md b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-duration.md new file mode 100644 index 0000000000..07e458e731 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-duration.md @@ -0,0 +1,3 @@ +appwrite projects update-auth-duration \ + --project-id <PROJECT_ID> \ + --duration 0 diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-auth-limit.md b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-limit.md new file mode 100644 index 0000000000..5e5d2addda --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-limit.md @@ -0,0 +1,3 @@ +appwrite projects update-auth-limit \ + --project-id <PROJECT_ID> \ + --limit 0 diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-auth-password-dictionary.md b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-password-dictionary.md new file mode 100644 index 0000000000..b4160e3412 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-password-dictionary.md @@ -0,0 +1,3 @@ +appwrite projects update-auth-password-dictionary \ + --project-id <PROJECT_ID> \ + --enabled false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-auth-password-history.md b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-password-history.md new file mode 100644 index 0000000000..cffc917911 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-password-history.md @@ -0,0 +1,3 @@ +appwrite projects update-auth-password-history \ + --project-id <PROJECT_ID> \ + --limit 0 diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-auth-sessions-limit.md b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-sessions-limit.md new file mode 100644 index 0000000000..fc205c03ac --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-sessions-limit.md @@ -0,0 +1,3 @@ +appwrite projects update-auth-sessions-limit \ + --project-id <PROJECT_ID> \ + --limit 1 diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-auth-status.md b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-status.md new file mode 100644 index 0000000000..5f38dc9225 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-auth-status.md @@ -0,0 +1,4 @@ +appwrite projects update-auth-status \ + --project-id <PROJECT_ID> \ + --method email-password \ + --status false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-dev-key.md b/docs/examples/1.8.x/console-cli/examples/projects/update-dev-key.md new file mode 100644 index 0000000000..1e54db37cb --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-dev-key.md @@ -0,0 +1,5 @@ +appwrite projects update-dev-key \ + --project-id <PROJECT_ID> \ + --key-id <KEY_ID> \ + --name <NAME> \ + --expire '' diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-email-template.md b/docs/examples/1.8.x/console-cli/examples/projects/update-email-template.md new file mode 100644 index 0000000000..f8e4919a4a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-email-template.md @@ -0,0 +1,6 @@ +appwrite projects update-email-template \ + --project-id <PROJECT_ID> \ + --type verification \ + --locale af \ + --subject <SUBJECT> \ + --message <MESSAGE> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-key.md b/docs/examples/1.8.x/console-cli/examples/projects/update-key.md new file mode 100644 index 0000000000..8ac173b75e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-key.md @@ -0,0 +1,5 @@ +appwrite projects update-key \ + --project-id <PROJECT_ID> \ + --key-id <KEY_ID> \ + --name <NAME> \ + --scopes one two three diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-memberships-privacy.md b/docs/examples/1.8.x/console-cli/examples/projects/update-memberships-privacy.md new file mode 100644 index 0000000000..94582f48b7 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-memberships-privacy.md @@ -0,0 +1,5 @@ +appwrite projects update-memberships-privacy \ + --project-id <PROJECT_ID> \ + --user-name false \ + --user-email false \ + --mfa false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-mock-numbers.md b/docs/examples/1.8.x/console-cli/examples/projects/update-mock-numbers.md new file mode 100644 index 0000000000..774887d6af --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-mock-numbers.md @@ -0,0 +1,3 @@ +appwrite projects update-mock-numbers \ + --project-id <PROJECT_ID> \ + --numbers one two three diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-o-auth-2.md b/docs/examples/1.8.x/console-cli/examples/projects/update-o-auth-2.md new file mode 100644 index 0000000000..7f8364df6a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-o-auth-2.md @@ -0,0 +1,3 @@ +appwrite projects update-o-auth-2 \ + --project-id <PROJECT_ID> \ + --provider amazon diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-personal-data-check.md b/docs/examples/1.8.x/console-cli/examples/projects/update-personal-data-check.md new file mode 100644 index 0000000000..7130decb07 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-personal-data-check.md @@ -0,0 +1,3 @@ +appwrite projects update-personal-data-check \ + --project-id <PROJECT_ID> \ + --enabled false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-platform.md b/docs/examples/1.8.x/console-cli/examples/projects/update-platform.md new file mode 100644 index 0000000000..170e8a6e68 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-platform.md @@ -0,0 +1,4 @@ +appwrite projects update-platform \ + --project-id <PROJECT_ID> \ + --platform-id <PLATFORM_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-service-status-all.md b/docs/examples/1.8.x/console-cli/examples/projects/update-service-status-all.md new file mode 100644 index 0000000000..1d8fab29a7 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-service-status-all.md @@ -0,0 +1,3 @@ +appwrite projects update-service-status-all \ + --project-id <PROJECT_ID> \ + --status false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-service-status.md b/docs/examples/1.8.x/console-cli/examples/projects/update-service-status.md new file mode 100644 index 0000000000..ce589bcb41 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-service-status.md @@ -0,0 +1,4 @@ +appwrite projects update-service-status \ + --project-id <PROJECT_ID> \ + --service account \ + --status false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-session-alerts.md b/docs/examples/1.8.x/console-cli/examples/projects/update-session-alerts.md new file mode 100644 index 0000000000..d25fa96000 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-session-alerts.md @@ -0,0 +1,3 @@ +appwrite projects update-session-alerts \ + --project-id <PROJECT_ID> \ + --alerts false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-session-invalidation.md b/docs/examples/1.8.x/console-cli/examples/projects/update-session-invalidation.md new file mode 100644 index 0000000000..17d635e5ac --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-session-invalidation.md @@ -0,0 +1,3 @@ +appwrite projects update-session-invalidation \ + --project-id <PROJECT_ID> \ + --enabled false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-sms-template.md b/docs/examples/1.8.x/console-cli/examples/projects/update-sms-template.md new file mode 100644 index 0000000000..5e10477f73 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-sms-template.md @@ -0,0 +1,5 @@ +appwrite projects update-sms-template \ + --project-id <PROJECT_ID> \ + --type verification \ + --locale af \ + --message <MESSAGE> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-smtp.md b/docs/examples/1.8.x/console-cli/examples/projects/update-smtp.md new file mode 100644 index 0000000000..f62059aa5c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-smtp.md @@ -0,0 +1,3 @@ +appwrite projects update-smtp \ + --project-id <PROJECT_ID> \ + --enabled false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-team.md b/docs/examples/1.8.x/console-cli/examples/projects/update-team.md new file mode 100644 index 0000000000..4cb0a981c0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-team.md @@ -0,0 +1,3 @@ +appwrite projects update-team \ + --project-id <PROJECT_ID> \ + --team-id <TEAM_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-webhook-signature.md b/docs/examples/1.8.x/console-cli/examples/projects/update-webhook-signature.md new file mode 100644 index 0000000000..708ff65663 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-webhook-signature.md @@ -0,0 +1,3 @@ +appwrite projects update-webhook-signature \ + --project-id <PROJECT_ID> \ + --webhook-id <WEBHOOK_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update-webhook.md b/docs/examples/1.8.x/console-cli/examples/projects/update-webhook.md new file mode 100644 index 0000000000..f505e6e520 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update-webhook.md @@ -0,0 +1,7 @@ +appwrite projects update-webhook \ + --project-id <PROJECT_ID> \ + --webhook-id <WEBHOOK_ID> \ + --name <NAME> \ + --events one two three \ + --url '' \ + --security false diff --git a/docs/examples/1.8.x/console-cli/examples/projects/update.md b/docs/examples/1.8.x/console-cli/examples/projects/update.md new file mode 100644 index 0000000000..e3c7ecaa88 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/projects/update.md @@ -0,0 +1,3 @@ +appwrite projects update \ + --project-id <PROJECT_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/proxy/create-api-rule.md b/docs/examples/1.8.x/console-cli/examples/proxy/create-api-rule.md new file mode 100644 index 0000000000..3bd7bb16fe --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/proxy/create-api-rule.md @@ -0,0 +1,2 @@ +appwrite proxy create-api-rule \ + --domain '' diff --git a/docs/examples/1.8.x/console-cli/examples/proxy/create-function-rule.md b/docs/examples/1.8.x/console-cli/examples/proxy/create-function-rule.md new file mode 100644 index 0000000000..2312f3afbb --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/proxy/create-function-rule.md @@ -0,0 +1,3 @@ +appwrite proxy create-function-rule \ + --domain '' \ + --function-id <FUNCTION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/proxy/create-redirect-rule.md b/docs/examples/1.8.x/console-cli/examples/proxy/create-redirect-rule.md new file mode 100644 index 0000000000..763f9bc8b4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/proxy/create-redirect-rule.md @@ -0,0 +1,6 @@ +appwrite proxy create-redirect-rule \ + --domain '' \ + --url https://example.com \ + --status-code 301 \ + --resource-id <RESOURCE_ID> \ + --resource-type site diff --git a/docs/examples/1.8.x/console-cli/examples/proxy/create-site-rule.md b/docs/examples/1.8.x/console-cli/examples/proxy/create-site-rule.md new file mode 100644 index 0000000000..fa7859b352 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/proxy/create-site-rule.md @@ -0,0 +1,3 @@ +appwrite proxy create-site-rule \ + --domain '' \ + --site-id <SITE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/proxy/delete-rule.md b/docs/examples/1.8.x/console-cli/examples/proxy/delete-rule.md new file mode 100644 index 0000000000..c676893a1b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/proxy/delete-rule.md @@ -0,0 +1,2 @@ +appwrite proxy delete-rule \ + --rule-id <RULE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/proxy/get-rule.md b/docs/examples/1.8.x/console-cli/examples/proxy/get-rule.md new file mode 100644 index 0000000000..22ac1de7bf --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/proxy/get-rule.md @@ -0,0 +1,2 @@ +appwrite proxy get-rule \ + --rule-id <RULE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/proxy/list-rules.md b/docs/examples/1.8.x/console-cli/examples/proxy/list-rules.md new file mode 100644 index 0000000000..ab530846d0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/proxy/list-rules.md @@ -0,0 +1 @@ +appwrite proxy list-rules diff --git a/docs/examples/1.8.x/console-cli/examples/proxy/update-rule-verification.md b/docs/examples/1.8.x/console-cli/examples/proxy/update-rule-verification.md new file mode 100644 index 0000000000..b381aa3353 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/proxy/update-rule-verification.md @@ -0,0 +1,2 @@ +appwrite proxy update-rule-verification \ + --rule-id <RULE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/create-deployment.md b/docs/examples/1.8.x/console-cli/examples/sites/create-deployment.md new file mode 100644 index 0000000000..dda0468278 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/create-deployment.md @@ -0,0 +1,4 @@ +appwrite sites create-deployment \ + --site-id <SITE_ID> \ + --code 'path/to/file.png' \ + --activate false diff --git a/docs/examples/1.8.x/console-cli/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/console-cli/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..30cf7d5ac8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,3 @@ +appwrite sites create-duplicate-deployment \ + --site-id <SITE_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/console-cli/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..2eece41976 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/create-template-deployment.md @@ -0,0 +1,6 @@ +appwrite sites create-template-deployment \ + --site-id <SITE_ID> \ + --repository <REPOSITORY> \ + --owner <OWNER> \ + --root-directory <ROOT_DIRECTORY> \ + --version <VERSION> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/create-variable.md b/docs/examples/1.8.x/console-cli/examples/sites/create-variable.md new file mode 100644 index 0000000000..af1f470113 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/create-variable.md @@ -0,0 +1,4 @@ +appwrite sites create-variable \ + --site-id <SITE_ID> \ + --key <KEY> \ + --value <VALUE> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/console-cli/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..ab9c444e06 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/create-vcs-deployment.md @@ -0,0 +1,4 @@ +appwrite sites create-vcs-deployment \ + --site-id <SITE_ID> \ + --type branch \ + --reference <REFERENCE> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/create.md b/docs/examples/1.8.x/console-cli/examples/sites/create.md new file mode 100644 index 0000000000..6806a106db --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/create.md @@ -0,0 +1,5 @@ +appwrite sites create \ + --site-id <SITE_ID> \ + --name <NAME> \ + --framework analog \ + --build-runtime node-14.5 diff --git a/docs/examples/1.8.x/console-cli/examples/sites/delete-deployment.md b/docs/examples/1.8.x/console-cli/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..7f7fe2f89b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/delete-deployment.md @@ -0,0 +1,3 @@ +appwrite sites delete-deployment \ + --site-id <SITE_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/delete-log.md b/docs/examples/1.8.x/console-cli/examples/sites/delete-log.md new file mode 100644 index 0000000000..3ea350396c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/delete-log.md @@ -0,0 +1,3 @@ +appwrite sites delete-log \ + --site-id <SITE_ID> \ + --log-id <LOG_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/delete-variable.md b/docs/examples/1.8.x/console-cli/examples/sites/delete-variable.md new file mode 100644 index 0000000000..a7a32b93ba --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/delete-variable.md @@ -0,0 +1,3 @@ +appwrite sites delete-variable \ + --site-id <SITE_ID> \ + --variable-id <VARIABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/delete.md b/docs/examples/1.8.x/console-cli/examples/sites/delete.md new file mode 100644 index 0000000000..e03eca67f1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/delete.md @@ -0,0 +1,2 @@ +appwrite sites delete \ + --site-id <SITE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/console-cli/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..e7af5c31b1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/get-deployment-download.md @@ -0,0 +1,3 @@ +appwrite sites get-deployment-download \ + --site-id <SITE_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/get-deployment.md b/docs/examples/1.8.x/console-cli/examples/sites/get-deployment.md new file mode 100644 index 0000000000..28fee04df8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/get-deployment.md @@ -0,0 +1,3 @@ +appwrite sites get-deployment \ + --site-id <SITE_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/get-log.md b/docs/examples/1.8.x/console-cli/examples/sites/get-log.md new file mode 100644 index 0000000000..adba026759 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/get-log.md @@ -0,0 +1,3 @@ +appwrite sites get-log \ + --site-id <SITE_ID> \ + --log-id <LOG_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/get-template.md b/docs/examples/1.8.x/console-cli/examples/sites/get-template.md new file mode 100644 index 0000000000..64bfd67d19 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/get-template.md @@ -0,0 +1,2 @@ +appwrite sites get-template \ + --template-id <TEMPLATE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/get-usage.md b/docs/examples/1.8.x/console-cli/examples/sites/get-usage.md new file mode 100644 index 0000000000..e1f88627e9 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/get-usage.md @@ -0,0 +1,2 @@ +appwrite sites get-usage \ + --site-id <SITE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/get-variable.md b/docs/examples/1.8.x/console-cli/examples/sites/get-variable.md new file mode 100644 index 0000000000..2e96d63277 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/get-variable.md @@ -0,0 +1,3 @@ +appwrite sites get-variable \ + --site-id <SITE_ID> \ + --variable-id <VARIABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/get.md b/docs/examples/1.8.x/console-cli/examples/sites/get.md new file mode 100644 index 0000000000..db34c8212b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/get.md @@ -0,0 +1,2 @@ +appwrite sites get \ + --site-id <SITE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/list-deployments.md b/docs/examples/1.8.x/console-cli/examples/sites/list-deployments.md new file mode 100644 index 0000000000..0c5de0578e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/list-deployments.md @@ -0,0 +1,2 @@ +appwrite sites list-deployments \ + --site-id <SITE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/list-frameworks.md b/docs/examples/1.8.x/console-cli/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..7a213b9ac5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/list-frameworks.md @@ -0,0 +1 @@ +appwrite sites list-frameworks diff --git a/docs/examples/1.8.x/console-cli/examples/sites/list-logs.md b/docs/examples/1.8.x/console-cli/examples/sites/list-logs.md new file mode 100644 index 0000000000..565bcab9d4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/list-logs.md @@ -0,0 +1,2 @@ +appwrite sites list-logs \ + --site-id <SITE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/list-specifications.md b/docs/examples/1.8.x/console-cli/examples/sites/list-specifications.md new file mode 100644 index 0000000000..e8f1a87eb5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/list-specifications.md @@ -0,0 +1 @@ +appwrite sites list-specifications diff --git a/docs/examples/1.8.x/console-cli/examples/sites/list-templates.md b/docs/examples/1.8.x/console-cli/examples/sites/list-templates.md new file mode 100644 index 0000000000..bde094fce8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/list-templates.md @@ -0,0 +1 @@ +appwrite sites list-templates diff --git a/docs/examples/1.8.x/console-cli/examples/sites/list-usage.md b/docs/examples/1.8.x/console-cli/examples/sites/list-usage.md new file mode 100644 index 0000000000..b5b4171d34 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/list-usage.md @@ -0,0 +1 @@ +appwrite sites list-usage diff --git a/docs/examples/1.8.x/console-cli/examples/sites/list-variables.md b/docs/examples/1.8.x/console-cli/examples/sites/list-variables.md new file mode 100644 index 0000000000..419fe76f8f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/list-variables.md @@ -0,0 +1,2 @@ +appwrite sites list-variables \ + --site-id <SITE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/list.md b/docs/examples/1.8.x/console-cli/examples/sites/list.md new file mode 100644 index 0000000000..9d3b883c34 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/list.md @@ -0,0 +1 @@ +appwrite sites list diff --git a/docs/examples/1.8.x/console-cli/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/console-cli/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..9220265d12 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/update-deployment-status.md @@ -0,0 +1,3 @@ +appwrite sites update-deployment-status \ + --site-id <SITE_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/console-cli/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..9db9e11ae0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/update-site-deployment.md @@ -0,0 +1,3 @@ +appwrite sites update-site-deployment \ + --site-id <SITE_ID> \ + --deployment-id <DEPLOYMENT_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/update-variable.md b/docs/examples/1.8.x/console-cli/examples/sites/update-variable.md new file mode 100644 index 0000000000..e7df76a549 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/update-variable.md @@ -0,0 +1,4 @@ +appwrite sites update-variable \ + --site-id <SITE_ID> \ + --variable-id <VARIABLE_ID> \ + --key <KEY> diff --git a/docs/examples/1.8.x/console-cli/examples/sites/update.md b/docs/examples/1.8.x/console-cli/examples/sites/update.md new file mode 100644 index 0000000000..6fab0af5fb --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/sites/update.md @@ -0,0 +1,4 @@ +appwrite sites update \ + --site-id <SITE_ID> \ + --name <NAME> \ + --framework analog diff --git a/docs/examples/1.8.x/console-cli/examples/storage/create-bucket.md b/docs/examples/1.8.x/console-cli/examples/storage/create-bucket.md new file mode 100644 index 0000000000..2e26dc770f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/create-bucket.md @@ -0,0 +1,3 @@ +appwrite storage create-bucket \ + --bucket-id <BUCKET_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/storage/create-file.md b/docs/examples/1.8.x/console-cli/examples/storage/create-file.md new file mode 100644 index 0000000000..82b4d0a1aa --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/create-file.md @@ -0,0 +1,4 @@ +appwrite storage create-file \ + --bucket-id <BUCKET_ID> \ + --file-id <FILE_ID> \ + --file 'path/to/file.png' diff --git a/docs/examples/1.8.x/console-cli/examples/storage/delete-bucket.md b/docs/examples/1.8.x/console-cli/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..33e520cc15 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/delete-bucket.md @@ -0,0 +1,2 @@ +appwrite storage delete-bucket \ + --bucket-id <BUCKET_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/storage/delete-file.md b/docs/examples/1.8.x/console-cli/examples/storage/delete-file.md new file mode 100644 index 0000000000..a3006c2fea --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/delete-file.md @@ -0,0 +1,3 @@ +appwrite storage delete-file \ + --bucket-id <BUCKET_ID> \ + --file-id <FILE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/storage/get-bucket-usage.md b/docs/examples/1.8.x/console-cli/examples/storage/get-bucket-usage.md new file mode 100644 index 0000000000..794b0ec8cf --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/get-bucket-usage.md @@ -0,0 +1,2 @@ +appwrite storage get-bucket-usage \ + --bucket-id <BUCKET_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/storage/get-bucket.md b/docs/examples/1.8.x/console-cli/examples/storage/get-bucket.md new file mode 100644 index 0000000000..64042812f6 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/get-bucket.md @@ -0,0 +1,2 @@ +appwrite storage get-bucket \ + --bucket-id <BUCKET_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/storage/get-file-download.md b/docs/examples/1.8.x/console-cli/examples/storage/get-file-download.md new file mode 100644 index 0000000000..12a74ea0a2 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/get-file-download.md @@ -0,0 +1,3 @@ +appwrite storage get-file-download \ + --bucket-id <BUCKET_ID> \ + --file-id <FILE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/storage/get-file-preview.md b/docs/examples/1.8.x/console-cli/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..82f180efc8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/get-file-preview.md @@ -0,0 +1,3 @@ +appwrite storage get-file-preview \ + --bucket-id <BUCKET_ID> \ + --file-id <FILE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/storage/get-file-view.md b/docs/examples/1.8.x/console-cli/examples/storage/get-file-view.md new file mode 100644 index 0000000000..5ce6526fad --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/get-file-view.md @@ -0,0 +1,3 @@ +appwrite storage get-file-view \ + --bucket-id <BUCKET_ID> \ + --file-id <FILE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/storage/get-file.md b/docs/examples/1.8.x/console-cli/examples/storage/get-file.md new file mode 100644 index 0000000000..8c139e602a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/get-file.md @@ -0,0 +1,3 @@ +appwrite storage get-file \ + --bucket-id <BUCKET_ID> \ + --file-id <FILE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/storage/get-usage.md b/docs/examples/1.8.x/console-cli/examples/storage/get-usage.md new file mode 100644 index 0000000000..1d69ffd820 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/get-usage.md @@ -0,0 +1 @@ +appwrite storage get-usage diff --git a/docs/examples/1.8.x/console-cli/examples/storage/list-buckets.md b/docs/examples/1.8.x/console-cli/examples/storage/list-buckets.md new file mode 100644 index 0000000000..1bffd0ebf8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/list-buckets.md @@ -0,0 +1 @@ +appwrite storage list-buckets diff --git a/docs/examples/1.8.x/console-cli/examples/storage/list-files.md b/docs/examples/1.8.x/console-cli/examples/storage/list-files.md new file mode 100644 index 0000000000..29dc20d3a1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/list-files.md @@ -0,0 +1,2 @@ +appwrite storage list-files \ + --bucket-id <BUCKET_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/storage/update-bucket.md b/docs/examples/1.8.x/console-cli/examples/storage/update-bucket.md new file mode 100644 index 0000000000..12282f3b11 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/update-bucket.md @@ -0,0 +1,3 @@ +appwrite storage update-bucket \ + --bucket-id <BUCKET_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/storage/update-file.md b/docs/examples/1.8.x/console-cli/examples/storage/update-file.md new file mode 100644 index 0000000000..86a3f3d10b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/storage/update-file.md @@ -0,0 +1,3 @@ +appwrite storage update-file \ + --bucket-id <BUCKET_ID> \ + --file-id <FILE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..b191215d67 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-boolean-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..7ccaf9e41f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-datetime-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..54f32b99db --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-email-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-email-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..4f3e9cea71 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-enum-column.md @@ -0,0 +1,6 @@ +appwrite tables-db create-enum-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --elements one two three \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..a365cefc8c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-float-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-float-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-index.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..7100907ff3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-index.md @@ -0,0 +1,6 @@ +appwrite tables-db create-index \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --type key \ + --columns one two three diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..2dc799b29f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-integer-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-integer-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..2b4601337e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-ip-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-ip-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..cd6db93ea9 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-line-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-line-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..0e7d2320d1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-point-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-point-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..060323b152 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-polygon-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..d7d58b6eb0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-relationship-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --related-table-id <RELATED_TABLE_ID> \ + --type oneToOne diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-row.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..d15c5ec047 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-row.md @@ -0,0 +1,5 @@ +appwrite tables-db create-row \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --row-id <ROW_ID> \ + --data '{ "key": "value" }' diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..39eb34961c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-rows.md @@ -0,0 +1,4 @@ +appwrite tables-db create-rows \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --rows one two three diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..a394ff59d0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-string-column.md @@ -0,0 +1,6 @@ +appwrite tables-db create-string-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --size 1 \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-table.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..1c5a22d7ef --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-table.md @@ -0,0 +1,4 @@ +appwrite tables-db create-table \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..d9b9f2b36f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create-url-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-url-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/create.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/create.md new file mode 100644 index 0000000000..d10c5d663d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/create.md @@ -0,0 +1,3 @@ +appwrite tables-db create \ + --database-id <DATABASE_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..79e0a51de1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,5 @@ +appwrite tables-db decrement-row-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --row-id <ROW_ID> \ + --column '' diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..4689290543 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-column.md @@ -0,0 +1,4 @@ +appwrite tables-db delete-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..0729f87952 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-index.md @@ -0,0 +1,4 @@ +appwrite tables-db delete-index \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..03b3562f5f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-row.md @@ -0,0 +1,4 @@ +appwrite tables-db delete-row \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --row-id <ROW_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..92cd143ad2 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-rows.md @@ -0,0 +1,3 @@ +appwrite tables-db delete-rows \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..6ec9df4539 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete-table.md @@ -0,0 +1,3 @@ +appwrite tables-db delete-table \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/delete.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete.md new file mode 100644 index 0000000000..52bf4cdde3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/delete.md @@ -0,0 +1,2 @@ +appwrite tables-db delete \ + --database-id <DATABASE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/get-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..d209c45b22 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-column.md @@ -0,0 +1,4 @@ +appwrite tables-db get-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/get-index.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..2035e78b65 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-index.md @@ -0,0 +1,4 @@ +appwrite tables-db get-index \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/get-row.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..c8d06ea02f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-row.md @@ -0,0 +1,4 @@ +appwrite tables-db get-row \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --row-id <ROW_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/get-table-usage.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-table-usage.md new file mode 100644 index 0000000000..0e7782f5eb --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-table-usage.md @@ -0,0 +1,3 @@ +appwrite tables-db get-table-usage \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/get-table.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..9e5e038163 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-table.md @@ -0,0 +1,3 @@ +appwrite tables-db get-table \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/get-usage.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-usage.md new file mode 100644 index 0000000000..ff421ce3f0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/get-usage.md @@ -0,0 +1,2 @@ +appwrite tables-db get-usage \ + --database-id <DATABASE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/get.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/get.md new file mode 100644 index 0000000000..1b125eccf0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/get.md @@ -0,0 +1,2 @@ +appwrite tables-db get \ + --database-id <DATABASE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..a15ab6917c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/increment-row-column.md @@ -0,0 +1,5 @@ +appwrite tables-db increment-row-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --row-id <ROW_ID> \ + --column '' diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..4c233d519a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-columns.md @@ -0,0 +1,3 @@ +appwrite tables-db list-columns \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..4139175a17 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-indexes.md @@ -0,0 +1,3 @@ +appwrite tables-db list-indexes \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/list-row-logs.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-row-logs.md new file mode 100644 index 0000000000..dfa2f98455 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-row-logs.md @@ -0,0 +1,4 @@ +appwrite tables-db list-row-logs \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --row-id <ROW_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..904350ef20 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-rows.md @@ -0,0 +1,3 @@ +appwrite tables-db list-rows \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/list-table-logs.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-table-logs.md new file mode 100644 index 0000000000..a803bf4053 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-table-logs.md @@ -0,0 +1,3 @@ +appwrite tables-db list-table-logs \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..f7e7930841 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-tables.md @@ -0,0 +1,2 @@ +appwrite tables-db list-tables \ + --database-id <DATABASE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/list-usage.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-usage.md new file mode 100644 index 0000000000..9e6b9802a4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/list-usage.md @@ -0,0 +1 @@ +appwrite tables-db list-usage diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/list.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/list.md new file mode 100644 index 0000000000..22d7e017a7 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/list.md @@ -0,0 +1 @@ +appwrite tables-db list diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..318ddac301 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-boolean-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false \ + --default false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..b40a825368 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-datetime-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false \ + --default '' diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..cd8104b775 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-email-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-email-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false \ + --default email@example.com diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..66bc3e2899 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-enum-column.md @@ -0,0 +1,7 @@ +appwrite tables-db update-enum-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --elements one two three \ + --required false \ + --default <DEFAULT> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..a3c6e6b265 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-float-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-float-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false \ + --default null diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..f651c5c142 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-integer-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-integer-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false \ + --default null diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..9a1425c522 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-ip-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-ip-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false \ + --default '' diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..203ebd64db --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-line-column.md @@ -0,0 +1,5 @@ +appwrite tables-db update-line-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..676a37ef49 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-point-column.md @@ -0,0 +1,5 @@ +appwrite tables-db update-point-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..24e1f01f91 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,5 @@ +appwrite tables-db update-polygon-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..fb358a311b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,4 @@ +appwrite tables-db update-relationship-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-row.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..31d88664ab --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-row.md @@ -0,0 +1,4 @@ +appwrite tables-db update-row \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --row-id <ROW_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..eca741f185 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-rows.md @@ -0,0 +1,3 @@ +appwrite tables-db update-rows \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..fadb277b02 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-string-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-string-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false \ + --default <DEFAULT> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-table.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..92884dfb3e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-table.md @@ -0,0 +1,4 @@ +appwrite tables-db update-table \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..e1bbdbb3b4 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update-url-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-url-column \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --key '' \ + --required false \ + --default https://example.com diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/update.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/update.md new file mode 100644 index 0000000000..b8dbec193c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/update.md @@ -0,0 +1,3 @@ +appwrite tables-db update \ + --database-id <DATABASE_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..32c9fd62b2 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/upsert-row.md @@ -0,0 +1,4 @@ +appwrite tables-db upsert-row \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --row-id <ROW_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/console-cli/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..85e0bc0ec9 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tablesdb/upsert-rows.md @@ -0,0 +1,4 @@ +appwrite tables-db upsert-rows \ + --database-id <DATABASE_ID> \ + --table-id <TABLE_ID> \ + --rows one two three diff --git a/docs/examples/1.8.x/console-cli/examples/teams/create-membership.md b/docs/examples/1.8.x/console-cli/examples/teams/create-membership.md new file mode 100644 index 0000000000..6e9d50a147 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/create-membership.md @@ -0,0 +1,3 @@ +appwrite teams create-membership \ + --team-id <TEAM_ID> \ + --roles one two three diff --git a/docs/examples/1.8.x/console-cli/examples/teams/create.md b/docs/examples/1.8.x/console-cli/examples/teams/create.md new file mode 100644 index 0000000000..fb8bc3ade6 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/create.md @@ -0,0 +1,3 @@ +appwrite teams create \ + --team-id <TEAM_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/teams/delete-membership.md b/docs/examples/1.8.x/console-cli/examples/teams/delete-membership.md new file mode 100644 index 0000000000..c9f1596aa8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/delete-membership.md @@ -0,0 +1,3 @@ +appwrite teams delete-membership \ + --team-id <TEAM_ID> \ + --membership-id <MEMBERSHIP_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/teams/delete.md b/docs/examples/1.8.x/console-cli/examples/teams/delete.md new file mode 100644 index 0000000000..04d5e4eadd --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/delete.md @@ -0,0 +1,2 @@ +appwrite teams delete \ + --team-id <TEAM_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/teams/get-membership.md b/docs/examples/1.8.x/console-cli/examples/teams/get-membership.md new file mode 100644 index 0000000000..a832b2384d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/get-membership.md @@ -0,0 +1,3 @@ +appwrite teams get-membership \ + --team-id <TEAM_ID> \ + --membership-id <MEMBERSHIP_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/teams/get-prefs.md b/docs/examples/1.8.x/console-cli/examples/teams/get-prefs.md new file mode 100644 index 0000000000..a2d456a77c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/get-prefs.md @@ -0,0 +1,2 @@ +appwrite teams get-prefs \ + --team-id <TEAM_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/teams/get.md b/docs/examples/1.8.x/console-cli/examples/teams/get.md new file mode 100644 index 0000000000..94f80a9ab7 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/get.md @@ -0,0 +1,2 @@ +appwrite teams get \ + --team-id <TEAM_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/teams/list-logs.md b/docs/examples/1.8.x/console-cli/examples/teams/list-logs.md new file mode 100644 index 0000000000..cbdf32ad9e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/list-logs.md @@ -0,0 +1,2 @@ +appwrite teams list-logs \ + --team-id <TEAM_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/teams/list-memberships.md b/docs/examples/1.8.x/console-cli/examples/teams/list-memberships.md new file mode 100644 index 0000000000..6a1cbcae7e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/list-memberships.md @@ -0,0 +1,2 @@ +appwrite teams list-memberships \ + --team-id <TEAM_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/teams/list.md b/docs/examples/1.8.x/console-cli/examples/teams/list.md new file mode 100644 index 0000000000..90ab82f8a1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/list.md @@ -0,0 +1 @@ +appwrite teams list diff --git a/docs/examples/1.8.x/console-cli/examples/teams/update-membership-status.md b/docs/examples/1.8.x/console-cli/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..9c234f528e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/update-membership-status.md @@ -0,0 +1,5 @@ +appwrite teams update-membership-status \ + --team-id <TEAM_ID> \ + --membership-id <MEMBERSHIP_ID> \ + --user-id <USER_ID> \ + --secret <SECRET> diff --git a/docs/examples/1.8.x/console-cli/examples/teams/update-membership.md b/docs/examples/1.8.x/console-cli/examples/teams/update-membership.md new file mode 100644 index 0000000000..f16c776ac3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/update-membership.md @@ -0,0 +1,4 @@ +appwrite teams update-membership \ + --team-id <TEAM_ID> \ + --membership-id <MEMBERSHIP_ID> \ + --roles one two three diff --git a/docs/examples/1.8.x/console-cli/examples/teams/update-name.md b/docs/examples/1.8.x/console-cli/examples/teams/update-name.md new file mode 100644 index 0000000000..cc803fbc47 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/update-name.md @@ -0,0 +1,3 @@ +appwrite teams update-name \ + --team-id <TEAM_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/teams/update-prefs.md b/docs/examples/1.8.x/console-cli/examples/teams/update-prefs.md new file mode 100644 index 0000000000..a8ce42646e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/teams/update-prefs.md @@ -0,0 +1,3 @@ +appwrite teams update-prefs \ + --team-id <TEAM_ID> \ + --prefs '{ "key": "value" }' diff --git a/docs/examples/1.8.x/console-cli/examples/tokens/create-file-token.md b/docs/examples/1.8.x/console-cli/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..3890041d59 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tokens/create-file-token.md @@ -0,0 +1,3 @@ +appwrite tokens create-file-token \ + --bucket-id <BUCKET_ID> \ + --file-id <FILE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tokens/delete.md b/docs/examples/1.8.x/console-cli/examples/tokens/delete.md new file mode 100644 index 0000000000..93c99a924b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tokens/delete.md @@ -0,0 +1,2 @@ +appwrite tokens delete \ + --token-id <TOKEN_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tokens/get.md b/docs/examples/1.8.x/console-cli/examples/tokens/get.md new file mode 100644 index 0000000000..617c112eac --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tokens/get.md @@ -0,0 +1,2 @@ +appwrite tokens get \ + --token-id <TOKEN_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tokens/list.md b/docs/examples/1.8.x/console-cli/examples/tokens/list.md new file mode 100644 index 0000000000..95e0df3b02 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tokens/list.md @@ -0,0 +1,3 @@ +appwrite tokens list \ + --bucket-id <BUCKET_ID> \ + --file-id <FILE_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/tokens/update.md b/docs/examples/1.8.x/console-cli/examples/tokens/update.md new file mode 100644 index 0000000000..ab86424adf --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/tokens/update.md @@ -0,0 +1,2 @@ +appwrite tokens update \ + --token-id <TOKEN_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/console-cli/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..fd2a7e4135 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-argon-2-user.md @@ -0,0 +1,4 @@ +appwrite users create-argon-2-user \ + --user-id <USER_ID> \ + --email email@example.com \ + --password password diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/console-cli/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..e05d9e83d8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-bcrypt-user.md @@ -0,0 +1,4 @@ +appwrite users create-bcrypt-user \ + --user-id <USER_ID> \ + --email email@example.com \ + --password password diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-jwt.md b/docs/examples/1.8.x/console-cli/examples/users/create-jwt.md new file mode 100644 index 0000000000..508c0f64c5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-jwt.md @@ -0,0 +1,2 @@ +appwrite users create-jwt \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-md-5-user.md b/docs/examples/1.8.x/console-cli/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..f47b9499b1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-md-5-user.md @@ -0,0 +1,4 @@ +appwrite users create-md-5-user \ + --user-id <USER_ID> \ + --email email@example.com \ + --password password diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/console-cli/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..c212872385 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,2 @@ +appwrite users create-mfa-recovery-codes \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/console-cli/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..a40470516d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-ph-pass-user.md @@ -0,0 +1,4 @@ +appwrite users create-ph-pass-user \ + --user-id <USER_ID> \ + --email email@example.com \ + --password password diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/console-cli/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..df4d651abf --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,7 @@ +appwrite users create-scrypt-modified-user \ + --user-id <USER_ID> \ + --email email@example.com \ + --password password \ + --password-salt <PASSWORD_SALT> \ + --password-salt-separator <PASSWORD_SALT_SEPARATOR> \ + --password-signer-key <PASSWORD_SIGNER_KEY> diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/console-cli/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..2f911b5891 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-scrypt-user.md @@ -0,0 +1,9 @@ +appwrite users create-scrypt-user \ + --user-id <USER_ID> \ + --email email@example.com \ + --password password \ + --password-salt <PASSWORD_SALT> \ + --password-cpu null \ + --password-memory null \ + --password-parallel null \ + --password-length null diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-session.md b/docs/examples/1.8.x/console-cli/examples/users/create-session.md new file mode 100644 index 0000000000..2644dce0ce --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-session.md @@ -0,0 +1,2 @@ +appwrite users create-session \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-sha-user.md b/docs/examples/1.8.x/console-cli/examples/users/create-sha-user.md new file mode 100644 index 0000000000..6965698f55 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-sha-user.md @@ -0,0 +1,4 @@ +appwrite users create-sha-user \ + --user-id <USER_ID> \ + --email email@example.com \ + --password password diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-target.md b/docs/examples/1.8.x/console-cli/examples/users/create-target.md new file mode 100644 index 0000000000..d0775c9e4d --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-target.md @@ -0,0 +1,5 @@ +appwrite users create-target \ + --user-id <USER_ID> \ + --target-id <TARGET_ID> \ + --provider-type email \ + --identifier <IDENTIFIER> diff --git a/docs/examples/1.8.x/console-cli/examples/users/create-token.md b/docs/examples/1.8.x/console-cli/examples/users/create-token.md new file mode 100644 index 0000000000..30b7812af9 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create-token.md @@ -0,0 +1,2 @@ +appwrite users create-token \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/create.md b/docs/examples/1.8.x/console-cli/examples/users/create.md new file mode 100644 index 0000000000..1103eaf476 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/create.md @@ -0,0 +1,2 @@ +appwrite users create \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/delete-identity.md b/docs/examples/1.8.x/console-cli/examples/users/delete-identity.md new file mode 100644 index 0000000000..602a7d0cd8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/delete-identity.md @@ -0,0 +1,2 @@ +appwrite users delete-identity \ + --identity-id <IDENTITY_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/console-cli/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..a0fcc704c3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,3 @@ +appwrite users delete-mfa-authenticator \ + --user-id <USER_ID> \ + --type totp diff --git a/docs/examples/1.8.x/console-cli/examples/users/delete-session.md b/docs/examples/1.8.x/console-cli/examples/users/delete-session.md new file mode 100644 index 0000000000..f638b83303 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/delete-session.md @@ -0,0 +1,3 @@ +appwrite users delete-session \ + --user-id <USER_ID> \ + --session-id <SESSION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/delete-sessions.md b/docs/examples/1.8.x/console-cli/examples/users/delete-sessions.md new file mode 100644 index 0000000000..eb038cc504 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/delete-sessions.md @@ -0,0 +1,2 @@ +appwrite users delete-sessions \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/delete-target.md b/docs/examples/1.8.x/console-cli/examples/users/delete-target.md new file mode 100644 index 0000000000..e6410dd1f0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/delete-target.md @@ -0,0 +1,3 @@ +appwrite users delete-target \ + --user-id <USER_ID> \ + --target-id <TARGET_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/delete.md b/docs/examples/1.8.x/console-cli/examples/users/delete.md new file mode 100644 index 0000000000..00f8f9c982 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/delete.md @@ -0,0 +1,2 @@ +appwrite users delete \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/console-cli/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..cbb75820c5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,2 @@ +appwrite users get-mfa-recovery-codes \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/get-prefs.md b/docs/examples/1.8.x/console-cli/examples/users/get-prefs.md new file mode 100644 index 0000000000..45d01a6fc3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/get-prefs.md @@ -0,0 +1,2 @@ +appwrite users get-prefs \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/get-target.md b/docs/examples/1.8.x/console-cli/examples/users/get-target.md new file mode 100644 index 0000000000..1be3c0efda --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/get-target.md @@ -0,0 +1,3 @@ +appwrite users get-target \ + --user-id <USER_ID> \ + --target-id <TARGET_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/get-usage.md b/docs/examples/1.8.x/console-cli/examples/users/get-usage.md new file mode 100644 index 0000000000..a4d13e70b9 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/get-usage.md @@ -0,0 +1 @@ +appwrite users get-usage diff --git a/docs/examples/1.8.x/console-cli/examples/users/get.md b/docs/examples/1.8.x/console-cli/examples/users/get.md new file mode 100644 index 0000000000..341844cfc9 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/get.md @@ -0,0 +1,2 @@ +appwrite users get \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/list-identities.md b/docs/examples/1.8.x/console-cli/examples/users/list-identities.md new file mode 100644 index 0000000000..d4fa82f2a6 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/list-identities.md @@ -0,0 +1 @@ +appwrite users list-identities diff --git a/docs/examples/1.8.x/console-cli/examples/users/list-logs.md b/docs/examples/1.8.x/console-cli/examples/users/list-logs.md new file mode 100644 index 0000000000..d2b95beef6 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/list-logs.md @@ -0,0 +1,2 @@ +appwrite users list-logs \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/list-memberships.md b/docs/examples/1.8.x/console-cli/examples/users/list-memberships.md new file mode 100644 index 0000000000..f027e4a2e3 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/list-memberships.md @@ -0,0 +1,2 @@ +appwrite users list-memberships \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/console-cli/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..d2cadf5b6f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/list-mfa-factors.md @@ -0,0 +1,2 @@ +appwrite users list-mfa-factors \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/list-sessions.md b/docs/examples/1.8.x/console-cli/examples/users/list-sessions.md new file mode 100644 index 0000000000..761447a6d1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/list-sessions.md @@ -0,0 +1,2 @@ +appwrite users list-sessions \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/list-targets.md b/docs/examples/1.8.x/console-cli/examples/users/list-targets.md new file mode 100644 index 0000000000..26330e801f --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/list-targets.md @@ -0,0 +1,2 @@ +appwrite users list-targets \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/list.md b/docs/examples/1.8.x/console-cli/examples/users/list.md new file mode 100644 index 0000000000..94057adff1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/list.md @@ -0,0 +1 @@ +appwrite users list diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-email-verification.md b/docs/examples/1.8.x/console-cli/examples/users/update-email-verification.md new file mode 100644 index 0000000000..9f4788aae0 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-email-verification.md @@ -0,0 +1,3 @@ +appwrite users update-email-verification \ + --user-id <USER_ID> \ + --email-verification false diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-email.md b/docs/examples/1.8.x/console-cli/examples/users/update-email.md new file mode 100644 index 0000000000..f02b79de5a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-email.md @@ -0,0 +1,3 @@ +appwrite users update-email \ + --user-id <USER_ID> \ + --email email@example.com diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-labels.md b/docs/examples/1.8.x/console-cli/examples/users/update-labels.md new file mode 100644 index 0000000000..5963768ffc --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-labels.md @@ -0,0 +1,3 @@ +appwrite users update-labels \ + --user-id <USER_ID> \ + --labels one two three diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/console-cli/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..4f63119f5a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,2 @@ +appwrite users update-mfa-recovery-codes \ + --user-id <USER_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-mfa.md b/docs/examples/1.8.x/console-cli/examples/users/update-mfa.md new file mode 100644 index 0000000000..1d36d9e1de --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-mfa.md @@ -0,0 +1,3 @@ +appwrite users update-mfa \ + --user-id <USER_ID> \ + --mfa false diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-name.md b/docs/examples/1.8.x/console-cli/examples/users/update-name.md new file mode 100644 index 0000000000..2f0d0788a5 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-name.md @@ -0,0 +1,3 @@ +appwrite users update-name \ + --user-id <USER_ID> \ + --name <NAME> diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-password.md b/docs/examples/1.8.x/console-cli/examples/users/update-password.md new file mode 100644 index 0000000000..ec320c23cd --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-password.md @@ -0,0 +1,3 @@ +appwrite users update-password \ + --user-id <USER_ID> \ + --password '' diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-phone-verification.md b/docs/examples/1.8.x/console-cli/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..2cf56b2a79 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-phone-verification.md @@ -0,0 +1,3 @@ +appwrite users update-phone-verification \ + --user-id <USER_ID> \ + --phone-verification false diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-phone.md b/docs/examples/1.8.x/console-cli/examples/users/update-phone.md new file mode 100644 index 0000000000..d1b7db3531 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-phone.md @@ -0,0 +1,3 @@ +appwrite users update-phone \ + --user-id <USER_ID> \ + --number +12065550100 diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-prefs.md b/docs/examples/1.8.x/console-cli/examples/users/update-prefs.md new file mode 100644 index 0000000000..b4e27cdadf --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-prefs.md @@ -0,0 +1,3 @@ +appwrite users update-prefs \ + --user-id <USER_ID> \ + --prefs '{ "key": "value" }' diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-status.md b/docs/examples/1.8.x/console-cli/examples/users/update-status.md new file mode 100644 index 0000000000..f7c1bb44e2 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-status.md @@ -0,0 +1,3 @@ +appwrite users update-status \ + --user-id <USER_ID> \ + --status false diff --git a/docs/examples/1.8.x/console-cli/examples/users/update-target.md b/docs/examples/1.8.x/console-cli/examples/users/update-target.md new file mode 100644 index 0000000000..1fa4b7ab7b --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/users/update-target.md @@ -0,0 +1,3 @@ +appwrite users update-target \ + --user-id <USER_ID> \ + --target-id <TARGET_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/vcs/create-repository-detection.md b/docs/examples/1.8.x/console-cli/examples/vcs/create-repository-detection.md new file mode 100644 index 0000000000..d10eac8091 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/vcs/create-repository-detection.md @@ -0,0 +1,4 @@ +appwrite vcs create-repository-detection \ + --installation-id <INSTALLATION_ID> \ + --provider-repository-id <PROVIDER_REPOSITORY_ID> \ + --type runtime diff --git a/docs/examples/1.8.x/console-cli/examples/vcs/create-repository.md b/docs/examples/1.8.x/console-cli/examples/vcs/create-repository.md new file mode 100644 index 0000000000..fa9206cfa2 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/vcs/create-repository.md @@ -0,0 +1,4 @@ +appwrite vcs create-repository \ + --installation-id <INSTALLATION_ID> \ + --name <NAME> \ + --private false diff --git a/docs/examples/1.8.x/console-cli/examples/vcs/delete-installation.md b/docs/examples/1.8.x/console-cli/examples/vcs/delete-installation.md new file mode 100644 index 0000000000..ae9fd335a8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/vcs/delete-installation.md @@ -0,0 +1,2 @@ +appwrite vcs delete-installation \ + --installation-id <INSTALLATION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/vcs/get-installation.md b/docs/examples/1.8.x/console-cli/examples/vcs/get-installation.md new file mode 100644 index 0000000000..e589d60460 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/vcs/get-installation.md @@ -0,0 +1,2 @@ +appwrite vcs get-installation \ + --installation-id <INSTALLATION_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/vcs/get-repository-contents.md b/docs/examples/1.8.x/console-cli/examples/vcs/get-repository-contents.md new file mode 100644 index 0000000000..786d2201f1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/vcs/get-repository-contents.md @@ -0,0 +1,3 @@ +appwrite vcs get-repository-contents \ + --installation-id <INSTALLATION_ID> \ + --provider-repository-id <PROVIDER_REPOSITORY_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/vcs/get-repository.md b/docs/examples/1.8.x/console-cli/examples/vcs/get-repository.md new file mode 100644 index 0000000000..10ab55500c --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/vcs/get-repository.md @@ -0,0 +1,3 @@ +appwrite vcs get-repository \ + --installation-id <INSTALLATION_ID> \ + --provider-repository-id <PROVIDER_REPOSITORY_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/vcs/list-installations.md b/docs/examples/1.8.x/console-cli/examples/vcs/list-installations.md new file mode 100644 index 0000000000..92e13bf0b8 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/vcs/list-installations.md @@ -0,0 +1 @@ +appwrite vcs list-installations diff --git a/docs/examples/1.8.x/console-cli/examples/vcs/list-repositories.md b/docs/examples/1.8.x/console-cli/examples/vcs/list-repositories.md new file mode 100644 index 0000000000..7a3214074a --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/vcs/list-repositories.md @@ -0,0 +1,3 @@ +appwrite vcs list-repositories \ + --installation-id <INSTALLATION_ID> \ + --type runtime diff --git a/docs/examples/1.8.x/console-cli/examples/vcs/list-repository-branches.md b/docs/examples/1.8.x/console-cli/examples/vcs/list-repository-branches.md new file mode 100644 index 0000000000..c6036731b1 --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/vcs/list-repository-branches.md @@ -0,0 +1,3 @@ +appwrite vcs list-repository-branches \ + --installation-id <INSTALLATION_ID> \ + --provider-repository-id <PROVIDER_REPOSITORY_ID> diff --git a/docs/examples/1.8.x/console-cli/examples/vcs/update-external-deployments.md b/docs/examples/1.8.x/console-cli/examples/vcs/update-external-deployments.md new file mode 100644 index 0000000000..f83891cb3e --- /dev/null +++ b/docs/examples/1.8.x/console-cli/examples/vcs/update-external-deployments.md @@ -0,0 +1,4 @@ +appwrite vcs update-external-deployments \ + --installation-id <INSTALLATION_ID> \ + --repository-id <REPOSITORY_ID> \ + --provider-pull-request-id <PROVIDER_PULL_REQUEST_ID> diff --git a/docs/examples/1.8.x/console-web/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/console-web/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..113f882e80 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-anonymous-session.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createAnonymousSession(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-email-password-session.md b/docs/examples/1.8.x/console-web/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..d8766a4da9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-email-password-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailPasswordSession({ + email: 'email@example.com', + password: 'password' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-email-token.md b/docs/examples/1.8.x/console-web/examples/account/create-email-token.md new file mode 100644 index 0000000000..12e7fb9365 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-email-token.md @@ -0,0 +1,15 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailToken({ + userId: '<USER_ID>', + email: 'email@example.com', + phrase: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-jwt.md b/docs/examples/1.8.x/console-web/examples/account/create-jwt.md new file mode 100644 index 0000000000..9fc0e6da5e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-jwt.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createJWT(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/console-web/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..7f3cd722ea --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-magic-url-token.md @@ -0,0 +1,16 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMagicURLToken({ + userId: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/console-web/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..7d3a01011f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-mfa-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticatorType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAAuthenticator({ + type: AuthenticatorType.Totp +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/console-web/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..3bea832ffd --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-mfa-challenge.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticationFactor } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMFAChallenge({ + factor: AuthenticationFactor.Email +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/console-web/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..d5ec4aaffb --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createMFARecoveryCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-o-auth-2-session.md b/docs/examples/1.8.x/console-web/examples/account/create-o-auth-2-session.md new file mode 100644 index 0000000000..10270fc64f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-o-auth-2-session.md @@ -0,0 +1,15 @@ +import { Client, Account, OAuthProvider } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +account.createOAuth2Session({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [] // optional +}); + diff --git a/docs/examples/1.8.x/console-web/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/console-web/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..15c0d5b440 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-o-auth-2-token.md @@ -0,0 +1,15 @@ +import { Client, Account, OAuthProvider } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +account.createOAuth2Token({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [] // optional +}); + diff --git a/docs/examples/1.8.x/console-web/examples/account/create-phone-token.md b/docs/examples/1.8.x/console-web/examples/account/create-phone-token.md new file mode 100644 index 0000000000..192a83f6ad --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-phone-token.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneToken({ + userId: '<USER_ID>', + phone: '+12065550100' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-phone-verification.md b/docs/examples/1.8.x/console-web/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..03185e3e91 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-phone-verification.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneVerification(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-push-target.md b/docs/examples/1.8.x/console-web/examples/account/create-push-target.md new file mode 100644 index 0000000000..d4add51faa --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-push-target.md @@ -0,0 +1,15 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createPushTarget({ + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-recovery.md b/docs/examples/1.8.x/console-web/examples/account/create-recovery.md new file mode 100644 index 0000000000..e7699db34a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-recovery.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createRecovery({ + email: 'email@example.com', + url: 'https://example.com' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-session.md b/docs/examples/1.8.x/console-web/examples/account/create-session.md new file mode 100644 index 0000000000..74e8917612 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create-verification.md b/docs/examples/1.8.x/console-web/examples/account/create-verification.md new file mode 100644 index 0000000000..bc873b5263 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create-verification.md @@ -0,0 +1,13 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.createVerification({ + url: 'https://example.com' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/create.md b/docs/examples/1.8.x/console-web/examples/account/create.md new file mode 100644 index 0000000000..d379255361 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/create.md @@ -0,0 +1,16 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.create({ + userId: '<USER_ID>', + email: 'email@example.com', + password: '', + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/delete-identity.md b/docs/examples/1.8.x/console-web/examples/account/delete-identity.md new file mode 100644 index 0000000000..c5bcd94525 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/delete-identity.md @@ -0,0 +1,13 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteIdentity({ + identityId: '<IDENTITY_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/console-web/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..5d6cfd9a3a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticatorType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteMFAAuthenticator({ + type: AuthenticatorType.Totp +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/delete-push-target.md b/docs/examples/1.8.x/console-web/examples/account/delete-push-target.md new file mode 100644 index 0000000000..546813a3f6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/delete-push-target.md @@ -0,0 +1,13 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deletePushTarget({ + targetId: '<TARGET_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/delete-session.md b/docs/examples/1.8.x/console-web/examples/account/delete-session.md new file mode 100644 index 0000000000..83bc337294 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/delete-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSession({ + sessionId: '<SESSION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/delete-sessions.md b/docs/examples/1.8.x/console-web/examples/account/delete-sessions.md new file mode 100644 index 0000000000..b9904d612f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/delete-sessions.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSessions(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/delete.md b/docs/examples/1.8.x/console-web/examples/account/delete.md new file mode 100644 index 0000000000..2fc730f9f0 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/delete.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.delete(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/console-web/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..a8c7810d78 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.getMFARecoveryCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/get-prefs.md b/docs/examples/1.8.x/console-web/examples/account/get-prefs.md new file mode 100644 index 0000000000..3a013e6615 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/get-prefs.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.getPrefs(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/get-session.md b/docs/examples/1.8.x/console-web/examples/account/get-session.md new file mode 100644 index 0000000000..803966f165 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/get-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.getSession({ + sessionId: '<SESSION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/get.md b/docs/examples/1.8.x/console-web/examples/account/get.md new file mode 100644 index 0000000000..35661e483b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/get.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.get(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/list-identities.md b/docs/examples/1.8.x/console-web/examples/account/list-identities.md new file mode 100644 index 0000000000..a41b9012e7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/list-identities.md @@ -0,0 +1,13 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listIdentities({ + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/list-logs.md b/docs/examples/1.8.x/console-web/examples/account/list-logs.md new file mode 100644 index 0000000000..9dd9339b7c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/list-logs.md @@ -0,0 +1,13 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listLogs({ + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/console-web/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..078503a678 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/list-mfa-factors.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listMFAFactors(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/list-sessions.md b/docs/examples/1.8.x/console-web/examples/account/list-sessions.md new file mode 100644 index 0000000000..6a24e372c5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/list-sessions.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.listSessions(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-email.md b/docs/examples/1.8.x/console-web/examples/account/update-email.md new file mode 100644 index 0000000000..f6631646aa --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-email.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateEmail({ + email: 'email@example.com', + password: 'password' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/console-web/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..7c58ca4db9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-magic-url-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMagicURLSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/console-web/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..b6aa383de3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-mfa-authenticator.md @@ -0,0 +1,14 @@ +import { Client, Account, AuthenticatorType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAAuthenticator({ + type: AuthenticatorType.Totp, + otp: '<OTP>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/console-web/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..d82e58326f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-mfa-challenge.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFAChallenge({ + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/console-web/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..d359a4ee3d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFARecoveryCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-mfa.md b/docs/examples/1.8.x/console-web/examples/account/update-mfa.md new file mode 100644 index 0000000000..f62374c57e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-mfa.md @@ -0,0 +1,13 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFA({ + mfa: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-name.md b/docs/examples/1.8.x/console-web/examples/account/update-name.md new file mode 100644 index 0000000000..c370197036 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-name.md @@ -0,0 +1,13 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateName({ + name: '<NAME>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-password.md b/docs/examples/1.8.x/console-web/examples/account/update-password.md new file mode 100644 index 0000000000..9e2d367dd2 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-password.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePassword({ + password: '', + oldPassword: 'password' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-phone-session.md b/docs/examples/1.8.x/console-web/examples/account/update-phone-session.md new file mode 100644 index 0000000000..8be5b8e43d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-phone-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-phone-verification.md b/docs/examples/1.8.x/console-web/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..0b1b91374f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-phone-verification.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneVerification({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-phone.md b/docs/examples/1.8.x/console-web/examples/account/update-phone.md new file mode 100644 index 0000000000..19bfd15360 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-phone.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhone({ + phone: '+12065550100', + password: 'password' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-prefs.md b/docs/examples/1.8.x/console-web/examples/account/update-prefs.md new file mode 100644 index 0000000000..cebe1da948 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-prefs.md @@ -0,0 +1,17 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePrefs({ + prefs: { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-push-target.md b/docs/examples/1.8.x/console-web/examples/account/update-push-target.md new file mode 100644 index 0000000000..b9c52b872c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-push-target.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePushTarget({ + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-recovery.md b/docs/examples/1.8.x/console-web/examples/account/update-recovery.md new file mode 100644 index 0000000000..17fe29b7b3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-recovery.md @@ -0,0 +1,15 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateRecovery({ + userId: '<USER_ID>', + secret: '<SECRET>', + password: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-session.md b/docs/examples/1.8.x/console-web/examples/account/update-session.md new file mode 100644 index 0000000000..3f331b1064 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateSession({ + sessionId: '<SESSION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-status.md b/docs/examples/1.8.x/console-web/examples/account/update-status.md new file mode 100644 index 0000000000..c1377dc4a6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-status.md @@ -0,0 +1,11 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateStatus(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/account/update-verification.md b/docs/examples/1.8.x/console-web/examples/account/update-verification.md new file mode 100644 index 0000000000..8d254c1014 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/account/update-verification.md @@ -0,0 +1,14 @@ +import { Client, Account } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const result = await account.updateVerification({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/assistant/chat.md b/docs/examples/1.8.x/console-web/examples/assistant/chat.md new file mode 100644 index 0000000000..868e3edbe4 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/assistant/chat.md @@ -0,0 +1,13 @@ +import { Client, Assistant } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const assistant = new Assistant(client); + +const result = await assistant.chat({ + prompt: '<PROMPT>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/avatars/get-browser.md b/docs/examples/1.8.x/console-web/examples/avatars/get-browser.md new file mode 100644 index 0000000000..954dd5dfef --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/avatars/get-browser.md @@ -0,0 +1,16 @@ +import { Client, Avatars, Browser } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getBrowser({ + code: Browser.AvantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/console-web/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..d81b6177c4 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/avatars/get-credit-card.md @@ -0,0 +1,16 @@ +import { Client, Avatars, CreditCard } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getCreditCard({ + code: CreditCard.AmericanExpress, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/avatars/get-favicon.md b/docs/examples/1.8.x/console-web/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..40daf096e7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/avatars/get-favicon.md @@ -0,0 +1,13 @@ +import { Client, Avatars } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFavicon({ + url: 'https://example.com' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/avatars/get-flag.md b/docs/examples/1.8.x/console-web/examples/avatars/get-flag.md new file mode 100644 index 0000000000..36c746894c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/avatars/get-flag.md @@ -0,0 +1,16 @@ +import { Client, Avatars, Flag } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFlag({ + code: Flag.Afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/avatars/get-image.md b/docs/examples/1.8.x/console-web/examples/avatars/get-image.md new file mode 100644 index 0000000000..fc7fb40222 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/avatars/get-image.md @@ -0,0 +1,15 @@ +import { Client, Avatars } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getImage({ + url: 'https://example.com', + width: 0, // optional + height: 0 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/avatars/get-initials.md b/docs/examples/1.8.x/console-web/examples/avatars/get-initials.md new file mode 100644 index 0000000000..117bc5046c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/avatars/get-initials.md @@ -0,0 +1,16 @@ +import { Client, Avatars } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getInitials({ + name: '<NAME>', // optional + width: 0, // optional + height: 0, // optional + background: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/avatars/get-qr.md b/docs/examples/1.8.x/console-web/examples/avatars/get-qr.md new file mode 100644 index 0000000000..dc1bad5727 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/avatars/get-qr.md @@ -0,0 +1,16 @@ +import { Client, Avatars } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getQR({ + text: '<TEXT>', + size: 1, // optional + margin: 0, // optional + download: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/console/get-resource.md b/docs/examples/1.8.x/console-web/examples/console/get-resource.md new file mode 100644 index 0000000000..eb687a827e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/console/get-resource.md @@ -0,0 +1,14 @@ +import { Client, Console, ConsoleResourceType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const console = new Console(client); + +const result = await console.getResource({ + value: '<VALUE>', + type: ConsoleResourceType.Rules +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/console/variables.md b/docs/examples/1.8.x/console-web/examples/console/variables.md new file mode 100644 index 0000000000..1dce6c0260 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/console/variables.md @@ -0,0 +1,11 @@ +import { Client, Console } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const console = new Console(client); + +const result = await console.variables(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..4a5a080f29 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-boolean-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createBooleanAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: false, // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-collection.md b/docs/examples/1.8.x/console-web/examples/databases/create-collection.md new file mode 100644 index 0000000000..f3c2efaaee --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-collection.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..a881eeb14f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-datetime-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDatetimeAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-document.md b/docs/examples/1.8.x/console-web/examples/databases/create-document.md new file mode 100644 index 0000000000..40fbd4ad85 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-document.md @@ -0,0 +1,23 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-documents.md b/docs/examples/1.8.x/console-web/examples/databases/create-documents.md new file mode 100644 index 0000000000..901133ac0a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-documents.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [] +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..cf998a388e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-email-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createEmailAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'email@example.com', // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..f9cacb3721 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-enum-attribute.md @@ -0,0 +1,19 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createEnumAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..00fb992d55 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-float-attribute.md @@ -0,0 +1,20 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createFloatAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-index.md b/docs/examples/1.8.x/console-web/examples/databases/create-index.md new file mode 100644 index 0000000000..82af4171f6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-index.md @@ -0,0 +1,19 @@ +import { Client, Databases, IndexType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + type: IndexType.Key, + attributes: [], + orders: [], // optional + lengths: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..a5a186b0bc --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-integer-attribute.md @@ -0,0 +1,20 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createIntegerAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..940f51f33e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-ip-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createIpAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..113ccc8028 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-line-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createLineAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..8e24fb9c0f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-point-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createPointAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [1, 2] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..82c2e519f0 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-polygon-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createPolygonAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..6a0e39b402 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-relationship-attribute.md @@ -0,0 +1,20 @@ +import { Client, Databases, RelationshipType, RelationMutate } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createRelationshipAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + relatedCollectionId: '<RELATED_COLLECTION_ID>', + type: RelationshipType.OneToOne, + twoWay: false, // optional + key: '', // optional + twoWayKey: '', // optional + onDelete: RelationMutate.Cascade // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..5457b159ca --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-string-attribute.md @@ -0,0 +1,20 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createStringAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + size: 1, + required: false, + default: '<DEFAULT>', // optional + array: false, // optional + encrypt: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..085af6c61c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create-url-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createUrlAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'https://example.com', // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/create.md b/docs/examples/1.8.x/console-web/examples/databases/create.md new file mode 100644 index 0000000000..ff1f739c57 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/create.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..ec014643bb --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.decrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + min: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/delete-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..6370b447c5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/delete-attribute.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/delete-collection.md b/docs/examples/1.8.x/console-web/examples/databases/delete-collection.md new file mode 100644 index 0000000000..ec9e8e3455 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/delete-collection.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/delete-document.md b/docs/examples/1.8.x/console-web/examples/databases/delete-document.md new file mode 100644 index 0000000000..11cf317147 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/delete-document.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/delete-documents.md b/docs/examples/1.8.x/console-web/examples/databases/delete-documents.md new file mode 100644 index 0000000000..45601a5985 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/delete-documents.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/delete-index.md b/docs/examples/1.8.x/console-web/examples/databases/delete-index.md new file mode 100644 index 0000000000..47e88ab3e9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/delete-index.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/delete.md b/docs/examples/1.8.x/console-web/examples/databases/delete.md new file mode 100644 index 0000000000..4edf39c5d5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/delete.md @@ -0,0 +1,13 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.delete({ + databaseId: '<DATABASE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/get-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/get-attribute.md new file mode 100644 index 0000000000..ba5c561a92 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/get-attribute.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/get-collection-usage.md b/docs/examples/1.8.x/console-web/examples/databases/get-collection-usage.md new file mode 100644 index 0000000000..c4fc5c264d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/get-collection-usage.md @@ -0,0 +1,15 @@ +import { Client, Databases, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getCollectionUsage({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/get-collection.md b/docs/examples/1.8.x/console-web/examples/databases/get-collection.md new file mode 100644 index 0000000000..4e31e9e7b1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/get-collection.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/get-document.md b/docs/examples/1.8.x/console-web/examples/databases/get-document.md new file mode 100644 index 0000000000..00595b1033 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/get-document.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/get-index.md b/docs/examples/1.8.x/console-web/examples/databases/get-index.md new file mode 100644 index 0000000000..73f61b8766 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/get-index.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/get-usage.md b/docs/examples/1.8.x/console-web/examples/databases/get-usage.md new file mode 100644 index 0000000000..b4cdcbd849 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/get-usage.md @@ -0,0 +1,14 @@ +import { Client, Databases, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getUsage({ + databaseId: '<DATABASE_ID>', + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/get.md b/docs/examples/1.8.x/console-web/examples/databases/get.md new file mode 100644 index 0000000000..a1c4573962 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/get.md @@ -0,0 +1,13 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.get({ + databaseId: '<DATABASE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..2207e94563 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.incrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + max: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/list-attributes.md b/docs/examples/1.8.x/console-web/examples/databases/list-attributes.md new file mode 100644 index 0000000000..cebeaf2121 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/list-attributes.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listAttributes({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/list-collection-logs.md b/docs/examples/1.8.x/console-web/examples/databases/list-collection-logs.md new file mode 100644 index 0000000000..291b77f668 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/list-collection-logs.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listCollectionLogs({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/list-collections.md b/docs/examples/1.8.x/console-web/examples/databases/list-collections.md new file mode 100644 index 0000000000..bb53f9875c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/list-collections.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listCollections({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/list-document-logs.md b/docs/examples/1.8.x/console-web/examples/databases/list-document-logs.md new file mode 100644 index 0000000000..8de4b4eab5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/list-document-logs.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listDocumentLogs({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/list-documents.md b/docs/examples/1.8.x/console-web/examples/databases/list-documents.md new file mode 100644 index 0000000000..dda036951c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/list-documents.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/list-indexes.md b/docs/examples/1.8.x/console-web/examples/databases/list-indexes.md new file mode 100644 index 0000000000..6aa4d33299 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/list-indexes.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listIndexes({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/list-logs.md b/docs/examples/1.8.x/console-web/examples/databases/list-logs.md new file mode 100644 index 0000000000..a7726312f6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/list-logs.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listLogs({ + databaseId: '<DATABASE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/list-usage.md b/docs/examples/1.8.x/console-web/examples/databases/list-usage.md new file mode 100644 index 0000000000..ce6203cbb1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/list-usage.md @@ -0,0 +1,13 @@ +import { Client, Databases, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listUsage({ + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/list.md b/docs/examples/1.8.x/console-web/examples/databases/list.md new file mode 100644 index 0000000000..79292dbacf --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/list.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..85b6138287 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-boolean-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateBooleanAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: false, + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-collection.md b/docs/examples/1.8.x/console-web/examples/databases/update-collection.md new file mode 100644 index 0000000000..83763e4509 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-collection.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..2f9a8e065a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-datetime-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDatetimeAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-document.md b/docs/examples/1.8.x/console-web/examples/databases/update-document.md new file mode 100644 index 0000000000..168ad11bda --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-document.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-documents.md b/docs/examples/1.8.x/console-web/examples/databases/update-documents.md new file mode 100644 index 0000000000..7462502c81 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-documents.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: {}, // optional + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..c5fa3de6e9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-email-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateEmailAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'email@example.com', + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..65e0931eeb --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-enum-attribute.md @@ -0,0 +1,19 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateEnumAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..1526c98f03 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-float-attribute.md @@ -0,0 +1,20 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateFloatAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..01b063006f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-integer-attribute.md @@ -0,0 +1,20 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateIntegerAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..85506d6f1a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-ip-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateIpAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..85190fc085 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-line-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateLineAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..ec4a2c02c1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-point-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updatePointAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [1, 2], // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..4fa9eb197b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-polygon-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updatePolygonAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..8a7340af4e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-relationship-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases, RelationMutate } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateRelationshipAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + onDelete: RelationMutate.Cascade, // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..aeb3753428 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-string-attribute.md @@ -0,0 +1,19 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateStringAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '<DEFAULT>', + size: 1, // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/console-web/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..75171f0206 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update-url-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateUrlAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'https://example.com', + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/update.md b/docs/examples/1.8.x/console-web/examples/databases/update.md new file mode 100644 index 0000000000..40cea93299 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/update.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/upsert-document.md b/docs/examples/1.8.x/console-web/examples/databases/upsert-document.md new file mode 100644 index 0000000000..3f8705f7c8 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/upsert-document.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.upsertDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/databases/upsert-documents.md b/docs/examples/1.8.x/console-web/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..b045516281 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/databases/upsert-documents.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.upsertDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [] +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/create-deployment.md b/docs/examples/1.8.x/console-web/examples/functions/create-deployment.md new file mode 100644 index 0000000000..ff9be3c80f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/create-deployment.md @@ -0,0 +1,17 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createDeployment({ + functionId: '<FUNCTION_ID>', + code: document.getElementById('uploader').files[0], + activate: false, + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/console-web/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..05da2af37b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,15 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createDuplicateDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + buildId: '<BUILD_ID>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/create-execution.md b/docs/examples/1.8.x/console-web/examples/functions/create-execution.md new file mode 100644 index 0000000000..d4015d46e1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/create-execution.md @@ -0,0 +1,19 @@ +import { Client, Functions, ExecutionMethod } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createExecution({ + functionId: '<FUNCTION_ID>', + body: '<BODY>', // optional + async: false, // optional + path: '<PATH>', // optional + method: ExecutionMethod.GET, // optional + headers: {}, // optional + scheduledAt: '<SCHEDULED_AT>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/console-web/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..8820ba3565 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/create-template-deployment.md @@ -0,0 +1,18 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createTemplateDeployment({ + functionId: '<FUNCTION_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/create-variable.md b/docs/examples/1.8.x/console-web/examples/functions/create-variable.md new file mode 100644 index 0000000000..28cfb8877f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/create-variable.md @@ -0,0 +1,16 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createVariable({ + functionId: '<FUNCTION_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/console-web/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..33da9bfd70 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/create-vcs-deployment.md @@ -0,0 +1,16 @@ +import { Client, Functions, VCSDeploymentType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createVcsDeployment({ + functionId: '<FUNCTION_ID>', + type: VCSDeploymentType.Branch, + reference: '<REFERENCE>', + activate: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/create.md b/docs/examples/1.8.x/console-web/examples/functions/create.md new file mode 100644 index 0000000000..b3ebbaf5a4 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/create.md @@ -0,0 +1,30 @@ +import { Client, Functions, } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.create({ + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: .Node145, + execute: ["any"], // optional + events: [], // optional + schedule: '', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/delete-deployment.md b/docs/examples/1.8.x/console-web/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..6558690f2f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/delete-deployment.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.deleteDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/delete-execution.md b/docs/examples/1.8.x/console-web/examples/functions/delete-execution.md new file mode 100644 index 0000000000..2791eea9b6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/delete-execution.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.deleteExecution({ + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/delete-variable.md b/docs/examples/1.8.x/console-web/examples/functions/delete-variable.md new file mode 100644 index 0000000000..369cdd6cff --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/delete-variable.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.deleteVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/delete.md b/docs/examples/1.8.x/console-web/examples/functions/delete.md new file mode 100644 index 0000000000..6cad721da9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/delete.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.delete({ + functionId: '<FUNCTION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/console-web/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..82f8881929 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/get-deployment-download.md @@ -0,0 +1,15 @@ +import { Client, Functions, DeploymentDownloadType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = functions.getDeploymentDownload({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType.Source // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/get-deployment.md b/docs/examples/1.8.x/console-web/examples/functions/get-deployment.md new file mode 100644 index 0000000000..483b3eb6a8 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/get-deployment.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/get-execution.md b/docs/examples/1.8.x/console-web/examples/functions/get-execution.md new file mode 100644 index 0000000000..29a7357415 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/get-execution.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getExecution({ + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/get-template.md b/docs/examples/1.8.x/console-web/examples/functions/get-template.md new file mode 100644 index 0000000000..031f9536d3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/get-template.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getTemplate({ + templateId: '<TEMPLATE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/get-usage.md b/docs/examples/1.8.x/console-web/examples/functions/get-usage.md new file mode 100644 index 0000000000..ffba26f4d9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/get-usage.md @@ -0,0 +1,14 @@ +import { Client, Functions, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getUsage({ + functionId: '<FUNCTION_ID>', + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/get-variable.md b/docs/examples/1.8.x/console-web/examples/functions/get-variable.md new file mode 100644 index 0000000000..d813d1250c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/get-variable.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/get.md b/docs/examples/1.8.x/console-web/examples/functions/get.md new file mode 100644 index 0000000000..4a5126b29e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/get.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.get({ + functionId: '<FUNCTION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/list-deployments.md b/docs/examples/1.8.x/console-web/examples/functions/list-deployments.md new file mode 100644 index 0000000000..becb2cf9cd --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/list-deployments.md @@ -0,0 +1,15 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listDeployments({ + functionId: '<FUNCTION_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/list-executions.md b/docs/examples/1.8.x/console-web/examples/functions/list-executions.md new file mode 100644 index 0000000000..f11089c16e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/list-executions.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listExecutions({ + functionId: '<FUNCTION_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/list-runtimes.md b/docs/examples/1.8.x/console-web/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..cdd1e08cad --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/list-runtimes.md @@ -0,0 +1,11 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listRuntimes(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/list-specifications.md b/docs/examples/1.8.x/console-web/examples/functions/list-specifications.md new file mode 100644 index 0000000000..fe671c54bb --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/list-specifications.md @@ -0,0 +1,11 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listSpecifications(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/list-templates.md b/docs/examples/1.8.x/console-web/examples/functions/list-templates.md new file mode 100644 index 0000000000..e98df543b3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/list-templates.md @@ -0,0 +1,16 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listTemplates({ + runtimes: [], // optional + useCases: [], // optional + limit: 1, // optional + offset: 0 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/list-usage.md b/docs/examples/1.8.x/console-web/examples/functions/list-usage.md new file mode 100644 index 0000000000..42035ec8f1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/list-usage.md @@ -0,0 +1,13 @@ +import { Client, Functions, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listUsage({ + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/list-variables.md b/docs/examples/1.8.x/console-web/examples/functions/list-variables.md new file mode 100644 index 0000000000..c5fdc226d1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/list-variables.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listVariables({ + functionId: '<FUNCTION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/list.md b/docs/examples/1.8.x/console-web/examples/functions/list.md new file mode 100644 index 0000000000..67e9db30dc --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/list.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/console-web/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..e9da320ef7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/update-deployment-status.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.updateDeploymentStatus({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/console-web/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..c249a279cf --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/update-function-deployment.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.updateFunctionDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/update-variable.md b/docs/examples/1.8.x/console-web/examples/functions/update-variable.md new file mode 100644 index 0000000000..6e1366ca0a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/update-variable.md @@ -0,0 +1,17 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.updateVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', // optional + secret: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/functions/update.md b/docs/examples/1.8.x/console-web/examples/functions/update.md new file mode 100644 index 0000000000..377712bfb7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/functions/update.md @@ -0,0 +1,30 @@ +import { Client, Functions, } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.update({ + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: .Node145, // optional + execute: ["any"], // optional + events: [], // optional + schedule: '', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/graphql/mutation.md b/docs/examples/1.8.x/console-web/examples/graphql/mutation.md new file mode 100644 index 0000000000..24c30e25a6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/graphql/mutation.md @@ -0,0 +1,13 @@ +import { Client, Graphql } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.mutation({ + query: {} +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/graphql/query.md b/docs/examples/1.8.x/console-web/examples/graphql/query.md new file mode 100644 index 0000000000..f4b8ac9b3d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/graphql/query.md @@ -0,0 +1,13 @@ +import { Client, Graphql } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.query({ + query: {} +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-antivirus.md b/docs/examples/1.8.x/console-web/examples/health/get-antivirus.md new file mode 100644 index 0000000000..30e142a63d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-antivirus.md @@ -0,0 +1,11 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getAntivirus(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-cache.md b/docs/examples/1.8.x/console-web/examples/health/get-cache.md new file mode 100644 index 0000000000..1c0bb182e2 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-cache.md @@ -0,0 +1,11 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getCache(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-certificate.md b/docs/examples/1.8.x/console-web/examples/health/get-certificate.md new file mode 100644 index 0000000000..ebff42e2fa --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-certificate.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getCertificate({ + domain: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-db.md b/docs/examples/1.8.x/console-web/examples/health/get-db.md new file mode 100644 index 0000000000..855e73466c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-db.md @@ -0,0 +1,11 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getDB(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/console-web/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..d0bac0cd6f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-failed-jobs.md @@ -0,0 +1,14 @@ +import { Client, Health, } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getFailedJobs({ + name: .V1Database, + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-pub-sub.md b/docs/examples/1.8.x/console-web/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..0ccce8e4d8 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-pub-sub.md @@ -0,0 +1,11 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getPubSub(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-builds.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..a9edbe1c7f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-builds.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueBuilds({ + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..fb4656723f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-certificates.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueCertificates({ + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-databases.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..6209742ce7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-databases.md @@ -0,0 +1,14 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueDatabases({ + name: '<NAME>', // optional + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..fcbb5b5e85 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-deletes.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueDeletes({ + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-functions.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..c169fd946b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-functions.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueFunctions({ + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-logs.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..e71d80895e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-logs.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueLogs({ + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-mails.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..fcb82acfa3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-mails.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueMails({ + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..63d58e2363 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-messaging.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueMessaging({ + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..3fa3110d7f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-migrations.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueMigrations({ + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..198b1558e8 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-stats-resources.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueStatsResources({ + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-usage.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..e80c0d8bc1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-usage.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueUsage({ + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/console-web/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..23a0169320 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-queue-webhooks.md @@ -0,0 +1,13 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getQueueWebhooks({ + threshold: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-storage-local.md b/docs/examples/1.8.x/console-web/examples/health/get-storage-local.md new file mode 100644 index 0000000000..e6bdf62c50 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-storage-local.md @@ -0,0 +1,11 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getStorageLocal(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-storage.md b/docs/examples/1.8.x/console-web/examples/health/get-storage.md new file mode 100644 index 0000000000..1d8941490e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-storage.md @@ -0,0 +1,11 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getStorage(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get-time.md b/docs/examples/1.8.x/console-web/examples/health/get-time.md new file mode 100644 index 0000000000..826eaf5a8c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get-time.md @@ -0,0 +1,11 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.getTime(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/health/get.md b/docs/examples/1.8.x/console-web/examples/health/get.md new file mode 100644 index 0000000000..b510d8a891 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/health/get.md @@ -0,0 +1,11 @@ +import { Client, Health } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const health = new Health(client); + +const result = await health.get(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/locale/get.md b/docs/examples/1.8.x/console-web/examples/locale/get.md new file mode 100644 index 0000000000..4b0331787e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/locale/get.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.get(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/locale/list-codes.md b/docs/examples/1.8.x/console-web/examples/locale/list-codes.md new file mode 100644 index 0000000000..d20399af4a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/locale/list-codes.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCodes(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/locale/list-continents.md b/docs/examples/1.8.x/console-web/examples/locale/list-continents.md new file mode 100644 index 0000000000..d769e88f1c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/locale/list-continents.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listContinents(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/console-web/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..ce8746421b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/locale/list-countries-eu.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesEU(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/console-web/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..457867707c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/locale/list-countries-phones.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesPhones(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/locale/list-countries.md b/docs/examples/1.8.x/console-web/examples/locale/list-countries.md new file mode 100644 index 0000000000..298e25ee81 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/locale/list-countries.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountries(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/locale/list-currencies.md b/docs/examples/1.8.x/console-web/examples/locale/list-currencies.md new file mode 100644 index 0000000000..05ff041cbb --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/locale/list-currencies.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCurrencies(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/locale/list-languages.md b/docs/examples/1.8.x/console-web/examples/locale/list-languages.md new file mode 100644 index 0000000000..1a2db31b55 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/locale/list-languages.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listLanguages(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..4b65337d49 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-apns-provider.md @@ -0,0 +1,20 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createAPNSProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false, // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-email.md b/docs/examples/1.8.x/console-web/examples/messaging/create-email.md new file mode 100644 index 0000000000..fa84304cc6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-email.md @@ -0,0 +1,24 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createEmail({ + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + attachments: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..6586ffbc5e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-fcm-provider.md @@ -0,0 +1,16 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + serviceAccountJSON: {}, // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..10c58cc7b6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,22 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + domain: '<DOMAIN>', // optional + isEuRegion: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..7efa2df1be --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>', // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-push.md b/docs/examples/1.8.x/console-web/examples/messaging/create-push.md new file mode 100644 index 0000000000..f0f54aa72f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-push.md @@ -0,0 +1,31 @@ +import { Client, Messaging, MessagePriority } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createPush({ + messageId: '<MESSAGE_ID>', + title: '<TITLE>', // optional + body: '<BODY>', // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '[ID1:ID2]', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: null, // optional + draft: false, // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..51b6096e64 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,20 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-sms.md b/docs/examples/1.8.x/console-web/examples/messaging/create-sms.md new file mode 100644 index 0000000000..3130ee8835 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-sms.md @@ -0,0 +1,19 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSMS({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..77033deae2 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-smtp-provider.md @@ -0,0 +1,26 @@ +import { Client, Messaging, SmtpEncryption } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 1, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/console-web/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..2c2796a289 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-subscriber.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..9e5d344964 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-telesign-provider.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..fc48d32d01 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-topic.md b/docs/examples/1.8.x/console-web/examples/messaging/create-topic.md new file mode 100644 index 0000000000..4fb72cbeb3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-topic.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ["any"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..9997303d69 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-twilio-provider.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..342922cb03 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/create-vonage-provider.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/delete-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..cb173c8077 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/delete-provider.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteProvider({ + providerId: '<PROVIDER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/console-web/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..67c0865605 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/delete-subscriber.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/delete-topic.md b/docs/examples/1.8.x/console-web/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..de14ac49f6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/delete-topic.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteTopic({ + topicId: '<TOPIC_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/delete.md b/docs/examples/1.8.x/console-web/examples/messaging/delete.md new file mode 100644 index 0000000000..8eaef5ce5f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/delete.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.delete({ + messageId: '<MESSAGE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/get-message.md b/docs/examples/1.8.x/console-web/examples/messaging/get-message.md new file mode 100644 index 0000000000..32b9306033 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/get-message.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.getMessage({ + messageId: '<MESSAGE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/get-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/get-provider.md new file mode 100644 index 0000000000..579018678d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/get-provider.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.getProvider({ + providerId: '<PROVIDER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/console-web/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..985fe87013 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/get-subscriber.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.getSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/get-topic.md b/docs/examples/1.8.x/console-web/examples/messaging/get-topic.md new file mode 100644 index 0000000000..9ec0a0d66d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/get-topic.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.getTopic({ + topicId: '<TOPIC_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/console-web/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..1ad57feadf --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/list-message-logs.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listMessageLogs({ + messageId: '<MESSAGE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/list-messages.md b/docs/examples/1.8.x/console-web/examples/messaging/list-messages.md new file mode 100644 index 0000000000..b003dc219e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/list-messages.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listMessages({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/console-web/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..c40c50899e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/list-provider-logs.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listProviderLogs({ + providerId: '<PROVIDER_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/list-providers.md b/docs/examples/1.8.x/console-web/examples/messaging/list-providers.md new file mode 100644 index 0000000000..f45da6437e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/list-providers.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listProviders({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/console-web/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..34fea03b79 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listSubscriberLogs({ + subscriberId: '<SUBSCRIBER_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/console-web/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..afe8374f9f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/list-subscribers.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listSubscribers({ + topicId: '<TOPIC_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/list-targets.md b/docs/examples/1.8.x/console-web/examples/messaging/list-targets.md new file mode 100644 index 0000000000..eb9ae44a0c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/list-targets.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listTargets({ + messageId: '<MESSAGE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/console-web/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..e44e2643e7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/list-topic-logs.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listTopicLogs({ + topicId: '<TOPIC_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/list-topics.md b/docs/examples/1.8.x/console-web/examples/messaging/list-topics.md new file mode 100644 index 0000000000..f775eb8fe3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/list-topics.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.listTopics({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..b48c5fe4ae --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-apns-provider.md @@ -0,0 +1,20 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateAPNSProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-email.md b/docs/examples/1.8.x/console-web/examples/messaging/update-email.md new file mode 100644 index 0000000000..deda783ff3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-email.md @@ -0,0 +1,24 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateEmail({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + subject: '<SUBJECT>', // optional + content: '<CONTENT>', // optional + draft: false, // optional + html: false, // optional + cc: [], // optional + bcc: [], // optional + scheduledAt: '', // optional + attachments: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..55e4ccbec2 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-fcm-provider.md @@ -0,0 +1,16 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + serviceAccountJSON: {} // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..4e5a9199f9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,22 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + apiKey: '<API_KEY>', // optional + domain: '<DOMAIN>', // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..369443fc61 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-push.md b/docs/examples/1.8.x/console-web/examples/messaging/update-push.md new file mode 100644 index 0000000000..5f5d6e5da2 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-push.md @@ -0,0 +1,31 @@ +import { Client, Messaging, MessagePriority } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updatePush({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + title: '<TITLE>', // optional + body: '<BODY>', // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '[ID1:ID2]', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: null, // optional + draft: false, // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..46608a3bb3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,20 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-sms.md b/docs/examples/1.8.x/console-web/examples/messaging/update-sms.md new file mode 100644 index 0000000000..f121f7e865 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-sms.md @@ -0,0 +1,19 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateSMS({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + content: '<CONTENT>', // optional + draft: false, // optional + scheduledAt: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..254c23e12b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-smtp-provider.md @@ -0,0 +1,26 @@ +import { Client, Messaging, SmtpEncryption } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + host: '<HOST>', // optional + port: 1, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..1df2779ce1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-telesign-provider.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..c739e0cd02 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-topic.md b/docs/examples/1.8.x/console-web/examples/messaging/update-topic.md new file mode 100644 index 0000000000..100f5ca73a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-topic.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', // optional + subscribe: ["any"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..b09b23fb97 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-twilio-provider.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + from: '<FROM>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/console-web/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..e998dbfbf5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/messaging/update-vonage-provider.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.updateVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + from: '<FROM>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/create-appwrite-migration.md b/docs/examples/1.8.x/console-web/examples/migrations/create-appwrite-migration.md new file mode 100644 index 0000000000..f53ab4aa3c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/create-appwrite-migration.md @@ -0,0 +1,16 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createAppwriteMigration({ + resources: [], + endpoint: 'https://example.com', + projectId: '<PROJECT_ID>', + apiKey: '<API_KEY>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/create-csv-migration.md b/docs/examples/1.8.x/console-web/examples/migrations/create-csv-migration.md new file mode 100644 index 0000000000..b25193ed21 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/create-csv-migration.md @@ -0,0 +1,16 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createCsvMigration({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + resourceId: '[ID1:ID2]', + internalFile: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/create-firebase-migration.md b/docs/examples/1.8.x/console-web/examples/migrations/create-firebase-migration.md new file mode 100644 index 0000000000..a3722c3839 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/create-firebase-migration.md @@ -0,0 +1,14 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createFirebaseMigration({ + resources: [], + serviceAccount: '<SERVICE_ACCOUNT>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/create-n-host-migration.md b/docs/examples/1.8.x/console-web/examples/migrations/create-n-host-migration.md new file mode 100644 index 0000000000..cada06e2ed --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/create-n-host-migration.md @@ -0,0 +1,20 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createNHostMigration({ + resources: [], + subdomain: '<SUBDOMAIN>', + region: '<REGION>', + adminSecret: '<ADMIN_SECRET>', + database: '<DATABASE>', + username: '<USERNAME>', + password: '<PASSWORD>', + port: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/create-supabase-migration.md b/docs/examples/1.8.x/console-web/examples/migrations/create-supabase-migration.md new file mode 100644 index 0000000000..13e3da08ca --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/create-supabase-migration.md @@ -0,0 +1,19 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.createSupabaseMigration({ + resources: [], + endpoint: 'https://example.com', + apiKey: '<API_KEY>', + databaseHost: '<DATABASE_HOST>', + username: '<USERNAME>', + password: '<PASSWORD>', + port: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/delete.md b/docs/examples/1.8.x/console-web/examples/migrations/delete.md new file mode 100644 index 0000000000..9df30d4178 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/delete.md @@ -0,0 +1,13 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.delete({ + migrationId: '<MIGRATION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/get-appwrite-report.md b/docs/examples/1.8.x/console-web/examples/migrations/get-appwrite-report.md new file mode 100644 index 0000000000..cdd5892a39 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/get-appwrite-report.md @@ -0,0 +1,16 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.getAppwriteReport({ + resources: [], + endpoint: 'https://example.com', + projectID: '<PROJECT_ID>', + key: '<KEY>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/get-firebase-report.md b/docs/examples/1.8.x/console-web/examples/migrations/get-firebase-report.md new file mode 100644 index 0000000000..4b8ea2118b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/get-firebase-report.md @@ -0,0 +1,14 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.getFirebaseReport({ + resources: [], + serviceAccount: '<SERVICE_ACCOUNT>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/get-n-host-report.md b/docs/examples/1.8.x/console-web/examples/migrations/get-n-host-report.md new file mode 100644 index 0000000000..bc88499b85 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/get-n-host-report.md @@ -0,0 +1,20 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.getNHostReport({ + resources: [], + subdomain: '<SUBDOMAIN>', + region: '<REGION>', + adminSecret: '<ADMIN_SECRET>', + database: '<DATABASE>', + username: '<USERNAME>', + password: '<PASSWORD>', + port: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/get-supabase-report.md b/docs/examples/1.8.x/console-web/examples/migrations/get-supabase-report.md new file mode 100644 index 0000000000..d054124e8e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/get-supabase-report.md @@ -0,0 +1,19 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.getSupabaseReport({ + resources: [], + endpoint: 'https://example.com', + apiKey: '<API_KEY>', + databaseHost: '<DATABASE_HOST>', + username: '<USERNAME>', + password: '<PASSWORD>', + port: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/get.md b/docs/examples/1.8.x/console-web/examples/migrations/get.md new file mode 100644 index 0000000000..e007ac9c73 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/get.md @@ -0,0 +1,13 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.get({ + migrationId: '<MIGRATION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/list.md b/docs/examples/1.8.x/console-web/examples/migrations/list.md new file mode 100644 index 0000000000..ea053a8e80 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/list.md @@ -0,0 +1,14 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/migrations/retry.md b/docs/examples/1.8.x/console-web/examples/migrations/retry.md new file mode 100644 index 0000000000..31322a14e5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/migrations/retry.md @@ -0,0 +1,13 @@ +import { Client, Migrations } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const migrations = new Migrations(client); + +const result = await migrations.retry({ + migrationId: '<MIGRATION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/project/create-variable.md b/docs/examples/1.8.x/console-web/examples/project/create-variable.md new file mode 100644 index 0000000000..2c7fea32d1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/project/create-variable.md @@ -0,0 +1,15 @@ +import { Client, Project } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.createVariable({ + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/project/delete-variable.md b/docs/examples/1.8.x/console-web/examples/project/delete-variable.md new file mode 100644 index 0000000000..4994eeebf3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/project/delete-variable.md @@ -0,0 +1,13 @@ +import { Client, Project } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.deleteVariable({ + variableId: '<VARIABLE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/project/get-usage.md b/docs/examples/1.8.x/console-web/examples/project/get-usage.md new file mode 100644 index 0000000000..dd548885a6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/project/get-usage.md @@ -0,0 +1,15 @@ +import { Client, Project, ProjectUsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.getUsage({ + startDate: '', + endDate: '', + period: ProjectUsageRange.OneHour // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/project/get-variable.md b/docs/examples/1.8.x/console-web/examples/project/get-variable.md new file mode 100644 index 0000000000..45ab31e614 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/project/get-variable.md @@ -0,0 +1,13 @@ +import { Client, Project } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.getVariable({ + variableId: '<VARIABLE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/project/list-variables.md b/docs/examples/1.8.x/console-web/examples/project/list-variables.md new file mode 100644 index 0000000000..9c17f8514e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/project/list-variables.md @@ -0,0 +1,11 @@ +import { Client, Project } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.listVariables(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/project/update-variable.md b/docs/examples/1.8.x/console-web/examples/project/update-variable.md new file mode 100644 index 0000000000..646333278e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/project/update-variable.md @@ -0,0 +1,16 @@ +import { Client, Project } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const project = new Project(client); + +const result = await project.updateVariable({ + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', // optional + secret: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/create-dev-key.md b/docs/examples/1.8.x/console-web/examples/projects/create-dev-key.md new file mode 100644 index 0000000000..9f1ed21e6f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/create-dev-key.md @@ -0,0 +1,15 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.createDevKey({ + projectId: '<PROJECT_ID>', + name: '<NAME>', + expire: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/create-jwt.md b/docs/examples/1.8.x/console-web/examples/projects/create-jwt.md new file mode 100644 index 0000000000..c880996399 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/create-jwt.md @@ -0,0 +1,15 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.createJWT({ + projectId: '<PROJECT_ID>', + scopes: [], + duration: 0 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/create-key.md b/docs/examples/1.8.x/console-web/examples/projects/create-key.md new file mode 100644 index 0000000000..a1e53e5f78 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/create-key.md @@ -0,0 +1,16 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.createKey({ + projectId: '<PROJECT_ID>', + name: '<NAME>', + scopes: [], + expire: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/create-platform.md b/docs/examples/1.8.x/console-web/examples/projects/create-platform.md new file mode 100644 index 0000000000..28a520626a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/create-platform.md @@ -0,0 +1,18 @@ +import { Client, Projects, PlatformType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.createPlatform({ + projectId: '<PROJECT_ID>', + type: PlatformType.Web, + name: '<NAME>', + key: '<KEY>', // optional + store: '<STORE>', // optional + hostname: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/create-smtp-test.md b/docs/examples/1.8.x/console-web/examples/projects/create-smtp-test.md new file mode 100644 index 0000000000..aa4fc1e1fe --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/create-smtp-test.md @@ -0,0 +1,22 @@ +import { Client, Projects, SMTPSecure } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.createSMTPTest({ + projectId: '<PROJECT_ID>', + emails: [], + senderName: '<SENDER_NAME>', + senderEmail: 'email@example.com', + host: '', + replyTo: 'email@example.com', // optional + port: null, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + secure: SMTPSecure.Tls // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/create-webhook.md b/docs/examples/1.8.x/console-web/examples/projects/create-webhook.md new file mode 100644 index 0000000000..3f32d7247b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/create-webhook.md @@ -0,0 +1,20 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.createWebhook({ + projectId: '<PROJECT_ID>', + name: '<NAME>', + events: [], + url: '', + security: false, + enabled: false, // optional + httpUser: '<HTTP_USER>', // optional + httpPass: '<HTTP_PASS>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/create.md b/docs/examples/1.8.x/console-web/examples/projects/create.md new file mode 100644 index 0000000000..44abc021ef --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/create.md @@ -0,0 +1,25 @@ +import { Client, Projects, } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.create({ + projectId: '', + name: '<NAME>', + teamId: '<TEAM_ID>', + region: .Default, // optional + description: '<DESCRIPTION>', // optional + logo: '<LOGO>', // optional + url: 'https://example.com', // optional + legalName: '<LEGAL_NAME>', // optional + legalCountry: '<LEGAL_COUNTRY>', // optional + legalState: '<LEGAL_STATE>', // optional + legalCity: '<LEGAL_CITY>', // optional + legalAddress: '<LEGAL_ADDRESS>', // optional + legalTaxId: '<LEGAL_TAX_ID>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/delete-dev-key.md b/docs/examples/1.8.x/console-web/examples/projects/delete-dev-key.md new file mode 100644 index 0000000000..2e5c08ab06 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/delete-dev-key.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.deleteDevKey({ + projectId: '<PROJECT_ID>', + keyId: '<KEY_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/delete-email-template.md b/docs/examples/1.8.x/console-web/examples/projects/delete-email-template.md new file mode 100644 index 0000000000..5c21e4797b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/delete-email-template.md @@ -0,0 +1,15 @@ +import { Client, Projects, EmailTemplateType, EmailTemplateLocale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.deleteEmailTemplate({ + projectId: '<PROJECT_ID>', + type: EmailTemplateType.Verification, + locale: EmailTemplateLocale.Af +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/delete-key.md b/docs/examples/1.8.x/console-web/examples/projects/delete-key.md new file mode 100644 index 0000000000..671413f0b5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/delete-key.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.deleteKey({ + projectId: '<PROJECT_ID>', + keyId: '<KEY_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/delete-platform.md b/docs/examples/1.8.x/console-web/examples/projects/delete-platform.md new file mode 100644 index 0000000000..8ed3e23afa --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/delete-platform.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.deletePlatform({ + projectId: '<PROJECT_ID>', + platformId: '<PLATFORM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/delete-sms-template.md b/docs/examples/1.8.x/console-web/examples/projects/delete-sms-template.md new file mode 100644 index 0000000000..f89ae275e3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/delete-sms-template.md @@ -0,0 +1,15 @@ +import { Client, Projects, SmsTemplateType, SmsTemplateLocale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.deleteSMSTemplate({ + projectId: '<PROJECT_ID>', + type: SmsTemplateType.Verification, + locale: SmsTemplateLocale.Af +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/delete-webhook.md b/docs/examples/1.8.x/console-web/examples/projects/delete-webhook.md new file mode 100644 index 0000000000..ec89642a3f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/delete-webhook.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.deleteWebhook({ + projectId: '<PROJECT_ID>', + webhookId: '<WEBHOOK_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/delete.md b/docs/examples/1.8.x/console-web/examples/projects/delete.md new file mode 100644 index 0000000000..c6ccd67cd6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/delete.md @@ -0,0 +1,13 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.delete({ + projectId: '<PROJECT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/get-dev-key.md b/docs/examples/1.8.x/console-web/examples/projects/get-dev-key.md new file mode 100644 index 0000000000..1e3ab57070 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/get-dev-key.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.getDevKey({ + projectId: '<PROJECT_ID>', + keyId: '<KEY_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/get-email-template.md b/docs/examples/1.8.x/console-web/examples/projects/get-email-template.md new file mode 100644 index 0000000000..3b812045c0 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/get-email-template.md @@ -0,0 +1,15 @@ +import { Client, Projects, EmailTemplateType, EmailTemplateLocale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.getEmailTemplate({ + projectId: '<PROJECT_ID>', + type: EmailTemplateType.Verification, + locale: EmailTemplateLocale.Af +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/get-key.md b/docs/examples/1.8.x/console-web/examples/projects/get-key.md new file mode 100644 index 0000000000..a937d8c413 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/get-key.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.getKey({ + projectId: '<PROJECT_ID>', + keyId: '<KEY_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/get-platform.md b/docs/examples/1.8.x/console-web/examples/projects/get-platform.md new file mode 100644 index 0000000000..6d5ca40214 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/get-platform.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.getPlatform({ + projectId: '<PROJECT_ID>', + platformId: '<PLATFORM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/get-sms-template.md b/docs/examples/1.8.x/console-web/examples/projects/get-sms-template.md new file mode 100644 index 0000000000..f48722c2a5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/get-sms-template.md @@ -0,0 +1,15 @@ +import { Client, Projects, SmsTemplateType, SmsTemplateLocale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.getSMSTemplate({ + projectId: '<PROJECT_ID>', + type: SmsTemplateType.Verification, + locale: SmsTemplateLocale.Af +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/get-webhook.md b/docs/examples/1.8.x/console-web/examples/projects/get-webhook.md new file mode 100644 index 0000000000..e8d00d2da6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/get-webhook.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.getWebhook({ + projectId: '<PROJECT_ID>', + webhookId: '<WEBHOOK_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/get.md b/docs/examples/1.8.x/console-web/examples/projects/get.md new file mode 100644 index 0000000000..f55a9677f9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/get.md @@ -0,0 +1,13 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.get({ + projectId: '<PROJECT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/list-dev-keys.md b/docs/examples/1.8.x/console-web/examples/projects/list-dev-keys.md new file mode 100644 index 0000000000..ecdf02598f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/list-dev-keys.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.listDevKeys({ + projectId: '<PROJECT_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/list-keys.md b/docs/examples/1.8.x/console-web/examples/projects/list-keys.md new file mode 100644 index 0000000000..3a47780c1c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/list-keys.md @@ -0,0 +1,13 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.listKeys({ + projectId: '<PROJECT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/list-platforms.md b/docs/examples/1.8.x/console-web/examples/projects/list-platforms.md new file mode 100644 index 0000000000..475bc068ef --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/list-platforms.md @@ -0,0 +1,13 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.listPlatforms({ + projectId: '<PROJECT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/list-webhooks.md b/docs/examples/1.8.x/console-web/examples/projects/list-webhooks.md new file mode 100644 index 0000000000..89cdf35b26 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/list-webhooks.md @@ -0,0 +1,13 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.listWebhooks({ + projectId: '<PROJECT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/list.md b/docs/examples/1.8.x/console-web/examples/projects/list.md new file mode 100644 index 0000000000..81dc422130 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/list.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-api-status-all.md b/docs/examples/1.8.x/console-web/examples/projects/update-api-status-all.md new file mode 100644 index 0000000000..02e0595130 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-api-status-all.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateAPIStatusAll({ + projectId: '<PROJECT_ID>', + status: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-api-status.md b/docs/examples/1.8.x/console-web/examples/projects/update-api-status.md new file mode 100644 index 0000000000..7ec06fee58 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-api-status.md @@ -0,0 +1,15 @@ +import { Client, Projects, } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateAPIStatus({ + projectId: '<PROJECT_ID>', + api: .Rest, + status: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-auth-duration.md b/docs/examples/1.8.x/console-web/examples/projects/update-auth-duration.md new file mode 100644 index 0000000000..a8119d12d3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-auth-duration.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateAuthDuration({ + projectId: '<PROJECT_ID>', + duration: 0 +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-auth-limit.md b/docs/examples/1.8.x/console-web/examples/projects/update-auth-limit.md new file mode 100644 index 0000000000..daed702834 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-auth-limit.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateAuthLimit({ + projectId: '<PROJECT_ID>', + limit: 0 +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-auth-password-dictionary.md b/docs/examples/1.8.x/console-web/examples/projects/update-auth-password-dictionary.md new file mode 100644 index 0000000000..06ab09316c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-auth-password-dictionary.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateAuthPasswordDictionary({ + projectId: '<PROJECT_ID>', + enabled: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-auth-password-history.md b/docs/examples/1.8.x/console-web/examples/projects/update-auth-password-history.md new file mode 100644 index 0000000000..76c246991f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-auth-password-history.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateAuthPasswordHistory({ + projectId: '<PROJECT_ID>', + limit: 0 +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-auth-sessions-limit.md b/docs/examples/1.8.x/console-web/examples/projects/update-auth-sessions-limit.md new file mode 100644 index 0000000000..ca5aef7737 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-auth-sessions-limit.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateAuthSessionsLimit({ + projectId: '<PROJECT_ID>', + limit: 1 +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-auth-status.md b/docs/examples/1.8.x/console-web/examples/projects/update-auth-status.md new file mode 100644 index 0000000000..75deb5ae5d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-auth-status.md @@ -0,0 +1,15 @@ +import { Client, Projects, AuthMethod } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateAuthStatus({ + projectId: '<PROJECT_ID>', + method: AuthMethod.EmailPassword, + status: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-dev-key.md b/docs/examples/1.8.x/console-web/examples/projects/update-dev-key.md new file mode 100644 index 0000000000..3d84fbbc85 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-dev-key.md @@ -0,0 +1,16 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateDevKey({ + projectId: '<PROJECT_ID>', + keyId: '<KEY_ID>', + name: '<NAME>', + expire: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-email-template.md b/docs/examples/1.8.x/console-web/examples/projects/update-email-template.md new file mode 100644 index 0000000000..f26e8887a7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-email-template.md @@ -0,0 +1,20 @@ +import { Client, Projects, EmailTemplateType, EmailTemplateLocale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateEmailTemplate({ + projectId: '<PROJECT_ID>', + type: EmailTemplateType.Verification, + locale: EmailTemplateLocale.Af, + subject: '<SUBJECT>', + message: '<MESSAGE>', + senderName: '<SENDER_NAME>', // optional + senderEmail: 'email@example.com', // optional + replyTo: 'email@example.com' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-key.md b/docs/examples/1.8.x/console-web/examples/projects/update-key.md new file mode 100644 index 0000000000..8e32cbd990 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-key.md @@ -0,0 +1,17 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateKey({ + projectId: '<PROJECT_ID>', + keyId: '<KEY_ID>', + name: '<NAME>', + scopes: [], + expire: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-memberships-privacy.md b/docs/examples/1.8.x/console-web/examples/projects/update-memberships-privacy.md new file mode 100644 index 0000000000..ca873e7ee1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-memberships-privacy.md @@ -0,0 +1,16 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateMembershipsPrivacy({ + projectId: '<PROJECT_ID>', + userName: false, + userEmail: false, + mfa: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-mock-numbers.md b/docs/examples/1.8.x/console-web/examples/projects/update-mock-numbers.md new file mode 100644 index 0000000000..918993be50 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-mock-numbers.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateMockNumbers({ + projectId: '<PROJECT_ID>', + numbers: [] +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-o-auth-2.md b/docs/examples/1.8.x/console-web/examples/projects/update-o-auth-2.md new file mode 100644 index 0000000000..01ecf3a1b4 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-o-auth-2.md @@ -0,0 +1,17 @@ +import { Client, Projects, OAuthProvider } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateOAuth2({ + projectId: '<PROJECT_ID>', + provider: OAuthProvider.Amazon, + appId: '<APP_ID>', // optional + secret: '<SECRET>', // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-personal-data-check.md b/docs/examples/1.8.x/console-web/examples/projects/update-personal-data-check.md new file mode 100644 index 0000000000..0fe0a35652 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-personal-data-check.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updatePersonalDataCheck({ + projectId: '<PROJECT_ID>', + enabled: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-platform.md b/docs/examples/1.8.x/console-web/examples/projects/update-platform.md new file mode 100644 index 0000000000..996cace8b5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-platform.md @@ -0,0 +1,18 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updatePlatform({ + projectId: '<PROJECT_ID>', + platformId: '<PLATFORM_ID>', + name: '<NAME>', + key: '<KEY>', // optional + store: '<STORE>', // optional + hostname: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-service-status-all.md b/docs/examples/1.8.x/console-web/examples/projects/update-service-status-all.md new file mode 100644 index 0000000000..c4216fcbbc --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-service-status-all.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateServiceStatusAll({ + projectId: '<PROJECT_ID>', + status: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-service-status.md b/docs/examples/1.8.x/console-web/examples/projects/update-service-status.md new file mode 100644 index 0000000000..e5b92683d2 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-service-status.md @@ -0,0 +1,15 @@ +import { Client, Projects, ApiService } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateServiceStatus({ + projectId: '<PROJECT_ID>', + service: ApiService.Account, + status: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-session-alerts.md b/docs/examples/1.8.x/console-web/examples/projects/update-session-alerts.md new file mode 100644 index 0000000000..21e73494fa --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-session-alerts.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateSessionAlerts({ + projectId: '<PROJECT_ID>', + alerts: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-session-invalidation.md b/docs/examples/1.8.x/console-web/examples/projects/update-session-invalidation.md new file mode 100644 index 0000000000..748ac72629 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-session-invalidation.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateSessionInvalidation({ + projectId: '<PROJECT_ID>', + enabled: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-sms-template.md b/docs/examples/1.8.x/console-web/examples/projects/update-sms-template.md new file mode 100644 index 0000000000..ab332c52e2 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-sms-template.md @@ -0,0 +1,16 @@ +import { Client, Projects, SmsTemplateType, SmsTemplateLocale } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateSMSTemplate({ + projectId: '<PROJECT_ID>', + type: SmsTemplateType.Verification, + locale: SmsTemplateLocale.Af, + message: '<MESSAGE>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-smtp.md b/docs/examples/1.8.x/console-web/examples/projects/update-smtp.md new file mode 100644 index 0000000000..cb5d73b0e9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-smtp.md @@ -0,0 +1,22 @@ +import { Client, Projects, SMTPSecure } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateSMTP({ + projectId: '<PROJECT_ID>', + enabled: false, + senderName: '<SENDER_NAME>', // optional + senderEmail: 'email@example.com', // optional + replyTo: 'email@example.com', // optional + host: '', // optional + port: null, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + secure: SMTPSecure.Tls // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-team.md b/docs/examples/1.8.x/console-web/examples/projects/update-team.md new file mode 100644 index 0000000000..6c27714d6d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-team.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateTeam({ + projectId: '<PROJECT_ID>', + teamId: '<TEAM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-webhook-signature.md b/docs/examples/1.8.x/console-web/examples/projects/update-webhook-signature.md new file mode 100644 index 0000000000..6ea0ee6969 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-webhook-signature.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateWebhookSignature({ + projectId: '<PROJECT_ID>', + webhookId: '<WEBHOOK_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update-webhook.md b/docs/examples/1.8.x/console-web/examples/projects/update-webhook.md new file mode 100644 index 0000000000..d3a1e4e60e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update-webhook.md @@ -0,0 +1,21 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateWebhook({ + projectId: '<PROJECT_ID>', + webhookId: '<WEBHOOK_ID>', + name: '<NAME>', + events: [], + url: '', + security: false, + enabled: false, // optional + httpUser: '<HTTP_USER>', // optional + httpPass: '<HTTP_PASS>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/projects/update.md b/docs/examples/1.8.x/console-web/examples/projects/update.md new file mode 100644 index 0000000000..3df8d6dc15 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/projects/update.md @@ -0,0 +1,23 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.update({ + projectId: '<PROJECT_ID>', + name: '<NAME>', + description: '<DESCRIPTION>', // optional + logo: '<LOGO>', // optional + url: 'https://example.com', // optional + legalName: '<LEGAL_NAME>', // optional + legalCountry: '<LEGAL_COUNTRY>', // optional + legalState: '<LEGAL_STATE>', // optional + legalCity: '<LEGAL_CITY>', // optional + legalAddress: '<LEGAL_ADDRESS>', // optional + legalTaxId: '<LEGAL_TAX_ID>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/proxy/create-api-rule.md b/docs/examples/1.8.x/console-web/examples/proxy/create-api-rule.md new file mode 100644 index 0000000000..593601da1f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/proxy/create-api-rule.md @@ -0,0 +1,13 @@ +import { Client, Proxy } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.createAPIRule({ + domain: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/proxy/create-function-rule.md b/docs/examples/1.8.x/console-web/examples/proxy/create-function-rule.md new file mode 100644 index 0000000000..168351723e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/proxy/create-function-rule.md @@ -0,0 +1,15 @@ +import { Client, Proxy } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.createFunctionRule({ + domain: '', + functionId: '<FUNCTION_ID>', + branch: '<BRANCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/proxy/create-redirect-rule.md b/docs/examples/1.8.x/console-web/examples/proxy/create-redirect-rule.md new file mode 100644 index 0000000000..396d6dee58 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/proxy/create-redirect-rule.md @@ -0,0 +1,17 @@ +import { Client, Proxy, , ProxyResourceType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.createRedirectRule({ + domain: '', + url: 'https://example.com', + statusCode: .MovedPermanently301, + resourceId: '<RESOURCE_ID>', + resourceType: ProxyResourceType.Site +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/proxy/create-site-rule.md b/docs/examples/1.8.x/console-web/examples/proxy/create-site-rule.md new file mode 100644 index 0000000000..60b371a359 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/proxy/create-site-rule.md @@ -0,0 +1,15 @@ +import { Client, Proxy } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.createSiteRule({ + domain: '', + siteId: '<SITE_ID>', + branch: '<BRANCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/proxy/delete-rule.md b/docs/examples/1.8.x/console-web/examples/proxy/delete-rule.md new file mode 100644 index 0000000000..7417ab7ddd --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/proxy/delete-rule.md @@ -0,0 +1,13 @@ +import { Client, Proxy } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.deleteRule({ + ruleId: '<RULE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/proxy/get-rule.md b/docs/examples/1.8.x/console-web/examples/proxy/get-rule.md new file mode 100644 index 0000000000..1033693196 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/proxy/get-rule.md @@ -0,0 +1,13 @@ +import { Client, Proxy } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.getRule({ + ruleId: '<RULE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/proxy/list-rules.md b/docs/examples/1.8.x/console-web/examples/proxy/list-rules.md new file mode 100644 index 0000000000..43c7ed2128 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/proxy/list-rules.md @@ -0,0 +1,14 @@ +import { Client, Proxy } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.listRules({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/proxy/update-rule-verification.md b/docs/examples/1.8.x/console-web/examples/proxy/update-rule-verification.md new file mode 100644 index 0000000000..4806b3072a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/proxy/update-rule-verification.md @@ -0,0 +1,13 @@ +import { Client, Proxy } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.updateRuleVerification({ + ruleId: '<RULE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/create-deployment.md b/docs/examples/1.8.x/console-web/examples/sites/create-deployment.md new file mode 100644 index 0000000000..44dc68adb8 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/create-deployment.md @@ -0,0 +1,18 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.createDeployment({ + siteId: '<SITE_ID>', + code: document.getElementById('uploader').files[0], + activate: false, + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/console-web/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..43812cfb7c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.createDuplicateDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/console-web/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..969a0b855c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/create-template-deployment.md @@ -0,0 +1,18 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.createTemplateDeployment({ + siteId: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/create-variable.md b/docs/examples/1.8.x/console-web/examples/sites/create-variable.md new file mode 100644 index 0000000000..2379e52496 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/create-variable.md @@ -0,0 +1,16 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.createVariable({ + siteId: '<SITE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/console-web/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..cc1fd1d301 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/create-vcs-deployment.md @@ -0,0 +1,16 @@ +import { Client, Sites, VCSDeploymentType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.createVcsDeployment({ + siteId: '<SITE_ID>', + type: VCSDeploymentType.Branch, + reference: '<REFERENCE>', + activate: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/create.md b/docs/examples/1.8.x/console-web/examples/sites/create.md new file mode 100644 index 0000000000..bd4e2d1f08 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/create.md @@ -0,0 +1,30 @@ +import { Client, Sites, , , } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.create({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: .Analog, + buildRuntime: .Node145, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + adapter: .Static, // optional + installationId: '<INSTALLATION_ID>', // optional + fallbackFile: '<FALLBACK_FILE>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/delete-deployment.md b/docs/examples/1.8.x/console-web/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..dac0500b73 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/delete-deployment.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.deleteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/delete-log.md b/docs/examples/1.8.x/console-web/examples/sites/delete-log.md new file mode 100644 index 0000000000..18d543775a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/delete-log.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.deleteLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/delete-variable.md b/docs/examples/1.8.x/console-web/examples/sites/delete-variable.md new file mode 100644 index 0000000000..a0e6f6fbb0 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/delete-variable.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.deleteVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/delete.md b/docs/examples/1.8.x/console-web/examples/sites/delete.md new file mode 100644 index 0000000000..1a289f6ef6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/delete.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.delete({ + siteId: '<SITE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/console-web/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..d66c9a682f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/get-deployment-download.md @@ -0,0 +1,15 @@ +import { Client, Sites, DeploymentDownloadType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = sites.getDeploymentDownload({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType.Source // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/get-deployment.md b/docs/examples/1.8.x/console-web/examples/sites/get-deployment.md new file mode 100644 index 0000000000..dc2a77c29a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/get-deployment.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.getDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/get-log.md b/docs/examples/1.8.x/console-web/examples/sites/get-log.md new file mode 100644 index 0000000000..18021449cf --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/get-log.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.getLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/get-template.md b/docs/examples/1.8.x/console-web/examples/sites/get-template.md new file mode 100644 index 0000000000..1ddc6ec97f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/get-template.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.getTemplate({ + templateId: '<TEMPLATE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/get-usage.md b/docs/examples/1.8.x/console-web/examples/sites/get-usage.md new file mode 100644 index 0000000000..39158c8c28 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/get-usage.md @@ -0,0 +1,14 @@ +import { Client, Sites, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.getUsage({ + siteId: '<SITE_ID>', + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/get-variable.md b/docs/examples/1.8.x/console-web/examples/sites/get-variable.md new file mode 100644 index 0000000000..a35bb511c1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/get-variable.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.getVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/get.md b/docs/examples/1.8.x/console-web/examples/sites/get.md new file mode 100644 index 0000000000..07016aab02 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/get.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.get({ + siteId: '<SITE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/list-deployments.md b/docs/examples/1.8.x/console-web/examples/sites/list-deployments.md new file mode 100644 index 0000000000..3de3554e99 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/list-deployments.md @@ -0,0 +1,15 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listDeployments({ + siteId: '<SITE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/list-frameworks.md b/docs/examples/1.8.x/console-web/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..aceadcc8c9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/list-frameworks.md @@ -0,0 +1,11 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listFrameworks(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/list-logs.md b/docs/examples/1.8.x/console-web/examples/sites/list-logs.md new file mode 100644 index 0000000000..e60203644a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/list-logs.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listLogs({ + siteId: '<SITE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/list-specifications.md b/docs/examples/1.8.x/console-web/examples/sites/list-specifications.md new file mode 100644 index 0000000000..9bbb35d76d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/list-specifications.md @@ -0,0 +1,11 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listSpecifications(); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/list-templates.md b/docs/examples/1.8.x/console-web/examples/sites/list-templates.md new file mode 100644 index 0000000000..82266bfde7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/list-templates.md @@ -0,0 +1,16 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listTemplates({ + frameworks: [], // optional + useCases: [], // optional + limit: 1, // optional + offset: 0 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/list-usage.md b/docs/examples/1.8.x/console-web/examples/sites/list-usage.md new file mode 100644 index 0000000000..1cd2cf7af1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/list-usage.md @@ -0,0 +1,13 @@ +import { Client, Sites, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listUsage({ + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/list-variables.md b/docs/examples/1.8.x/console-web/examples/sites/list-variables.md new file mode 100644 index 0000000000..0b795d08af --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/list-variables.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.listVariables({ + siteId: '<SITE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/list.md b/docs/examples/1.8.x/console-web/examples/sites/list.md new file mode 100644 index 0000000000..b3d4f6865c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/list.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/console-web/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..4b9d2a87db --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/update-deployment-status.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.updateDeploymentStatus({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/console-web/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..91118ec734 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/update-site-deployment.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.updateSiteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/update-variable.md b/docs/examples/1.8.x/console-web/examples/sites/update-variable.md new file mode 100644 index 0000000000..9fe767db81 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/update-variable.md @@ -0,0 +1,17 @@ +import { Client, Sites } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.updateVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', // optional + secret: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/sites/update.md b/docs/examples/1.8.x/console-web/examples/sites/update.md new file mode 100644 index 0000000000..68bd073c50 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/sites/update.md @@ -0,0 +1,30 @@ +import { Client, Sites, , , } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const sites = new Sites(client); + +const result = await sites.update({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: .Analog, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + buildRuntime: .Node145, // optional + adapter: .Static, // optional + fallbackFile: '<FALLBACK_FILE>', // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/create-bucket.md b/docs/examples/1.8.x/console-web/examples/storage/create-bucket.md new file mode 100644 index 0000000000..7727d1c7bb --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/create-bucket.md @@ -0,0 +1,22 @@ +import { Client, Storage, } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.createBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: .None, // optional + encryption: false, // optional + antivirus: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/create-file.md b/docs/examples/1.8.x/console-web/examples/storage/create-file.md new file mode 100644 index 0000000000..1dcab62ba4 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/create-file.md @@ -0,0 +1,16 @@ +import { Client, Storage } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.createFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: document.getElementById('uploader').files[0], + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/delete-bucket.md b/docs/examples/1.8.x/console-web/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..25d4d2023d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/delete-bucket.md @@ -0,0 +1,13 @@ +import { Client, Storage } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.deleteBucket({ + bucketId: '<BUCKET_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/delete-file.md b/docs/examples/1.8.x/console-web/examples/storage/delete-file.md new file mode 100644 index 0000000000..e8750be3c3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/delete-file.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.deleteFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/get-bucket-usage.md b/docs/examples/1.8.x/console-web/examples/storage/get-bucket-usage.md new file mode 100644 index 0000000000..5749effa41 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/get-bucket-usage.md @@ -0,0 +1,14 @@ +import { Client, Storage, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getBucketUsage({ + bucketId: '<BUCKET_ID>', + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/get-bucket.md b/docs/examples/1.8.x/console-web/examples/storage/get-bucket.md new file mode 100644 index 0000000000..7519b2b1c2 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/get-bucket.md @@ -0,0 +1,13 @@ +import { Client, Storage } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getBucket({ + bucketId: '<BUCKET_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/get-file-download.md b/docs/examples/1.8.x/console-web/examples/storage/get-file-download.md new file mode 100644 index 0000000000..876776f0f8 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/get-file-download.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileDownload({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/get-file-preview.md b/docs/examples/1.8.x/console-web/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..16bfe5feb8 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/get-file-preview.md @@ -0,0 +1,26 @@ +import { Client, Storage, ImageGravity, ImageFormat } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFilePreview({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // optional + height: 0, // optional + gravity: ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: '', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: '', // optional + output: ImageFormat.Jpg, // optional + token: '<TOKEN>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/get-file-view.md b/docs/examples/1.8.x/console-web/examples/storage/get-file-view.md new file mode 100644 index 0000000000..dca7ffae2f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/get-file-view.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileView({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/get-file.md b/docs/examples/1.8.x/console-web/examples/storage/get-file.md new file mode 100644 index 0000000000..5f5370dcf3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/get-file.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/get-usage.md b/docs/examples/1.8.x/console-web/examples/storage/get-usage.md new file mode 100644 index 0000000000..1584361d18 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/get-usage.md @@ -0,0 +1,13 @@ +import { Client, Storage, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getUsage({ + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/list-buckets.md b/docs/examples/1.8.x/console-web/examples/storage/list-buckets.md new file mode 100644 index 0000000000..548daed87b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/list-buckets.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.listBuckets({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/list-files.md b/docs/examples/1.8.x/console-web/examples/storage/list-files.md new file mode 100644 index 0000000000..245c614b17 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/list-files.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.listFiles({ + bucketId: '<BUCKET_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/update-bucket.md b/docs/examples/1.8.x/console-web/examples/storage/update-bucket.md new file mode 100644 index 0000000000..58ad29fe15 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/update-bucket.md @@ -0,0 +1,22 @@ +import { Client, Storage, } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.updateBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: .None, // optional + encryption: false, // optional + antivirus: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/storage/update-file.md b/docs/examples/1.8.x/console-web/examples/storage/update-file.md new file mode 100644 index 0000000000..b73149db13 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/storage/update-file.md @@ -0,0 +1,16 @@ +import { Client, Storage } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.updateFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..4622b821a5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: false, // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..30dd10e3a2 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..61ae3e1e85 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-email-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..0a5657148d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-enum-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..b8794dd697 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-float-column.md @@ -0,0 +1,20 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-index.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..7c11aa67b7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-index.md @@ -0,0 +1,19 @@ +import { Client, TablesDB, IndexType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + type: IndexType.Key, + columns: [], + orders: [], // optional + lengths: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..0eaf240078 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-integer-column.md @@ -0,0 +1,20 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..4df6dcd7a8 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-ip-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..05b4ec76d0 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-line-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createLineColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..a2c94fb247 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-point-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createPointColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [1, 2] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..5de3ece01a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createPolygonColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..e7c72e7e30 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,20 @@ +import { Client, TablesDB, RelationshipType, RelationMutate } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + relatedTableId: '<RELATED_TABLE_ID>', + type: RelationshipType.OneToOne, + twoWay: false, // optional + key: '', // optional + twoWayKey: '', // optional + onDelete: RelationMutate.Cascade // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-row.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..6123b5fc31 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-row.md @@ -0,0 +1,23 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..b827beb048 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-rows.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [] +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..e162c976ba --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-string-column.md @@ -0,0 +1,20 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + size: 1, + required: false, + default: '<DEFAULT>', // optional + array: false, // optional + encrypt: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-table.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..aad0eceb73 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-table.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..2cee4674f9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create-url-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', // optional + array: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/create.md b/docs/examples/1.8.x/console-web/examples/tablesdb/create.md new file mode 100644 index 0000000000..91a89ce236 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/create.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..067afc7820 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.decrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, // optional + min: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..868cd6e277 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/delete-column.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/console-web/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..451dcc8a94 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/delete-index.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/console-web/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..9b7def4f00 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/delete-row.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/console-web/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..16868a0c6e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/delete-rows.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/console-web/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..e3d453291d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/delete-table.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.deleteTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/delete.md b/docs/examples/1.8.x/console-web/examples/tablesdb/delete.md new file mode 100644 index 0000000000..a567ad5035 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/delete.md @@ -0,0 +1,13 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.delete({ + databaseId: '<DATABASE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/get-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..45d5c20531 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/get-column.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/get-index.md b/docs/examples/1.8.x/console-web/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..576702638d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/get-index.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/get-row.md b/docs/examples/1.8.x/console-web/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..f170078430 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/get-row.md @@ -0,0 +1,16 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/get-table-usage.md b/docs/examples/1.8.x/console-web/examples/tablesdb/get-table-usage.md new file mode 100644 index 0000000000..6f5cff484c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/get-table-usage.md @@ -0,0 +1,15 @@ +import { Client, TablesDB, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getTableUsage({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/get-table.md b/docs/examples/1.8.x/console-web/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..47ca8b7e04 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/get-table.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/get-usage.md b/docs/examples/1.8.x/console-web/examples/tablesdb/get-usage.md new file mode 100644 index 0000000000..c4f34ee36e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/get-usage.md @@ -0,0 +1,14 @@ +import { Client, TablesDB, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.getUsage({ + databaseId: '<DATABASE_ID>', + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/get.md b/docs/examples/1.8.x/console-web/examples/tablesdb/get.md new file mode 100644 index 0000000000..fc408caa56 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/get.md @@ -0,0 +1,13 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.get({ + databaseId: '<DATABASE_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..95694d49a4 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/increment-row-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.incrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, // optional + max: null // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/console-web/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..ea20458266 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/list-columns.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listColumns({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/console-web/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..dd00898f23 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/list-indexes.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listIndexes({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/list-row-logs.md b/docs/examples/1.8.x/console-web/examples/tablesdb/list-row-logs.md new file mode 100644 index 0000000000..870023ee0e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/list-row-logs.md @@ -0,0 +1,16 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listRowLogs({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/console-web/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..46159b3d42 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/list-rows.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/list-table-logs.md b/docs/examples/1.8.x/console-web/examples/tablesdb/list-table-logs.md new file mode 100644 index 0000000000..102623e431 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/list-table-logs.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listTableLogs({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/console-web/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..1d7c6d511f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/list-tables.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listTables({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/list-usage.md b/docs/examples/1.8.x/console-web/examples/tablesdb/list-usage.md new file mode 100644 index 0000000000..875128dc53 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/list-usage.md @@ -0,0 +1,13 @@ +import { Client, TablesDB, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.listUsage({ + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/list.md b/docs/examples/1.8.x/console-web/examples/tablesdb/list.md new file mode 100644 index 0000000000..002a6f75e0 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/list.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..d91927dd5f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: false, + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..977c5106f9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..7f575a3d0c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-email-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..28dfc51ba6 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-enum-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..2be0755220 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-float-column.md @@ -0,0 +1,20 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..3e752b7009 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-integer-column.md @@ -0,0 +1,20 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..c5f43af64e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-ip-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..38b5aedb37 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-line-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateLineColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..f361d4c5bc --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-point-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updatePointColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [1, 2], // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..64b60d7630 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updatePolygonColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..88d6725507 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB, RelationMutate } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + onDelete: RelationMutate.Cascade, // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-row.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..5d6109c04c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-row.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..0ce117efa3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-rows.md @@ -0,0 +1,16 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + data: {}, // optional + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..b84185ca8f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-string-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '<DEFAULT>', + size: 1, // optional + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-table.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..11eec2e343 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-table.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..e267e404de --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update-url-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.updateUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', + newKey: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/update.md b/docs/examples/1.8.x/console-web/examples/tablesdb/update.md new file mode 100644 index 0000000000..55809cb070 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/update.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/console-web/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..665f181d8b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/upsert-row.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.upsertRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/console-web/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..05e78e3efa --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tablesdb/upsert-rows.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.upsertRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [] +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/create-membership.md b/docs/examples/1.8.x/console-web/examples/teams/create-membership.md new file mode 100644 index 0000000000..50c4d06b6d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/create-membership.md @@ -0,0 +1,19 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.createMembership({ + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // optional + userId: '<USER_ID>', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/create.md b/docs/examples/1.8.x/console-web/examples/teams/create.md new file mode 100644 index 0000000000..027155b4eb --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/create.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.create({ + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/delete-membership.md b/docs/examples/1.8.x/console-web/examples/teams/delete-membership.md new file mode 100644 index 0000000000..43edacebde --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/delete-membership.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.deleteMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/delete.md b/docs/examples/1.8.x/console-web/examples/teams/delete.md new file mode 100644 index 0000000000..9ebc45b39a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/delete.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.delete({ + teamId: '<TEAM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/get-membership.md b/docs/examples/1.8.x/console-web/examples/teams/get-membership.md new file mode 100644 index 0000000000..a766060bc9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/get-membership.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/get-prefs.md b/docs/examples/1.8.x/console-web/examples/teams/get-prefs.md new file mode 100644 index 0000000000..a044e8a4d7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/get-prefs.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getPrefs({ + teamId: '<TEAM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/get.md b/docs/examples/1.8.x/console-web/examples/teams/get.md new file mode 100644 index 0000000000..2ec6271f0f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/get.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.get({ + teamId: '<TEAM_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/list-logs.md b/docs/examples/1.8.x/console-web/examples/teams/list-logs.md new file mode 100644 index 0000000000..a077ae59ce --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/list-logs.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.listLogs({ + teamId: '<TEAM_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/list-memberships.md b/docs/examples/1.8.x/console-web/examples/teams/list-memberships.md new file mode 100644 index 0000000000..a5cf9f0fbf --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/list-memberships.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.listMemberships({ + teamId: '<TEAM_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/list.md b/docs/examples/1.8.x/console-web/examples/teams/list.md new file mode 100644 index 0000000000..5d7dbcd3d9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/list.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/update-membership-status.md b/docs/examples/1.8.x/console-web/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..ab6bc93d4f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/update-membership-status.md @@ -0,0 +1,16 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembershipStatus({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/update-membership.md b/docs/examples/1.8.x/console-web/examples/teams/update-membership.md new file mode 100644 index 0000000000..9a94f51a96 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/update-membership.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [] +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/update-name.md b/docs/examples/1.8.x/console-web/examples/teams/update-name.md new file mode 100644 index 0000000000..82d3d0fac2 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/update-name.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateName({ + teamId: '<TEAM_ID>', + name: '<NAME>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/teams/update-prefs.md b/docs/examples/1.8.x/console-web/examples/teams/update-prefs.md new file mode 100644 index 0000000000..1519f5398a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/teams/update-prefs.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updatePrefs({ + teamId: '<TEAM_ID>', + prefs: {} +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tokens/create-file-token.md b/docs/examples/1.8.x/console-web/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..b762493708 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tokens/create-file-token.md @@ -0,0 +1,15 @@ +import { Client, Tokens } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tokens = new Tokens(client); + +const result = await tokens.createFileToken({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + expire: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tokens/delete.md b/docs/examples/1.8.x/console-web/examples/tokens/delete.md new file mode 100644 index 0000000000..8591dce076 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tokens/delete.md @@ -0,0 +1,13 @@ +import { Client, Tokens } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tokens = new Tokens(client); + +const result = await tokens.delete({ + tokenId: '<TOKEN_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tokens/get.md b/docs/examples/1.8.x/console-web/examples/tokens/get.md new file mode 100644 index 0000000000..33916c1939 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tokens/get.md @@ -0,0 +1,13 @@ +import { Client, Tokens } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tokens = new Tokens(client); + +const result = await tokens.get({ + tokenId: '<TOKEN_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tokens/list.md b/docs/examples/1.8.x/console-web/examples/tokens/list.md new file mode 100644 index 0000000000..29b9a3d242 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tokens/list.md @@ -0,0 +1,15 @@ +import { Client, Tokens } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tokens = new Tokens(client); + +const result = await tokens.list({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/tokens/update.md b/docs/examples/1.8.x/console-web/examples/tokens/update.md new file mode 100644 index 0000000000..96d92348ef --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/tokens/update.md @@ -0,0 +1,14 @@ +import { Client, Tokens } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tokens = new Tokens(client); + +const result = await tokens.update({ + tokenId: '<TOKEN_ID>', + expire: '' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/console-web/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..58da25bcb0 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-argon-2-user.md @@ -0,0 +1,16 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createArgon2User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/console-web/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..f83290d10d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-bcrypt-user.md @@ -0,0 +1,16 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createBcryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-jwt.md b/docs/examples/1.8.x/console-web/examples/users/create-jwt.md new file mode 100644 index 0000000000..4bd160bc96 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-jwt.md @@ -0,0 +1,15 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createJWT({ + userId: '<USER_ID>', + sessionId: '<SESSION_ID>', // optional + duration: 0 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-md-5-user.md b/docs/examples/1.8.x/console-web/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..a0bfb47a2d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-md-5-user.md @@ -0,0 +1,16 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createMD5User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/console-web/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..f8669589af --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createMFARecoveryCodes({ + userId: '<USER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/console-web/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..a42b8d7594 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-ph-pass-user.md @@ -0,0 +1,16 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createPHPassUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/console-web/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..b5a7ca3231 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,19 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createScryptModifiedUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>', + passwordSignerKey: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/console-web/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..6727e2895f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-scrypt-user.md @@ -0,0 +1,21 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createScryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordCpu: null, + passwordMemory: null, + passwordParallel: null, + passwordLength: null, + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-session.md b/docs/examples/1.8.x/console-web/examples/users/create-session.md new file mode 100644 index 0000000000..917fbaa341 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-session.md @@ -0,0 +1,13 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createSession({ + userId: '<USER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-sha-user.md b/docs/examples/1.8.x/console-web/examples/users/create-sha-user.md new file mode 100644 index 0000000000..8d593ce6b5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-sha-user.md @@ -0,0 +1,17 @@ +import { Client, Users, PasswordHash } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createSHAUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordVersion: PasswordHash.Sha1, // optional + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-target.md b/docs/examples/1.8.x/console-web/examples/users/create-target.md new file mode 100644 index 0000000000..814d6f780a --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-target.md @@ -0,0 +1,18 @@ +import { Client, Users, MessagingProviderType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: MessagingProviderType.Email, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create-token.md b/docs/examples/1.8.x/console-web/examples/users/create-token.md new file mode 100644 index 0000000000..d1fa556e6f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create-token.md @@ -0,0 +1,15 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createToken({ + userId: '<USER_ID>', + length: 4, // optional + expire: 60 // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/create.md b/docs/examples/1.8.x/console-web/examples/users/create.md new file mode 100644 index 0000000000..b61c814539 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/create.md @@ -0,0 +1,17 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.create({ + userId: '<USER_ID>', + email: 'email@example.com', // optional + phone: '+12065550100', // optional + password: '', // optional + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/delete-identity.md b/docs/examples/1.8.x/console-web/examples/users/delete-identity.md new file mode 100644 index 0000000000..9961f4a53f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/delete-identity.md @@ -0,0 +1,13 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.deleteIdentity({ + identityId: '<IDENTITY_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/console-web/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..eeba75ad32 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,14 @@ +import { Client, Users, AuthenticatorType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.deleteMFAAuthenticator({ + userId: '<USER_ID>', + type: AuthenticatorType.Totp +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/delete-session.md b/docs/examples/1.8.x/console-web/examples/users/delete-session.md new file mode 100644 index 0000000000..08342e854e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/delete-session.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.deleteSession({ + userId: '<USER_ID>', + sessionId: '<SESSION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/delete-sessions.md b/docs/examples/1.8.x/console-web/examples/users/delete-sessions.md new file mode 100644 index 0000000000..0f4d5efe0f --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/delete-sessions.md @@ -0,0 +1,13 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.deleteSessions({ + userId: '<USER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/delete-target.md b/docs/examples/1.8.x/console-web/examples/users/delete-target.md new file mode 100644 index 0000000000..44c65cda48 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/delete-target.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.deleteTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/delete.md b/docs/examples/1.8.x/console-web/examples/users/delete.md new file mode 100644 index 0000000000..dc702403f8 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/delete.md @@ -0,0 +1,13 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.delete({ + userId: '<USER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/console-web/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..082a2f8485 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.getMFARecoveryCodes({ + userId: '<USER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/get-prefs.md b/docs/examples/1.8.x/console-web/examples/users/get-prefs.md new file mode 100644 index 0000000000..61e575b12b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/get-prefs.md @@ -0,0 +1,13 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.getPrefs({ + userId: '<USER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/get-target.md b/docs/examples/1.8.x/console-web/examples/users/get-target.md new file mode 100644 index 0000000000..c5e209032c --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/get-target.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.getTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/get-usage.md b/docs/examples/1.8.x/console-web/examples/users/get-usage.md new file mode 100644 index 0000000000..80c3a0ced3 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/get-usage.md @@ -0,0 +1,13 @@ +import { Client, Users, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.getUsage({ + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/get.md b/docs/examples/1.8.x/console-web/examples/users/get.md new file mode 100644 index 0000000000..0c6ead786b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/get.md @@ -0,0 +1,13 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.get({ + userId: '<USER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/list-identities.md b/docs/examples/1.8.x/console-web/examples/users/list-identities.md new file mode 100644 index 0000000000..4cf88ccb54 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/list-identities.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.listIdentities({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/list-logs.md b/docs/examples/1.8.x/console-web/examples/users/list-logs.md new file mode 100644 index 0000000000..dfdaf1a068 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/list-logs.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.listLogs({ + userId: '<USER_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/list-memberships.md b/docs/examples/1.8.x/console-web/examples/users/list-memberships.md new file mode 100644 index 0000000000..e2b49223f8 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/list-memberships.md @@ -0,0 +1,15 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.listMemberships({ + userId: '<USER_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/console-web/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..4301971574 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/list-mfa-factors.md @@ -0,0 +1,13 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.listMFAFactors({ + userId: '<USER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/list-sessions.md b/docs/examples/1.8.x/console-web/examples/users/list-sessions.md new file mode 100644 index 0000000000..a506008fd7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/list-sessions.md @@ -0,0 +1,13 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.listSessions({ + userId: '<USER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/list-targets.md b/docs/examples/1.8.x/console-web/examples/users/list-targets.md new file mode 100644 index 0000000000..f3af0c4011 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/list-targets.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.listTargets({ + userId: '<USER_ID>', + queries: [] // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/list.md b/docs/examples/1.8.x/console-web/examples/users/list.md new file mode 100644 index 0000000000..de75f2dacb --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/list.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-email-verification.md b/docs/examples/1.8.x/console-web/examples/users/update-email-verification.md new file mode 100644 index 0000000000..f5af0085b7 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-email-verification.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateEmailVerification({ + userId: '<USER_ID>', + emailVerification: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-email.md b/docs/examples/1.8.x/console-web/examples/users/update-email.md new file mode 100644 index 0000000000..ed5c83886b --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-email.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateEmail({ + userId: '<USER_ID>', + email: 'email@example.com' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-labels.md b/docs/examples/1.8.x/console-web/examples/users/update-labels.md new file mode 100644 index 0000000000..e25ee6a6b0 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-labels.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateLabels({ + userId: '<USER_ID>', + labels: [] +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/console-web/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..f9eecac66d --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateMFARecoveryCodes({ + userId: '<USER_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-mfa.md b/docs/examples/1.8.x/console-web/examples/users/update-mfa.md new file mode 100644 index 0000000000..bbb33e8a42 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-mfa.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateMFA({ + userId: '<USER_ID>', + mfa: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-name.md b/docs/examples/1.8.x/console-web/examples/users/update-name.md new file mode 100644 index 0000000000..7433abca41 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-name.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateName({ + userId: '<USER_ID>', + name: '<NAME>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-password.md b/docs/examples/1.8.x/console-web/examples/users/update-password.md new file mode 100644 index 0000000000..5c620e60f1 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-password.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updatePassword({ + userId: '<USER_ID>', + password: '' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-phone-verification.md b/docs/examples/1.8.x/console-web/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..a163d34406 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-phone-verification.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updatePhoneVerification({ + userId: '<USER_ID>', + phoneVerification: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-phone.md b/docs/examples/1.8.x/console-web/examples/users/update-phone.md new file mode 100644 index 0000000000..a8a31dcfc9 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-phone.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updatePhone({ + userId: '<USER_ID>', + number: '+12065550100' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-prefs.md b/docs/examples/1.8.x/console-web/examples/users/update-prefs.md new file mode 100644 index 0000000000..a08e27d10e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-prefs.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updatePrefs({ + userId: '<USER_ID>', + prefs: {} +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-status.md b/docs/examples/1.8.x/console-web/examples/users/update-status.md new file mode 100644 index 0000000000..cdb393dd16 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-status.md @@ -0,0 +1,14 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateStatus({ + userId: '<USER_ID>', + status: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/users/update-target.md b/docs/examples/1.8.x/console-web/examples/users/update-target.md new file mode 100644 index 0000000000..27f5611cee --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/users/update-target.md @@ -0,0 +1,17 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.updateTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', // optional + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/vcs/create-repository-detection.md b/docs/examples/1.8.x/console-web/examples/vcs/create-repository-detection.md new file mode 100644 index 0000000000..69b2ea1f44 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/vcs/create-repository-detection.md @@ -0,0 +1,16 @@ +import { Client, Vcs, VCSDetectionType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.createRepositoryDetection({ + installationId: '<INSTALLATION_ID>', + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', + type: VCSDetectionType.Runtime, + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/vcs/create-repository.md b/docs/examples/1.8.x/console-web/examples/vcs/create-repository.md new file mode 100644 index 0000000000..7e4e629099 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/vcs/create-repository.md @@ -0,0 +1,15 @@ +import { Client, Vcs } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.createRepository({ + installationId: '<INSTALLATION_ID>', + name: '<NAME>', + private: false +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/vcs/delete-installation.md b/docs/examples/1.8.x/console-web/examples/vcs/delete-installation.md new file mode 100644 index 0000000000..9c49ac9cb5 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/vcs/delete-installation.md @@ -0,0 +1,13 @@ +import { Client, Vcs } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.deleteInstallation({ + installationId: '<INSTALLATION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/vcs/get-installation.md b/docs/examples/1.8.x/console-web/examples/vcs/get-installation.md new file mode 100644 index 0000000000..2942f5b56e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/vcs/get-installation.md @@ -0,0 +1,13 @@ +import { Client, Vcs } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.getInstallation({ + installationId: '<INSTALLATION_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/vcs/get-repository-contents.md b/docs/examples/1.8.x/console-web/examples/vcs/get-repository-contents.md new file mode 100644 index 0000000000..b33cadd448 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/vcs/get-repository-contents.md @@ -0,0 +1,16 @@ +import { Client, Vcs } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.getRepositoryContents({ + installationId: '<INSTALLATION_ID>', + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + providerReference: '<PROVIDER_REFERENCE>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/vcs/get-repository.md b/docs/examples/1.8.x/console-web/examples/vcs/get-repository.md new file mode 100644 index 0000000000..e42812e11e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/vcs/get-repository.md @@ -0,0 +1,14 @@ +import { Client, Vcs } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.getRepository({ + installationId: '<INSTALLATION_ID>', + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/vcs/list-installations.md b/docs/examples/1.8.x/console-web/examples/vcs/list-installations.md new file mode 100644 index 0000000000..5a90607262 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/vcs/list-installations.md @@ -0,0 +1,14 @@ +import { Client, Vcs } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.listInstallations({ + queries: [], // optional + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/vcs/list-repositories.md b/docs/examples/1.8.x/console-web/examples/vcs/list-repositories.md new file mode 100644 index 0000000000..cae640097e --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/vcs/list-repositories.md @@ -0,0 +1,15 @@ +import { Client, Vcs, VCSDetectionType } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.listRepositories({ + installationId: '<INSTALLATION_ID>', + type: VCSDetectionType.Runtime, + search: '<SEARCH>' // optional +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/vcs/list-repository-branches.md b/docs/examples/1.8.x/console-web/examples/vcs/list-repository-branches.md new file mode 100644 index 0000000000..d0103afa03 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/vcs/list-repository-branches.md @@ -0,0 +1,14 @@ +import { Client, Vcs } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.listRepositoryBranches({ + installationId: '<INSTALLATION_ID>', + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/console-web/examples/vcs/update-external-deployments.md b/docs/examples/1.8.x/console-web/examples/vcs/update-external-deployments.md new file mode 100644 index 0000000000..2ebcada011 --- /dev/null +++ b/docs/examples/1.8.x/console-web/examples/vcs/update-external-deployments.md @@ -0,0 +1,15 @@ +import { Client, Vcs } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.updateExternalDeployments({ + installationId: '<INSTALLATION_ID>', + repositoryId: '<REPOSITORY_ID>', + providerPullRequestId: '<PROVIDER_PULL_REQUEST_ID>' +}); + +console.log(result); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/server-dart/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..7b1cc08304 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-anonymous-session.md @@ -0,0 +1,9 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.createAnonymousSession(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-email-password-session.md b/docs/examples/1.8.x/server-dart/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..2305367d94 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-email-password-session.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.createEmailPasswordSession( + email: 'email@example.com', + password: 'password', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-email-token.md b/docs/examples/1.8.x/server-dart/examples/account/create-email-token.md new file mode 100644 index 0000000000..e9696f92bf --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-email-token.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.createEmailToken( + userId: '<USER_ID>', + email: 'email@example.com', + phrase: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-jwt.md b/docs/examples/1.8.x/server-dart/examples/account/create-jwt.md new file mode 100644 index 0000000000..4288c71ce1 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-jwt.md @@ -0,0 +1,9 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Jwt result = await account.createJWT(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/server-dart/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..791b9cbd4f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-magic-url-token.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.createMagicURLToken( + userId: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', // (optional) + phrase: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-dart/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..4dd2191ff2 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-mfa-authenticator.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +MfaType result = await account.createMFAAuthenticator( + type: AuthenticatorType.totp, +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-dart/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..5df3abadad --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-mfa-challenge.md @@ -0,0 +1,11 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +MfaChallenge result = await account.createMFAChallenge( + factor: AuthenticationFactor.email, +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dart/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..1e8d478887 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +MfaRecoveryCodes result = await account.createMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-dart/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..4a26a9fd7f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-o-auth-2-token.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +await account.createOAuth2Token( + provider: OAuthProvider.amazon, + success: 'https://example.com', // (optional) + failure: 'https://example.com', // (optional) + scopes: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-phone-token.md b/docs/examples/1.8.x/server-dart/examples/account/create-phone-token.md new file mode 100644 index 0000000000..7011b3cf48 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-phone-token.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Token result = await account.createPhoneToken( + userId: '<USER_ID>', + phone: '+12065550100', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-phone-verification.md b/docs/examples/1.8.x/server-dart/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..8616834b27 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-phone-verification.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.createPhoneVerification(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-recovery.md b/docs/examples/1.8.x/server-dart/examples/account/create-recovery.md new file mode 100644 index 0000000000..f56d4227a9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-recovery.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.createRecovery( + email: 'email@example.com', + url: 'https://example.com', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-session.md b/docs/examples/1.8.x/server-dart/examples/account/create-session.md new file mode 100644 index 0000000000..1e56fc71bb --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-session.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.createSession( + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create-verification.md b/docs/examples/1.8.x/server-dart/examples/account/create-verification.md new file mode 100644 index 0000000000..150833cd6b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create-verification.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.createVerification( + url: 'https://example.com', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/create.md b/docs/examples/1.8.x/server-dart/examples/account/create.md new file mode 100644 index 0000000000..f0384f46f4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/create.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +User result = await account.create( + userId: '<USER_ID>', + email: 'email@example.com', + password: '', + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/delete-identity.md b/docs/examples/1.8.x/server-dart/examples/account/delete-identity.md new file mode 100644 index 0000000000..124e6adad4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/delete-identity.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +await account.deleteIdentity( + identityId: '<IDENTITY_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-dart/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..7f3f4ab1c8 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +await account.deleteMFAAuthenticator( + type: AuthenticatorType.totp, +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/delete-session.md b/docs/examples/1.8.x/server-dart/examples/account/delete-session.md new file mode 100644 index 0000000000..d02808bbe9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/delete-session.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +await account.deleteSession( + sessionId: '<SESSION_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/delete-sessions.md b/docs/examples/1.8.x/server-dart/examples/account/delete-sessions.md new file mode 100644 index 0000000000..9406ca39d0 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/delete-sessions.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +await account.deleteSessions(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dart/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..5ff858fdaf --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +MfaRecoveryCodes result = await account.getMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/get-prefs.md b/docs/examples/1.8.x/server-dart/examples/account/get-prefs.md new file mode 100644 index 0000000000..94e10db1b6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/get-prefs.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Preferences result = await account.getPrefs(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/get-session.md b/docs/examples/1.8.x/server-dart/examples/account/get-session.md new file mode 100644 index 0000000000..3a81954bd9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/get-session.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Session result = await account.getSession( + sessionId: '<SESSION_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/get.md b/docs/examples/1.8.x/server-dart/examples/account/get.md new file mode 100644 index 0000000000..76a139a46a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/get.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.get(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/list-identities.md b/docs/examples/1.8.x/server-dart/examples/account/list-identities.md new file mode 100644 index 0000000000..a0b67851c2 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/list-identities.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +IdentityList result = await account.listIdentities( + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/list-logs.md b/docs/examples/1.8.x/server-dart/examples/account/list-logs.md new file mode 100644 index 0000000000..d3c50af1d5 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/list-logs.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +LogList result = await account.listLogs( + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/server-dart/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..083b51d6c3 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/list-mfa-factors.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +MfaFactors result = await account.listMFAFactors(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/list-sessions.md b/docs/examples/1.8.x/server-dart/examples/account/list-sessions.md new file mode 100644 index 0000000000..73cf462af6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/list-sessions.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +SessionList result = await account.listSessions(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-email.md b/docs/examples/1.8.x/server-dart/examples/account/update-email.md new file mode 100644 index 0000000000..cf6a56edcc --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-email.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updateEmail( + email: 'email@example.com', + password: 'password', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/server-dart/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..475e464ff0 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-magic-url-session.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.updateMagicURLSession( + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-dart/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..c475d30e19 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-mfa-authenticator.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updateMFAAuthenticator( + type: AuthenticatorType.totp, + otp: '<OTP>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-dart/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..6cf3bb473e --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-mfa-challenge.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Session result = await account.updateMFAChallenge( + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dart/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..10fc77d2f2 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +MfaRecoveryCodes result = await account.updateMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-mfa.md b/docs/examples/1.8.x/server-dart/examples/account/update-mfa.md new file mode 100644 index 0000000000..947d862e46 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-mfa.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updateMFA( + mfa: false, +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-name.md b/docs/examples/1.8.x/server-dart/examples/account/update-name.md new file mode 100644 index 0000000000..82cc3358a1 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-name.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updateName( + name: '<NAME>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-password.md b/docs/examples/1.8.x/server-dart/examples/account/update-password.md new file mode 100644 index 0000000000..27d360ba51 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-password.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updatePassword( + password: '', + oldPassword: 'password', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-phone-session.md b/docs/examples/1.8.x/server-dart/examples/account/update-phone-session.md new file mode 100644 index 0000000000..046dd0a701 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-phone-session.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +Account account = Account(client); + +Session result = await account.updatePhoneSession( + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-phone-verification.md b/docs/examples/1.8.x/server-dart/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..f4b0c6fe6a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-phone-verification.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.updatePhoneVerification( + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-phone.md b/docs/examples/1.8.x/server-dart/examples/account/update-phone.md new file mode 100644 index 0000000000..d861561b60 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-phone.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updatePhone( + phone: '+12065550100', + password: 'password', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-prefs.md b/docs/examples/1.8.x/server-dart/examples/account/update-prefs.md new file mode 100644 index 0000000000..4334383546 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-prefs.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updatePrefs( + prefs: { + "language": "en", + "timezone": "UTC", + "darkTheme": true + }, +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-recovery.md b/docs/examples/1.8.x/server-dart/examples/account/update-recovery.md new file mode 100644 index 0000000000..162ad58ac9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-recovery.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.updateRecovery( + userId: '<USER_ID>', + secret: '<SECRET>', + password: '', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-session.md b/docs/examples/1.8.x/server-dart/examples/account/update-session.md new file mode 100644 index 0000000000..a317a0840a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-session.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Session result = await account.updateSession( + sessionId: '<SESSION_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-status.md b/docs/examples/1.8.x/server-dart/examples/account/update-status.md new file mode 100644 index 0000000000..2ee15d603c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-status.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +User result = await account.updateStatus(); diff --git a/docs/examples/1.8.x/server-dart/examples/account/update-verification.md b/docs/examples/1.8.x/server-dart/examples/account/update-verification.md new file mode 100644 index 0000000000..61904fd3f0 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/account/update-verification.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Account account = Account(client); + +Token result = await account.updateVerification( + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/avatars/get-browser.md b/docs/examples/1.8.x/server-dart/examples/avatars/get-browser.md new file mode 100644 index 0000000000..8d5287511d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/avatars/get-browser.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +UInt8List result = await avatars.getBrowser( + code: Browser.avantBrowser, + width: 0, // (optional) + height: 0, // (optional) + quality: -1, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/server-dart/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..88fe35ebd9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/avatars/get-credit-card.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +UInt8List result = await avatars.getCreditCard( + code: CreditCard.americanExpress, + width: 0, // (optional) + height: 0, // (optional) + quality: -1, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/avatars/get-favicon.md b/docs/examples/1.8.x/server-dart/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..d4cd8eae83 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/avatars/get-favicon.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +UInt8List result = await avatars.getFavicon( + url: 'https://example.com', +); diff --git a/docs/examples/1.8.x/server-dart/examples/avatars/get-flag.md b/docs/examples/1.8.x/server-dart/examples/avatars/get-flag.md new file mode 100644 index 0000000000..56046681bc --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/avatars/get-flag.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +UInt8List result = await avatars.getFlag( + code: Flag.afghanistan, + width: 0, // (optional) + height: 0, // (optional) + quality: -1, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/avatars/get-image.md b/docs/examples/1.8.x/server-dart/examples/avatars/get-image.md new file mode 100644 index 0000000000..b6db1858c5 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/avatars/get-image.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +UInt8List result = await avatars.getImage( + url: 'https://example.com', + width: 0, // (optional) + height: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/avatars/get-initials.md b/docs/examples/1.8.x/server-dart/examples/avatars/get-initials.md new file mode 100644 index 0000000000..7dc0989b4d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/avatars/get-initials.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +UInt8List result = await avatars.getInitials( + name: '<NAME>', // (optional) + width: 0, // (optional) + height: 0, // (optional) + background: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/avatars/get-qr.md b/docs/examples/1.8.x/server-dart/examples/avatars/get-qr.md new file mode 100644 index 0000000000..f64fe8a4ff --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/avatars/get-qr.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Avatars avatars = Avatars(client); + +UInt8List result = await avatars.getQR( + text: '<TEXT>', + size: 1, // (optional) + margin: 0, // (optional) + download: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..13ca992889 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-boolean-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeBoolean result = await databases.createBooleanAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: false, // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-collection.md b/docs/examples/1.8.x/server-dart/examples/databases/create-collection.md new file mode 100644 index 0000000000..61401761ec --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-collection.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Collection result = await databases.createCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], // (optional) + documentSecurity: false, // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..2591011423 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-datetime-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeDatetime result = await databases.createDatetimeAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: '', // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-document.md b/docs/examples/1.8.x/server-dart/examples/databases/create-document.md new file mode 100644 index 0000000000..e3bae98162 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-document.md @@ -0,0 +1,22 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.createDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-documents.md b/docs/examples/1.8.x/server-dart/examples/databases/create-documents.md new file mode 100644 index 0000000000..ba0e34950b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-documents.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +DocumentList result = await databases.createDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..216d020260 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-email-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeEmail result = await databases.createEmailAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: 'email@example.com', // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..d45ca4476c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-enum-attribute.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeEnum result = await databases.createEnumAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + elements: [], + xrequired: false, + xdefault: '<DEFAULT>', // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..75d47f44ad --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-float-attribute.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeFloat result = await databases.createFloatAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + min: 0, // (optional) + max: 0, // (optional) + xdefault: 0, // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-index.md b/docs/examples/1.8.x/server-dart/examples/databases/create-index.md new file mode 100644 index 0000000000..c3fa1abd60 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-index.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Index result = await databases.createIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + type: IndexType.key, + attributes: [], + orders: [], // (optional) + lengths: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..6511696f92 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-integer-attribute.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeInteger result = await databases.createIntegerAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + min: 0, // (optional) + max: 0, // (optional) + xdefault: 0, // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..10ddb47bdf --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-ip-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeIp result = await databases.createIpAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: '', // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..74e8e406b8 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-line-attribute.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeLine result = await databases.createLineAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: [[1, 2], [3, 4], [5, 6]], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..7a630825a1 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-point-attribute.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributePoint result = await databases.createPointAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: [1, 2], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..b0fa8d6a38 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-polygon-attribute.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributePolygon result = await databases.createPolygonAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..dcdf34fcb8 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-relationship-attribute.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeRelationship result = await databases.createRelationshipAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + relatedCollectionId: '<RELATED_COLLECTION_ID>', + type: RelationshipType.oneToOne, + twoWay: false, // (optional) + key: '', // (optional) + twoWayKey: '', // (optional) + onDelete: RelationMutate.cascade, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..8785ea7647 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-string-attribute.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeString result = await databases.createStringAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + size: 1, + xrequired: false, + xdefault: '<DEFAULT>', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..9088f8dfeb --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create-url-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeUrl result = await databases.createUrlAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: 'https://example.com', // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/create.md b/docs/examples/1.8.x/server-dart/examples/databases/create.md new file mode 100644 index 0000000000..a2e978bd30 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/create.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Database result = await databases.create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..e46244874d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/decrement-document-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.decrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: 0, // (optional) + min: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/delete-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..f9cbbd42ef --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/delete-attribute.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +await databases.deleteAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/delete-collection.md b/docs/examples/1.8.x/server-dart/examples/databases/delete-collection.md new file mode 100644 index 0000000000..919e17891b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/delete-collection.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +await databases.deleteCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/delete-document.md b/docs/examples/1.8.x/server-dart/examples/databases/delete-document.md new file mode 100644 index 0000000000..dd04d89959 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/delete-document.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +await databases.deleteDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/delete-documents.md b/docs/examples/1.8.x/server-dart/examples/databases/delete-documents.md new file mode 100644 index 0000000000..66bd5584c7 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/delete-documents.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +await databases.deleteDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/delete-index.md b/docs/examples/1.8.x/server-dart/examples/databases/delete-index.md new file mode 100644 index 0000000000..f16c84b9a7 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/delete-index.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +await databases.deleteIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/delete.md b/docs/examples/1.8.x/server-dart/examples/databases/delete.md new file mode 100644 index 0000000000..5e9042e542 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/delete.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +await databases.delete( + databaseId: '<DATABASE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/get-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/get-attribute.md new file mode 100644 index 0000000000..8329f8db05 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/get-attribute.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + + result = await databases.getAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/get-collection.md b/docs/examples/1.8.x/server-dart/examples/databases/get-collection.md new file mode 100644 index 0000000000..b678420128 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/get-collection.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Collection result = await databases.getCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/get-document.md b/docs/examples/1.8.x/server-dart/examples/databases/get-document.md new file mode 100644 index 0000000000..45745186e6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/get-document.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.getDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/get-index.md b/docs/examples/1.8.x/server-dart/examples/databases/get-index.md new file mode 100644 index 0000000000..848257960a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/get-index.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Index result = await databases.getIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/get.md b/docs/examples/1.8.x/server-dart/examples/databases/get.md new file mode 100644 index 0000000000..28d3d2bd14 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/get.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Database result = await databases.get( + databaseId: '<DATABASE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..a2d2622629 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/increment-document-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.incrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: 0, // (optional) + max: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/list-attributes.md b/docs/examples/1.8.x/server-dart/examples/databases/list-attributes.md new file mode 100644 index 0000000000..64aaf331b8 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/list-attributes.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeList result = await databases.listAttributes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/list-collections.md b/docs/examples/1.8.x/server-dart/examples/databases/list-collections.md new file mode 100644 index 0000000000..69c2a0fe61 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/list-collections.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +CollectionList result = await databases.listCollections( + databaseId: '<DATABASE_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/list-documents.md b/docs/examples/1.8.x/server-dart/examples/databases/list-documents.md new file mode 100644 index 0000000000..cdecc59e33 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/list-documents.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +DocumentList result = await databases.listDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/list-indexes.md b/docs/examples/1.8.x/server-dart/examples/databases/list-indexes.md new file mode 100644 index 0000000000..38b95d5d5b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/list-indexes.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +IndexList result = await databases.listIndexes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/list.md b/docs/examples/1.8.x/server-dart/examples/databases/list.md new file mode 100644 index 0000000000..2de4e97cf2 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/list.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +DatabaseList result = await databases.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..46e3ef4ce3 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-boolean-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeBoolean result = await databases.updateBooleanAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: false, + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-collection.md b/docs/examples/1.8.x/server-dart/examples/databases/update-collection.md new file mode 100644 index 0000000000..c3c565b231 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-collection.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Collection result = await databases.updateCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], // (optional) + documentSecurity: false, // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..ddc8f26a70 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-datetime-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeDatetime result = await databases.updateDatetimeAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: '', + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-document.md b/docs/examples/1.8.x/server-dart/examples/databases/update-document.md new file mode 100644 index 0000000000..47a1867c10 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-document.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.updateDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // (optional) + permissions: ["read("any")"], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-documents.md b/docs/examples/1.8.x/server-dart/examples/databases/update-documents.md new file mode 100644 index 0000000000..70b7cbf86d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-documents.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +DocumentList result = await databases.updateDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: {}, // (optional) + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..ee0e09719e --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-email-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeEmail result = await databases.updateEmailAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: 'email@example.com', + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..61ef4d0835 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-enum-attribute.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeEnum result = await databases.updateEnumAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + elements: [], + xrequired: false, + xdefault: '<DEFAULT>', + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..36f360eebc --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-float-attribute.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeFloat result = await databases.updateFloatAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: 0, + min: 0, // (optional) + max: 0, // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..9089cc8bf6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-integer-attribute.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeInteger result = await databases.updateIntegerAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: 0, + min: 0, // (optional) + max: 0, // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..e698a59e3a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-ip-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeIp result = await databases.updateIpAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: '', + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..8787e84433 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-line-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeLine result = await databases.updateLineAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: [[1, 2], [3, 4], [5, 6]], // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..d1a64941d5 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-point-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributePoint result = await databases.updatePointAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: [1, 2], // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..3596475911 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-polygon-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributePolygon result = await databases.updatePolygonAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..28aac9643f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-relationship-attribute.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeRelationship result = await databases.updateRelationshipAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + onDelete: RelationMutate.cascade, // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..7674f51c5b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-string-attribute.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeString result = await databases.updateStringAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: '<DEFAULT>', + size: 1, // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/server-dart/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..3aaa01b441 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update-url-attribute.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +AttributeUrl result = await databases.updateUrlAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + xrequired: false, + xdefault: 'https://example.com', + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/update.md b/docs/examples/1.8.x/server-dart/examples/databases/update.md new file mode 100644 index 0000000000..a46f116389 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/update.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +Database result = await databases.update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/upsert-document.md b/docs/examples/1.8.x/server-dart/examples/databases/upsert-document.md new file mode 100644 index 0000000000..93e306ebce --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/upsert-document.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.upsertDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, + permissions: ["read("any")"], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/databases/upsert-documents.md b/docs/examples/1.8.x/server-dart/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..cd35014f63 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/databases/upsert-documents.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Databases databases = Databases(client); + +DocumentList result = await databases.upsertDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [], +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/create-deployment.md b/docs/examples/1.8.x/server-dart/examples/functions/create-deployment.md new file mode 100644 index 0000000000..f459b3dd89 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/create-deployment.md @@ -0,0 +1,17 @@ +import 'dart:io'; +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.createDeployment( + functionId: '<FUNCTION_ID>', + code: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), + activate: false, + entrypoint: '<ENTRYPOINT>', // (optional) + commands: '<COMMANDS>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-dart/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..34ff5b2067 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.createDuplicateDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + buildId: '<BUILD_ID>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/create-execution.md b/docs/examples/1.8.x/server-dart/examples/functions/create-execution.md new file mode 100644 index 0000000000..64b28d5f0c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/create-execution.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Functions functions = Functions(client); + +Execution result = await functions.createExecution( + functionId: '<FUNCTION_ID>', + body: '<BODY>', // (optional) + xasync: false, // (optional) + path: '<PATH>', // (optional) + method: ExecutionMethod.gET, // (optional) + headers: {}, // (optional) + scheduledAt: '<SCHEDULED_AT>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/server-dart/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..cc293b0c3b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/create-template-deployment.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.createTemplateDeployment( + functionId: '<FUNCTION_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/create-variable.md b/docs/examples/1.8.x/server-dart/examples/functions/create-variable.md new file mode 100644 index 0000000000..03e36d8275 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/create-variable.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Variable result = await functions.createVariable( + functionId: '<FUNCTION_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-dart/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..ed315a54e3 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/create-vcs-deployment.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.createVcsDeployment( + functionId: '<FUNCTION_ID>', + type: VCSDeploymentType.branch, + reference: '<REFERENCE>', + activate: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/create.md b/docs/examples/1.8.x/server-dart/examples/functions/create.md new file mode 100644 index 0000000000..f3f2683000 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/create.md @@ -0,0 +1,29 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Func result = await functions.create( + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: .node145, + execute: ["any"], // (optional) + events: [], // (optional) + schedule: '', // (optional) + timeout: 1, // (optional) + enabled: false, // (optional) + logging: false, // (optional) + entrypoint: '<ENTRYPOINT>', // (optional) + commands: '<COMMANDS>', // (optional) + scopes: [], // (optional) + installationId: '<INSTALLATION_ID>', // (optional) + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional) + providerBranch: '<PROVIDER_BRANCH>', // (optional) + providerSilentMode: false, // (optional) + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // (optional) + specification: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/delete-deployment.md b/docs/examples/1.8.x/server-dart/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..8e4167f756 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/delete-deployment.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +await functions.deleteDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/delete-execution.md b/docs/examples/1.8.x/server-dart/examples/functions/delete-execution.md new file mode 100644 index 0000000000..d077bc9328 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/delete-execution.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +await functions.deleteExecution( + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/delete-variable.md b/docs/examples/1.8.x/server-dart/examples/functions/delete-variable.md new file mode 100644 index 0000000000..d4b2832830 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/delete-variable.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +await functions.deleteVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/delete.md b/docs/examples/1.8.x/server-dart/examples/functions/delete.md new file mode 100644 index 0000000000..38d360b764 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/delete.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +await functions.delete( + functionId: '<FUNCTION_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/server-dart/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..e7bbacf344 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/get-deployment-download.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +UInt8List result = await functions.getDeploymentDownload( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType.source, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/get-deployment.md b/docs/examples/1.8.x/server-dart/examples/functions/get-deployment.md new file mode 100644 index 0000000000..805ca0b634 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/get-deployment.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.getDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/get-execution.md b/docs/examples/1.8.x/server-dart/examples/functions/get-execution.md new file mode 100644 index 0000000000..e0026e0c4b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/get-execution.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Functions functions = Functions(client); + +Execution result = await functions.getExecution( + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/get-variable.md b/docs/examples/1.8.x/server-dart/examples/functions/get-variable.md new file mode 100644 index 0000000000..fe61cee587 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/get-variable.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Variable result = await functions.getVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/get.md b/docs/examples/1.8.x/server-dart/examples/functions/get.md new file mode 100644 index 0000000000..c92a4f746c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/get.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Func result = await functions.get( + functionId: '<FUNCTION_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/list-deployments.md b/docs/examples/1.8.x/server-dart/examples/functions/list-deployments.md new file mode 100644 index 0000000000..d07d2b32f3 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/list-deployments.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +DeploymentList result = await functions.listDeployments( + functionId: '<FUNCTION_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/list-executions.md b/docs/examples/1.8.x/server-dart/examples/functions/list-executions.md new file mode 100644 index 0000000000..1dfd39093d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/list-executions.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Functions functions = Functions(client); + +ExecutionList result = await functions.listExecutions( + functionId: '<FUNCTION_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/list-runtimes.md b/docs/examples/1.8.x/server-dart/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..a99f872b7e --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/list-runtimes.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +RuntimeList result = await functions.listRuntimes(); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/list-specifications.md b/docs/examples/1.8.x/server-dart/examples/functions/list-specifications.md new file mode 100644 index 0000000000..bec5d5e635 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/list-specifications.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +SpecificationList result = await functions.listSpecifications(); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/list-variables.md b/docs/examples/1.8.x/server-dart/examples/functions/list-variables.md new file mode 100644 index 0000000000..0fa3b002bf --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/list-variables.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +VariableList result = await functions.listVariables( + functionId: '<FUNCTION_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/list.md b/docs/examples/1.8.x/server-dart/examples/functions/list.md new file mode 100644 index 0000000000..8eaeec0625 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/list.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +FunctionList result = await functions.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/server-dart/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..2b068098af --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/update-deployment-status.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.updateDeploymentStatus( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/server-dart/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..0a5c09dd96 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/update-function-deployment.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Func result = await functions.updateFunctionDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/update-variable.md b/docs/examples/1.8.x/server-dart/examples/functions/update-variable.md new file mode 100644 index 0000000000..7330d9f850 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/update-variable.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Variable result = await functions.updateVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', // (optional) + secret: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/functions/update.md b/docs/examples/1.8.x/server-dart/examples/functions/update.md new file mode 100644 index 0000000000..ebe3be8cc6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/functions/update.md @@ -0,0 +1,29 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Functions functions = Functions(client); + +Func result = await functions.update( + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: .node145, // (optional) + execute: ["any"], // (optional) + events: [], // (optional) + schedule: '', // (optional) + timeout: 1, // (optional) + enabled: false, // (optional) + logging: false, // (optional) + entrypoint: '<ENTRYPOINT>', // (optional) + commands: '<COMMANDS>', // (optional) + scopes: [], // (optional) + installationId: '<INSTALLATION_ID>', // (optional) + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional) + providerBranch: '<PROVIDER_BRANCH>', // (optional) + providerSilentMode: false, // (optional) + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // (optional) + specification: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/graphql/mutation.md b/docs/examples/1.8.x/server-dart/examples/graphql/mutation.md new file mode 100644 index 0000000000..a88749851c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/graphql/mutation.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Graphql graphql = Graphql(client); + +Any result = await graphql.mutation( + query: {}, +); diff --git a/docs/examples/1.8.x/server-dart/examples/graphql/query.md b/docs/examples/1.8.x/server-dart/examples/graphql/query.md new file mode 100644 index 0000000000..2dca8f2929 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/graphql/query.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Graphql graphql = Graphql(client); + +Any result = await graphql.query( + query: {}, +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-antivirus.md b/docs/examples/1.8.x/server-dart/examples/health/get-antivirus.md new file mode 100644 index 0000000000..395d1f84d1 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-antivirus.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthAntivirus result = await health.getAntivirus(); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-cache.md b/docs/examples/1.8.x/server-dart/examples/health/get-cache.md new file mode 100644 index 0000000000..6312e3cbe6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-cache.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthStatus result = await health.getCache(); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-certificate.md b/docs/examples/1.8.x/server-dart/examples/health/get-certificate.md new file mode 100644 index 0000000000..eac30a6aef --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-certificate.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthCertificate result = await health.getCertificate( + domain: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-db.md b/docs/examples/1.8.x/server-dart/examples/health/get-db.md new file mode 100644 index 0000000000..25ad9607f5 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-db.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthStatus result = await health.getDB(); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/server-dart/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..6f80718f6b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-failed-jobs.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getFailedJobs( + name: .v1Database, + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-pub-sub.md b/docs/examples/1.8.x/server-dart/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..d544fbfc40 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-pub-sub.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthStatus result = await health.getPubSub(); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-builds.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..b48623ec18 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-builds.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueBuilds( + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..d72ac97b14 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-certificates.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueCertificates( + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-databases.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..b9d8e8bc66 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-databases.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueDatabases( + name: '<NAME>', // (optional) + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..3074cbb8ab --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-deletes.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueDeletes( + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-functions.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..727fd239cc --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-functions.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueFunctions( + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-logs.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..32d3e3bb7b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-logs.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueLogs( + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-mails.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..93ec993845 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-mails.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueMails( + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..4ffd769d3c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-messaging.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueMessaging( + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..fab19875e5 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-migrations.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueMigrations( + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..89a3d03179 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-stats-resources.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueStatsResources( + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-usage.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..473dcd15ee --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-usage.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueUsage( + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-dart/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..523c1007f5 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-queue-webhooks.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthQueue result = await health.getQueueWebhooks( + threshold: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-storage-local.md b/docs/examples/1.8.x/server-dart/examples/health/get-storage-local.md new file mode 100644 index 0000000000..c33cf555f3 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-storage-local.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthStatus result = await health.getStorageLocal(); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-storage.md b/docs/examples/1.8.x/server-dart/examples/health/get-storage.md new file mode 100644 index 0000000000..cb6c572154 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-storage.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthStatus result = await health.getStorage(); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get-time.md b/docs/examples/1.8.x/server-dart/examples/health/get-time.md new file mode 100644 index 0000000000..f4439957d9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get-time.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthTime result = await health.getTime(); diff --git a/docs/examples/1.8.x/server-dart/examples/health/get.md b/docs/examples/1.8.x/server-dart/examples/health/get.md new file mode 100644 index 0000000000..3134490848 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/health/get.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Health health = Health(client); + +HealthStatus result = await health.get(); diff --git a/docs/examples/1.8.x/server-dart/examples/locale/get.md b/docs/examples/1.8.x/server-dart/examples/locale/get.md new file mode 100644 index 0000000000..dec6f068c6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/locale/get.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +Locale result = await locale.get(); diff --git a/docs/examples/1.8.x/server-dart/examples/locale/list-codes.md b/docs/examples/1.8.x/server-dart/examples/locale/list-codes.md new file mode 100644 index 0000000000..9f9eac9f29 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/locale/list-codes.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +LocaleCodeList result = await locale.listCodes(); diff --git a/docs/examples/1.8.x/server-dart/examples/locale/list-continents.md b/docs/examples/1.8.x/server-dart/examples/locale/list-continents.md new file mode 100644 index 0000000000..276738eac7 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/locale/list-continents.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +ContinentList result = await locale.listContinents(); diff --git a/docs/examples/1.8.x/server-dart/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/server-dart/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..59596c624c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/locale/list-countries-eu.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +CountryList result = await locale.listCountriesEU(); diff --git a/docs/examples/1.8.x/server-dart/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/server-dart/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..2a2d32eaca --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/locale/list-countries-phones.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +PhoneList result = await locale.listCountriesPhones(); diff --git a/docs/examples/1.8.x/server-dart/examples/locale/list-countries.md b/docs/examples/1.8.x/server-dart/examples/locale/list-countries.md new file mode 100644 index 0000000000..6b8343c6b3 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/locale/list-countries.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +CountryList result = await locale.listCountries(); diff --git a/docs/examples/1.8.x/server-dart/examples/locale/list-currencies.md b/docs/examples/1.8.x/server-dart/examples/locale/list-currencies.md new file mode 100644 index 0000000000..48247d98fe --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/locale/list-currencies.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +CurrencyList result = await locale.listCurrencies(); diff --git a/docs/examples/1.8.x/server-dart/examples/locale/list-languages.md b/docs/examples/1.8.x/server-dart/examples/locale/list-languages.md new file mode 100644 index 0000000000..2376f18917 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/locale/list-languages.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Locale locale = Locale(client); + +LanguageList result = await locale.listLanguages(); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..a4faf2dacf --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-apns-provider.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createAPNSProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + authKey: '<AUTH_KEY>', // (optional) + authKeyId: '<AUTH_KEY_ID>', // (optional) + teamId: '<TEAM_ID>', // (optional) + bundleId: '<BUNDLE_ID>', // (optional) + sandbox: false, // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-email.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-email.md new file mode 100644 index 0000000000..78c695c7ed --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-email.md @@ -0,0 +1,23 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.createEmail( + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + cc: [], // (optional) + bcc: [], // (optional) + attachments: [], // (optional) + draft: false, // (optional) + html: false, // (optional) + scheduledAt: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..ce4f810d5d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-fcm-provider.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createFCMProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + serviceAccountJSON: {}, // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..10d803d624 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,21 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createMailgunProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // (optional) + domain: '<DOMAIN>', // (optional) + isEuRegion: false, // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: 'email@example.com', // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..b283b75325 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createMsg91Provider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + templateId: '<TEMPLATE_ID>', // (optional) + senderId: '<SENDER_ID>', // (optional) + authKey: '<AUTH_KEY>', // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-push.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-push.md new file mode 100644 index 0000000000..58d82c7a0a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-push.md @@ -0,0 +1,30 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.createPush( + messageId: '<MESSAGE_ID>', + title: '<TITLE>', // (optional) + body: '<BODY>', // (optional) + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + data: {}, // (optional) + action: '<ACTION>', // (optional) + image: '[ID1:ID2]', // (optional) + icon: '<ICON>', // (optional) + sound: '<SOUND>', // (optional) + color: '<COLOR>', // (optional) + tag: '<TAG>', // (optional) + badge: 0, // (optional) + draft: false, // (optional) + scheduledAt: '', // (optional) + contentAvailable: false, // (optional) + critical: false, // (optional) + priority: MessagePriority.normal, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..e759a26094 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createSendgridProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: 'email@example.com', // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-sms.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-sms.md new file mode 100644 index 0000000000..ca90bc6011 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-sms.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.createSMS( + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + draft: false, // (optional) + scheduledAt: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..644d30faa7 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-smtp-provider.md @@ -0,0 +1,25 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createSMTPProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 1, // (optional) + username: '<USERNAME>', // (optional) + password: '<PASSWORD>', // (optional) + encryption: SmtpEncryption.none, // (optional) + autoTLS: false, // (optional) + mailer: '<MAILER>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: 'email@example.com', // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..5fd4859fb9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-subscriber.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +Messaging messaging = Messaging(client); + +Subscriber result = await messaging.createSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..5417b951dd --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-telesign-provider.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createTelesignProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // (optional) + customerId: '<CUSTOMER_ID>', // (optional) + apiKey: '<API_KEY>', // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..4cf6463b6e --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createTextmagicProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // (optional) + username: '<USERNAME>', // (optional) + apiKey: '<API_KEY>', // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-topic.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-topic.md new file mode 100644 index 0000000000..67e47412a1 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-topic.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Topic result = await messaging.createTopic( + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ["any"], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..8c3370baa7 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-twilio-provider.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createTwilioProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // (optional) + accountSid: '<ACCOUNT_SID>', // (optional) + authToken: '<AUTH_TOKEN>', // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..d625f38230 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/create-vonage-provider.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.createVonageProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // (optional) + apiKey: '<API_KEY>', // (optional) + apiSecret: '<API_SECRET>', // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/delete-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..361bacc2c3 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/delete-provider.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +await messaging.deleteProvider( + providerId: '<PROVIDER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-dart/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..e4a044c280 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/delete-subscriber.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +Messaging messaging = Messaging(client); + +await messaging.deleteSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/delete-topic.md b/docs/examples/1.8.x/server-dart/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..59c5592c93 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/delete-topic.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +await messaging.deleteTopic( + topicId: '<TOPIC_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/delete.md b/docs/examples/1.8.x/server-dart/examples/messaging/delete.md new file mode 100644 index 0000000000..14b680ae99 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/delete.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +await messaging.delete( + messageId: '<MESSAGE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/get-message.md b/docs/examples/1.8.x/server-dart/examples/messaging/get-message.md new file mode 100644 index 0000000000..ccc98961e7 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/get-message.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.getMessage( + messageId: '<MESSAGE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/get-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/get-provider.md new file mode 100644 index 0000000000..a82ef15775 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/get-provider.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.getProvider( + providerId: '<PROVIDER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/server-dart/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..03f78b7fa4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/get-subscriber.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Subscriber result = await messaging.getSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/get-topic.md b/docs/examples/1.8.x/server-dart/examples/messaging/get-topic.md new file mode 100644 index 0000000000..204f875793 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/get-topic.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Topic result = await messaging.getTopic( + topicId: '<TOPIC_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/server-dart/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..1d2b1805b4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/list-message-logs.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +LogList result = await messaging.listMessageLogs( + messageId: '<MESSAGE_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/list-messages.md b/docs/examples/1.8.x/server-dart/examples/messaging/list-messages.md new file mode 100644 index 0000000000..2c0a142ee8 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/list-messages.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +MessageList result = await messaging.listMessages( + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-dart/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..9f40a5fa49 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/list-provider-logs.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +LogList result = await messaging.listProviderLogs( + providerId: '<PROVIDER_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/list-providers.md b/docs/examples/1.8.x/server-dart/examples/messaging/list-providers.md new file mode 100644 index 0000000000..df7a8a022c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/list-providers.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +ProviderList result = await messaging.listProviders( + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-dart/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..3a9593ca89 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +LogList result = await messaging.listSubscriberLogs( + subscriberId: '<SUBSCRIBER_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/server-dart/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..19d907cd9a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/list-subscribers.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +SubscriberList result = await messaging.listSubscribers( + topicId: '<TOPIC_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/list-targets.md b/docs/examples/1.8.x/server-dart/examples/messaging/list-targets.md new file mode 100644 index 0000000000..5a327773c2 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/list-targets.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +TargetList result = await messaging.listTargets( + messageId: '<MESSAGE_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-dart/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..0ab02eaa74 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/list-topic-logs.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +LogList result = await messaging.listTopicLogs( + topicId: '<TOPIC_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/list-topics.md b/docs/examples/1.8.x/server-dart/examples/messaging/list-topics.md new file mode 100644 index 0000000000..c5fdb4901f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/list-topics.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +TopicList result = await messaging.listTopics( + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..7f3bc8340e --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-apns-provider.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateAPNSProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + authKey: '<AUTH_KEY>', // (optional) + authKeyId: '<AUTH_KEY_ID>', // (optional) + teamId: '<TEAM_ID>', // (optional) + bundleId: '<BUNDLE_ID>', // (optional) + sandbox: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-email.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-email.md new file mode 100644 index 0000000000..b725cee5f0 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-email.md @@ -0,0 +1,23 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.updateEmail( + messageId: '<MESSAGE_ID>', + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + subject: '<SUBJECT>', // (optional) + content: '<CONTENT>', // (optional) + draft: false, // (optional) + html: false, // (optional) + cc: [], // (optional) + bcc: [], // (optional) + scheduledAt: '', // (optional) + attachments: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..65afba1fe2 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-fcm-provider.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateFCMProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + serviceAccountJSON: {}, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..c042a6faaa --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,21 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateMailgunProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + apiKey: '<API_KEY>', // (optional) + domain: '<DOMAIN>', // (optional) + isEuRegion: false, // (optional) + enabled: false, // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: '<REPLY_TO_EMAIL>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..24290e958f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateMsg91Provider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + templateId: '<TEMPLATE_ID>', // (optional) + senderId: '<SENDER_ID>', // (optional) + authKey: '<AUTH_KEY>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-push.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-push.md new file mode 100644 index 0000000000..f7cc117b64 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-push.md @@ -0,0 +1,30 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.updatePush( + messageId: '<MESSAGE_ID>', + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + title: '<TITLE>', // (optional) + body: '<BODY>', // (optional) + data: {}, // (optional) + action: '<ACTION>', // (optional) + image: '[ID1:ID2]', // (optional) + icon: '<ICON>', // (optional) + sound: '<SOUND>', // (optional) + color: '<COLOR>', // (optional) + tag: '<TAG>', // (optional) + badge: 0, // (optional) + draft: false, // (optional) + scheduledAt: '', // (optional) + contentAvailable: false, // (optional) + critical: false, // (optional) + priority: MessagePriority.normal, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..53b8c33df4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateSendgridProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + apiKey: '<API_KEY>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: '<REPLY_TO_EMAIL>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-sms.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-sms.md new file mode 100644 index 0000000000..26e6649b57 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-sms.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message result = await messaging.updateSMS( + messageId: '<MESSAGE_ID>', + topics: [], // (optional) + users: [], // (optional) + targets: [], // (optional) + content: '<CONTENT>', // (optional) + draft: false, // (optional) + scheduledAt: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..911fa14485 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-smtp-provider.md @@ -0,0 +1,25 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateSMTPProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + host: '<HOST>', // (optional) + port: 1, // (optional) + username: '<USERNAME>', // (optional) + password: '<PASSWORD>', // (optional) + encryption: SmtpEncryption.none, // (optional) + autoTLS: false, // (optional) + mailer: '<MAILER>', // (optional) + fromName: '<FROM_NAME>', // (optional) + fromEmail: 'email@example.com', // (optional) + replyToName: '<REPLY_TO_NAME>', // (optional) + replyToEmail: '<REPLY_TO_EMAIL>', // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..4bf76fbcfe --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-telesign-provider.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateTelesignProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + customerId: '<CUSTOMER_ID>', // (optional) + apiKey: '<API_KEY>', // (optional) + from: '<FROM>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..86bb985778 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateTextmagicProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + username: '<USERNAME>', // (optional) + apiKey: '<API_KEY>', // (optional) + from: '<FROM>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-topic.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-topic.md new file mode 100644 index 0000000000..5311fd5e9b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-topic.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Topic result = await messaging.updateTopic( + topicId: '<TOPIC_ID>', + name: '<NAME>', // (optional) + subscribe: ["any"], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..8ace97521b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-twilio-provider.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateTwilioProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + accountSid: '<ACCOUNT_SID>', // (optional) + authToken: '<AUTH_TOKEN>', // (optional) + from: '<FROM>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-dart/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..e0d95d1cb4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/messaging/update-vonage-provider.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Messaging messaging = Messaging(client); + +Provider result = await messaging.updateVonageProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // (optional) + enabled: false, // (optional) + apiKey: '<API_KEY>', // (optional) + apiSecret: '<API_SECRET>', // (optional) + from: '<FROM>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/create-deployment.md b/docs/examples/1.8.x/server-dart/examples/sites/create-deployment.md new file mode 100644 index 0000000000..93f9615b8b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/create-deployment.md @@ -0,0 +1,18 @@ +import 'dart:io'; +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createDeployment( + siteId: '<SITE_ID>', + code: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), + activate: false, + installCommand: '<INSTALL_COMMAND>', // (optional) + buildCommand: '<BUILD_COMMAND>', // (optional) + outputDirectory: '<OUTPUT_DIRECTORY>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-dart/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..1a3e84a33c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createDuplicateDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/server-dart/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..348b4652b6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/create-template-deployment.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createTemplateDeployment( + siteId: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/create-variable.md b/docs/examples/1.8.x/server-dart/examples/sites/create-variable.md new file mode 100644 index 0000000000..aa3c876174 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/create-variable.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Variable result = await sites.createVariable( + siteId: '<SITE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-dart/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..50f65b9603 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/create-vcs-deployment.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createVcsDeployment( + siteId: '<SITE_ID>', + type: VCSDeploymentType.branch, + reference: '<REFERENCE>', + activate: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/create.md b/docs/examples/1.8.x/server-dart/examples/sites/create.md new file mode 100644 index 0000000000..448abab1df --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/create.md @@ -0,0 +1,29 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.create( + siteId: '<SITE_ID>', + name: '<NAME>', + framework: .analog, + buildRuntime: .node145, + enabled: false, // (optional) + logging: false, // (optional) + timeout: 1, // (optional) + installCommand: '<INSTALL_COMMAND>', // (optional) + buildCommand: '<BUILD_COMMAND>', // (optional) + outputDirectory: '<OUTPUT_DIRECTORY>', // (optional) + adapter: .static, // (optional) + installationId: '<INSTALLATION_ID>', // (optional) + fallbackFile: '<FALLBACK_FILE>', // (optional) + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional) + providerBranch: '<PROVIDER_BRANCH>', // (optional) + providerSilentMode: false, // (optional) + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // (optional) + specification: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/delete-deployment.md b/docs/examples/1.8.x/server-dart/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..ca93ac668d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/delete-deployment.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +await sites.deleteDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/delete-log.md b/docs/examples/1.8.x/server-dart/examples/sites/delete-log.md new file mode 100644 index 0000000000..c11ecab71e --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/delete-log.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +await sites.deleteLog( + siteId: '<SITE_ID>', + logId: '<LOG_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/delete-variable.md b/docs/examples/1.8.x/server-dart/examples/sites/delete-variable.md new file mode 100644 index 0000000000..f04b9451ae --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/delete-variable.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +await sites.deleteVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/delete.md b/docs/examples/1.8.x/server-dart/examples/sites/delete.md new file mode 100644 index 0000000000..e81df372bc --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/delete.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +await sites.delete( + siteId: '<SITE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/server-dart/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..ad21070b8a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/get-deployment-download.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +UInt8List result = await sites.getDeploymentDownload( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType.source, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/get-deployment.md b/docs/examples/1.8.x/server-dart/examples/sites/get-deployment.md new file mode 100644 index 0000000000..9acc89b56f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/get-deployment.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.getDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/get-log.md b/docs/examples/1.8.x/server-dart/examples/sites/get-log.md new file mode 100644 index 0000000000..195f8aad2d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/get-log.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Execution result = await sites.getLog( + siteId: '<SITE_ID>', + logId: '<LOG_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/get-variable.md b/docs/examples/1.8.x/server-dart/examples/sites/get-variable.md new file mode 100644 index 0000000000..637e08a58c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/get-variable.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Variable result = await sites.getVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/get.md b/docs/examples/1.8.x/server-dart/examples/sites/get.md new file mode 100644 index 0000000000..32abcfcffc --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/get.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.get( + siteId: '<SITE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/list-deployments.md b/docs/examples/1.8.x/server-dart/examples/sites/list-deployments.md new file mode 100644 index 0000000000..6f6c9ce3f0 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/list-deployments.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +DeploymentList result = await sites.listDeployments( + siteId: '<SITE_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/list-frameworks.md b/docs/examples/1.8.x/server-dart/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..72a600fad3 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/list-frameworks.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +FrameworkList result = await sites.listFrameworks(); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/list-logs.md b/docs/examples/1.8.x/server-dart/examples/sites/list-logs.md new file mode 100644 index 0000000000..4ccf170f8b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/list-logs.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +ExecutionList result = await sites.listLogs( + siteId: '<SITE_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/list-specifications.md b/docs/examples/1.8.x/server-dart/examples/sites/list-specifications.md new file mode 100644 index 0000000000..b81faf0e43 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/list-specifications.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +SpecificationList result = await sites.listSpecifications(); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/list-variables.md b/docs/examples/1.8.x/server-dart/examples/sites/list-variables.md new file mode 100644 index 0000000000..14be96629c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/list-variables.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +VariableList result = await sites.listVariables( + siteId: '<SITE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/list.md b/docs/examples/1.8.x/server-dart/examples/sites/list.md new file mode 100644 index 0000000000..0dd52262f1 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/list.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +SiteList result = await sites.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/server-dart/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..bd031cf27a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/update-deployment-status.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.updateDeploymentStatus( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/server-dart/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..dbb4e27aa6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/update-site-deployment.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.updateSiteDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/update-variable.md b/docs/examples/1.8.x/server-dart/examples/sites/update-variable.md new file mode 100644 index 0000000000..af2123c989 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/update-variable.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Variable result = await sites.updateVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', // (optional) + secret: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/sites/update.md b/docs/examples/1.8.x/server-dart/examples/sites/update.md new file mode 100644 index 0000000000..c13acfb25b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/sites/update.md @@ -0,0 +1,29 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.update( + siteId: '<SITE_ID>', + name: '<NAME>', + framework: .analog, + enabled: false, // (optional) + logging: false, // (optional) + timeout: 1, // (optional) + installCommand: '<INSTALL_COMMAND>', // (optional) + buildCommand: '<BUILD_COMMAND>', // (optional) + outputDirectory: '<OUTPUT_DIRECTORY>', // (optional) + buildRuntime: .node145, // (optional) + adapter: .static, // (optional) + fallbackFile: '<FALLBACK_FILE>', // (optional) + installationId: '<INSTALLATION_ID>', // (optional) + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional) + providerBranch: '<PROVIDER_BRANCH>', // (optional) + providerSilentMode: false, // (optional) + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // (optional) + specification: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/create-bucket.md b/docs/examples/1.8.x/server-dart/examples/storage/create-bucket.md new file mode 100644 index 0000000000..c09a4f2c5d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/create-bucket.md @@ -0,0 +1,21 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Storage storage = Storage(client); + +Bucket result = await storage.createBucket( + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], // (optional) + fileSecurity: false, // (optional) + enabled: false, // (optional) + maximumFileSize: 1, // (optional) + allowedFileExtensions: [], // (optional) + compression: .none, // (optional) + encryption: false, // (optional) + antivirus: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/create-file.md b/docs/examples/1.8.x/server-dart/examples/storage/create-file.md new file mode 100644 index 0000000000..e631416ecb --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/create-file.md @@ -0,0 +1,16 @@ +import 'dart:io'; +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +File result = await storage.createFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), + permissions: ["read("any")"], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/delete-bucket.md b/docs/examples/1.8.x/server-dart/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..1eb1b51ca2 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/delete-bucket.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Storage storage = Storage(client); + +await storage.deleteBucket( + bucketId: '<BUCKET_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/delete-file.md b/docs/examples/1.8.x/server-dart/examples/storage/delete-file.md new file mode 100644 index 0000000000..26dd602c7e --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/delete-file.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +await storage.deleteFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/get-bucket.md b/docs/examples/1.8.x/server-dart/examples/storage/get-bucket.md new file mode 100644 index 0000000000..3464d2233b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/get-bucket.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Storage storage = Storage(client); + +Bucket result = await storage.getBucket( + bucketId: '<BUCKET_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/get-file-download.md b/docs/examples/1.8.x/server-dart/examples/storage/get-file-download.md new file mode 100644 index 0000000000..8c119c386c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/get-file-download.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +UInt8List result = await storage.getFileDownload( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/get-file-preview.md b/docs/examples/1.8.x/server-dart/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..a1f3c09b33 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/get-file-preview.md @@ -0,0 +1,25 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +UInt8List result = await storage.getFilePreview( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // (optional) + height: 0, // (optional) + gravity: ImageGravity.center, // (optional) + quality: -1, // (optional) + borderWidth: 0, // (optional) + borderColor: '', // (optional) + borderRadius: 0, // (optional) + opacity: 0, // (optional) + rotation: -360, // (optional) + background: '', // (optional) + output: ImageFormat.jpg, // (optional) + token: '<TOKEN>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/get-file-view.md b/docs/examples/1.8.x/server-dart/examples/storage/get-file-view.md new file mode 100644 index 0000000000..d48b51c19c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/get-file-view.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +UInt8List result = await storage.getFileView( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/get-file.md b/docs/examples/1.8.x/server-dart/examples/storage/get-file.md new file mode 100644 index 0000000000..f765c62356 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/get-file.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +File result = await storage.getFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/list-buckets.md b/docs/examples/1.8.x/server-dart/examples/storage/list-buckets.md new file mode 100644 index 0000000000..c20dac1968 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/list-buckets.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Storage storage = Storage(client); + +BucketList result = await storage.listBuckets( + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/list-files.md b/docs/examples/1.8.x/server-dart/examples/storage/list-files.md new file mode 100644 index 0000000000..28f85b091a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/list-files.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +FileList result = await storage.listFiles( + bucketId: '<BUCKET_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/update-bucket.md b/docs/examples/1.8.x/server-dart/examples/storage/update-bucket.md new file mode 100644 index 0000000000..b4e45e059c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/update-bucket.md @@ -0,0 +1,21 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Storage storage = Storage(client); + +Bucket result = await storage.updateBucket( + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], // (optional) + fileSecurity: false, // (optional) + enabled: false, // (optional) + maximumFileSize: 1, // (optional) + allowedFileExtensions: [], // (optional) + compression: .none, // (optional) + encryption: false, // (optional) + antivirus: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/storage/update-file.md b/docs/examples/1.8.x/server-dart/examples/storage/update-file.md new file mode 100644 index 0000000000..966883a1f9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/storage/update-file.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Storage storage = Storage(client); + +File result = await storage.updateFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // (optional) + permissions: ["read("any")"], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..aa7b7c592d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnBoolean result = await tablesDB.createBooleanColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: false, // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..10284ddf9a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnDatetime result = await tablesDB.createDatetimeColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: '', // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..ec36530e82 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-email-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnEmail result = await tablesDB.createEmailColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: 'email@example.com', // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..594376d72f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-enum-column.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnEnum result = await tablesDB.createEnumColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + xrequired: false, + xdefault: '<DEFAULT>', // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..0b97073709 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-float-column.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnFloat result = await tablesDB.createFloatColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + min: 0, // (optional) + max: 0, // (optional) + xdefault: 0, // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-index.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..64fea75726 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-index.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnIndex result = await tablesDB.createIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + type: IndexType.key, + columns: [], + orders: [], // (optional) + lengths: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..d90dca56b7 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-integer-column.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnInteger result = await tablesDB.createIntegerColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + min: 0, // (optional) + max: 0, // (optional) + xdefault: 0, // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..322776e64a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-ip-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnIp result = await tablesDB.createIpColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: '', // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..e9b578f466 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-line-column.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnLine result = await tablesDB.createLineColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: [[1, 2], [3, 4], [5, 6]], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..6e055170dc --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-point-column.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnPoint result = await tablesDB.createPointColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: [1, 2], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..5e851f86f1 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnPolygon result = await tablesDB.createPolygonColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..3b2ea3d141 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnRelationship result = await tablesDB.createRelationshipColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + relatedTableId: '<RELATED_TABLE_ID>', + type: RelationshipType.oneToOne, + twoWay: false, // (optional) + key: '', // (optional) + twoWayKey: '', // (optional) + onDelete: RelationMutate.cascade, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-row.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..c2f5dd8293 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-row.md @@ -0,0 +1,22 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.createRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..c22fdba506 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-rows.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +RowList result = await tablesDB.createRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [], +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..6fd0e93a93 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-string-column.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnString result = await tablesDB.createStringColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + size: 1, + xrequired: false, + xdefault: '<DEFAULT>', // (optional) + array: false, // (optional) + encrypt: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-table.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..c055e93fec --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-table.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Table result = await tablesDB.createTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], // (optional) + rowSecurity: false, // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..05c8da80f8 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create-url-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnUrl result = await tablesDB.createUrlColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: 'https://example.com', // (optional) + array: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/create.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/create.md new file mode 100644 index 0000000000..6991b910eb --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/create.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Database result = await tablesDB.create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..8c376563d8 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.decrementRowColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: 0, // (optional) + min: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..ebee29e4c7 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-column.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..2b73e25f0a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-index.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..f3966c0930 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-row.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..eb2aebb3e6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-rows.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..d425cec160 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete-table.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.deleteTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/delete.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete.md new file mode 100644 index 0000000000..565f4ef6c9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/delete.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +await tablesDB.delete( + databaseId: '<DATABASE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/get-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..437d72e621 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/get-column.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + + result = await tablesDB.getColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/get-index.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..ef5f9a0ed6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/get-index.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnIndex result = await tablesDB.getIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/get-row.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..0af17b612a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/get-row.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.getRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/get-table.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..c230f6a1df --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/get-table.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Table result = await tablesDB.getTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/get.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/get.md new file mode 100644 index 0000000000..d147fb1c3f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/get.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Database result = await tablesDB.get( + databaseId: '<DATABASE_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..bbe262e5c9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/increment-row-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.incrementRowColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: 0, // (optional) + max: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..2665c0db2e --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/list-columns.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnList result = await tablesDB.listColumns( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..5028923db7 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/list-indexes.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnIndexList result = await tablesDB.listIndexes( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..83bbe38fca --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/list-rows.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +RowList result = await tablesDB.listRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..ede3f5cd53 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/list-tables.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +TableList result = await tablesDB.listTables( + databaseId: '<DATABASE_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/list.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/list.md new file mode 100644 index 0000000000..e13187de67 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/list.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +DatabaseList result = await tablesDB.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..1e6c604a64 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnBoolean result = await tablesDB.updateBooleanColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: false, + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..982d8d55f9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnDatetime result = await tablesDB.updateDatetimeColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: '', + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..e2f075191c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-email-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnEmail result = await tablesDB.updateEmailColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: 'email@example.com', + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..b0ddd485bb --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-enum-column.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnEnum result = await tablesDB.updateEnumColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + xrequired: false, + xdefault: '<DEFAULT>', + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..7239b48882 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-float-column.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnFloat result = await tablesDB.updateFloatColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: 0, + min: 0, // (optional) + max: 0, // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..bb98ad27e7 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-integer-column.md @@ -0,0 +1,19 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnInteger result = await tablesDB.updateIntegerColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: 0, + min: 0, // (optional) + max: 0, // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..21c5f1bcd8 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-ip-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnIp result = await tablesDB.updateIpColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: '', + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..53d7999d6f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-line-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnLine result = await tablesDB.updateLineColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: [[1, 2], [3, 4], [5, 6]], // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..5658393b07 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-point-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnPoint result = await tablesDB.updatePointColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: [1, 2], // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..b98e8615a4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnPolygon result = await tablesDB.updatePolygonColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..95e09d38b2 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnRelationship result = await tablesDB.updateRelationshipColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + onDelete: RelationMutate.cascade, // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-row.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..d66c24f505 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-row.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.updateRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // (optional) + permissions: ["read("any")"], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..a0973b47d1 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-rows.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +RowList result = await tablesDB.updateRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + data: {}, // (optional) + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..bd390dfd4d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-string-column.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnString result = await tablesDB.updateStringColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: '<DEFAULT>', + size: 1, // (optional) + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-table.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..fd6646a01b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-table.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Table result = await tablesDB.updateTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], // (optional) + rowSecurity: false, // (optional) + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..fcfdfcd1d9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update-url-column.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +ColumnUrl result = await tablesDB.updateUrlColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + xrequired: false, + xdefault: 'https://example.com', + newKey: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/update.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/update.md new file mode 100644 index 0000000000..81d3379911 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/update.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +Database result = await tablesDB.update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..fbe4d2928a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/upsert-row.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +TablesDB tablesDB = TablesDB(client); + +Row result = await tablesDB.upsertRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // (optional) + permissions: ["read("any")"], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-dart/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..031aa50bea --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tablesdb/upsert-rows.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +TablesDB tablesDB = TablesDB(client); + +RowList result = await tablesDB.upsertRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [], +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/create-membership.md b/docs/examples/1.8.x/server-dart/examples/teams/create-membership.md new file mode 100644 index 0000000000..f13a6e69bb --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/create-membership.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Membership result = await teams.createMembership( + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // (optional) + userId: '<USER_ID>', // (optional) + phone: '+12065550100', // (optional) + url: 'https://example.com', // (optional) + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/create.md b/docs/examples/1.8.x/server-dart/examples/teams/create.md new file mode 100644 index 0000000000..772f3cfa86 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/create.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Team result = await teams.create( + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/delete-membership.md b/docs/examples/1.8.x/server-dart/examples/teams/delete-membership.md new file mode 100644 index 0000000000..9d99cbbd3d --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/delete-membership.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +await teams.deleteMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/delete.md b/docs/examples/1.8.x/server-dart/examples/teams/delete.md new file mode 100644 index 0000000000..1c08ab8ed9 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/delete.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +await teams.delete( + teamId: '<TEAM_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/get-membership.md b/docs/examples/1.8.x/server-dart/examples/teams/get-membership.md new file mode 100644 index 0000000000..0bdc63f8d4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/get-membership.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Membership result = await teams.getMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/get-prefs.md b/docs/examples/1.8.x/server-dart/examples/teams/get-prefs.md new file mode 100644 index 0000000000..e206393320 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/get-prefs.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Preferences result = await teams.getPrefs( + teamId: '<TEAM_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/get.md b/docs/examples/1.8.x/server-dart/examples/teams/get.md new file mode 100644 index 0000000000..bb3bcaf7e2 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/get.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Team result = await teams.get( + teamId: '<TEAM_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/list-memberships.md b/docs/examples/1.8.x/server-dart/examples/teams/list-memberships.md new file mode 100644 index 0000000000..3c01dec4c5 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/list-memberships.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +MembershipList result = await teams.listMemberships( + teamId: '<TEAM_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/list.md b/docs/examples/1.8.x/server-dart/examples/teams/list.md new file mode 100644 index 0000000000..093a139f71 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/list.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +TeamList result = await teams.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/update-membership-status.md b/docs/examples/1.8.x/server-dart/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..c947162fa4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/update-membership-status.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Membership result = await teams.updateMembershipStatus( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/update-membership.md b/docs/examples/1.8.x/server-dart/examples/teams/update-membership.md new file mode 100644 index 0000000000..87a4325857 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/update-membership.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Membership result = await teams.updateMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [], +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/update-name.md b/docs/examples/1.8.x/server-dart/examples/teams/update-name.md new file mode 100644 index 0000000000..fe3a9faabf --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/update-name.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Team result = await teams.updateName( + teamId: '<TEAM_ID>', + name: '<NAME>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/teams/update-prefs.md b/docs/examples/1.8.x/server-dart/examples/teams/update-prefs.md new file mode 100644 index 0000000000..57518ada43 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/teams/update-prefs.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Teams teams = Teams(client); + +Preferences result = await teams.updatePrefs( + teamId: '<TEAM_ID>', + prefs: {}, +); diff --git a/docs/examples/1.8.x/server-dart/examples/tokens/create-file-token.md b/docs/examples/1.8.x/server-dart/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..cc75a91726 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tokens/create-file-token.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceToken result = await tokens.createFileToken( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + expire: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tokens/delete.md b/docs/examples/1.8.x/server-dart/examples/tokens/delete.md new file mode 100644 index 0000000000..ce95e7b752 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tokens/delete.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Tokens tokens = Tokens(client); + +await tokens.delete( + tokenId: '<TOKEN_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/tokens/get.md b/docs/examples/1.8.x/server-dart/examples/tokens/get.md new file mode 100644 index 0000000000..3112b5e1e5 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tokens/get.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceToken result = await tokens.get( + tokenId: '<TOKEN_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/tokens/list.md b/docs/examples/1.8.x/server-dart/examples/tokens/list.md new file mode 100644 index 0000000000..5331e44de3 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tokens/list.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceTokenList result = await tokens.list( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/tokens/update.md b/docs/examples/1.8.x/server-dart/examples/tokens/update.md new file mode 100644 index 0000000000..47e910d574 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/tokens/update.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceToken result = await tokens.update( + tokenId: '<TOKEN_ID>', + expire: '', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/server-dart/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..38b0255ea4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-argon-2-user.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createArgon2User( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-dart/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..aa898ba22f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-bcrypt-user.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createBcryptUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-jwt.md b/docs/examples/1.8.x/server-dart/examples/users/create-jwt.md new file mode 100644 index 0000000000..6e8b7a2bac --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-jwt.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Jwt result = await users.createJWT( + userId: '<USER_ID>', + sessionId: '<SESSION_ID>', // (optional) + duration: 0, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-md-5-user.md b/docs/examples/1.8.x/server-dart/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..e08edd617f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-md-5-user.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createMD5User( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dart/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..12a7e32f5a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +MfaRecoveryCodes result = await users.createMFARecoveryCodes( + userId: '<USER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-dart/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..9f23baaef2 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-ph-pass-user.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createPHPassUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-dart/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..34bfbf66c4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,18 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createScryptModifiedUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>', + passwordSignerKey: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/server-dart/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..20cf911a09 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-scrypt-user.md @@ -0,0 +1,20 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createScryptUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordCpu: 0, + passwordMemory: 0, + passwordParallel: 0, + passwordLength: 0, + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-session.md b/docs/examples/1.8.x/server-dart/examples/users/create-session.md new file mode 100644 index 0000000000..4293e7edf6 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-session.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Session result = await users.createSession( + userId: '<USER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-sha-user.md b/docs/examples/1.8.x/server-dart/examples/users/create-sha-user.md new file mode 100644 index 0000000000..628cf3297e --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-sha-user.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.createSHAUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordVersion: PasswordHash.sha1, // (optional) + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-target.md b/docs/examples/1.8.x/server-dart/examples/users/create-target.md new file mode 100644 index 0000000000..354a8dbb48 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-target.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Target result = await users.createTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: MessagingProviderType.email, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', // (optional) + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create-token.md b/docs/examples/1.8.x/server-dart/examples/users/create-token.md new file mode 100644 index 0000000000..ab7acba3dd --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create-token.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Token result = await users.createToken( + userId: '<USER_ID>', + length: 4, // (optional) + expire: 60, // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/create.md b/docs/examples/1.8.x/server-dart/examples/users/create.md new file mode 100644 index 0000000000..b4953748e5 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/create.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.create( + userId: '<USER_ID>', + email: 'email@example.com', // (optional) + phone: '+12065550100', // (optional) + password: '', // (optional) + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/delete-identity.md b/docs/examples/1.8.x/server-dart/examples/users/delete-identity.md new file mode 100644 index 0000000000..7ac2da9000 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/delete-identity.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.deleteIdentity( + identityId: '<IDENTITY_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-dart/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..b5dcc6af55 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.deleteMFAAuthenticator( + userId: '<USER_ID>', + type: AuthenticatorType.totp, +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/delete-session.md b/docs/examples/1.8.x/server-dart/examples/users/delete-session.md new file mode 100644 index 0000000000..68d243e52f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/delete-session.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.deleteSession( + userId: '<USER_ID>', + sessionId: '<SESSION_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/delete-sessions.md b/docs/examples/1.8.x/server-dart/examples/users/delete-sessions.md new file mode 100644 index 0000000000..07c3566a7c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/delete-sessions.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.deleteSessions( + userId: '<USER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/delete-target.md b/docs/examples/1.8.x/server-dart/examples/users/delete-target.md new file mode 100644 index 0000000000..aa27b32d38 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/delete-target.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.deleteTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/delete.md b/docs/examples/1.8.x/server-dart/examples/users/delete.md new file mode 100644 index 0000000000..93819b72d7 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/delete.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +await users.delete( + userId: '<USER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dart/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..e16158bfda --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +MfaRecoveryCodes result = await users.getMFARecoveryCodes( + userId: '<USER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/get-prefs.md b/docs/examples/1.8.x/server-dart/examples/users/get-prefs.md new file mode 100644 index 0000000000..146cff6820 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/get-prefs.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Preferences result = await users.getPrefs( + userId: '<USER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/get-target.md b/docs/examples/1.8.x/server-dart/examples/users/get-target.md new file mode 100644 index 0000000000..9ddaafb55f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/get-target.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Target result = await users.getTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/get.md b/docs/examples/1.8.x/server-dart/examples/users/get.md new file mode 100644 index 0000000000..a171b79582 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/get.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.get( + userId: '<USER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/list-identities.md b/docs/examples/1.8.x/server-dart/examples/users/list-identities.md new file mode 100644 index 0000000000..2c14775e9a --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/list-identities.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +IdentityList result = await users.listIdentities( + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/list-logs.md b/docs/examples/1.8.x/server-dart/examples/users/list-logs.md new file mode 100644 index 0000000000..5885dcb874 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/list-logs.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +LogList result = await users.listLogs( + userId: '<USER_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/list-memberships.md b/docs/examples/1.8.x/server-dart/examples/users/list-memberships.md new file mode 100644 index 0000000000..dabe5a123c --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/list-memberships.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +MembershipList result = await users.listMemberships( + userId: '<USER_ID>', + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/server-dart/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..290109d2ae --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/list-mfa-factors.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +MfaFactors result = await users.listMFAFactors( + userId: '<USER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/list-sessions.md b/docs/examples/1.8.x/server-dart/examples/users/list-sessions.md new file mode 100644 index 0000000000..22a37c05a0 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/list-sessions.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +SessionList result = await users.listSessions( + userId: '<USER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/list-targets.md b/docs/examples/1.8.x/server-dart/examples/users/list-targets.md new file mode 100644 index 0000000000..971fbea0e1 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/list-targets.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +TargetList result = await users.listTargets( + userId: '<USER_ID>', + queries: [], // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/list.md b/docs/examples/1.8.x/server-dart/examples/users/list.md new file mode 100644 index 0000000000..6d34bb470b --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/list.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +UserList result = await users.list( + queries: [], // (optional) + search: '<SEARCH>', // (optional) +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-email-verification.md b/docs/examples/1.8.x/server-dart/examples/users/update-email-verification.md new file mode 100644 index 0000000000..9930e30be5 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-email-verification.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateEmailVerification( + userId: '<USER_ID>', + emailVerification: false, +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-email.md b/docs/examples/1.8.x/server-dart/examples/users/update-email.md new file mode 100644 index 0000000000..129a8e2437 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-email.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateEmail( + userId: '<USER_ID>', + email: 'email@example.com', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-labels.md b/docs/examples/1.8.x/server-dart/examples/users/update-labels.md new file mode 100644 index 0000000000..d247bf5e74 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-labels.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateLabels( + userId: '<USER_ID>', + labels: [], +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dart/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..a2340ff8c1 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +MfaRecoveryCodes result = await users.updateMFARecoveryCodes( + userId: '<USER_ID>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-mfa.md b/docs/examples/1.8.x/server-dart/examples/users/update-mfa.md new file mode 100644 index 0000000000..7d3b71d9c4 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-mfa.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateMFA( + userId: '<USER_ID>', + mfa: false, +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-name.md b/docs/examples/1.8.x/server-dart/examples/users/update-name.md new file mode 100644 index 0000000000..905cee0e49 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-name.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateName( + userId: '<USER_ID>', + name: '<NAME>', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-password.md b/docs/examples/1.8.x/server-dart/examples/users/update-password.md new file mode 100644 index 0000000000..14e27482ec --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-password.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updatePassword( + userId: '<USER_ID>', + password: '', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-phone-verification.md b/docs/examples/1.8.x/server-dart/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..b57aafab1f --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-phone-verification.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updatePhoneVerification( + userId: '<USER_ID>', + phoneVerification: false, +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-phone.md b/docs/examples/1.8.x/server-dart/examples/users/update-phone.md new file mode 100644 index 0000000000..aa891d2351 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-phone.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updatePhone( + userId: '<USER_ID>', + number: '+12065550100', +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-prefs.md b/docs/examples/1.8.x/server-dart/examples/users/update-prefs.md new file mode 100644 index 0000000000..87fc2968f5 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-prefs.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Preferences result = await users.updatePrefs( + userId: '<USER_ID>', + prefs: {}, +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-status.md b/docs/examples/1.8.x/server-dart/examples/users/update-status.md new file mode 100644 index 0000000000..4d8dca03ad --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-status.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +User result = await users.updateStatus( + userId: '<USER_ID>', + status: false, +); diff --git a/docs/examples/1.8.x/server-dart/examples/users/update-target.md b/docs/examples/1.8.x/server-dart/examples/users/update-target.md new file mode 100644 index 0000000000..f66f0b7475 --- /dev/null +++ b/docs/examples/1.8.x/server-dart/examples/users/update-target.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +Users users = Users(client); + +Target result = await users.updateTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', // (optional) + providerId: '<PROVIDER_ID>', // (optional) + name: '<NAME>', // (optional) +); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/server-deno/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..62ad345304 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-anonymous-session.md @@ -0,0 +1,9 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.createAnonymousSession(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-email-password-session.md b/docs/examples/1.8.x/server-deno/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..ab71bc3f7a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-email-password-session.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.createEmailPasswordSession({ + email: 'email@example.com', + password: 'password' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-email-token.md b/docs/examples/1.8.x/server-deno/examples/account/create-email-token.md new file mode 100644 index 0000000000..daab356a86 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-email-token.md @@ -0,0 +1,13 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.createEmailToken({ + userId: '<USER_ID>', + email: 'email@example.com', + phrase: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-jwt.md b/docs/examples/1.8.x/server-deno/examples/account/create-jwt.md new file mode 100644 index 0000000000..a0a7f722cc --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-jwt.md @@ -0,0 +1,9 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.createJWT(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/server-deno/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..266aa8b3d3 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-magic-url-token.md @@ -0,0 +1,14 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.createMagicURLToken({ + userId: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-deno/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..0e496e0042 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-mfa-authenticator.md @@ -0,0 +1,12 @@ +import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.createMFAAuthenticator({ + type: AuthenticatorType.Totp +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-deno/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..a36e286960 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-mfa-challenge.md @@ -0,0 +1,11 @@ +import { Client, Account, AuthenticationFactor } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.createMFAChallenge({ + factor: AuthenticationFactor.Email +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-deno/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..5a8f6a3683 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.createMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-deno/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..bc1f5fce9f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-o-auth-2-token.md @@ -0,0 +1,14 @@ +import { Client, Account, OAuthProvider } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +account.createOAuth2Token({ + provider: OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-phone-token.md b/docs/examples/1.8.x/server-deno/examples/account/create-phone-token.md new file mode 100644 index 0000000000..f31ddee329 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-phone-token.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.createPhoneToken({ + userId: '<USER_ID>', + phone: '+12065550100' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-phone-verification.md b/docs/examples/1.8.x/server-deno/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..8f01304f5b --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-phone-verification.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.createPhoneVerification(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-recovery.md b/docs/examples/1.8.x/server-deno/examples/account/create-recovery.md new file mode 100644 index 0000000000..cd08f64683 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-recovery.md @@ -0,0 +1,13 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.createRecovery({ + email: 'email@example.com', + url: 'https://example.com' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-session.md b/docs/examples/1.8.x/server-deno/examples/account/create-session.md new file mode 100644 index 0000000000..ff238a88af --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-session.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.createSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create-verification.md b/docs/examples/1.8.x/server-deno/examples/account/create-verification.md new file mode 100644 index 0000000000..002c3f6407 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create-verification.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.createVerification({ + url: 'https://example.com' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/create.md b/docs/examples/1.8.x/server-deno/examples/account/create.md new file mode 100644 index 0000000000..025dad8d8a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/create.md @@ -0,0 +1,14 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.create({ + userId: '<USER_ID>', + email: 'email@example.com', + password: '', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/delete-identity.md b/docs/examples/1.8.x/server-deno/examples/account/delete-identity.md new file mode 100644 index 0000000000..26490a5e7f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/delete-identity.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.deleteIdentity({ + identityId: '<IDENTITY_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-deno/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..777347de98 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,12 @@ +import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.deleteMFAAuthenticator({ + type: AuthenticatorType.Totp +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/delete-session.md b/docs/examples/1.8.x/server-deno/examples/account/delete-session.md new file mode 100644 index 0000000000..8472e579a4 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/delete-session.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.deleteSession({ + sessionId: '<SESSION_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/delete-sessions.md b/docs/examples/1.8.x/server-deno/examples/account/delete-sessions.md new file mode 100644 index 0000000000..864c50535b --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/delete-sessions.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.deleteSessions(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-deno/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..6f631ac783 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.getMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/get-prefs.md b/docs/examples/1.8.x/server-deno/examples/account/get-prefs.md new file mode 100644 index 0000000000..4479df71f7 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/get-prefs.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.getPrefs(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/get-session.md b/docs/examples/1.8.x/server-deno/examples/account/get-session.md new file mode 100644 index 0000000000..05d1782593 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/get-session.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.getSession({ + sessionId: '<SESSION_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/get.md b/docs/examples/1.8.x/server-deno/examples/account/get.md new file mode 100644 index 0000000000..5abdc95ec7 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/get.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.get(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/list-identities.md b/docs/examples/1.8.x/server-deno/examples/account/list-identities.md new file mode 100644 index 0000000000..cbcac73f91 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/list-identities.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.listIdentities({ + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/list-logs.md b/docs/examples/1.8.x/server-deno/examples/account/list-logs.md new file mode 100644 index 0000000000..6e7ce67c42 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/list-logs.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.listLogs({ + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/server-deno/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..0eb3d5db71 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/list-mfa-factors.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.listMFAFactors(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/list-sessions.md b/docs/examples/1.8.x/server-deno/examples/account/list-sessions.md new file mode 100644 index 0000000000..e34da16995 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/list-sessions.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.listSessions(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-email.md b/docs/examples/1.8.x/server-deno/examples/account/update-email.md new file mode 100644 index 0000000000..746309ebcf --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-email.md @@ -0,0 +1,13 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateEmail({ + email: 'email@example.com', + password: 'password' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/server-deno/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..b40824b1bf --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-magic-url-session.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.updateMagicURLSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-deno/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..1049f6a200 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-mfa-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateMFAAuthenticator({ + type: AuthenticatorType.Totp, + otp: '<OTP>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-deno/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..9ee0825c47 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-mfa-challenge.md @@ -0,0 +1,13 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateMFAChallenge({ + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-deno/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..eae8560014 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-mfa.md b/docs/examples/1.8.x/server-deno/examples/account/update-mfa.md new file mode 100644 index 0000000000..ab496cd391 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-mfa.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateMFA({ + mfa: false +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-name.md b/docs/examples/1.8.x/server-deno/examples/account/update-name.md new file mode 100644 index 0000000000..c62bcf1a60 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-name.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateName({ + name: '<NAME>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-password.md b/docs/examples/1.8.x/server-deno/examples/account/update-password.md new file mode 100644 index 0000000000..1bd388a1f8 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-password.md @@ -0,0 +1,13 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updatePassword({ + password: '', + oldPassword: 'password' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-phone-session.md b/docs/examples/1.8.x/server-deno/examples/account/update-phone-session.md new file mode 100644 index 0000000000..4a86183e79 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-phone-session.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new Account(client); + +const response = await account.updatePhoneSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-phone-verification.md b/docs/examples/1.8.x/server-deno/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..30f9b40d0a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-phone-verification.md @@ -0,0 +1,13 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updatePhoneVerification({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-phone.md b/docs/examples/1.8.x/server-deno/examples/account/update-phone.md new file mode 100644 index 0000000000..821c279189 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-phone.md @@ -0,0 +1,13 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updatePhone({ + phone: '+12065550100', + password: 'password' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-prefs.md b/docs/examples/1.8.x/server-deno/examples/account/update-prefs.md new file mode 100644 index 0000000000..96bc4ac6be --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-prefs.md @@ -0,0 +1,16 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updatePrefs({ + prefs: { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-recovery.md b/docs/examples/1.8.x/server-deno/examples/account/update-recovery.md new file mode 100644 index 0000000000..031b6a3c90 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-recovery.md @@ -0,0 +1,14 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateRecovery({ + userId: '<USER_ID>', + secret: '<SECRET>', + password: '' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-session.md b/docs/examples/1.8.x/server-deno/examples/account/update-session.md new file mode 100644 index 0000000000..cccd5d2cbf --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-session.md @@ -0,0 +1,12 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateSession({ + sessionId: '<SESSION_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-status.md b/docs/examples/1.8.x/server-deno/examples/account/update-status.md new file mode 100644 index 0000000000..0c70c88b51 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-status.md @@ -0,0 +1,10 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateStatus(); diff --git a/docs/examples/1.8.x/server-deno/examples/account/update-verification.md b/docs/examples/1.8.x/server-deno/examples/account/update-verification.md new file mode 100644 index 0000000000..1ef9050479 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/account/update-verification.md @@ -0,0 +1,13 @@ +import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new Account(client); + +const response = await account.updateVerification({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/avatars/get-browser.md b/docs/examples/1.8.x/server-deno/examples/avatars/get-browser.md new file mode 100644 index 0000000000..fbef7eef36 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/avatars/get-browser.md @@ -0,0 +1,15 @@ +import { Client, Avatars, Browser } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new Avatars(client); + +const result = avatars.getBrowser({ + code: Browser.AvantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/server-deno/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..c4323c3264 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/avatars/get-credit-card.md @@ -0,0 +1,15 @@ +import { Client, Avatars, CreditCard } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new Avatars(client); + +const result = avatars.getCreditCard({ + code: CreditCard.AmericanExpress, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/avatars/get-favicon.md b/docs/examples/1.8.x/server-deno/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..5a1a0020c2 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/avatars/get-favicon.md @@ -0,0 +1,12 @@ +import { Client, Avatars } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new Avatars(client); + +const result = avatars.getFavicon({ + url: 'https://example.com' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/avatars/get-flag.md b/docs/examples/1.8.x/server-deno/examples/avatars/get-flag.md new file mode 100644 index 0000000000..7032c4870c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/avatars/get-flag.md @@ -0,0 +1,15 @@ +import { Client, Avatars, Flag } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new Avatars(client); + +const result = avatars.getFlag({ + code: Flag.Afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/avatars/get-image.md b/docs/examples/1.8.x/server-deno/examples/avatars/get-image.md new file mode 100644 index 0000000000..d4012ed847 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/avatars/get-image.md @@ -0,0 +1,14 @@ +import { Client, Avatars } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new Avatars(client); + +const result = avatars.getImage({ + url: 'https://example.com', + width: 0, // optional + height: 0 // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/avatars/get-initials.md b/docs/examples/1.8.x/server-deno/examples/avatars/get-initials.md new file mode 100644 index 0000000000..c08699715f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/avatars/get-initials.md @@ -0,0 +1,15 @@ +import { Client, Avatars } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new Avatars(client); + +const result = avatars.getInitials({ + name: '<NAME>', // optional + width: 0, // optional + height: 0, // optional + background: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/avatars/get-qr.md b/docs/examples/1.8.x/server-deno/examples/avatars/get-qr.md new file mode 100644 index 0000000000..096014b587 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/avatars/get-qr.md @@ -0,0 +1,15 @@ +import { Client, Avatars } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new Avatars(client); + +const result = avatars.getQR({ + text: '<TEXT>', + size: 1, // optional + margin: 0, // optional + download: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..fbcdde43d5 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-boolean-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createBooleanAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: false, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-collection.md b/docs/examples/1.8.x/server-deno/examples/databases/create-collection.md new file mode 100644 index 0000000000..9b2776a83e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-collection.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..80dec8c45c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-datetime-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createDatetimeAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-document.md b/docs/examples/1.8.x/server-deno/examples/databases/create-document.md new file mode 100644 index 0000000000..35be696eb2 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-document.md @@ -0,0 +1,22 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new Databases(client); + +const response = await databases.createDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-documents.md b/docs/examples/1.8.x/server-deno/examples/databases/create-documents.md new file mode 100644 index 0000000000..71011dad3f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-documents.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [] +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..6206a74f3e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-email-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createEmailAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'email@example.com', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..b8555bf3b6 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-enum-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createEnumAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..3cec0ee168 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-float-attribute.md @@ -0,0 +1,19 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createFloatAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-index.md b/docs/examples/1.8.x/server-deno/examples/databases/create-index.md new file mode 100644 index 0000000000..b2be093e11 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-index.md @@ -0,0 +1,18 @@ +import { Client, Databases, IndexType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + type: IndexType.Key, + attributes: [], + orders: [], // optional + lengths: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..37ba43aa73 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-integer-attribute.md @@ -0,0 +1,19 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createIntegerAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..047622d7a9 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-ip-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createIpAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..2f6b1f9bd2 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-line-attribute.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createLineAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..173c759928 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-point-attribute.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createPointAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..13bec65296 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-polygon-attribute.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createPolygonAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..39c73d0ae0 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-relationship-attribute.md @@ -0,0 +1,19 @@ +import { Client, Databases, RelationshipType, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createRelationshipAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + relatedCollectionId: '<RELATED_COLLECTION_ID>', + type: RelationshipType.OneToOne, + twoWay: false, // optional + key: '', // optional + twoWayKey: '', // optional + onDelete: RelationMutate.Cascade // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..17d4aa1dbf --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-string-attribute.md @@ -0,0 +1,19 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createStringAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + size: 1, + required: false, + default: '<DEFAULT>', // optional + array: false, // optional + encrypt: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..f60423cdba --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create-url-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.createUrlAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'https://example.com', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/create.md b/docs/examples/1.8.x/server-deno/examples/databases/create.md new file mode 100644 index 0000000000..63e547105c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/create.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..52d71921f6 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/decrement-document-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new Databases(client); + +const response = await databases.decrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + min: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/delete-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..d41c512994 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/delete-attribute.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.deleteAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/delete-collection.md b/docs/examples/1.8.x/server-deno/examples/databases/delete-collection.md new file mode 100644 index 0000000000..d2a2b7096d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/delete-collection.md @@ -0,0 +1,13 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.deleteCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/delete-document.md b/docs/examples/1.8.x/server-deno/examples/databases/delete-document.md new file mode 100644 index 0000000000..6efe03f05b --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/delete-document.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new Databases(client); + +const response = await databases.deleteDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/delete-documents.md b/docs/examples/1.8.x/server-deno/examples/databases/delete-documents.md new file mode 100644 index 0000000000..b63a960a3f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/delete-documents.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.deleteDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/delete-index.md b/docs/examples/1.8.x/server-deno/examples/databases/delete-index.md new file mode 100644 index 0000000000..c2f2969683 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/delete-index.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.deleteIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/delete.md b/docs/examples/1.8.x/server-deno/examples/databases/delete.md new file mode 100644 index 0000000000..e14a83ce1f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/delete.md @@ -0,0 +1,12 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.delete({ + databaseId: '<DATABASE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/get-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/get-attribute.md new file mode 100644 index 0000000000..efe21550a1 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/get-attribute.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.getAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/get-collection.md b/docs/examples/1.8.x/server-deno/examples/databases/get-collection.md new file mode 100644 index 0000000000..0745ad9f34 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/get-collection.md @@ -0,0 +1,13 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.getCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/get-document.md b/docs/examples/1.8.x/server-deno/examples/databases/get-document.md new file mode 100644 index 0000000000..fb8415895d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/get-document.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new Databases(client); + +const response = await databases.getDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/get-index.md b/docs/examples/1.8.x/server-deno/examples/databases/get-index.md new file mode 100644 index 0000000000..235eed6ff2 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/get-index.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.getIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/get.md b/docs/examples/1.8.x/server-deno/examples/databases/get.md new file mode 100644 index 0000000000..0891f72562 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/get.md @@ -0,0 +1,12 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.get({ + databaseId: '<DATABASE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..c32c48498f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/increment-document-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new Databases(client); + +const response = await databases.incrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + max: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/list-attributes.md b/docs/examples/1.8.x/server-deno/examples/databases/list-attributes.md new file mode 100644 index 0000000000..39de5d4e41 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/list-attributes.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.listAttributes({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/list-collections.md b/docs/examples/1.8.x/server-deno/examples/databases/list-collections.md new file mode 100644 index 0000000000..264be3c2fd --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/list-collections.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.listCollections({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/list-documents.md b/docs/examples/1.8.x/server-deno/examples/databases/list-documents.md new file mode 100644 index 0000000000..5c3899882a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/list-documents.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new Databases(client); + +const response = await databases.listDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/list-indexes.md b/docs/examples/1.8.x/server-deno/examples/databases/list-indexes.md new file mode 100644 index 0000000000..628a434fae --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/list-indexes.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.listIndexes({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/list.md b/docs/examples/1.8.x/server-deno/examples/databases/list.md new file mode 100644 index 0000000000..4ba17dd9e5 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/list.md @@ -0,0 +1,13 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..28e4718978 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-boolean-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateBooleanAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: false, + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-collection.md b/docs/examples/1.8.x/server-deno/examples/databases/update-collection.md new file mode 100644 index 0000000000..89b2d0e5f9 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-collection.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..9e9116b58d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-datetime-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateDatetimeAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-document.md b/docs/examples/1.8.x/server-deno/examples/databases/update-document.md new file mode 100644 index 0000000000..2a59177970 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-document.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new Databases(client); + +const response = await databases.updateDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-documents.md b/docs/examples/1.8.x/server-deno/examples/databases/update-documents.md new file mode 100644 index 0000000000..15c4a90c97 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-documents.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: {}, // optional + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..ff6cf2196d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-email-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateEmailAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'email@example.com', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..60f84fd5ea --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-enum-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateEnumAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..3a6640732e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-float-attribute.md @@ -0,0 +1,19 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateFloatAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..679eeaa28e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-integer-attribute.md @@ -0,0 +1,19 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateIntegerAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..d4145f481b --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-ip-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateIpAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..a9cdf41f04 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-line-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateLineAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..552db1e60e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-point-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updatePointAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..fc655f0737 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-polygon-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updatePolygonAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..3c9e9acb46 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-relationship-attribute.md @@ -0,0 +1,16 @@ +import { Client, Databases, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateRelationshipAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + onDelete: RelationMutate.Cascade, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..ec0dd8bf1e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-string-attribute.md @@ -0,0 +1,18 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateStringAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '<DEFAULT>', + size: 1, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/server-deno/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..f59ae750a8 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update-url-attribute.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateUrlAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'https://example.com', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/update.md b/docs/examples/1.8.x/server-deno/examples/databases/update.md new file mode 100644 index 0000000000..9df4fca32c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/update.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/upsert-document.md b/docs/examples/1.8.x/server-deno/examples/databases/upsert-document.md new file mode 100644 index 0000000000..27eb1e19c1 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/upsert-document.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new Databases(client); + +const response = await databases.upsertDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/databases/upsert-documents.md b/docs/examples/1.8.x/server-deno/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..ea6fea6e89 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/databases/upsert-documents.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.upsertDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [] +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/create-deployment.md b/docs/examples/1.8.x/server-deno/examples/functions/create-deployment.md new file mode 100644 index 0000000000..4f27138d81 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/create-deployment.md @@ -0,0 +1,16 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.createDeployment({ + functionId: '<FUNCTION_ID>', + code: InputFile.fromPath('/path/to/file.png', 'file.png'), + activate: false, + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-deno/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..b8c7e43fce --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.createDuplicateDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + buildId: '<BUILD_ID>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/create-execution.md b/docs/examples/1.8.x/server-deno/examples/functions/create-execution.md new file mode 100644 index 0000000000..651a5c9024 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/create-execution.md @@ -0,0 +1,18 @@ +import { Client, Functions, ExecutionMethod } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const functions = new Functions(client); + +const response = await functions.createExecution({ + functionId: '<FUNCTION_ID>', + body: '<BODY>', // optional + async: false, // optional + path: '<PATH>', // optional + method: ExecutionMethod.GET, // optional + headers: {}, // optional + scheduledAt: '<SCHEDULED_AT>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/server-deno/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..6e8b932852 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/create-template-deployment.md @@ -0,0 +1,17 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.createTemplateDeployment({ + functionId: '<FUNCTION_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/create-variable.md b/docs/examples/1.8.x/server-deno/examples/functions/create-variable.md new file mode 100644 index 0000000000..4e871c6f61 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/create-variable.md @@ -0,0 +1,15 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.createVariable({ + functionId: '<FUNCTION_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-deno/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..7a108248f0 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/create-vcs-deployment.md @@ -0,0 +1,15 @@ +import { Client, Functions, VCSDeploymentType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.createVcsDeployment({ + functionId: '<FUNCTION_ID>', + type: VCSDeploymentType.Branch, + reference: '<REFERENCE>', + activate: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/create.md b/docs/examples/1.8.x/server-deno/examples/functions/create.md new file mode 100644 index 0000000000..4681bd6a83 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/create.md @@ -0,0 +1,29 @@ +import { Client, Functions, } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.create({ + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: .Node145, + execute: ["any"], // optional + events: [], // optional + schedule: '', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/delete-deployment.md b/docs/examples/1.8.x/server-deno/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..11c2e9238a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/delete-deployment.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.deleteDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/delete-execution.md b/docs/examples/1.8.x/server-deno/examples/functions/delete-execution.md new file mode 100644 index 0000000000..95185ab894 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/delete-execution.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.deleteExecution({ + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/delete-variable.md b/docs/examples/1.8.x/server-deno/examples/functions/delete-variable.md new file mode 100644 index 0000000000..d3387fd256 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/delete-variable.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.deleteVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/delete.md b/docs/examples/1.8.x/server-deno/examples/functions/delete.md new file mode 100644 index 0000000000..9270762a4a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/delete.md @@ -0,0 +1,12 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.delete({ + functionId: '<FUNCTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/server-deno/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..34971111a0 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/get-deployment-download.md @@ -0,0 +1,14 @@ +import { Client, Functions, DeploymentDownloadType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const result = functions.getDeploymentDownload({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType.Source // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/get-deployment.md b/docs/examples/1.8.x/server-deno/examples/functions/get-deployment.md new file mode 100644 index 0000000000..e125fa598d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/get-deployment.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.getDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/get-execution.md b/docs/examples/1.8.x/server-deno/examples/functions/get-execution.md new file mode 100644 index 0000000000..d52b60ea8e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/get-execution.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const functions = new Functions(client); + +const response = await functions.getExecution({ + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/get-variable.md b/docs/examples/1.8.x/server-deno/examples/functions/get-variable.md new file mode 100644 index 0000000000..e5916c7615 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/get-variable.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.getVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/get.md b/docs/examples/1.8.x/server-deno/examples/functions/get.md new file mode 100644 index 0000000000..c4678f0b08 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/get.md @@ -0,0 +1,12 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.get({ + functionId: '<FUNCTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/list-deployments.md b/docs/examples/1.8.x/server-deno/examples/functions/list-deployments.md new file mode 100644 index 0000000000..6d1718da39 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/list-deployments.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.listDeployments({ + functionId: '<FUNCTION_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/list-executions.md b/docs/examples/1.8.x/server-deno/examples/functions/list-executions.md new file mode 100644 index 0000000000..101d4ec55e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/list-executions.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const functions = new Functions(client); + +const response = await functions.listExecutions({ + functionId: '<FUNCTION_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/list-runtimes.md b/docs/examples/1.8.x/server-deno/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..a45afe4aa7 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/list-runtimes.md @@ -0,0 +1,10 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.listRuntimes(); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/list-specifications.md b/docs/examples/1.8.x/server-deno/examples/functions/list-specifications.md new file mode 100644 index 0000000000..3bf0d08e7c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/list-specifications.md @@ -0,0 +1,10 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.listSpecifications(); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/list-variables.md b/docs/examples/1.8.x/server-deno/examples/functions/list-variables.md new file mode 100644 index 0000000000..6bc904b605 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/list-variables.md @@ -0,0 +1,12 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.listVariables({ + functionId: '<FUNCTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/list.md b/docs/examples/1.8.x/server-deno/examples/functions/list.md new file mode 100644 index 0000000000..bb0475d0bc --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/list.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/server-deno/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..d6b6cddec0 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/update-deployment-status.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.updateDeploymentStatus({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/server-deno/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..1e0b5542a5 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/update-function-deployment.md @@ -0,0 +1,13 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.updateFunctionDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/update-variable.md b/docs/examples/1.8.x/server-deno/examples/functions/update-variable.md new file mode 100644 index 0000000000..cff5cc43f4 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/update-variable.md @@ -0,0 +1,16 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.updateVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', // optional + secret: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/functions/update.md b/docs/examples/1.8.x/server-deno/examples/functions/update.md new file mode 100644 index 0000000000..0a743693f7 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/functions/update.md @@ -0,0 +1,29 @@ +import { Client, Functions, } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.update({ + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: .Node145, // optional + execute: ["any"], // optional + events: [], // optional + schedule: '', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/graphql/mutation.md b/docs/examples/1.8.x/server-deno/examples/graphql/mutation.md new file mode 100644 index 0000000000..67716b21df --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/graphql/mutation.md @@ -0,0 +1,12 @@ +import { Client, Graphql } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const graphql = new Graphql(client); + +const response = await graphql.mutation({ + query: {} +}); diff --git a/docs/examples/1.8.x/server-deno/examples/graphql/query.md b/docs/examples/1.8.x/server-deno/examples/graphql/query.md new file mode 100644 index 0000000000..e80f795851 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/graphql/query.md @@ -0,0 +1,12 @@ +import { Client, Graphql } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const graphql = new Graphql(client); + +const response = await graphql.query({ + query: {} +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-antivirus.md b/docs/examples/1.8.x/server-deno/examples/health/get-antivirus.md new file mode 100644 index 0000000000..d8dcc1fe3a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-antivirus.md @@ -0,0 +1,10 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getAntivirus(); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-cache.md b/docs/examples/1.8.x/server-deno/examples/health/get-cache.md new file mode 100644 index 0000000000..e138b50b26 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-cache.md @@ -0,0 +1,10 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getCache(); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-certificate.md b/docs/examples/1.8.x/server-deno/examples/health/get-certificate.md new file mode 100644 index 0000000000..388fce9f2c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-certificate.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getCertificate({ + domain: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-db.md b/docs/examples/1.8.x/server-deno/examples/health/get-db.md new file mode 100644 index 0000000000..bded9eb81b --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-db.md @@ -0,0 +1,10 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getDB(); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/server-deno/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..a8202355ad --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-failed-jobs.md @@ -0,0 +1,13 @@ +import { Client, Health, } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getFailedJobs({ + name: .V1Database, + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-pub-sub.md b/docs/examples/1.8.x/server-deno/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..ecc05a3e21 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-pub-sub.md @@ -0,0 +1,10 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getPubSub(); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-builds.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..d247f48e2e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-builds.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueBuilds({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..c43cffb5dd --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-certificates.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueCertificates({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-databases.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..9c126dc611 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-databases.md @@ -0,0 +1,13 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueDatabases({ + name: '<NAME>', // optional + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..240cfe34fc --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-deletes.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueDeletes({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-functions.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..333b5abc09 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-functions.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueFunctions({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-logs.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..787768506a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-logs.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueLogs({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-mails.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..3ec4b390a3 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-mails.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueMails({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..6d5bf48cc8 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-messaging.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueMessaging({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..520b92de2d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-migrations.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueMigrations({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..8f22c23211 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-stats-resources.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueStatsResources({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-usage.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..69ab874051 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-usage.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueUsage({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-deno/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..0e14d7cd16 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-queue-webhooks.md @@ -0,0 +1,12 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getQueueWebhooks({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-storage-local.md b/docs/examples/1.8.x/server-deno/examples/health/get-storage-local.md new file mode 100644 index 0000000000..0e64e1a6dd --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-storage-local.md @@ -0,0 +1,10 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getStorageLocal(); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-storage.md b/docs/examples/1.8.x/server-deno/examples/health/get-storage.md new file mode 100644 index 0000000000..698e33b999 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-storage.md @@ -0,0 +1,10 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getStorage(); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get-time.md b/docs/examples/1.8.x/server-deno/examples/health/get-time.md new file mode 100644 index 0000000000..1bb1ae0e56 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get-time.md @@ -0,0 +1,10 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.getTime(); diff --git a/docs/examples/1.8.x/server-deno/examples/health/get.md b/docs/examples/1.8.x/server-deno/examples/health/get.md new file mode 100644 index 0000000000..87d7ea5396 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/health/get.md @@ -0,0 +1,10 @@ +import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new Health(client); + +const response = await health.get(); diff --git a/docs/examples/1.8.x/server-deno/examples/locale/get.md b/docs/examples/1.8.x/server-deno/examples/locale/get.md new file mode 100644 index 0000000000..960ee6f4f3 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/locale/get.md @@ -0,0 +1,10 @@ +import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new Locale(client); + +const response = await locale.get(); diff --git a/docs/examples/1.8.x/server-deno/examples/locale/list-codes.md b/docs/examples/1.8.x/server-deno/examples/locale/list-codes.md new file mode 100644 index 0000000000..8f91c212df --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/locale/list-codes.md @@ -0,0 +1,10 @@ +import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new Locale(client); + +const response = await locale.listCodes(); diff --git a/docs/examples/1.8.x/server-deno/examples/locale/list-continents.md b/docs/examples/1.8.x/server-deno/examples/locale/list-continents.md new file mode 100644 index 0000000000..55b208c741 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/locale/list-continents.md @@ -0,0 +1,10 @@ +import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new Locale(client); + +const response = await locale.listContinents(); diff --git a/docs/examples/1.8.x/server-deno/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/server-deno/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..b4fbfa0e37 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/locale/list-countries-eu.md @@ -0,0 +1,10 @@ +import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new Locale(client); + +const response = await locale.listCountriesEU(); diff --git a/docs/examples/1.8.x/server-deno/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/server-deno/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..19ac0a06cf --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/locale/list-countries-phones.md @@ -0,0 +1,10 @@ +import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new Locale(client); + +const response = await locale.listCountriesPhones(); diff --git a/docs/examples/1.8.x/server-deno/examples/locale/list-countries.md b/docs/examples/1.8.x/server-deno/examples/locale/list-countries.md new file mode 100644 index 0000000000..67ba0fedd7 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/locale/list-countries.md @@ -0,0 +1,10 @@ +import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new Locale(client); + +const response = await locale.listCountries(); diff --git a/docs/examples/1.8.x/server-deno/examples/locale/list-currencies.md b/docs/examples/1.8.x/server-deno/examples/locale/list-currencies.md new file mode 100644 index 0000000000..986f09d237 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/locale/list-currencies.md @@ -0,0 +1,10 @@ +import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new Locale(client); + +const response = await locale.listCurrencies(); diff --git a/docs/examples/1.8.x/server-deno/examples/locale/list-languages.md b/docs/examples/1.8.x/server-deno/examples/locale/list-languages.md new file mode 100644 index 0000000000..91b4a857b9 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/locale/list-languages.md @@ -0,0 +1,10 @@ +import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new Locale(client); + +const response = await locale.listLanguages(); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..b32386b2a5 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-apns-provider.md @@ -0,0 +1,19 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createAPNSProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-email.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-email.md new file mode 100644 index 0000000000..8ba3db8ddf --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-email.md @@ -0,0 +1,23 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createEmail({ + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + attachments: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..bea200d78b --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-fcm-provider.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + serviceAccountJSON: {}, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..2eaa888ecd --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,21 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + domain: '<DOMAIN>', // optional + isEuRegion: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..b9f3238080 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,17 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-push.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-push.md new file mode 100644 index 0000000000..efa40ce1e7 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-push.md @@ -0,0 +1,30 @@ +import { Client, Messaging, MessagePriority } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createPush({ + messageId: '<MESSAGE_ID>', + title: '<TITLE>', // optional + body: '<BODY>', // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '[ID1:ID2]', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: null, // optional + draft: false, // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..10ce45e381 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,19 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-sms.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-sms.md new file mode 100644 index 0000000000..bf81ff9bcd --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-sms.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createSMS({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..06307b3026 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-smtp-provider.md @@ -0,0 +1,25 @@ +import { Client, Messaging, SmtpEncryption } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 1, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..671c6ea089 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-subscriber.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +const messaging = new Messaging(client); + +const response = await messaging.createSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..0c9376b2a6 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-telesign-provider.md @@ -0,0 +1,17 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..1bf61f9f1d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,17 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-topic.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-topic.md new file mode 100644 index 0000000000..a15699b1d7 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-topic.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ["any"] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..cd889f01f1 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-twilio-provider.md @@ -0,0 +1,17 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..e03b0b6e55 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/create-vonage-provider.md @@ -0,0 +1,17 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.createVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/delete-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..2e0855a00c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/delete-provider.md @@ -0,0 +1,12 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.deleteProvider({ + providerId: '<PROVIDER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-deno/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..c48c9de4cf --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/delete-subscriber.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +const messaging = new Messaging(client); + +const response = await messaging.deleteSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/delete-topic.md b/docs/examples/1.8.x/server-deno/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..5dd1317339 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/delete-topic.md @@ -0,0 +1,12 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.deleteTopic({ + topicId: '<TOPIC_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/delete.md b/docs/examples/1.8.x/server-deno/examples/messaging/delete.md new file mode 100644 index 0000000000..8b4357fd2b --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/delete.md @@ -0,0 +1,12 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.delete({ + messageId: '<MESSAGE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/get-message.md b/docs/examples/1.8.x/server-deno/examples/messaging/get-message.md new file mode 100644 index 0000000000..f0e4c5b8d9 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/get-message.md @@ -0,0 +1,12 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.getMessage({ + messageId: '<MESSAGE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/get-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/get-provider.md new file mode 100644 index 0000000000..18ce92a49b --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/get-provider.md @@ -0,0 +1,12 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.getProvider({ + providerId: '<PROVIDER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/server-deno/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..4916e27700 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/get-subscriber.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.getSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/get-topic.md b/docs/examples/1.8.x/server-deno/examples/messaging/get-topic.md new file mode 100644 index 0000000000..baf1f39d11 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/get-topic.md @@ -0,0 +1,12 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.getTopic({ + topicId: '<TOPIC_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/server-deno/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..b470dbcec4 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/list-message-logs.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.listMessageLogs({ + messageId: '<MESSAGE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/list-messages.md b/docs/examples/1.8.x/server-deno/examples/messaging/list-messages.md new file mode 100644 index 0000000000..a1bd90ae29 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/list-messages.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.listMessages({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-deno/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..9784ff30c3 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/list-provider-logs.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.listProviderLogs({ + providerId: '<PROVIDER_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/list-providers.md b/docs/examples/1.8.x/server-deno/examples/messaging/list-providers.md new file mode 100644 index 0000000000..150de6fed8 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/list-providers.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.listProviders({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-deno/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..ccc575ca10 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.listSubscriberLogs({ + subscriberId: '<SUBSCRIBER_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/server-deno/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..68614ec71d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/list-subscribers.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.listSubscribers({ + topicId: '<TOPIC_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/list-targets.md b/docs/examples/1.8.x/server-deno/examples/messaging/list-targets.md new file mode 100644 index 0000000000..6d269b72e8 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/list-targets.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.listTargets({ + messageId: '<MESSAGE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-deno/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..70b287a806 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/list-topic-logs.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.listTopicLogs({ + topicId: '<TOPIC_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/list-topics.md b/docs/examples/1.8.x/server-deno/examples/messaging/list-topics.md new file mode 100644 index 0000000000..073b78e843 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/list-topics.md @@ -0,0 +1,13 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.listTopics({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..160786f480 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-apns-provider.md @@ -0,0 +1,19 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateAPNSProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-email.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-email.md new file mode 100644 index 0000000000..0f281cd795 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-email.md @@ -0,0 +1,23 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateEmail({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + subject: '<SUBJECT>', // optional + content: '<CONTENT>', // optional + draft: false, // optional + html: false, // optional + cc: [], // optional + bcc: [], // optional + scheduledAt: '', // optional + attachments: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..b76e03736d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-fcm-provider.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + serviceAccountJSON: {} // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..b4f88e8695 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,21 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + apiKey: '<API_KEY>', // optional + domain: '<DOMAIN>', // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..5cf61cb872 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,17 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-push.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-push.md new file mode 100644 index 0000000000..fb776fd489 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-push.md @@ -0,0 +1,30 @@ +import { Client, Messaging, MessagePriority } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updatePush({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + title: '<TITLE>', // optional + body: '<BODY>', // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '[ID1:ID2]', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: null, // optional + draft: false, // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..edf82f6807 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,19 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-sms.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-sms.md new file mode 100644 index 0000000000..9d7f3a3c2f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-sms.md @@ -0,0 +1,18 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateSMS({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + content: '<CONTENT>', // optional + draft: false, // optional + scheduledAt: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..6fc0021a3a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-smtp-provider.md @@ -0,0 +1,25 @@ +import { Client, Messaging, SmtpEncryption } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + host: '<HOST>', // optional + port: 1, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..defb10e246 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-telesign-provider.md @@ -0,0 +1,17 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..c859643999 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,17 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-topic.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-topic.md new file mode 100644 index 0000000000..7dc9337de8 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-topic.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', // optional + subscribe: ["any"] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..75940f5618 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-twilio-provider.md @@ -0,0 +1,17 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + from: '<FROM>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-deno/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..fea4465c18 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/messaging/update-vonage-provider.md @@ -0,0 +1,17 @@ +import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new Messaging(client); + +const response = await messaging.updateVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + from: '<FROM>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/create-deployment.md b/docs/examples/1.8.x/server-deno/examples/sites/create-deployment.md new file mode 100644 index 0000000000..81a0527633 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/create-deployment.md @@ -0,0 +1,17 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.createDeployment({ + siteId: '<SITE_ID>', + code: InputFile.fromPath('/path/to/file.png', 'file.png'), + activate: false, + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-deno/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..515257170c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.createDuplicateDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/server-deno/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..e9b569d5f5 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/create-template-deployment.md @@ -0,0 +1,17 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.createTemplateDeployment({ + siteId: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/create-variable.md b/docs/examples/1.8.x/server-deno/examples/sites/create-variable.md new file mode 100644 index 0000000000..ab5e143454 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/create-variable.md @@ -0,0 +1,15 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.createVariable({ + siteId: '<SITE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-deno/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..7c7b7cca53 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/create-vcs-deployment.md @@ -0,0 +1,15 @@ +import { Client, Sites, VCSDeploymentType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.createVcsDeployment({ + siteId: '<SITE_ID>', + type: VCSDeploymentType.Branch, + reference: '<REFERENCE>', + activate: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/create.md b/docs/examples/1.8.x/server-deno/examples/sites/create.md new file mode 100644 index 0000000000..7161da53a3 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/create.md @@ -0,0 +1,29 @@ +import { Client, Sites, , , } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.create({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: .Analog, + buildRuntime: .Node145, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + adapter: .Static, // optional + installationId: '<INSTALLATION_ID>', // optional + fallbackFile: '<FALLBACK_FILE>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/delete-deployment.md b/docs/examples/1.8.x/server-deno/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..4164f478c0 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/delete-deployment.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.deleteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/delete-log.md b/docs/examples/1.8.x/server-deno/examples/sites/delete-log.md new file mode 100644 index 0000000000..f70a8fb93d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/delete-log.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.deleteLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/delete-variable.md b/docs/examples/1.8.x/server-deno/examples/sites/delete-variable.md new file mode 100644 index 0000000000..226b2f14bc --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/delete-variable.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.deleteVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/delete.md b/docs/examples/1.8.x/server-deno/examples/sites/delete.md new file mode 100644 index 0000000000..2af4f53986 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/delete.md @@ -0,0 +1,12 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.delete({ + siteId: '<SITE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/server-deno/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..40731b1d6a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/get-deployment-download.md @@ -0,0 +1,14 @@ +import { Client, Sites, DeploymentDownloadType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const result = sites.getDeploymentDownload({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType.Source // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/get-deployment.md b/docs/examples/1.8.x/server-deno/examples/sites/get-deployment.md new file mode 100644 index 0000000000..ed23bd15fb --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/get-deployment.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.getDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/get-log.md b/docs/examples/1.8.x/server-deno/examples/sites/get-log.md new file mode 100644 index 0000000000..30cd601868 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/get-log.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.getLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/get-variable.md b/docs/examples/1.8.x/server-deno/examples/sites/get-variable.md new file mode 100644 index 0000000000..e070d2e1e6 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/get-variable.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.getVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/get.md b/docs/examples/1.8.x/server-deno/examples/sites/get.md new file mode 100644 index 0000000000..80cc792ed0 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/get.md @@ -0,0 +1,12 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.get({ + siteId: '<SITE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/list-deployments.md b/docs/examples/1.8.x/server-deno/examples/sites/list-deployments.md new file mode 100644 index 0000000000..013b62126e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/list-deployments.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.listDeployments({ + siteId: '<SITE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/list-frameworks.md b/docs/examples/1.8.x/server-deno/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..5623960463 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/list-frameworks.md @@ -0,0 +1,10 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.listFrameworks(); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/list-logs.md b/docs/examples/1.8.x/server-deno/examples/sites/list-logs.md new file mode 100644 index 0000000000..6ab920a96e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/list-logs.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.listLogs({ + siteId: '<SITE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/list-specifications.md b/docs/examples/1.8.x/server-deno/examples/sites/list-specifications.md new file mode 100644 index 0000000000..a1b0b334ed --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/list-specifications.md @@ -0,0 +1,10 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.listSpecifications(); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/list-variables.md b/docs/examples/1.8.x/server-deno/examples/sites/list-variables.md new file mode 100644 index 0000000000..ed7176289f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/list-variables.md @@ -0,0 +1,12 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.listVariables({ + siteId: '<SITE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/list.md b/docs/examples/1.8.x/server-deno/examples/sites/list.md new file mode 100644 index 0000000000..87f9ef3bdf --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/list.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/server-deno/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..e634de99b8 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/update-deployment-status.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.updateDeploymentStatus({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/server-deno/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..c6ee03bfb4 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/update-site-deployment.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.updateSiteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/update-variable.md b/docs/examples/1.8.x/server-deno/examples/sites/update-variable.md new file mode 100644 index 0000000000..5bc179dd3e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/update-variable.md @@ -0,0 +1,16 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.updateVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', // optional + secret: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/sites/update.md b/docs/examples/1.8.x/server-deno/examples/sites/update.md new file mode 100644 index 0000000000..1f5235cca2 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/sites/update.md @@ -0,0 +1,29 @@ +import { Client, Sites, , , } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.update({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: .Analog, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + buildRuntime: .Node145, // optional + adapter: .Static, // optional + fallbackFile: '<FALLBACK_FILE>', // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/create-bucket.md b/docs/examples/1.8.x/server-deno/examples/storage/create-bucket.md new file mode 100644 index 0000000000..1f996b1369 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/create-bucket.md @@ -0,0 +1,21 @@ +import { Client, Storage, } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new Storage(client); + +const response = await storage.createBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: .None, // optional + encryption: false, // optional + antivirus: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/create-file.md b/docs/examples/1.8.x/server-deno/examples/storage/create-file.md new file mode 100644 index 0000000000..4b6c1fd78a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/create-file.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new Storage(client); + +const response = await storage.createFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: InputFile.fromPath('/path/to/file.png', 'file.png'), + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/delete-bucket.md b/docs/examples/1.8.x/server-deno/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..d5f2e365f8 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/delete-bucket.md @@ -0,0 +1,12 @@ +import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new Storage(client); + +const response = await storage.deleteBucket({ + bucketId: '<BUCKET_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/delete-file.md b/docs/examples/1.8.x/server-deno/examples/storage/delete-file.md new file mode 100644 index 0000000000..3f9f2ac566 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/delete-file.md @@ -0,0 +1,13 @@ +import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new Storage(client); + +const response = await storage.deleteFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/get-bucket.md b/docs/examples/1.8.x/server-deno/examples/storage/get-bucket.md new file mode 100644 index 0000000000..ffb191326d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/get-bucket.md @@ -0,0 +1,12 @@ +import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new Storage(client); + +const response = await storage.getBucket({ + bucketId: '<BUCKET_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/get-file-download.md b/docs/examples/1.8.x/server-deno/examples/storage/get-file-download.md new file mode 100644 index 0000000000..fa1b465c59 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/get-file-download.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new Storage(client); + +const result = storage.getFileDownload({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/get-file-preview.md b/docs/examples/1.8.x/server-deno/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..884a84a95f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/get-file-preview.md @@ -0,0 +1,25 @@ +import { Client, Storage, ImageGravity, ImageFormat } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new Storage(client); + +const result = storage.getFilePreview({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // optional + height: 0, // optional + gravity: ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: '', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: '', // optional + output: ImageFormat.Jpg, // optional + token: '<TOKEN>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/get-file-view.md b/docs/examples/1.8.x/server-deno/examples/storage/get-file-view.md new file mode 100644 index 0000000000..86a357a23c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/get-file-view.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new Storage(client); + +const result = storage.getFileView({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/get-file.md b/docs/examples/1.8.x/server-deno/examples/storage/get-file.md new file mode 100644 index 0000000000..604696a08c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/get-file.md @@ -0,0 +1,13 @@ +import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new Storage(client); + +const response = await storage.getFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/list-buckets.md b/docs/examples/1.8.x/server-deno/examples/storage/list-buckets.md new file mode 100644 index 0000000000..56bba163c6 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/list-buckets.md @@ -0,0 +1,13 @@ +import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new Storage(client); + +const response = await storage.listBuckets({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/list-files.md b/docs/examples/1.8.x/server-deno/examples/storage/list-files.md new file mode 100644 index 0000000000..e2ea466b9b --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/list-files.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new Storage(client); + +const response = await storage.listFiles({ + bucketId: '<BUCKET_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/update-bucket.md b/docs/examples/1.8.x/server-deno/examples/storage/update-bucket.md new file mode 100644 index 0000000000..b0adba1ef3 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/update-bucket.md @@ -0,0 +1,21 @@ +import { Client, Storage, } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new Storage(client); + +const response = await storage.updateBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: .None, // optional + encryption: false, // optional + antivirus: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/storage/update-file.md b/docs/examples/1.8.x/server-deno/examples/storage/update-file.md new file mode 100644 index 0000000000..1a28c98c3f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/storage/update-file.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new Storage(client); + +const response = await storage.updateFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // optional + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..7407b583a6 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: false, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..f139666946 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..a004a895e0 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-email-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..1f40abd73b --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-enum-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..5d555a73bd --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-float-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-index.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..0e164ed29e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-index.md @@ -0,0 +1,18 @@ +import { Client, TablesDB, IndexType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + type: IndexType.Key, + columns: [], + orders: [], // optional + lengths: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..297b096234 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-integer-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..95b20b8803 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-ip-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..66d02cb64d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-line-column.md @@ -0,0 +1,16 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createLineColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..db8034e507 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-point-column.md @@ -0,0 +1,16 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createPointColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..00dbbda632 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,16 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createPolygonColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..27952f7ea6 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDB, RelationshipType, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + relatedTableId: '<RELATED_TABLE_ID>', + type: RelationshipType.OneToOne, + twoWay: false, // optional + key: '', // optional + twoWayKey: '', // optional + onDelete: RelationMutate.Cascade // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-row.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..fdb59a6b70 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-row.md @@ -0,0 +1,22 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..a3fafcfe94 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-rows.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [] +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..ff0816a946 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-string-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + size: 1, + required: false, + default: '<DEFAULT>', // optional + array: false, // optional + encrypt: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-table.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..5dcaac40f6 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-table.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..f019bab896 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create-url-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.createUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/create.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/create.md new file mode 100644 index 0000000000..5971eb18c7 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/create.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..68c2fa458f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.decrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, // optional + min: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..63b567aacf --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-column.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.deleteColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..15a98fbe0f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-index.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.deleteIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..2f63a91387 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-row.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.deleteRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..310b189c96 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-rows.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.deleteRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..3f36527998 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete-table.md @@ -0,0 +1,13 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.deleteTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/delete.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete.md new file mode 100644 index 0000000000..12249aba90 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/delete.md @@ -0,0 +1,12 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.delete({ + databaseId: '<DATABASE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/get-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..16bb38a760 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/get-column.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.getColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/get-index.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..47e7a61251 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/get-index.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.getIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/get-row.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..c662df22d8 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/get-row.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.getRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/get-table.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..6a46bbde35 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/get-table.md @@ -0,0 +1,13 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.getTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/get.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/get.md new file mode 100644 index 0000000000..4304258d6c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/get.md @@ -0,0 +1,12 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.get({ + databaseId: '<DATABASE_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..a57683e91e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/increment-row-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.incrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, // optional + max: null // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..2a1cbe23d5 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/list-columns.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.listColumns({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..7a0af70d2b --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/list-indexes.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.listIndexes({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..2a0949993f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/list-rows.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..0ffd1b9593 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/list-tables.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.listTables({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/list.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/list.md new file mode 100644 index 0000000000..529bd64318 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/list.md @@ -0,0 +1,13 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..ebc0bfb01e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: false, + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..a2672c8a12 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..18fc845316 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-email-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..e282ec8e42 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-enum-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..6ee1c5a955 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-float-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..1d9968362a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-integer-column.md @@ -0,0 +1,19 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..d69e0f1ab6 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-ip-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..71ddd6bdcf --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-line-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateLineColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..0075c71eba --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-point-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updatePointColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..c057ba4225 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updatePolygonColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1,2], [3, 4]], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..3f361e091e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,16 @@ +import { Client, TablesDB, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + onDelete: RelationMutate.Cascade, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-row.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..53848c7300 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-row.md @@ -0,0 +1,16 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..2a3e3f106d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-rows.md @@ -0,0 +1,15 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + data: {}, // optional + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..ff532ae23c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-string-column.md @@ -0,0 +1,18 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '<DEFAULT>', + size: 1, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-table.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..c0453f66d3 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-table.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..a594499053 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update-url-column.md @@ -0,0 +1,17 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.updateUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/update.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/update.md new file mode 100644 index 0000000000..f309641f7f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/update.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..701e1a272f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/upsert-row.md @@ -0,0 +1,16 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.upsertRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-deno/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..a5fa731fdc --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tablesdb/upsert-rows.md @@ -0,0 +1,14 @@ +import { Client, TablesDB } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new TablesDB(client); + +const response = await tablesDB.upsertRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [] +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/create-membership.md b/docs/examples/1.8.x/server-deno/examples/teams/create-membership.md new file mode 100644 index 0000000000..27e4ec722a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/create-membership.md @@ -0,0 +1,18 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.createMembership({ + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // optional + userId: '<USER_ID>', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/create.md b/docs/examples/1.8.x/server-deno/examples/teams/create.md new file mode 100644 index 0000000000..0c921292b5 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/create.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.create({ + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/delete-membership.md b/docs/examples/1.8.x/server-deno/examples/teams/delete-membership.md new file mode 100644 index 0000000000..51fcd0c99d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/delete-membership.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.deleteMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/delete.md b/docs/examples/1.8.x/server-deno/examples/teams/delete.md new file mode 100644 index 0000000000..e300ad5d69 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/delete.md @@ -0,0 +1,12 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.delete({ + teamId: '<TEAM_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/get-membership.md b/docs/examples/1.8.x/server-deno/examples/teams/get-membership.md new file mode 100644 index 0000000000..73b6a240c6 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/get-membership.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.getMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/get-prefs.md b/docs/examples/1.8.x/server-deno/examples/teams/get-prefs.md new file mode 100644 index 0000000000..d2cdd8af10 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/get-prefs.md @@ -0,0 +1,12 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.getPrefs({ + teamId: '<TEAM_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/get.md b/docs/examples/1.8.x/server-deno/examples/teams/get.md new file mode 100644 index 0000000000..41c81bc2ee --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/get.md @@ -0,0 +1,12 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.get({ + teamId: '<TEAM_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/list-memberships.md b/docs/examples/1.8.x/server-deno/examples/teams/list-memberships.md new file mode 100644 index 0000000000..f781fffc48 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/list-memberships.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.listMemberships({ + teamId: '<TEAM_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/list.md b/docs/examples/1.8.x/server-deno/examples/teams/list.md new file mode 100644 index 0000000000..4bb0c41b98 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/list.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/update-membership-status.md b/docs/examples/1.8.x/server-deno/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..22ac429361 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/update-membership-status.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.updateMembershipStatus({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/update-membership.md b/docs/examples/1.8.x/server-deno/examples/teams/update-membership.md new file mode 100644 index 0000000000..3524cc5b4e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/update-membership.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.updateMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [] +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/update-name.md b/docs/examples/1.8.x/server-deno/examples/teams/update-name.md new file mode 100644 index 0000000000..b7d7e0f837 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/update-name.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.updateName({ + teamId: '<TEAM_ID>', + name: '<NAME>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/teams/update-prefs.md b/docs/examples/1.8.x/server-deno/examples/teams/update-prefs.md new file mode 100644 index 0000000000..5c7eaecf72 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/teams/update-prefs.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new Teams(client); + +const response = await teams.updatePrefs({ + teamId: '<TEAM_ID>', + prefs: {} +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tokens/create-file-token.md b/docs/examples/1.8.x/server-deno/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..e0d5b4d7c2 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tokens/create-file-token.md @@ -0,0 +1,14 @@ +import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new Tokens(client); + +const response = await tokens.createFileToken({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + expire: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tokens/delete.md b/docs/examples/1.8.x/server-deno/examples/tokens/delete.md new file mode 100644 index 0000000000..6c41ea5c0a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tokens/delete.md @@ -0,0 +1,12 @@ +import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new Tokens(client); + +const response = await tokens.delete({ + tokenId: '<TOKEN_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tokens/get.md b/docs/examples/1.8.x/server-deno/examples/tokens/get.md new file mode 100644 index 0000000000..a7bf23a1c8 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tokens/get.md @@ -0,0 +1,12 @@ +import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new Tokens(client); + +const response = await tokens.get({ + tokenId: '<TOKEN_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tokens/list.md b/docs/examples/1.8.x/server-deno/examples/tokens/list.md new file mode 100644 index 0000000000..a33ac66191 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tokens/list.md @@ -0,0 +1,14 @@ +import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new Tokens(client); + +const response = await tokens.list({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/tokens/update.md b/docs/examples/1.8.x/server-deno/examples/tokens/update.md new file mode 100644 index 0000000000..0524e05dc7 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/tokens/update.md @@ -0,0 +1,13 @@ +import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new Tokens(client); + +const response = await tokens.update({ + tokenId: '<TOKEN_ID>', + expire: '' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/server-deno/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..b08fbb9acd --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-argon-2-user.md @@ -0,0 +1,15 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createArgon2User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-deno/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..6501c0279a --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-bcrypt-user.md @@ -0,0 +1,15 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createBcryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-jwt.md b/docs/examples/1.8.x/server-deno/examples/users/create-jwt.md new file mode 100644 index 0000000000..6cd2f3d62f --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-jwt.md @@ -0,0 +1,14 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createJWT({ + userId: '<USER_ID>', + sessionId: '<SESSION_ID>', // optional + duration: 0 // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-md-5-user.md b/docs/examples/1.8.x/server-deno/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..4af161f795 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-md-5-user.md @@ -0,0 +1,15 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createMD5User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-deno/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..fe8a4af08e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createMFARecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-deno/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..d1f159a423 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-ph-pass-user.md @@ -0,0 +1,15 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createPHPassUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-deno/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..e382a4a4ff --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,18 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createScryptModifiedUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>', + passwordSignerKey: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/server-deno/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..7a6c8749c6 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-scrypt-user.md @@ -0,0 +1,20 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createScryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordCpu: null, + passwordMemory: null, + passwordParallel: null, + passwordLength: null, + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-session.md b/docs/examples/1.8.x/server-deno/examples/users/create-session.md new file mode 100644 index 0000000000..962d391185 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-session.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createSession({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-sha-user.md b/docs/examples/1.8.x/server-deno/examples/users/create-sha-user.md new file mode 100644 index 0000000000..325da0e6cd --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-sha-user.md @@ -0,0 +1,16 @@ +import { Client, Users, PasswordHash } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createSHAUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordVersion: PasswordHash.Sha1, // optional + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-target.md b/docs/examples/1.8.x/server-deno/examples/users/create-target.md new file mode 100644 index 0000000000..861c25afbd --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-target.md @@ -0,0 +1,17 @@ +import { Client, Users, MessagingProviderType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: MessagingProviderType.Email, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create-token.md b/docs/examples/1.8.x/server-deno/examples/users/create-token.md new file mode 100644 index 0000000000..b84d0959ec --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create-token.md @@ -0,0 +1,14 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.createToken({ + userId: '<USER_ID>', + length: 4, // optional + expire: 60 // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/create.md b/docs/examples/1.8.x/server-deno/examples/users/create.md new file mode 100644 index 0000000000..7da9b9ad3e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/create.md @@ -0,0 +1,16 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.create({ + userId: '<USER_ID>', + email: 'email@example.com', // optional + phone: '+12065550100', // optional + password: '', // optional + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/delete-identity.md b/docs/examples/1.8.x/server-deno/examples/users/delete-identity.md new file mode 100644 index 0000000000..83efe6a3c5 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/delete-identity.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.deleteIdentity({ + identityId: '<IDENTITY_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-deno/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..5097cffdd7 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Users, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.deleteMFAAuthenticator({ + userId: '<USER_ID>', + type: AuthenticatorType.Totp +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/delete-session.md b/docs/examples/1.8.x/server-deno/examples/users/delete-session.md new file mode 100644 index 0000000000..1d4adc8063 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/delete-session.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.deleteSession({ + userId: '<USER_ID>', + sessionId: '<SESSION_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/delete-sessions.md b/docs/examples/1.8.x/server-deno/examples/users/delete-sessions.md new file mode 100644 index 0000000000..ec4453111e --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/delete-sessions.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.deleteSessions({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/delete-target.md b/docs/examples/1.8.x/server-deno/examples/users/delete-target.md new file mode 100644 index 0000000000..953ade1e02 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/delete-target.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.deleteTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/delete.md b/docs/examples/1.8.x/server-deno/examples/users/delete.md new file mode 100644 index 0000000000..5ab1f18726 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/delete.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.delete({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-deno/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..c2e4752a71 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.getMFARecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/get-prefs.md b/docs/examples/1.8.x/server-deno/examples/users/get-prefs.md new file mode 100644 index 0000000000..d252ffe223 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/get-prefs.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.getPrefs({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/get-target.md b/docs/examples/1.8.x/server-deno/examples/users/get-target.md new file mode 100644 index 0000000000..7586fae9ad --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/get-target.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.getTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/get.md b/docs/examples/1.8.x/server-deno/examples/users/get.md new file mode 100644 index 0000000000..c3e58635a1 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/get.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.get({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/list-identities.md b/docs/examples/1.8.x/server-deno/examples/users/list-identities.md new file mode 100644 index 0000000000..f91100759c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/list-identities.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.listIdentities({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/list-logs.md b/docs/examples/1.8.x/server-deno/examples/users/list-logs.md new file mode 100644 index 0000000000..a039a745f9 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/list-logs.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.listLogs({ + userId: '<USER_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/list-memberships.md b/docs/examples/1.8.x/server-deno/examples/users/list-memberships.md new file mode 100644 index 0000000000..538a635a12 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/list-memberships.md @@ -0,0 +1,14 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.listMemberships({ + userId: '<USER_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/server-deno/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..c4130118ba --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/list-mfa-factors.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.listMFAFactors({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/list-sessions.md b/docs/examples/1.8.x/server-deno/examples/users/list-sessions.md new file mode 100644 index 0000000000..46f4e5c40d --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/list-sessions.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.listSessions({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/list-targets.md b/docs/examples/1.8.x/server-deno/examples/users/list-targets.md new file mode 100644 index 0000000000..9eee79fd34 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/list-targets.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.listTargets({ + userId: '<USER_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/list.md b/docs/examples/1.8.x/server-deno/examples/users/list.md new file mode 100644 index 0000000000..df734633ce --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/list.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-email-verification.md b/docs/examples/1.8.x/server-deno/examples/users/update-email-verification.md new file mode 100644 index 0000000000..df2fd03fd0 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-email-verification.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updateEmailVerification({ + userId: '<USER_ID>', + emailVerification: false +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-email.md b/docs/examples/1.8.x/server-deno/examples/users/update-email.md new file mode 100644 index 0000000000..fbf34cabdd --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-email.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updateEmail({ + userId: '<USER_ID>', + email: 'email@example.com' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-labels.md b/docs/examples/1.8.x/server-deno/examples/users/update-labels.md new file mode 100644 index 0000000000..18cdca2933 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-labels.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updateLabels({ + userId: '<USER_ID>', + labels: [] +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-deno/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..ce1b875b03 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updateMFARecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-mfa.md b/docs/examples/1.8.x/server-deno/examples/users/update-mfa.md new file mode 100644 index 0000000000..235357f818 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-mfa.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updateMFA({ + userId: '<USER_ID>', + mfa: false +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-name.md b/docs/examples/1.8.x/server-deno/examples/users/update-name.md new file mode 100644 index 0000000000..304e833506 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-name.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updateName({ + userId: '<USER_ID>', + name: '<NAME>' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-password.md b/docs/examples/1.8.x/server-deno/examples/users/update-password.md new file mode 100644 index 0000000000..8eecca408c --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-password.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updatePassword({ + userId: '<USER_ID>', + password: '' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-phone-verification.md b/docs/examples/1.8.x/server-deno/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..713cdac8d7 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-phone-verification.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updatePhoneVerification({ + userId: '<USER_ID>', + phoneVerification: false +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-phone.md b/docs/examples/1.8.x/server-deno/examples/users/update-phone.md new file mode 100644 index 0000000000..1c3926bc79 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-phone.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updatePhone({ + userId: '<USER_ID>', + number: '+12065550100' +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-prefs.md b/docs/examples/1.8.x/server-deno/examples/users/update-prefs.md new file mode 100644 index 0000000000..555f9b4e23 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-prefs.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updatePrefs({ + userId: '<USER_ID>', + prefs: {} +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-status.md b/docs/examples/1.8.x/server-deno/examples/users/update-status.md new file mode 100644 index 0000000000..b6b692e3e1 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-status.md @@ -0,0 +1,13 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updateStatus({ + userId: '<USER_ID>', + status: false +}); diff --git a/docs/examples/1.8.x/server-deno/examples/users/update-target.md b/docs/examples/1.8.x/server-deno/examples/users/update-target.md new file mode 100644 index 0000000000..ebc039bca0 --- /dev/null +++ b/docs/examples/1.8.x/server-deno/examples/users/update-target.md @@ -0,0 +1,16 @@ +import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new Users(client); + +const response = await users.updateTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', // optional + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..fc807aa4e5 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-anonymous-session.md @@ -0,0 +1,11 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +Session result = await account.CreateAnonymousSession(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-email-password-session.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..abf5a41317 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-email-password-session.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +Session result = await account.CreateEmailPasswordSession( + email: "email@example.com", + password: "password" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-email-token.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-email-token.md new file mode 100644 index 0000000000..69862feed0 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-email-token.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +Token result = await account.CreateEmailToken( + userId: "<USER_ID>", + email: "email@example.com", + phrase: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-jwt.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-jwt.md new file mode 100644 index 0000000000..423cbed2b3 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-jwt.md @@ -0,0 +1,11 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +JWT result = await account.CreateJWT(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..21bcef6bed --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-magic-url-token.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +Token result = await account.CreateMagicURLToken( + userId: "<USER_ID>", + email: "email@example.com", + url: "https://example.com", // optional + phrase: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..9076fcd069 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-mfa-authenticator.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaType result = await account.CreateMFAAuthenticator( + type: AuthenticatorType.Totp +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..32497b4ec3 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-mfa-challenge.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +MfaChallenge result = await account.CreateMFAChallenge( + factor: AuthenticationFactor.Email +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..406fd4493f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaRecoveryCodes result = await account.CreateMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..5b405449b1 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-o-auth-2-token.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +await account.CreateOAuth2Token( + provider: OAuthProvider.Amazon, + success: "https://example.com", // optional + failure: "https://example.com", // optional + scopes: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-phone-token.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-phone-token.md new file mode 100644 index 0000000000..0d17f5ecee --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-phone-token.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +Token result = await account.CreatePhoneToken( + userId: "<USER_ID>", + phone: "+12065550100" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-phone-verification.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..185fc46e0d --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-phone-verification.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.CreatePhoneVerification(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-recovery.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-recovery.md new file mode 100644 index 0000000000..c2e3571d56 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-recovery.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.CreateRecovery( + email: "email@example.com", + url: "https://example.com" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-session.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-session.md new file mode 100644 index 0000000000..2da46ce62b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-session.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +Session result = await account.CreateSession( + userId: "<USER_ID>", + secret: "<SECRET>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create-verification.md b/docs/examples/1.8.x/server-dotnet/examples/account/create-verification.md new file mode 100644 index 0000000000..92222ea88a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create-verification.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.CreateVerification( + url: "https://example.com" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/create.md b/docs/examples/1.8.x/server-dotnet/examples/account/create.md new file mode 100644 index 0000000000..83c1d54251 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/create.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +User result = await account.Create( + userId: "<USER_ID>", + email: "email@example.com", + password: "", + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/delete-identity.md b/docs/examples/1.8.x/server-dotnet/examples/account/delete-identity.md new file mode 100644 index 0000000000..9b084800d4 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/delete-identity.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeleteIdentity( + identityId: "<IDENTITY_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-dotnet/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..c695de2956 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeleteMFAAuthenticator( + type: AuthenticatorType.Totp +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/delete-session.md b/docs/examples/1.8.x/server-dotnet/examples/account/delete-session.md new file mode 100644 index 0000000000..0bca7c172a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/delete-session.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeleteSession( + sessionId: "<SESSION_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/delete-sessions.md b/docs/examples/1.8.x/server-dotnet/examples/account/delete-sessions.md new file mode 100644 index 0000000000..5b0e7b5cba --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/delete-sessions.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +await account.DeleteSessions(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dotnet/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..2e5468ad98 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaRecoveryCodes result = await account.GetMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/get-prefs.md b/docs/examples/1.8.x/server-dotnet/examples/account/get-prefs.md new file mode 100644 index 0000000000..b0fce89a3f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/get-prefs.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Preferences result = await account.GetPrefs(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/get-session.md b/docs/examples/1.8.x/server-dotnet/examples/account/get-session.md new file mode 100644 index 0000000000..9aa7abaee0 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/get-session.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Session result = await account.GetSession( + sessionId: "<SESSION_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/get.md b/docs/examples/1.8.x/server-dotnet/examples/account/get.md new file mode 100644 index 0000000000..eecb890b30 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/get.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.Get(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/list-identities.md b/docs/examples/1.8.x/server-dotnet/examples/account/list-identities.md new file mode 100644 index 0000000000..661fab9f4e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/list-identities.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +IdentityList result = await account.ListIdentities( + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/list-logs.md b/docs/examples/1.8.x/server-dotnet/examples/account/list-logs.md new file mode 100644 index 0000000000..8e5eadf961 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/list-logs.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +LogList result = await account.ListLogs( + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/server-dotnet/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..f284f6f227 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/list-mfa-factors.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaFactors result = await account.ListMFAFactors(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/list-sessions.md b/docs/examples/1.8.x/server-dotnet/examples/account/list-sessions.md new file mode 100644 index 0000000000..6304383cb3 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/list-sessions.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +SessionList result = await account.ListSessions(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-email.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-email.md new file mode 100644 index 0000000000..06e2a2a9df --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-email.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdateEmail( + email: "email@example.com", + password: "password" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..a8d8312e18 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-magic-url-session.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +Session result = await account.UpdateMagicURLSession( + userId: "<USER_ID>", + secret: "<SECRET>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..f5dd5c502f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa-authenticator.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdateMFAAuthenticator( + type: AuthenticatorType.Totp, + otp: "<OTP>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..f9a9db465b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa-challenge.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Session result = await account.UpdateMFAChallenge( + challengeId: "<CHALLENGE_ID>", + otp: "<OTP>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..bfc6c876f2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +MfaRecoveryCodes result = await account.UpdateMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa.md new file mode 100644 index 0000000000..b9405e7e2c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-mfa.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdateMFA( + mfa: false +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-name.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-name.md new file mode 100644 index 0000000000..6088226fc8 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-name.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdateName( + name: "<NAME>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-password.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-password.md new file mode 100644 index 0000000000..f24c703a9a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-password.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdatePassword( + password: "", + oldPassword: "password" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-phone-session.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-phone-session.md new file mode 100644 index 0000000000..2f8b091999 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-phone-session.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +Session result = await account.UpdatePhoneSession( + userId: "<USER_ID>", + secret: "<SECRET>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-phone-verification.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..a100c0f2e2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-phone-verification.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.UpdatePhoneVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-phone.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-phone.md new file mode 100644 index 0000000000..224001dd6e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-phone.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdatePhone( + phone: "+12065550100", + password: "password" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-prefs.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-prefs.md new file mode 100644 index 0000000000..80f42aaaf8 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-prefs.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdatePrefs( + prefs: new { + language = "en", + timezone = "UTC", + darkTheme = true + } +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-recovery.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-recovery.md new file mode 100644 index 0000000000..188462229b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-recovery.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.UpdateRecovery( + userId: "<USER_ID>", + secret: "<SECRET>", + password: "" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-session.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-session.md new file mode 100644 index 0000000000..a98644c032 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-session.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Session result = await account.UpdateSession( + sessionId: "<SESSION_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-status.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-status.md new file mode 100644 index 0000000000..d9c5b41d72 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-status.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +User result = await account.UpdateStatus(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/account/update-verification.md b/docs/examples/1.8.x/server-dotnet/examples/account/update-verification.md new file mode 100644 index 0000000000..b9dd1ded40 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/account/update-verification.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.UpdateVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/avatars/get-browser.md b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-browser.md new file mode 100644 index 0000000000..9c7b643af1 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-browser.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetBrowser( + code: Browser.AvantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..a41ade1438 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-credit-card.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetCreditCard( + code: CreditCard.AmericanExpress, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/avatars/get-favicon.md b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..345d856717 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-favicon.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetFavicon( + url: "https://example.com" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/avatars/get-flag.md b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-flag.md new file mode 100644 index 0000000000..f7a3e05cee --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-flag.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetFlag( + code: Flag.Afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/avatars/get-image.md b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-image.md new file mode 100644 index 0000000000..4a67e58517 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-image.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetImage( + url: "https://example.com", + width: 0, // optional + height: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/avatars/get-initials.md b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-initials.md new file mode 100644 index 0000000000..55427ff622 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-initials.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetInitials( + name: "<NAME>", // optional + width: 0, // optional + height: 0, // optional + background: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/avatars/get-qr.md b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-qr.md new file mode 100644 index 0000000000..4591b7d99c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/avatars/get-qr.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +byte[] result = await avatars.GetQR( + text: "<TEXT>", + size: 1, // optional + margin: 0, // optional + download: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..8807648521 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-boolean-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeBoolean result = await databases.CreateBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: false, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-collection.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-collection.md new file mode 100644 index 0000000000..75a1c5c311 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-collection.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Collection result = await databases.CreateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..7be723379e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-datetime-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeDatetime result = await databases.CreateDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-document.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-document.md new file mode 100644 index 0000000000..4a7444db7a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-document.md @@ -0,0 +1,24 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.CreateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 30, + isAdmin = false + }, + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-documents.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-documents.md new file mode 100644 index 0000000000..dad710f0df --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-documents.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +DocumentList result = await databases.CreateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: new List<object>() +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..df00119ff9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-email-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeEmail result = await databases.CreateEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "email@example.com", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..d85e8a72a9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-enum-attribute.md @@ -0,0 +1,20 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeEnum result = await databases.CreateEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + elements: new List<string>(), + required: false, + default: "<DEFAULT>", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..bc03fac7ae --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-float-attribute.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeFloat result = await databases.CreateFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + min: 0, // optional + max: 0, // optional + default: 0, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-index.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-index.md new file mode 100644 index 0000000000..ae5583c68d --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-index.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Index result = await databases.CreateIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + type: IndexType.Key, + attributes: new List<string>(), + orders: new List<string>(), // optional + lengths: new List<long>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..c8e7c13355 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-integer-attribute.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeInteger result = await databases.CreateIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + min: 0, // optional + max: 0, // optional + default: 0, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..f95c257089 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-ip-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeIp result = await databases.CreateIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..d0de49457d --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-line-attribute.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeLine result = await databases.CreateLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..4843174c1a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-point-attribute.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributePoint result = await databases.CreatePointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [1, 2] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..15c8b98696 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-polygon-attribute.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributePolygon result = await databases.CreatePolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..b0f4d1194f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-relationship-attribute.md @@ -0,0 +1,22 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeRelationship result = await databases.CreateRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + relatedCollectionId: "<RELATED_COLLECTION_ID>", + type: RelationshipType.OneToOne, + twoWay: false, // optional + key: "", // optional + twoWayKey: "", // optional + onDelete: RelationMutate.Cascade // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..6cba31ff36 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-string-attribute.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeString result = await databases.CreateStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + size: 1, + required: false, + default: "<DEFAULT>", // optional + array: false, // optional + encrypt: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..dce1ac496a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create-url-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeUrl result = await databases.CreateUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "https://example.com", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/create.md b/docs/examples/1.8.x/server-dotnet/examples/databases/create.md new file mode 100644 index 0000000000..9b66c15cef --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/create.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Database result = await databases.Create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..2e48d4578e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.DecrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, // optional + min: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/delete-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..46eb44b4b8 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/delete-attribute.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +await databases.DeleteAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/delete-collection.md b/docs/examples/1.8.x/server-dotnet/examples/databases/delete-collection.md new file mode 100644 index 0000000000..e05717dc6c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/delete-collection.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +await databases.DeleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/delete-document.md b/docs/examples/1.8.x/server-dotnet/examples/databases/delete-document.md new file mode 100644 index 0000000000..221b80e254 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/delete-document.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +await databases.DeleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/delete-documents.md b/docs/examples/1.8.x/server-dotnet/examples/databases/delete-documents.md new file mode 100644 index 0000000000..a9bc9c277b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/delete-documents.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +await databases.DeleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/delete-index.md b/docs/examples/1.8.x/server-dotnet/examples/databases/delete-index.md new file mode 100644 index 0000000000..02dcf5c66a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/delete-index.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +await databases.DeleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/delete.md b/docs/examples/1.8.x/server-dotnet/examples/databases/delete.md new file mode 100644 index 0000000000..a877eabc02 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/delete.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +await databases.Delete( + databaseId: "<DATABASE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/get-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/get-attribute.md new file mode 100644 index 0000000000..d9e02e36b6 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/get-attribute.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + + result = await databases.GetAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/get-collection.md b/docs/examples/1.8.x/server-dotnet/examples/databases/get-collection.md new file mode 100644 index 0000000000..79fe685cbc --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/get-collection.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Collection result = await databases.GetCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/get-document.md b/docs/examples/1.8.x/server-dotnet/examples/databases/get-document.md new file mode 100644 index 0000000000..d7e9b68807 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/get-document.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.GetDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/get-index.md b/docs/examples/1.8.x/server-dotnet/examples/databases/get-index.md new file mode 100644 index 0000000000..02f7b812c8 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/get-index.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Index result = await databases.GetIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/get.md b/docs/examples/1.8.x/server-dotnet/examples/databases/get.md new file mode 100644 index 0000000000..174d74c4f0 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/get.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Database result = await databases.Get( + databaseId: "<DATABASE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..923c8d63e2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.IncrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, // optional + max: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/list-attributes.md b/docs/examples/1.8.x/server-dotnet/examples/databases/list-attributes.md new file mode 100644 index 0000000000..d2ac6c3afd --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/list-attributes.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeList result = await databases.ListAttributes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/list-collections.md b/docs/examples/1.8.x/server-dotnet/examples/databases/list-collections.md new file mode 100644 index 0000000000..5dacb62e97 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/list-collections.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +CollectionList result = await databases.ListCollections( + databaseId: "<DATABASE_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/list-documents.md b/docs/examples/1.8.x/server-dotnet/examples/databases/list-documents.md new file mode 100644 index 0000000000..f59e4576bd --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/list-documents.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +DocumentList result = await databases.ListDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/list-indexes.md b/docs/examples/1.8.x/server-dotnet/examples/databases/list-indexes.md new file mode 100644 index 0000000000..e6adab1f2d --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/list-indexes.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +IndexList result = await databases.ListIndexes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/list.md b/docs/examples/1.8.x/server-dotnet/examples/databases/list.md new file mode 100644 index 0000000000..d2b552b27c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/list.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +DatabaseList result = await databases.List( + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..aa2ed498d2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-boolean-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeBoolean result = await databases.UpdateBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: false, + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-collection.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-collection.md new file mode 100644 index 0000000000..7885ad3969 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-collection.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Collection result = await databases.UpdateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..e6b60c8753 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-datetime-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeDatetime result = await databases.UpdateDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-document.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-document.md new file mode 100644 index 0000000000..3121c15e08 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-document.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.UpdateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [object], // optional + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-documents.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-documents.md new file mode 100644 index 0000000000..63ded21ac9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-documents.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +DocumentList result = await databases.UpdateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: [object], // optional + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..8d36a43780 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-email-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeEmail result = await databases.UpdateEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "email@example.com", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..e3ca9fe124 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-enum-attribute.md @@ -0,0 +1,20 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeEnum result = await databases.UpdateEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + elements: new List<string>(), + required: false, + default: "<DEFAULT>", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..46328d26f5 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-float-attribute.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeFloat result = await databases.UpdateFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: 0, + min: 0, // optional + max: 0, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..91ff1897c7 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-integer-attribute.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeInteger result = await databases.UpdateIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: 0, + min: 0, // optional + max: 0, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..dfcb5d214a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-ip-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeIp result = await databases.UpdateIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..0cc21572bc --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-line-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeLine result = await databases.UpdateLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..3969b16074 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-point-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributePoint result = await databases.UpdatePointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [1, 2], // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..1344574585 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-polygon-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributePolygon result = await databases.UpdatePolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..5b6dd71467 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-relationship-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeRelationship result = await databases.UpdateRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + onDelete: RelationMutate.Cascade, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..918fdc0e3f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-string-attribute.md @@ -0,0 +1,20 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeString result = await databases.UpdateStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "<DEFAULT>", + size: 1, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..8766a3f2f7 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update-url-attribute.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +AttributeUrl result = await databases.UpdateUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "https://example.com", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/update.md b/docs/examples/1.8.x/server-dotnet/examples/databases/update.md new file mode 100644 index 0000000000..d4dd28aa2b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/update.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +Database result = await databases.Update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/upsert-document.md b/docs/examples/1.8.x/server-dotnet/examples/databases/upsert-document.md new file mode 100644 index 0000000000..c0876bfa73 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/upsert-document.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.UpsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [object], + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/databases/upsert-documents.md b/docs/examples/1.8.x/server-dotnet/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..6c124c16e5 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/databases/upsert-documents.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +DocumentList result = await databases.UpsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: new List<object>() +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/create-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/functions/create-deployment.md new file mode 100644 index 0000000000..26c6ff4c42 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/create-deployment.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.CreateDeployment( + functionId: "<FUNCTION_ID>", + code: InputFile.FromPath("./path-to-files/image.jpg"), + activate: false, + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..057fe12b10 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.CreateDuplicateDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>", + buildId: "<BUILD_ID>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/create-execution.md b/docs/examples/1.8.x/server-dotnet/examples/functions/create-execution.md new file mode 100644 index 0000000000..98d1b2f3ff --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/create-execution.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +Execution result = await functions.CreateExecution( + functionId: "<FUNCTION_ID>", + body: "<BODY>", // optional + async: false, // optional + path: "<PATH>", // optional + method: ExecutionMethod.GET, // optional + headers: [object], // optional + scheduledAt: "<SCHEDULED_AT>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..019a9bf256 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/create-template-deployment.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.CreateTemplateDeployment( + functionId: "<FUNCTION_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + version: "<VERSION>", + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/create-variable.md b/docs/examples/1.8.x/server-dotnet/examples/functions/create-variable.md new file mode 100644 index 0000000000..6d1f85b12e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/create-variable.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Variable result = await functions.CreateVariable( + functionId: "<FUNCTION_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..9651365912 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/create-vcs-deployment.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.CreateVcsDeployment( + functionId: "<FUNCTION_ID>", + type: VCSDeploymentType.Branch, + reference: "<REFERENCE>", + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/create.md b/docs/examples/1.8.x/server-dotnet/examples/functions/create.md new file mode 100644 index 0000000000..6e705228f1 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/create.md @@ -0,0 +1,32 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Function result = await functions.Create( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: .Node145, + execute: ["any"], // optional + events: new List<string>(), // optional + schedule: "", // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>", // optional + scopes: new List<string>(), // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + specification: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/delete-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..33c537ad0d --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/delete-deployment.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +await functions.DeleteDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/delete-execution.md b/docs/examples/1.8.x/server-dotnet/examples/functions/delete-execution.md new file mode 100644 index 0000000000..5d5ab8dee2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/delete-execution.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +await functions.DeleteExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/delete-variable.md b/docs/examples/1.8.x/server-dotnet/examples/functions/delete-variable.md new file mode 100644 index 0000000000..263c3f6420 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/delete-variable.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +await functions.DeleteVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/delete.md b/docs/examples/1.8.x/server-dotnet/examples/functions/delete.md new file mode 100644 index 0000000000..ed780ac15a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/delete.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +await functions.Delete( + functionId: "<FUNCTION_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/server-dotnet/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..bfc3209635 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/get-deployment-download.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +byte[] result = await functions.GetDeploymentDownload( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>", + type: DeploymentDownloadType.Source // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/get-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/functions/get-deployment.md new file mode 100644 index 0000000000..5fe31a2f6e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/get-deployment.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.GetDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/get-execution.md b/docs/examples/1.8.x/server-dotnet/examples/functions/get-execution.md new file mode 100644 index 0000000000..8581b968af --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/get-execution.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +Execution result = await functions.GetExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/get-variable.md b/docs/examples/1.8.x/server-dotnet/examples/functions/get-variable.md new file mode 100644 index 0000000000..57ba993389 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/get-variable.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Variable result = await functions.GetVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/get.md b/docs/examples/1.8.x/server-dotnet/examples/functions/get.md new file mode 100644 index 0000000000..baba5d0b4a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/get.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Function result = await functions.Get( + functionId: "<FUNCTION_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/list-deployments.md b/docs/examples/1.8.x/server-dotnet/examples/functions/list-deployments.md new file mode 100644 index 0000000000..093befcf61 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/list-deployments.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +DeploymentList result = await functions.ListDeployments( + functionId: "<FUNCTION_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/list-executions.md b/docs/examples/1.8.x/server-dotnet/examples/functions/list-executions.md new file mode 100644 index 0000000000..6ec320eb7a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/list-executions.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +ExecutionList result = await functions.ListExecutions( + functionId: "<FUNCTION_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/list-runtimes.md b/docs/examples/1.8.x/server-dotnet/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..c238671670 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/list-runtimes.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +RuntimeList result = await functions.ListRuntimes(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/list-specifications.md b/docs/examples/1.8.x/server-dotnet/examples/functions/list-specifications.md new file mode 100644 index 0000000000..2d868d1343 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/list-specifications.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +SpecificationList result = await functions.ListSpecifications(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/list-variables.md b/docs/examples/1.8.x/server-dotnet/examples/functions/list-variables.md new file mode 100644 index 0000000000..4c85da8995 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/list-variables.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +VariableList result = await functions.ListVariables( + functionId: "<FUNCTION_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/list.md b/docs/examples/1.8.x/server-dotnet/examples/functions/list.md new file mode 100644 index 0000000000..750642d498 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/list.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +FunctionList result = await functions.List( + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/server-dotnet/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..4dd70b1932 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/update-deployment-status.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Deployment result = await functions.UpdateDeploymentStatus( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..7bdbd91b5c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/update-function-deployment.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Function result = await functions.UpdateFunctionDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/update-variable.md b/docs/examples/1.8.x/server-dotnet/examples/functions/update-variable.md new file mode 100644 index 0000000000..2b776d69ea --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/update-variable.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Variable result = await functions.UpdateVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", // optional + secret: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/functions/update.md b/docs/examples/1.8.x/server-dotnet/examples/functions/update.md new file mode 100644 index 0000000000..7160795f77 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/functions/update.md @@ -0,0 +1,32 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +Function result = await functions.Update( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: .Node145, // optional + execute: ["any"], // optional + events: new List<string>(), // optional + schedule: "", // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>", // optional + scopes: new List<string>(), // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + specification: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/graphql/mutation.md b/docs/examples/1.8.x/server-dotnet/examples/graphql/mutation.md new file mode 100644 index 0000000000..b153e34d51 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/graphql/mutation.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Graphql graphql = new Graphql(client); + +Any result = await graphql.Mutation( + query: [object] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/graphql/query.md b/docs/examples/1.8.x/server-dotnet/examples/graphql/query.md new file mode 100644 index 0000000000..61345d7665 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/graphql/query.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Graphql graphql = new Graphql(client); + +Any result = await graphql.Query( + query: [object] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-antivirus.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-antivirus.md new file mode 100644 index 0000000000..115c0e5c7b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-antivirus.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthAntivirus result = await health.GetAntivirus(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-cache.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-cache.md new file mode 100644 index 0000000000..0c5ec37c2b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-cache.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthStatus result = await health.GetCache(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-certificate.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-certificate.md new file mode 100644 index 0000000000..457b70128a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-certificate.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthCertificate result = await health.GetCertificate( + domain: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-db.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-db.md new file mode 100644 index 0000000000..7ae8b14854 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-db.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthStatus result = await health.GetDB(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..4d43479831 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-failed-jobs.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetFailedJobs( + name: .V1Database, + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-pub-sub.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..4ffdd7e531 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-pub-sub.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthStatus result = await health.GetPubSub(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-builds.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..5d522f03f2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-builds.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueBuilds( + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..c7e186e5ee --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-certificates.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueCertificates( + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-databases.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..1db6fb518c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-databases.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueDatabases( + name: "<NAME>", // optional + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..487cee3411 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-deletes.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueDeletes( + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-functions.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..949e3766a7 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-functions.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueFunctions( + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-logs.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..58ad1ac2fe --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-logs.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueLogs( + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-mails.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..2c1008c7b1 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-mails.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueMails( + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..4116f19b1f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-messaging.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueMessaging( + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..5a0c7a0337 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-migrations.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueMigrations( + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..4002cca158 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-stats-resources.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueStatsResources( + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-usage.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..546e9a07de --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-usage.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueUsage( + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..1fc8d4d63c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-queue-webhooks.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthQueue result = await health.GetQueueWebhooks( + threshold: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-storage-local.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-storage-local.md new file mode 100644 index 0000000000..3e8539794a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-storage-local.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthStatus result = await health.GetStorageLocal(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-storage.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-storage.md new file mode 100644 index 0000000000..42d4aba45b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-storage.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthStatus result = await health.GetStorage(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get-time.md b/docs/examples/1.8.x/server-dotnet/examples/health/get-time.md new file mode 100644 index 0000000000..959060113b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get-time.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthTime result = await health.GetTime(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/health/get.md b/docs/examples/1.8.x/server-dotnet/examples/health/get.md new file mode 100644 index 0000000000..a926fe71e5 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/health/get.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +HealthStatus result = await health.Get(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/locale/get.md b/docs/examples/1.8.x/server-dotnet/examples/locale/get.md new file mode 100644 index 0000000000..48b9701801 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/locale/get.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +Locale result = await locale.Get(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/locale/list-codes.md b/docs/examples/1.8.x/server-dotnet/examples/locale/list-codes.md new file mode 100644 index 0000000000..0df7696da5 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/locale/list-codes.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +LocaleCodeList result = await locale.ListCodes(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/locale/list-continents.md b/docs/examples/1.8.x/server-dotnet/examples/locale/list-continents.md new file mode 100644 index 0000000000..7cf74caec3 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/locale/list-continents.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +ContinentList result = await locale.ListContinents(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/server-dotnet/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..106e140ee4 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/locale/list-countries-eu.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +CountryList result = await locale.ListCountriesEU(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/server-dotnet/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..38fbe24ff3 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/locale/list-countries-phones.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +PhoneList result = await locale.ListCountriesPhones(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/locale/list-countries.md b/docs/examples/1.8.x/server-dotnet/examples/locale/list-countries.md new file mode 100644 index 0000000000..5e5d9f407f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/locale/list-countries.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +CountryList result = await locale.ListCountries(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/locale/list-currencies.md b/docs/examples/1.8.x/server-dotnet/examples/locale/list-currencies.md new file mode 100644 index 0000000000..e51a138813 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/locale/list-currencies.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +CurrencyList result = await locale.ListCurrencies(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/locale/list-languages.md b/docs/examples/1.8.x/server-dotnet/examples/locale/list-languages.md new file mode 100644 index 0000000000..62aa15d1d9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/locale/list-languages.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +LanguageList result = await locale.ListLanguages(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..74bfe5ec2f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-apns-provider.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + authKey: "<AUTH_KEY>", // optional + authKeyId: "<AUTH_KEY_ID>", // optional + teamId: "<TEAM_ID>", // optional + bundleId: "<BUNDLE_ID>", // optional + sandbox: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-email.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-email.md new file mode 100644 index 0000000000..51c6db4ddb --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-email.md @@ -0,0 +1,25 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.CreateEmail( + messageId: "<MESSAGE_ID>", + subject: "<SUBJECT>", + content: "<CONTENT>", + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + cc: new List<string>(), // optional + bcc: new List<string>(), // optional + attachments: new List<string>(), // optional + draft: false, // optional + html: false, // optional + scheduledAt: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..0b72bb3fea --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-fcm-provider.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + serviceAccountJSON: [object], // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..1bacbab8d5 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,23 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", // optional + domain: "<DOMAIN>", // optional + isEuRegion: false, // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..a0b7372709 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + templateId: "<TEMPLATE_ID>", // optional + senderId: "<SENDER_ID>", // optional + authKey: "<AUTH_KEY>", // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-push.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-push.md new file mode 100644 index 0000000000..1d2dbec1f2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-push.md @@ -0,0 +1,33 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.CreatePush( + messageId: "<MESSAGE_ID>", + title: "<TITLE>", // optional + body: "<BODY>", // optional + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + data: [object], // optional + action: "<ACTION>", // optional + image: "[ID1:ID2]", // optional + icon: "<ICON>", // optional + sound: "<SOUND>", // optional + color: "<COLOR>", // optional + tag: "<TAG>", // optional + badge: 0, // optional + draft: false, // optional + scheduledAt: "", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..8464c47ae1 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-sms.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-sms.md new file mode 100644 index 0000000000..f67a43164f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-sms.md @@ -0,0 +1,20 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.CreateSMS( + messageId: "<MESSAGE_ID>", + content: "<CONTENT>", + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + draft: false, // optional + scheduledAt: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..d29826dd4a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-smtp-provider.md @@ -0,0 +1,28 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + host: "<HOST>", + port: 1, // optional + username: "<USERNAME>", // optional + password: "<PASSWORD>", // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: "<MAILER>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..8b37d31e68 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-subscriber.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetJWT("<YOUR_JWT>"); // Your secret JSON Web Token + +Messaging messaging = new Messaging(client); + +Subscriber result = await messaging.CreateSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>", + targetId: "<TARGET_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..37e1bd1df9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-telesign-provider.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + customerId: "<CUSTOMER_ID>", // optional + apiKey: "<API_KEY>", // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..7dc0a6b26f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + username: "<USERNAME>", // optional + apiKey: "<API_KEY>", // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-topic.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-topic.md new file mode 100644 index 0000000000..51eab0fd11 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-topic.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Topic result = await messaging.CreateTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", + subscribe: ["any"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..0deba742ff --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-twilio-provider.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + accountSid: "<ACCOUNT_SID>", // optional + authToken: "<AUTH_TOKEN>", // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..8f4855aab4 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/create-vonage-provider.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.CreateVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + apiKey: "<API_KEY>", // optional + apiSecret: "<API_SECRET>", // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/delete-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..a1ca2a1450 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/delete-provider.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +await messaging.DeleteProvider( + providerId: "<PROVIDER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..9424535c9f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/delete-subscriber.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetJWT("<YOUR_JWT>"); // Your secret JSON Web Token + +Messaging messaging = new Messaging(client); + +await messaging.DeleteSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/delete-topic.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..0b4819a219 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/delete-topic.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +await messaging.DeleteTopic( + topicId: "<TOPIC_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/delete.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/delete.md new file mode 100644 index 0000000000..ff041e853a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/delete.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +await messaging.Delete( + messageId: "<MESSAGE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/get-message.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/get-message.md new file mode 100644 index 0000000000..0dad3668f8 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/get-message.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.GetMessage( + messageId: "<MESSAGE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/get-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/get-provider.md new file mode 100644 index 0000000000..fac5a07da5 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/get-provider.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.GetProvider( + providerId: "<PROVIDER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..516aa682c8 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/get-subscriber.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Subscriber result = await messaging.GetSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/get-topic.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/get-topic.md new file mode 100644 index 0000000000..3a662b3111 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/get-topic.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Topic result = await messaging.GetTopic( + topicId: "<TOPIC_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..49d3513127 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-message-logs.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +LogList result = await messaging.ListMessageLogs( + messageId: "<MESSAGE_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/list-messages.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-messages.md new file mode 100644 index 0000000000..4c17128e72 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-messages.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +MessageList result = await messaging.ListMessages( + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..928c14845a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-provider-logs.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +LogList result = await messaging.ListProviderLogs( + providerId: "<PROVIDER_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/list-providers.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-providers.md new file mode 100644 index 0000000000..6cf5757fb6 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-providers.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +ProviderList result = await messaging.ListProviders( + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..815f1325d4 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +LogList result = await messaging.ListSubscriberLogs( + subscriberId: "<SUBSCRIBER_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..b522be327c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-subscribers.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +SubscriberList result = await messaging.ListSubscribers( + topicId: "<TOPIC_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/list-targets.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-targets.md new file mode 100644 index 0000000000..a8e8de567e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-targets.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +TargetList result = await messaging.ListTargets( + messageId: "<MESSAGE_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..093db0ff2c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-topic-logs.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +LogList result = await messaging.ListTopicLogs( + topicId: "<TOPIC_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/list-topics.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-topics.md new file mode 100644 index 0000000000..cc88afab69 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/list-topics.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +TopicList result = await messaging.ListTopics( + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..24cd49da16 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-apns-provider.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + authKey: "<AUTH_KEY>", // optional + authKeyId: "<AUTH_KEY_ID>", // optional + teamId: "<TEAM_ID>", // optional + bundleId: "<BUNDLE_ID>", // optional + sandbox: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-email.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-email.md new file mode 100644 index 0000000000..90d1555d8f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-email.md @@ -0,0 +1,25 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.UpdateEmail( + messageId: "<MESSAGE_ID>", + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + subject: "<SUBJECT>", // optional + content: "<CONTENT>", // optional + draft: false, // optional + html: false, // optional + cc: new List<string>(), // optional + bcc: new List<string>(), // optional + scheduledAt: "", // optional + attachments: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..df1ce204f6 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-fcm-provider.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + serviceAccountJSON: [object] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..512cb0586b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,23 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + apiKey: "<API_KEY>", // optional + domain: "<DOMAIN>", // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..51355c5836 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + templateId: "<TEMPLATE_ID>", // optional + senderId: "<SENDER_ID>", // optional + authKey: "<AUTH_KEY>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-push.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-push.md new file mode 100644 index 0000000000..37da215e82 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-push.md @@ -0,0 +1,33 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.UpdatePush( + messageId: "<MESSAGE_ID>", + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + title: "<TITLE>", // optional + body: "<BODY>", // optional + data: [object], // optional + action: "<ACTION>", // optional + image: "[ID1:ID2]", // optional + icon: "<ICON>", // optional + sound: "<SOUND>", // optional + color: "<COLOR>", // optional + tag: "<TAG>", // optional + badge: 0, // optional + draft: false, // optional + scheduledAt: "", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..d718a7158b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-sms.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-sms.md new file mode 100644 index 0000000000..3216fcff03 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-sms.md @@ -0,0 +1,20 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message result = await messaging.UpdateSMS( + messageId: "<MESSAGE_ID>", + topics: new List<string>(), // optional + users: new List<string>(), // optional + targets: new List<string>(), // optional + content: "<CONTENT>", // optional + draft: false, // optional + scheduledAt: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..29553887ff --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-smtp-provider.md @@ -0,0 +1,28 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + host: "<HOST>", // optional + port: 1, // optional + username: "<USERNAME>", // optional + password: "<PASSWORD>", // optional + encryption: SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: "<MAILER>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>", // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..d4f1c5e015 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-telesign-provider.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + customerId: "<CUSTOMER_ID>", // optional + apiKey: "<API_KEY>", // optional + from: "<FROM>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..3529f9b99c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + username: "<USERNAME>", // optional + apiKey: "<API_KEY>", // optional + from: "<FROM>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-topic.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-topic.md new file mode 100644 index 0000000000..11943f70e2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-topic.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Topic result = await messaging.UpdateTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", // optional + subscribe: ["any"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..66fc7e27a3 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-twilio-provider.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + accountSid: "<ACCOUNT_SID>", // optional + authToken: "<AUTH_TOKEN>", // optional + from: "<FROM>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..03addd3de6 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/messaging/update-vonage-provider.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Provider result = await messaging.UpdateVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + apiKey: "<API_KEY>", // optional + apiSecret: "<API_SECRET>", // optional + from: "<FROM>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/create-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/sites/create-deployment.md new file mode 100644 index 0000000000..1bcb5d5bac --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/create-deployment.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.CreateDeployment( + siteId: "<SITE_ID>", + code: InputFile.FromPath("./path-to-files/image.jpg"), + activate: false, + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..1e45aca8ef --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.CreateDuplicateDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..57f9a83d9c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/create-template-deployment.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.CreateTemplateDeployment( + siteId: "<SITE_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + version: "<VERSION>", + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/create-variable.md b/docs/examples/1.8.x/server-dotnet/examples/sites/create-variable.md new file mode 100644 index 0000000000..09feb0316e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/create-variable.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Variable result = await sites.CreateVariable( + siteId: "<SITE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..4d3e685176 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/create-vcs-deployment.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.CreateVcsDeployment( + siteId: "<SITE_ID>", + type: VCSDeploymentType.Branch, + reference: "<REFERENCE>", + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/create.md b/docs/examples/1.8.x/server-dotnet/examples/sites/create.md new file mode 100644 index 0000000000..025adca41d --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/create.md @@ -0,0 +1,32 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Site result = await sites.Create( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: .Analog, + buildRuntime: .Node145, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>", // optional + adapter: .Static, // optional + installationId: "<INSTALLATION_ID>", // optional + fallbackFile: "<FALLBACK_FILE>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + specification: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/delete-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..f74be24acf --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/delete-deployment.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +await sites.DeleteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/delete-log.md b/docs/examples/1.8.x/server-dotnet/examples/sites/delete-log.md new file mode 100644 index 0000000000..83d1aa12ca --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/delete-log.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +await sites.DeleteLog( + siteId: "<SITE_ID>", + logId: "<LOG_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/delete-variable.md b/docs/examples/1.8.x/server-dotnet/examples/sites/delete-variable.md new file mode 100644 index 0000000000..9751512718 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/delete-variable.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +await sites.DeleteVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/delete.md b/docs/examples/1.8.x/server-dotnet/examples/sites/delete.md new file mode 100644 index 0000000000..173c486499 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/delete.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +await sites.Delete( + siteId: "<SITE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/server-dotnet/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..27c9647629 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/get-deployment-download.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +byte[] result = await sites.GetDeploymentDownload( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>", + type: DeploymentDownloadType.Source // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/get-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/sites/get-deployment.md new file mode 100644 index 0000000000..138c97ba42 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/get-deployment.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.GetDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/get-log.md b/docs/examples/1.8.x/server-dotnet/examples/sites/get-log.md new file mode 100644 index 0000000000..d90b6c8477 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/get-log.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Execution result = await sites.GetLog( + siteId: "<SITE_ID>", + logId: "<LOG_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/get-variable.md b/docs/examples/1.8.x/server-dotnet/examples/sites/get-variable.md new file mode 100644 index 0000000000..01f57f3bf2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/get-variable.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Variable result = await sites.GetVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/get.md b/docs/examples/1.8.x/server-dotnet/examples/sites/get.md new file mode 100644 index 0000000000..87a91ae8e8 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/get.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Site result = await sites.Get( + siteId: "<SITE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/list-deployments.md b/docs/examples/1.8.x/server-dotnet/examples/sites/list-deployments.md new file mode 100644 index 0000000000..ac1cae9127 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/list-deployments.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +DeploymentList result = await sites.ListDeployments( + siteId: "<SITE_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/list-frameworks.md b/docs/examples/1.8.x/server-dotnet/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..9220b2a7da --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/list-frameworks.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +FrameworkList result = await sites.ListFrameworks(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/list-logs.md b/docs/examples/1.8.x/server-dotnet/examples/sites/list-logs.md new file mode 100644 index 0000000000..692bd707b2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/list-logs.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +ExecutionList result = await sites.ListLogs( + siteId: "<SITE_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/list-specifications.md b/docs/examples/1.8.x/server-dotnet/examples/sites/list-specifications.md new file mode 100644 index 0000000000..edf82da81b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/list-specifications.md @@ -0,0 +1,12 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +SpecificationList result = await sites.ListSpecifications(); diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/list-variables.md b/docs/examples/1.8.x/server-dotnet/examples/sites/list-variables.md new file mode 100644 index 0000000000..6eb0ff7093 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/list-variables.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +VariableList result = await sites.ListVariables( + siteId: "<SITE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/list.md b/docs/examples/1.8.x/server-dotnet/examples/sites/list.md new file mode 100644 index 0000000000..649ee50331 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/list.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +SiteList result = await sites.List( + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/server-dotnet/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..c7415e7a0b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/update-deployment-status.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Deployment result = await sites.UpdateDeploymentStatus( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/server-dotnet/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..8706ff594a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/update-site-deployment.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Site result = await sites.UpdateSiteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/update-variable.md b/docs/examples/1.8.x/server-dotnet/examples/sites/update-variable.md new file mode 100644 index 0000000000..99718cd6cd --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/update-variable.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Variable result = await sites.UpdateVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", // optional + secret: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/sites/update.md b/docs/examples/1.8.x/server-dotnet/examples/sites/update.md new file mode 100644 index 0000000000..c25e3f6df9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/sites/update.md @@ -0,0 +1,32 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +Site result = await sites.Update( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: .Analog, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>", // optional + buildRuntime: .Node145, // optional + adapter: .Static, // optional + fallbackFile: "<FALLBACK_FILE>", // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + specification: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/create-bucket.md b/docs/examples/1.8.x/server-dotnet/examples/storage/create-bucket.md new file mode 100644 index 0000000000..0cc317d9a6 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/create-bucket.md @@ -0,0 +1,24 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +Bucket result = await storage.CreateBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: new List<string>(), // optional + compression: .None, // optional + encryption: false, // optional + antivirus: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/create-file.md b/docs/examples/1.8.x/server-dotnet/examples/storage/create-file.md new file mode 100644 index 0000000000..a4cedb8214 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/create-file.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +File result = await storage.CreateFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + file: InputFile.FromPath("./path-to-files/image.jpg"), + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/delete-bucket.md b/docs/examples/1.8.x/server-dotnet/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..22aa2acf19 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/delete-bucket.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +await storage.DeleteBucket( + bucketId: "<BUCKET_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/delete-file.md b/docs/examples/1.8.x/server-dotnet/examples/storage/delete-file.md new file mode 100644 index 0000000000..a8cc310aa5 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/delete-file.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +await storage.DeleteFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/get-bucket.md b/docs/examples/1.8.x/server-dotnet/examples/storage/get-bucket.md new file mode 100644 index 0000000000..a6f74ebdae --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/get-bucket.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +Bucket result = await storage.GetBucket( + bucketId: "<BUCKET_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/get-file-download.md b/docs/examples/1.8.x/server-dotnet/examples/storage/get-file-download.md new file mode 100644 index 0000000000..514fda9e9c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/get-file-download.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +byte[] result = await storage.GetFileDownload( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/get-file-preview.md b/docs/examples/1.8.x/server-dotnet/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..c9ec508b4a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/get-file-preview.md @@ -0,0 +1,28 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +byte[] result = await storage.GetFilePreview( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + width: 0, // optional + height: 0, // optional + gravity: ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: "", // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: "", // optional + output: ImageFormat.Jpg, // optional + token: "<TOKEN>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/get-file-view.md b/docs/examples/1.8.x/server-dotnet/examples/storage/get-file-view.md new file mode 100644 index 0000000000..1a27dc153c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/get-file-view.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +byte[] result = await storage.GetFileView( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/get-file.md b/docs/examples/1.8.x/server-dotnet/examples/storage/get-file.md new file mode 100644 index 0000000000..e4c05c1e6b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/get-file.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +File result = await storage.GetFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/list-buckets.md b/docs/examples/1.8.x/server-dotnet/examples/storage/list-buckets.md new file mode 100644 index 0000000000..8e397729e6 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/list-buckets.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +BucketList result = await storage.ListBuckets( + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/list-files.md b/docs/examples/1.8.x/server-dotnet/examples/storage/list-files.md new file mode 100644 index 0000000000..2751da5244 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/list-files.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +FileList result = await storage.ListFiles( + bucketId: "<BUCKET_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/update-bucket.md b/docs/examples/1.8.x/server-dotnet/examples/storage/update-bucket.md new file mode 100644 index 0000000000..2a439ba2af --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/update-bucket.md @@ -0,0 +1,24 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +Bucket result = await storage.UpdateBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: new List<string>(), // optional + compression: .None, // optional + encryption: false, // optional + antivirus: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/storage/update-file.md b/docs/examples/1.8.x/server-dotnet/examples/storage/update-file.md new file mode 100644 index 0000000000..3f6ea608d7 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/storage/update-file.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +File result = await storage.UpdateFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + name: "<NAME>", // optional + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..ff7b647fe6 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnBoolean result = await tablesDB.CreateBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: false, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..c03ba36156 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnDatetime result = await tablesDB.CreateDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..309db62820 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-email-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnEmail result = await tablesDB.CreateEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "email@example.com", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..632bbef52b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-enum-column.md @@ -0,0 +1,20 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnEnum result = await tablesDB.CreateEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + elements: new List<string>(), + required: false, + default: "<DEFAULT>", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..e7da5323f3 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-float-column.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnFloat result = await tablesDB.CreateFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + min: 0, // optional + max: 0, // optional + default: 0, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-index.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..3b19981ec6 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-index.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnIndex result = await tablesDB.CreateIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + type: IndexType.Key, + columns: new List<string>(), + orders: new List<string>(), // optional + lengths: new List<long>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..7bdb971aca --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-integer-column.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnInteger result = await tablesDB.CreateIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + min: 0, // optional + max: 0, // optional + default: 0, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..9359b28983 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-ip-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnIp result = await tablesDB.CreateIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..31dc069815 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-line-column.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnLine result = await tablesDB.CreateLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..a1461bcc8f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-point-column.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnPoint result = await tablesDB.CreatePointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [1, 2] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..e1e92b2d97 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnPolygon result = await tablesDB.CreatePolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..95b34d0265 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,22 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnRelationship result = await tablesDB.CreateRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + relatedTableId: "<RELATED_TABLE_ID>", + type: RelationshipType.OneToOne, + twoWay: false, // optional + key: "", // optional + twoWayKey: "", // optional + onDelete: RelationMutate.Cascade // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-row.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..01a21b0dcd --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-row.md @@ -0,0 +1,24 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.CreateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: new { + username = "walter.obrien", + email = "walter.obrien@example.com", + fullName = "Walter O'Brien", + age = 30, + isAdmin = false + }, + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..c23e795a84 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-rows.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +RowList result = await tablesDB.CreateRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: new List<object>() +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..ab77d4da61 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-string-column.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnString result = await tablesDB.CreateStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + size: 1, + required: false, + default: "<DEFAULT>", // optional + array: false, // optional + encrypt: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-table.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..7085b9a0f7 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-table.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Table result = await tablesDB.CreateTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..bfae1ccd7e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create-url-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnUrl result = await tablesDB.CreateUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "https://example.com", // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create.md new file mode 100644 index 0000000000..105d838d5f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/create.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Database result = await tablesDB.Create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..66d98b65b9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.DecrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "", + value: 0, // optional + min: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..4cc43f20e7 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-column.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..46c899b7ee --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-index.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..86d7fbf392 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-row.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..13d5758fdb --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-rows.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..4f772f3fb7 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete-table.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.DeleteTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete.md new file mode 100644 index 0000000000..55395b0230 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/delete.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +await tablesDB.Delete( + databaseId: "<DATABASE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..70089aa019 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-column.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + + result = await tablesDB.GetColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-index.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..b48ac846b8 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-index.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnIndex result = await tablesDB.GetIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-row.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..99d79ac3dd --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-row.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.GetRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-table.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..82311e8f55 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get-table.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Table result = await tablesDB.GetTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get.md new file mode 100644 index 0000000000..ace26de4fe --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/get.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Database result = await tablesDB.Get( + databaseId: "<DATABASE_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..48eabc34d4 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/increment-row-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.IncrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "", + value: 0, // optional + max: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..345ac00bf5 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-columns.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnList result = await tablesDB.ListColumns( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..6074787f38 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-indexes.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnIndexList result = await tablesDB.ListIndexes( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..d3f860e869 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-rows.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +RowList result = await tablesDB.ListRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..9e94dc84ee --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list-tables.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +TableList result = await tablesDB.ListTables( + databaseId: "<DATABASE_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list.md new file mode 100644 index 0000000000..8b320eeb00 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/list.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +DatabaseList result = await tablesDB.List( + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..b6c6d58438 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnBoolean result = await tablesDB.UpdateBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: false, + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..8236b6af7c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnDatetime result = await tablesDB.UpdateDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..88567783a2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-email-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnEmail result = await tablesDB.UpdateEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "email@example.com", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..58c3c65d7b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-enum-column.md @@ -0,0 +1,20 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnEnum result = await tablesDB.UpdateEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + elements: new List<string>(), + required: false, + default: "<DEFAULT>", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..057a076733 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-float-column.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnFloat result = await tablesDB.UpdateFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: 0, + min: 0, // optional + max: 0, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..2cc3b3614e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-integer-column.md @@ -0,0 +1,21 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnInteger result = await tablesDB.UpdateIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: 0, + min: 0, // optional + max: 0, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..7e6d64f03c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-ip-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnIp result = await tablesDB.UpdateIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..7a7620a98d --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-line-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnLine result = await tablesDB.UpdateLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..663f1838a0 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-point-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnPoint result = await tablesDB.UpdatePointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [1, 2], // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..ac8300ad39 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnPolygon result = await tablesDB.UpdatePolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..9a0a36b690 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnRelationship result = await tablesDB.UpdateRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + onDelete: RelationMutate.Cascade, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-row.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..5eb5acdbd2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-row.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.UpdateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: [object], // optional + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..401464d66a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-rows.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +RowList result = await tablesDB.UpdateRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + data: [object], // optional + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..df5308ddb3 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-string-column.md @@ -0,0 +1,20 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnString result = await tablesDB.UpdateStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "<DEFAULT>", + size: 1, // optional + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-table.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..b2d52b755c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-table.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Table result = await tablesDB.UpdateTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..d342fc9476 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update-url-column.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +ColumnUrl result = await tablesDB.UpdateUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "https://example.com", + newKey: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update.md new file mode 100644 index 0000000000..920866bad4 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/update.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +Database result = await tablesDB.Update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..e1f68a7dfb --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/upsert-row.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +Row result = await tablesDB.UpsertRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: [object], // optional + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..199dc2ba85 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tablesdb/upsert-rows.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +RowList result = await tablesDB.UpsertRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: new List<object>() +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/create-membership.md b/docs/examples/1.8.x/server-dotnet/examples/teams/create-membership.md new file mode 100644 index 0000000000..f3f5682cbf --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/create-membership.md @@ -0,0 +1,20 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Membership result = await teams.CreateMembership( + teamId: "<TEAM_ID>", + roles: new List<string>(), + email: "email@example.com", // optional + userId: "<USER_ID>", // optional + phone: "+12065550100", // optional + url: "https://example.com", // optional + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/create.md b/docs/examples/1.8.x/server-dotnet/examples/teams/create.md new file mode 100644 index 0000000000..07b102d70a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/create.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Team result = await teams.Create( + teamId: "<TEAM_ID>", + name: "<NAME>", + roles: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/delete-membership.md b/docs/examples/1.8.x/server-dotnet/examples/teams/delete-membership.md new file mode 100644 index 0000000000..01a58aaa11 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/delete-membership.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +await teams.DeleteMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/delete.md b/docs/examples/1.8.x/server-dotnet/examples/teams/delete.md new file mode 100644 index 0000000000..ee525f23c9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/delete.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +await teams.Delete( + teamId: "<TEAM_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/get-membership.md b/docs/examples/1.8.x/server-dotnet/examples/teams/get-membership.md new file mode 100644 index 0000000000..cb9109df14 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/get-membership.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Membership result = await teams.GetMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/get-prefs.md b/docs/examples/1.8.x/server-dotnet/examples/teams/get-prefs.md new file mode 100644 index 0000000000..f95d73af77 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/get-prefs.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Preferences result = await teams.GetPrefs( + teamId: "<TEAM_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/get.md b/docs/examples/1.8.x/server-dotnet/examples/teams/get.md new file mode 100644 index 0000000000..339b33f657 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/get.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Team result = await teams.Get( + teamId: "<TEAM_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/list-memberships.md b/docs/examples/1.8.x/server-dotnet/examples/teams/list-memberships.md new file mode 100644 index 0000000000..6072158100 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/list-memberships.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +MembershipList result = await teams.ListMemberships( + teamId: "<TEAM_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/list.md b/docs/examples/1.8.x/server-dotnet/examples/teams/list.md new file mode 100644 index 0000000000..b1ca72b82e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/list.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +TeamList result = await teams.List( + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/update-membership-status.md b/docs/examples/1.8.x/server-dotnet/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..87609aa32e --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/update-membership-status.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Membership result = await teams.UpdateMembershipStatus( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + userId: "<USER_ID>", + secret: "<SECRET>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/update-membership.md b/docs/examples/1.8.x/server-dotnet/examples/teams/update-membership.md new file mode 100644 index 0000000000..3583b4d0a9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/update-membership.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Membership result = await teams.UpdateMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + roles: new List<string>() +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/update-name.md b/docs/examples/1.8.x/server-dotnet/examples/teams/update-name.md new file mode 100644 index 0000000000..9a3fb1316a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/update-name.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Team result = await teams.UpdateName( + teamId: "<TEAM_ID>", + name: "<NAME>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/teams/update-prefs.md b/docs/examples/1.8.x/server-dotnet/examples/teams/update-prefs.md new file mode 100644 index 0000000000..55ff96e9e8 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/teams/update-prefs.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +Preferences result = await teams.UpdatePrefs( + teamId: "<TEAM_ID>", + prefs: [object] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tokens/create-file-token.md b/docs/examples/1.8.x/server-dotnet/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..70f4ed3900 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tokens/create-file-token.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +ResourceToken result = await tokens.CreateFileToken( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + expire: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tokens/delete.md b/docs/examples/1.8.x/server-dotnet/examples/tokens/delete.md new file mode 100644 index 0000000000..e88147c1c9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tokens/delete.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +await tokens.Delete( + tokenId: "<TOKEN_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tokens/get.md b/docs/examples/1.8.x/server-dotnet/examples/tokens/get.md new file mode 100644 index 0000000000..da9b431017 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tokens/get.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +ResourceToken result = await tokens.Get( + tokenId: "<TOKEN_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tokens/list.md b/docs/examples/1.8.x/server-dotnet/examples/tokens/list.md new file mode 100644 index 0000000000..68579f237b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tokens/list.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +ResourceTokenList result = await tokens.List( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/tokens/update.md b/docs/examples/1.8.x/server-dotnet/examples/tokens/update.md new file mode 100644 index 0000000000..b7604182ab --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/tokens/update.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +ResourceToken result = await tokens.Update( + tokenId: "<TOKEN_ID>", + expire: "" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..db6dd6486a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-argon-2-user.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateArgon2User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..bf8bf3dedd --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-bcrypt-user.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateBcryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-jwt.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-jwt.md new file mode 100644 index 0000000000..a7c57ad642 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-jwt.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +JWT result = await users.CreateJWT( + userId: "<USER_ID>", + sessionId: "<SESSION_ID>", // optional + duration: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-md-5-user.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..7b7d0e7760 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-md-5-user.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateMD5User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..d0c0d95ad8 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +MfaRecoveryCodes result = await users.CreateMFARecoveryCodes( + userId: "<USER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..9f5521ef2f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-ph-pass-user.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreatePHPassUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..3af99e88c2 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,20 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateScryptModifiedUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordSaltSeparator: "<PASSWORD_SALT_SEPARATOR>", + passwordSignerKey: "<PASSWORD_SIGNER_KEY>", + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..79085f7206 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-scrypt-user.md @@ -0,0 +1,22 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateScryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordCpu: 0, + passwordMemory: 0, + passwordParallel: 0, + passwordLength: 0, + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-session.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-session.md new file mode 100644 index 0000000000..a021c2551f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-session.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Session result = await users.CreateSession( + userId: "<USER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-sha-user.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-sha-user.md new file mode 100644 index 0000000000..0821bf46e9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-sha-user.md @@ -0,0 +1,19 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.CreateSHAUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordVersion: PasswordHash.Sha1, // optional + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-target.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-target.md new file mode 100644 index 0000000000..44ba48ac01 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-target.md @@ -0,0 +1,20 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Target result = await users.CreateTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + providerType: MessagingProviderType.Email, + identifier: "<IDENTIFIER>", + providerId: "<PROVIDER_ID>", // optional + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create-token.md b/docs/examples/1.8.x/server-dotnet/examples/users/create-token.md new file mode 100644 index 0000000000..0e9cf43fd7 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create-token.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Token result = await users.CreateToken( + userId: "<USER_ID>", + length: 4, // optional + expire: 60 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/create.md b/docs/examples/1.8.x/server-dotnet/examples/users/create.md new file mode 100644 index 0000000000..3cf1d3af29 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/create.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.Create( + userId: "<USER_ID>", + email: "email@example.com", // optional + phone: "+12065550100", // optional + password: "", // optional + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/delete-identity.md b/docs/examples/1.8.x/server-dotnet/examples/users/delete-identity.md new file mode 100644 index 0000000000..d2bac6b797 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/delete-identity.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.DeleteIdentity( + identityId: "<IDENTITY_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-dotnet/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..b4cec73ae9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Enums; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.DeleteMFAAuthenticator( + userId: "<USER_ID>", + type: AuthenticatorType.Totp +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/delete-session.md b/docs/examples/1.8.x/server-dotnet/examples/users/delete-session.md new file mode 100644 index 0000000000..d9d36d20b4 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/delete-session.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.DeleteSession( + userId: "<USER_ID>", + sessionId: "<SESSION_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/delete-sessions.md b/docs/examples/1.8.x/server-dotnet/examples/users/delete-sessions.md new file mode 100644 index 0000000000..7011e426bb --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/delete-sessions.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.DeleteSessions( + userId: "<USER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/delete-target.md b/docs/examples/1.8.x/server-dotnet/examples/users/delete-target.md new file mode 100644 index 0000000000..ad900afa5a --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/delete-target.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.DeleteTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/delete.md b/docs/examples/1.8.x/server-dotnet/examples/users/delete.md new file mode 100644 index 0000000000..00ed23cf5f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/delete.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +await users.Delete( + userId: "<USER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dotnet/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..ce9453119f --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +MfaRecoveryCodes result = await users.GetMFARecoveryCodes( + userId: "<USER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/get-prefs.md b/docs/examples/1.8.x/server-dotnet/examples/users/get-prefs.md new file mode 100644 index 0000000000..36888651d9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/get-prefs.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Preferences result = await users.GetPrefs( + userId: "<USER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/get-target.md b/docs/examples/1.8.x/server-dotnet/examples/users/get-target.md new file mode 100644 index 0000000000..2bbf4d614c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/get-target.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Target result = await users.GetTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/get.md b/docs/examples/1.8.x/server-dotnet/examples/users/get.md new file mode 100644 index 0000000000..25971baddc --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/get.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.Get( + userId: "<USER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/list-identities.md b/docs/examples/1.8.x/server-dotnet/examples/users/list-identities.md new file mode 100644 index 0000000000..996edfba71 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/list-identities.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +IdentityList result = await users.ListIdentities( + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/list-logs.md b/docs/examples/1.8.x/server-dotnet/examples/users/list-logs.md new file mode 100644 index 0000000000..822d16fe64 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/list-logs.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +LogList result = await users.ListLogs( + userId: "<USER_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/list-memberships.md b/docs/examples/1.8.x/server-dotnet/examples/users/list-memberships.md new file mode 100644 index 0000000000..4296cd2dcd --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/list-memberships.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +MembershipList result = await users.ListMemberships( + userId: "<USER_ID>", + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/server-dotnet/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..956949d0a9 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/list-mfa-factors.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +MfaFactors result = await users.ListMFAFactors( + userId: "<USER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/list-sessions.md b/docs/examples/1.8.x/server-dotnet/examples/users/list-sessions.md new file mode 100644 index 0000000000..97f92f3b07 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/list-sessions.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +SessionList result = await users.ListSessions( + userId: "<USER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/list-targets.md b/docs/examples/1.8.x/server-dotnet/examples/users/list-targets.md new file mode 100644 index 0000000000..aa59ce2983 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/list-targets.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +TargetList result = await users.ListTargets( + userId: "<USER_ID>", + queries: new List<string>() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/list.md b/docs/examples/1.8.x/server-dotnet/examples/users/list.md new file mode 100644 index 0000000000..aae7ae27b3 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/list.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +UserList result = await users.List( + queries: new List<string>(), // optional + search: "<SEARCH>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-email-verification.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-email-verification.md new file mode 100644 index 0000000000..8add2d4d6b --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-email-verification.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateEmailVerification( + userId: "<USER_ID>", + emailVerification: false +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-email.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-email.md new file mode 100644 index 0000000000..d0d737cb80 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-email.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateEmail( + userId: "<USER_ID>", + email: "email@example.com" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-labels.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-labels.md new file mode 100644 index 0000000000..6637ad0438 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-labels.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateLabels( + userId: "<USER_ID>", + labels: new List<string>() +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..ac14ccf932 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +MfaRecoveryCodes result = await users.UpdateMFARecoveryCodes( + userId: "<USER_ID>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-mfa.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-mfa.md new file mode 100644 index 0000000000..1114982333 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-mfa.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateMFA( + userId: "<USER_ID>", + mfa: false +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-name.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-name.md new file mode 100644 index 0000000000..ffa90f9657 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-name.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateName( + userId: "<USER_ID>", + name: "<NAME>" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-password.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-password.md new file mode 100644 index 0000000000..6dc30d5bcf --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-password.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdatePassword( + userId: "<USER_ID>", + password: "" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-phone-verification.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..ba5ca253ee --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-phone-verification.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdatePhoneVerification( + userId: "<USER_ID>", + phoneVerification: false +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-phone.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-phone.md new file mode 100644 index 0000000000..e633740e94 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-phone.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdatePhone( + userId: "<USER_ID>", + number: "+12065550100" +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-prefs.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-prefs.md new file mode 100644 index 0000000000..421a4c2314 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-prefs.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Preferences result = await users.UpdatePrefs( + userId: "<USER_ID>", + prefs: [object] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-status.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-status.md new file mode 100644 index 0000000000..3037d8dd0c --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-status.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +User result = await users.UpdateStatus( + userId: "<USER_ID>", + status: false +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-dotnet/examples/users/update-target.md b/docs/examples/1.8.x/server-dotnet/examples/users/update-target.md new file mode 100644 index 0000000000..9863af19d8 --- /dev/null +++ b/docs/examples/1.8.x/server-dotnet/examples/users/update-target.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +Target result = await users.UpdateTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + identifier: "<IDENTIFIER>", // optional + providerId: "<PROVIDER_ID>", // optional + name: "<NAME>" // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-go/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/server-go/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..c2f23a5b2c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-anonymous-session.md @@ -0,0 +1,16 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.CreateAnonymousSession()) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-email-password-session.md b/docs/examples/1.8.x/server-go/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..66a55b953e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-email-password-session.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.CreateEmailPasswordSession( + "email@example.com", + "password", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-email-token.md b/docs/examples/1.8.x/server-go/examples/account/create-email-token.md new file mode 100644 index 0000000000..b2a1aac498 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-email-token.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.CreateEmailToken( + "<USER_ID>", + "email@example.com", + account.WithCreateEmailTokenPhrase(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-jwt.md b/docs/examples/1.8.x/server-go/examples/account/create-jwt.md new file mode 100644 index 0000000000..153c70d9fc --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-jwt.md @@ -0,0 +1,16 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.CreateJWT()) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/server-go/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..b36a2d99b1 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-magic-url-token.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.CreateMagicURLToken( + "<USER_ID>", + "email@example.com", + account.WithCreateMagicURLTokenUrl("https://example.com"), + account.WithCreateMagicURLTokenPhrase(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-go/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..c0124d6cf9 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-mfa-authenticator.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.CreateMFAAuthenticator( + "totp", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-go/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..0ae3262568 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-mfa-challenge.md @@ -0,0 +1,18 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.CreateMFAChallenge( + "email", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-go/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..332102ea64 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.CreateMFARecoveryCodes()) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-go/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..19b9258f00 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-o-auth-2-token.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.CreateOAuth2Token( + "amazon", + account.WithCreateOAuth2TokenSuccess("https://example.com"), + account.WithCreateOAuth2TokenFailure("https://example.com"), + account.WithCreateOAuth2TokenScopes([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-phone-token.md b/docs/examples/1.8.x/server-go/examples/account/create-phone-token.md new file mode 100644 index 0000000000..97737e5646 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-phone-token.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.CreatePhoneToken( + "<USER_ID>", + "+12065550100", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-phone-verification.md b/docs/examples/1.8.x/server-go/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..68fd7f788d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-phone-verification.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.CreatePhoneVerification()) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-recovery.md b/docs/examples/1.8.x/server-go/examples/account/create-recovery.md new file mode 100644 index 0000000000..5e78d01980 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-recovery.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.CreateRecovery( + "email@example.com", + "https://example.com", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-session.md b/docs/examples/1.8.x/server-go/examples/account/create-session.md new file mode 100644 index 0000000000..fb0b9cbfe4 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-session.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.CreateSession( + "<USER_ID>", + "<SECRET>", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/create-verification.md b/docs/examples/1.8.x/server-go/examples/account/create-verification.md new file mode 100644 index 0000000000..14a1b946f3 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create-verification.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.CreateVerification( + "https://example.com", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/create.md b/docs/examples/1.8.x/server-go/examples/account/create.md new file mode 100644 index 0000000000..5e04847860 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/create.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.Create( + "<USER_ID>", + "email@example.com", + "", + account.WithCreateName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/account/delete-identity.md b/docs/examples/1.8.x/server-go/examples/account/delete-identity.md new file mode 100644 index 0000000000..a513991ad6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/delete-identity.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.DeleteIdentity( + "<IDENTITY_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-go/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..33b7e51af7 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.DeleteMFAAuthenticator( + "totp", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/delete-session.md b/docs/examples/1.8.x/server-go/examples/account/delete-session.md new file mode 100644 index 0000000000..0a7bb5a856 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/delete-session.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.DeleteSession( + "<SESSION_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/delete-sessions.md b/docs/examples/1.8.x/server-go/examples/account/delete-sessions.md new file mode 100644 index 0000000000..87c9881e06 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/delete-sessions.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.DeleteSessions()) diff --git a/docs/examples/1.8.x/server-go/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-go/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..ee955116f3 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.GetMFARecoveryCodes()) diff --git a/docs/examples/1.8.x/server-go/examples/account/get-prefs.md b/docs/examples/1.8.x/server-go/examples/account/get-prefs.md new file mode 100644 index 0000000000..c4511438ab --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/get-prefs.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.GetPrefs()) diff --git a/docs/examples/1.8.x/server-go/examples/account/get-session.md b/docs/examples/1.8.x/server-go/examples/account/get-session.md new file mode 100644 index 0000000000..9005de9cf6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/get-session.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.GetSession( + "<SESSION_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/get.md b/docs/examples/1.8.x/server-go/examples/account/get.md new file mode 100644 index 0000000000..280492c77e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/get.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.Get()) diff --git a/docs/examples/1.8.x/server-go/examples/account/list-identities.md b/docs/examples/1.8.x/server-go/examples/account/list-identities.md new file mode 100644 index 0000000000..8114ff9e2f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/list-identities.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.ListIdentities( + account.WithListIdentitiesQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/account/list-logs.md b/docs/examples/1.8.x/server-go/examples/account/list-logs.md new file mode 100644 index 0000000000..d72597e8d2 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/list-logs.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.ListLogs( + account.WithListLogsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/server-go/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..f6f90f625f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/list-mfa-factors.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.ListMFAFactors()) diff --git a/docs/examples/1.8.x/server-go/examples/account/list-sessions.md b/docs/examples/1.8.x/server-go/examples/account/list-sessions.md new file mode 100644 index 0000000000..c8a408586b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/list-sessions.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.ListSessions()) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-email.md b/docs/examples/1.8.x/server-go/examples/account/update-email.md new file mode 100644 index 0000000000..6defd00964 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-email.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdateEmail( + "email@example.com", + "password", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/server-go/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..9f799c511f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-magic-url-session.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.UpdateMagicURLSession( + "<USER_ID>", + "<SECRET>", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-go/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..4999034576 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-mfa-authenticator.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdateMFAAuthenticator( + "totp", + "<OTP>", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-go/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..a9dd94eab6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-mfa-challenge.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdateMFAChallenge( + "<CHALLENGE_ID>", + "<OTP>", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-go/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..fc47d3b023 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdateMFARecoveryCodes()) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-mfa.md b/docs/examples/1.8.x/server-go/examples/account/update-mfa.md new file mode 100644 index 0000000000..1808eed84b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-mfa.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdateMFA( + false, +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-name.md b/docs/examples/1.8.x/server-go/examples/account/update-name.md new file mode 100644 index 0000000000..1cf5aa2a22 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-name.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdateName( + "<NAME>", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-password.md b/docs/examples/1.8.x/server-go/examples/account/update-password.md new file mode 100644 index 0000000000..f574679217 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-password.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdatePassword( + "", + account.WithUpdatePasswordOldPassword("password"), +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-phone-session.md b/docs/examples/1.8.x/server-go/examples/account/update-phone-session.md new file mode 100644 index 0000000000..5af46b840b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-phone-session.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") +) + +service := account.New(client) + +response, error := service.UpdatePhoneSession( + "<USER_ID>", + "<SECRET>", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-phone-verification.md b/docs/examples/1.8.x/server-go/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..cb5a93934e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-phone-verification.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdatePhoneVerification( + "<USER_ID>", + "<SECRET>", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-phone.md b/docs/examples/1.8.x/server-go/examples/account/update-phone.md new file mode 100644 index 0000000000..ac21bd321f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-phone.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdatePhone( + "+12065550100", + "password", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-prefs.md b/docs/examples/1.8.x/server-go/examples/account/update-prefs.md new file mode 100644 index 0000000000..2091395fb5 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-prefs.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdatePrefs( + map[string]interface{}{ + "language": "en", + "timezone": "UTC", + "darkTheme": true + }, +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-recovery.md b/docs/examples/1.8.x/server-go/examples/account/update-recovery.md new file mode 100644 index 0000000000..e21e5ccfdc --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-recovery.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdateRecovery( + "<USER_ID>", + "<SECRET>", + "", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-session.md b/docs/examples/1.8.x/server-go/examples/account/update-session.md new file mode 100644 index 0000000000..4984b9ef85 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-session.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdateSession( + "<SESSION_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-status.md b/docs/examples/1.8.x/server-go/examples/account/update-status.md new file mode 100644 index 0000000000..e3c5d66a1d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-status.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdateStatus()) diff --git a/docs/examples/1.8.x/server-go/examples/account/update-verification.md b/docs/examples/1.8.x/server-go/examples/account/update-verification.md new file mode 100644 index 0000000000..b31751746a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/account/update-verification.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdateVerification( + "<USER_ID>", + "<SECRET>", +) diff --git a/docs/examples/1.8.x/server-go/examples/avatars/get-browser.md b/docs/examples/1.8.x/server-go/examples/avatars/get-browser.md new file mode 100644 index 0000000000..6b238c9f1f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/avatars/get-browser.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/avatars" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := avatars.New(client) + +response, error := service.GetBrowser( + "aa", + avatars.WithGetBrowserWidth(0), + avatars.WithGetBrowserHeight(0), + avatars.WithGetBrowserQuality(-1), +) diff --git a/docs/examples/1.8.x/server-go/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/server-go/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..4ca6feb2d9 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/avatars/get-credit-card.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/avatars" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := avatars.New(client) + +response, error := service.GetCreditCard( + "amex", + avatars.WithGetCreditCardWidth(0), + avatars.WithGetCreditCardHeight(0), + avatars.WithGetCreditCardQuality(-1), +) diff --git a/docs/examples/1.8.x/server-go/examples/avatars/get-favicon.md b/docs/examples/1.8.x/server-go/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..dafc8dd7e9 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/avatars/get-favicon.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/avatars" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := avatars.New(client) + +response, error := service.GetFavicon( + "https://example.com", +) diff --git a/docs/examples/1.8.x/server-go/examples/avatars/get-flag.md b/docs/examples/1.8.x/server-go/examples/avatars/get-flag.md new file mode 100644 index 0000000000..ad46317c2c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/avatars/get-flag.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/avatars" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := avatars.New(client) + +response, error := service.GetFlag( + "af", + avatars.WithGetFlagWidth(0), + avatars.WithGetFlagHeight(0), + avatars.WithGetFlagQuality(-1), +) diff --git a/docs/examples/1.8.x/server-go/examples/avatars/get-image.md b/docs/examples/1.8.x/server-go/examples/avatars/get-image.md new file mode 100644 index 0000000000..7e9a20f2f7 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/avatars/get-image.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/avatars" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := avatars.New(client) + +response, error := service.GetImage( + "https://example.com", + avatars.WithGetImageWidth(0), + avatars.WithGetImageHeight(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/avatars/get-initials.md b/docs/examples/1.8.x/server-go/examples/avatars/get-initials.md new file mode 100644 index 0000000000..84ddfc080a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/avatars/get-initials.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/avatars" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := avatars.New(client) + +response, error := service.GetInitials( + avatars.WithGetInitialsName("<NAME>"), + avatars.WithGetInitialsWidth(0), + avatars.WithGetInitialsHeight(0), + avatars.WithGetInitialsBackground(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/avatars/get-qr.md b/docs/examples/1.8.x/server-go/examples/avatars/get-qr.md new file mode 100644 index 0000000000..97efa7400e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/avatars/get-qr.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/avatars" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := avatars.New(client) + +response, error := service.GetQR( + "<TEXT>", + avatars.WithGetQRSize(1), + avatars.WithGetQRMargin(0), + avatars.WithGetQRDownload(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..db87ed2d2d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-boolean-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateBooleanAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithCreateBooleanAttributeDefault(false), + databases.WithCreateBooleanAttributeArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-collection.md b/docs/examples/1.8.x/server-go/examples/databases/create-collection.md new file mode 100644 index 0000000000..4e4e9f764c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-collection.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + databases.WithCreateCollectionPermissions(interface{}{"read("any")"}), + databases.WithCreateCollectionDocumentSecurity(false), + databases.WithCreateCollectionEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..d1b5785b2e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-datetime-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateDatetimeAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithCreateDatetimeAttributeDefault(""), + databases.WithCreateDatetimeAttributeArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-document.md b/docs/examples/1.8.x/server-go/examples/databases/create-document.md new file mode 100644 index 0000000000..ea6305a06e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-document.md @@ -0,0 +1,29 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := databases.New(client) + +response, error := service.CreateDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + map[string]interface{}{ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + databases.WithCreateDocumentPermissions(interface{}{"read("any")"}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-documents.md b/docs/examples/1.8.x/server-go/examples/databases/create-documents.md new file mode 100644 index 0000000000..8bd0a5761a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-documents.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + []interface{}{}, +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..24ceeab4ad --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-email-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateEmailAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithCreateEmailAttributeDefault("email@example.com"), + databases.WithCreateEmailAttributeArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..49c576a62d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-enum-attribute.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateEnumAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + []interface{}{}, + false, + databases.WithCreateEnumAttributeDefault("<DEFAULT>"), + databases.WithCreateEnumAttributeArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..2a039e802e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-float-attribute.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateFloatAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithCreateFloatAttributeMin(0), + databases.WithCreateFloatAttributeMax(0), + databases.WithCreateFloatAttributeDefault(0), + databases.WithCreateFloatAttributeArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-index.md b/docs/examples/1.8.x/server-go/examples/databases/create-index.md new file mode 100644 index 0000000000..e2b11982d4 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-index.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + "key", + []interface{}{}, + databases.WithCreateIndexOrders([]interface{}{}), + databases.WithCreateIndexLengths([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..ad93ff053c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-integer-attribute.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateIntegerAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithCreateIntegerAttributeMin(0), + databases.WithCreateIntegerAttributeMax(0), + databases.WithCreateIntegerAttributeDefault(0), + databases.WithCreateIntegerAttributeArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..47df16ced4 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-ip-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateIpAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithCreateIpAttributeDefault(""), + databases.WithCreateIpAttributeArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..4993176457 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-line-attribute.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateLineAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithCreateLineAttributeDefault(interface{}{[1, 2], [3, 4], [5, 6]}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..75d5e7908d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-point-attribute.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreatePointAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithCreatePointAttributeDefault(interface{}{1, 2}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..0f89b4237d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-polygon-attribute.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreatePolygonAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithCreatePolygonAttributeDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..f63779ff75 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-relationship-attribute.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateRelationshipAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<RELATED_COLLECTION_ID>", + "oneToOne", + databases.WithCreateRelationshipAttributeTwoWay(false), + databases.WithCreateRelationshipAttributeKey(""), + databases.WithCreateRelationshipAttributeTwoWayKey(""), + databases.WithCreateRelationshipAttributeOnDelete("cascade"), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..4082041aaf --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-string-attribute.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateStringAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + 1, + false, + databases.WithCreateStringAttributeDefault("<DEFAULT>"), + databases.WithCreateStringAttributeArray(false), + databases.WithCreateStringAttributeEncrypt(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..5b367e0cac --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create-url-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.CreateUrlAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithCreateUrlAttributeDefault("https://example.com"), + databases.WithCreateUrlAttributeArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/create.md b/docs/examples/1.8.x/server-go/examples/databases/create.md new file mode 100644 index 0000000000..57c8e106ed --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/create.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.Create( + "<DATABASE_ID>", + "<NAME>", + databases.WithCreateEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..af463743b5 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/decrement-document-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := databases.New(client) + +response, error := service.DecrementDocumentAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + "", + databases.WithDecrementDocumentAttributeValue(0), + databases.WithDecrementDocumentAttributeMin(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/delete-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..9640983294 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/delete-attribute.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.DeleteAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/delete-collection.md b/docs/examples/1.8.x/server-go/examples/databases/delete-collection.md new file mode 100644 index 0000000000..df3031640b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/delete-collection.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.DeleteCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/delete-document.md b/docs/examples/1.8.x/server-go/examples/databases/delete-document.md new file mode 100644 index 0000000000..6e9b58a56d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/delete-document.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := databases.New(client) + +response, error := service.DeleteDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/delete-documents.md b/docs/examples/1.8.x/server-go/examples/databases/delete-documents.md new file mode 100644 index 0000000000..43e0d4cb36 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/delete-documents.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.DeleteDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + databases.WithDeleteDocumentsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/delete-index.md b/docs/examples/1.8.x/server-go/examples/databases/delete-index.md new file mode 100644 index 0000000000..229c50ca36 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/delete-index.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.DeleteIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/delete.md b/docs/examples/1.8.x/server-go/examples/databases/delete.md new file mode 100644 index 0000000000..eb7999ccb2 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/delete.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.Delete( + "<DATABASE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/get-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/get-attribute.md new file mode 100644 index 0000000000..e1c5d10d3c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/get-attribute.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.GetAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/get-collection.md b/docs/examples/1.8.x/server-go/examples/databases/get-collection.md new file mode 100644 index 0000000000..2827eec74d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/get-collection.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.GetCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/get-document.md b/docs/examples/1.8.x/server-go/examples/databases/get-document.md new file mode 100644 index 0000000000..5e63077aac --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/get-document.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := databases.New(client) + +response, error := service.GetDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + databases.WithGetDocumentQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/get-index.md b/docs/examples/1.8.x/server-go/examples/databases/get-index.md new file mode 100644 index 0000000000..54d5705211 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/get-index.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.GetIndex( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/get.md b/docs/examples/1.8.x/server-go/examples/databases/get.md new file mode 100644 index 0000000000..c92506cf57 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/get.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.Get( + "<DATABASE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..d2e91ee4c1 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/increment-document-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := databases.New(client) + +response, error := service.IncrementDocumentAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + "", + databases.WithIncrementDocumentAttributeValue(0), + databases.WithIncrementDocumentAttributeMax(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/list-attributes.md b/docs/examples/1.8.x/server-go/examples/databases/list-attributes.md new file mode 100644 index 0000000000..061e43bb05 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/list-attributes.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.ListAttributes( + "<DATABASE_ID>", + "<COLLECTION_ID>", + databases.WithListAttributesQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/list-collections.md b/docs/examples/1.8.x/server-go/examples/databases/list-collections.md new file mode 100644 index 0000000000..2926768f0b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/list-collections.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.ListCollections( + "<DATABASE_ID>", + databases.WithListCollectionsQueries([]interface{}{}), + databases.WithListCollectionsSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/list-documents.md b/docs/examples/1.8.x/server-go/examples/databases/list-documents.md new file mode 100644 index 0000000000..0aaef36c59 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/list-documents.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := databases.New(client) + +response, error := service.ListDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + databases.WithListDocumentsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/list-indexes.md b/docs/examples/1.8.x/server-go/examples/databases/list-indexes.md new file mode 100644 index 0000000000..c26fbc8e7f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/list-indexes.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.ListIndexes( + "<DATABASE_ID>", + "<COLLECTION_ID>", + databases.WithListIndexesQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/list.md b/docs/examples/1.8.x/server-go/examples/databases/list.md new file mode 100644 index 0000000000..657d3b6b78 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/list.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.List( + databases.WithListQueries([]interface{}{}), + databases.WithListSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..bf854b0440 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-boolean-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateBooleanAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + false, + databases.WithUpdateBooleanAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-collection.md b/docs/examples/1.8.x/server-go/examples/databases/update-collection.md new file mode 100644 index 0000000000..4bafd5eb2c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-collection.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateCollection( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<NAME>", + databases.WithUpdateCollectionPermissions(interface{}{"read("any")"}), + databases.WithUpdateCollectionDocumentSecurity(false), + databases.WithUpdateCollectionEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..d78d1b879c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-datetime-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateDatetimeAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + "", + databases.WithUpdateDatetimeAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-document.md b/docs/examples/1.8.x/server-go/examples/databases/update-document.md new file mode 100644 index 0000000000..90c0947536 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-document.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := databases.New(client) + +response, error := service.UpdateDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + databases.WithUpdateDocumentData(map[string]interface{}{}), + databases.WithUpdateDocumentPermissions(interface{}{"read("any")"}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-documents.md b/docs/examples/1.8.x/server-go/examples/databases/update-documents.md new file mode 100644 index 0000000000..7caee918e4 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-documents.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + databases.WithUpdateDocumentsData(map[string]interface{}{}), + databases.WithUpdateDocumentsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..728bbd7ac9 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-email-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateEmailAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + "email@example.com", + databases.WithUpdateEmailAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..86a5ea087e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-enum-attribute.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateEnumAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + []interface{}{}, + false, + "<DEFAULT>", + databases.WithUpdateEnumAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..9dd04e7731 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-float-attribute.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateFloatAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + 0, + databases.WithUpdateFloatAttributeMin(0), + databases.WithUpdateFloatAttributeMax(0), + databases.WithUpdateFloatAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..b9d8bf162d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-integer-attribute.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateIntegerAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + 0, + databases.WithUpdateIntegerAttributeMin(0), + databases.WithUpdateIntegerAttributeMax(0), + databases.WithUpdateIntegerAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..fd1cfcc52d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-ip-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateIpAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + "", + databases.WithUpdateIpAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..209044158f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-line-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateLineAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithUpdateLineAttributeDefault(interface{}{[1, 2], [3, 4], [5, 6]}), + databases.WithUpdateLineAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..735b4d8c64 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-point-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdatePointAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithUpdatePointAttributeDefault(interface{}{1, 2}), + databases.WithUpdatePointAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..6499f3640f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-polygon-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdatePolygonAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + databases.WithUpdatePolygonAttributeDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}), + databases.WithUpdatePolygonAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..0c9ee73f8b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-relationship-attribute.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateRelationshipAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + databases.WithUpdateRelationshipAttributeOnDelete("cascade"), + databases.WithUpdateRelationshipAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..0d131001fc --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-string-attribute.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateStringAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + "<DEFAULT>", + databases.WithUpdateStringAttributeSize(1), + databases.WithUpdateStringAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/server-go/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..56dfbf03e3 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update-url-attribute.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpdateUrlAttribute( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "", + false, + "https://example.com", + databases.WithUpdateUrlAttributeNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/update.md b/docs/examples/1.8.x/server-go/examples/databases/update.md new file mode 100644 index 0000000000..49d85eba08 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/update.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.Update( + "<DATABASE_ID>", + "<NAME>", + databases.WithUpdateEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/upsert-document.md b/docs/examples/1.8.x/server-go/examples/databases/upsert-document.md new file mode 100644 index 0000000000..00cf8ad408 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/upsert-document.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := databases.New(client) + +response, error := service.UpsertDocument( + "<DATABASE_ID>", + "<COLLECTION_ID>", + "<DOCUMENT_ID>", + map[string]interface{}{}, + databases.WithUpsertDocumentPermissions(interface{}{"read("any")"}), +) diff --git a/docs/examples/1.8.x/server-go/examples/databases/upsert-documents.md b/docs/examples/1.8.x/server-go/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..a81ee4446e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/databases/upsert-documents.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := databases.New(client) + +response, error := service.UpsertDocuments( + "<DATABASE_ID>", + "<COLLECTION_ID>", + []interface{}{}, +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/create-deployment.md b/docs/examples/1.8.x/server-go/examples/functions/create-deployment.md new file mode 100644 index 0000000000..86eda6f07b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/create-deployment.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.CreateDeployment( + "<FUNCTION_ID>", + file.NewInputFile("/path/to/file.png", "file.png"), + false, + functions.WithCreateDeploymentEntrypoint("<ENTRYPOINT>"), + functions.WithCreateDeploymentCommands("<COMMANDS>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-go/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..8c01a9e305 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.CreateDuplicateDeployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", + functions.WithCreateDuplicateDeploymentBuildId("<BUILD_ID>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/create-execution.md b/docs/examples/1.8.x/server-go/examples/functions/create-execution.md new file mode 100644 index 0000000000..1f723b8027 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/create-execution.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := functions.New(client) + +response, error := service.CreateExecution( + "<FUNCTION_ID>", + functions.WithCreateExecutionBody("<BODY>"), + functions.WithCreateExecutionAsync(false), + functions.WithCreateExecutionPath("<PATH>"), + functions.WithCreateExecutionMethod("GET"), + functions.WithCreateExecutionHeaders(map[string]interface{}{}), + functions.WithCreateExecutionScheduledAt("<SCHEDULED_AT>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/server-go/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..14f694ba4a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/create-template-deployment.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.CreateTemplateDeployment( + "<FUNCTION_ID>", + "<REPOSITORY>", + "<OWNER>", + "<ROOT_DIRECTORY>", + "<VERSION>", + functions.WithCreateTemplateDeploymentActivate(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/create-variable.md b/docs/examples/1.8.x/server-go/examples/functions/create-variable.md new file mode 100644 index 0000000000..84b68b834e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/create-variable.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.CreateVariable( + "<FUNCTION_ID>", + "<KEY>", + "<VALUE>", + functions.WithCreateVariableSecret(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-go/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..5ccb045569 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/create-vcs-deployment.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.CreateVcsDeployment( + "<FUNCTION_ID>", + "branch", + "<REFERENCE>", + functions.WithCreateVcsDeploymentActivate(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/create.md b/docs/examples/1.8.x/server-go/examples/functions/create.md new file mode 100644 index 0000000000..5bacf3ce34 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/create.md @@ -0,0 +1,36 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.Create( + "<FUNCTION_ID>", + "<NAME>", + "node-14.5", + functions.WithCreateExecute(interface{}{"any"}), + functions.WithCreateEvents([]interface{}{}), + functions.WithCreateSchedule(""), + functions.WithCreateTimeout(1), + functions.WithCreateEnabled(false), + functions.WithCreateLogging(false), + functions.WithCreateEntrypoint("<ENTRYPOINT>"), + functions.WithCreateCommands("<COMMANDS>"), + functions.WithCreateScopes([]interface{}{}), + functions.WithCreateInstallationId("<INSTALLATION_ID>"), + functions.WithCreateProviderRepositoryId("<PROVIDER_REPOSITORY_ID>"), + functions.WithCreateProviderBranch("<PROVIDER_BRANCH>"), + functions.WithCreateProviderSilentMode(false), + functions.WithCreateProviderRootDirectory("<PROVIDER_ROOT_DIRECTORY>"), + functions.WithCreateSpecification(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/delete-deployment.md b/docs/examples/1.8.x/server-go/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..297c433652 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/delete-deployment.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.DeleteDeployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/delete-execution.md b/docs/examples/1.8.x/server-go/examples/functions/delete-execution.md new file mode 100644 index 0000000000..493488cfbc --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/delete-execution.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.DeleteExecution( + "<FUNCTION_ID>", + "<EXECUTION_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/delete-variable.md b/docs/examples/1.8.x/server-go/examples/functions/delete-variable.md new file mode 100644 index 0000000000..049afed8a2 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/delete-variable.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.DeleteVariable( + "<FUNCTION_ID>", + "<VARIABLE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/delete.md b/docs/examples/1.8.x/server-go/examples/functions/delete.md new file mode 100644 index 0000000000..fe2a02d87c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/delete.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.Delete( + "<FUNCTION_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/server-go/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..26f14512b3 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/get-deployment-download.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.GetDeploymentDownload( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", + functions.WithGetDeploymentDownloadType("source"), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/get-deployment.md b/docs/examples/1.8.x/server-go/examples/functions/get-deployment.md new file mode 100644 index 0000000000..f05bfd737a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/get-deployment.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.GetDeployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/get-execution.md b/docs/examples/1.8.x/server-go/examples/functions/get-execution.md new file mode 100644 index 0000000000..5fa2a32edf --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/get-execution.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := functions.New(client) + +response, error := service.GetExecution( + "<FUNCTION_ID>", + "<EXECUTION_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/get-variable.md b/docs/examples/1.8.x/server-go/examples/functions/get-variable.md new file mode 100644 index 0000000000..78916740aa --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/get-variable.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.GetVariable( + "<FUNCTION_ID>", + "<VARIABLE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/get.md b/docs/examples/1.8.x/server-go/examples/functions/get.md new file mode 100644 index 0000000000..91e21e4eec --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/get.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.Get( + "<FUNCTION_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/list-deployments.md b/docs/examples/1.8.x/server-go/examples/functions/list-deployments.md new file mode 100644 index 0000000000..af00c765c8 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/list-deployments.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.ListDeployments( + "<FUNCTION_ID>", + functions.WithListDeploymentsQueries([]interface{}{}), + functions.WithListDeploymentsSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/list-executions.md b/docs/examples/1.8.x/server-go/examples/functions/list-executions.md new file mode 100644 index 0000000000..8cb902f353 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/list-executions.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := functions.New(client) + +response, error := service.ListExecutions( + "<FUNCTION_ID>", + functions.WithListExecutionsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/list-runtimes.md b/docs/examples/1.8.x/server-go/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..c40a08f149 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/list-runtimes.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.ListRuntimes()) diff --git a/docs/examples/1.8.x/server-go/examples/functions/list-specifications.md b/docs/examples/1.8.x/server-go/examples/functions/list-specifications.md new file mode 100644 index 0000000000..c0a29fc3ea --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/list-specifications.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.ListSpecifications()) diff --git a/docs/examples/1.8.x/server-go/examples/functions/list-variables.md b/docs/examples/1.8.x/server-go/examples/functions/list-variables.md new file mode 100644 index 0000000000..e71f01704b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/list-variables.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.ListVariables( + "<FUNCTION_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/list.md b/docs/examples/1.8.x/server-go/examples/functions/list.md new file mode 100644 index 0000000000..8d7b5c9bf0 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/list.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.List( + functions.WithListQueries([]interface{}{}), + functions.WithListSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/server-go/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..f29be75500 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/update-deployment-status.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.UpdateDeploymentStatus( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/server-go/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..9e85be96b4 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/update-function-deployment.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.UpdateFunctionDeployment( + "<FUNCTION_ID>", + "<DEPLOYMENT_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/update-variable.md b/docs/examples/1.8.x/server-go/examples/functions/update-variable.md new file mode 100644 index 0000000000..aad017d81c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/update-variable.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.UpdateVariable( + "<FUNCTION_ID>", + "<VARIABLE_ID>", + "<KEY>", + functions.WithUpdateVariableValue("<VALUE>"), + functions.WithUpdateVariableSecret(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/functions/update.md b/docs/examples/1.8.x/server-go/examples/functions/update.md new file mode 100644 index 0000000000..1e652489f0 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/functions/update.md @@ -0,0 +1,36 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/functions" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := functions.New(client) + +response, error := service.Update( + "<FUNCTION_ID>", + "<NAME>", + functions.WithUpdateRuntime("node-14.5"), + functions.WithUpdateExecute(interface{}{"any"}), + functions.WithUpdateEvents([]interface{}{}), + functions.WithUpdateSchedule(""), + functions.WithUpdateTimeout(1), + functions.WithUpdateEnabled(false), + functions.WithUpdateLogging(false), + functions.WithUpdateEntrypoint("<ENTRYPOINT>"), + functions.WithUpdateCommands("<COMMANDS>"), + functions.WithUpdateScopes([]interface{}{}), + functions.WithUpdateInstallationId("<INSTALLATION_ID>"), + functions.WithUpdateProviderRepositoryId("<PROVIDER_REPOSITORY_ID>"), + functions.WithUpdateProviderBranch("<PROVIDER_BRANCH>"), + functions.WithUpdateProviderSilentMode(false), + functions.WithUpdateProviderRootDirectory("<PROVIDER_ROOT_DIRECTORY>"), + functions.WithUpdateSpecification(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/graphql/mutation.md b/docs/examples/1.8.x/server-go/examples/graphql/mutation.md new file mode 100644 index 0000000000..04d9d58fe7 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/graphql/mutation.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/graphql" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := graphql.New(client) + +response, error := service.Mutation( + map[string]interface{}{}, +) diff --git a/docs/examples/1.8.x/server-go/examples/graphql/query.md b/docs/examples/1.8.x/server-go/examples/graphql/query.md new file mode 100644 index 0000000000..05699ad881 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/graphql/query.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/graphql" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := graphql.New(client) + +response, error := service.Query( + map[string]interface{}{}, +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-antivirus.md b/docs/examples/1.8.x/server-go/examples/health/get-antivirus.md new file mode 100644 index 0000000000..0d7ffcecb5 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-antivirus.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetAntivirus()) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-cache.md b/docs/examples/1.8.x/server-go/examples/health/get-cache.md new file mode 100644 index 0000000000..1d4dd1aa68 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-cache.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetCache()) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-certificate.md b/docs/examples/1.8.x/server-go/examples/health/get-certificate.md new file mode 100644 index 0000000000..3590e97c0e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-certificate.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetCertificate( + health.WithGetCertificateDomain(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-db.md b/docs/examples/1.8.x/server-go/examples/health/get-db.md new file mode 100644 index 0000000000..293e8666cd --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-db.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetDB()) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/server-go/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..7dfcc5edc8 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-failed-jobs.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetFailedJobs( + "v1-database", + health.WithGetFailedJobsThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-pub-sub.md b/docs/examples/1.8.x/server-go/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..998de3891a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-pub-sub.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetPubSub()) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-builds.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..4f41ee574b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-builds.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueBuilds( + health.WithGetQueueBuildsThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..1cb06f49e6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-certificates.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueCertificates( + health.WithGetQueueCertificatesThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-databases.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..51ad2d8e0f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-databases.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueDatabases( + health.WithGetQueueDatabasesName("<NAME>"), + health.WithGetQueueDatabasesThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..97ac4d2a0b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-deletes.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueDeletes( + health.WithGetQueueDeletesThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-functions.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..56c7517b44 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-functions.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueFunctions( + health.WithGetQueueFunctionsThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-logs.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..76952a3167 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-logs.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueLogs( + health.WithGetQueueLogsThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-mails.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..3d85dda4f3 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-mails.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueMails( + health.WithGetQueueMailsThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..db8a90345d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-messaging.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueMessaging( + health.WithGetQueueMessagingThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..ae5c524662 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-migrations.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueMigrations( + health.WithGetQueueMigrationsThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..28de62a3e1 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-stats-resources.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueStatsResources( + health.WithGetQueueStatsResourcesThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-usage.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..e081c077a6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-usage.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueUsage( + health.WithGetQueueUsageThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-go/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..85acb5207d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-queue-webhooks.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetQueueWebhooks( + health.WithGetQueueWebhooksThreshold(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-storage-local.md b/docs/examples/1.8.x/server-go/examples/health/get-storage-local.md new file mode 100644 index 0000000000..41b5dfaab0 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-storage-local.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetStorageLocal()) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-storage.md b/docs/examples/1.8.x/server-go/examples/health/get-storage.md new file mode 100644 index 0000000000..33ad742e2c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-storage.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetStorage()) diff --git a/docs/examples/1.8.x/server-go/examples/health/get-time.md b/docs/examples/1.8.x/server-go/examples/health/get-time.md new file mode 100644 index 0000000000..f995ad9ddc --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get-time.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.GetTime()) diff --git a/docs/examples/1.8.x/server-go/examples/health/get.md b/docs/examples/1.8.x/server-go/examples/health/get.md new file mode 100644 index 0000000000..da7e86a80d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/health/get.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := health.New(client) + +response, error := service.Get()) diff --git a/docs/examples/1.8.x/server-go/examples/locale/get.md b/docs/examples/1.8.x/server-go/examples/locale/get.md new file mode 100644 index 0000000000..87a4513d51 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/locale/get.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/locale" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := locale.New(client) + +response, error := service.Get()) diff --git a/docs/examples/1.8.x/server-go/examples/locale/list-codes.md b/docs/examples/1.8.x/server-go/examples/locale/list-codes.md new file mode 100644 index 0000000000..b204a13b07 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/locale/list-codes.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/locale" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := locale.New(client) + +response, error := service.ListCodes()) diff --git a/docs/examples/1.8.x/server-go/examples/locale/list-continents.md b/docs/examples/1.8.x/server-go/examples/locale/list-continents.md new file mode 100644 index 0000000000..4db9555f5e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/locale/list-continents.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/locale" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := locale.New(client) + +response, error := service.ListContinents()) diff --git a/docs/examples/1.8.x/server-go/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/server-go/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..e46c9235c9 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/locale/list-countries-eu.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/locale" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := locale.New(client) + +response, error := service.ListCountriesEU()) diff --git a/docs/examples/1.8.x/server-go/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/server-go/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..301d94db2a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/locale/list-countries-phones.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/locale" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := locale.New(client) + +response, error := service.ListCountriesPhones()) diff --git a/docs/examples/1.8.x/server-go/examples/locale/list-countries.md b/docs/examples/1.8.x/server-go/examples/locale/list-countries.md new file mode 100644 index 0000000000..b598adbbe0 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/locale/list-countries.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/locale" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := locale.New(client) + +response, error := service.ListCountries()) diff --git a/docs/examples/1.8.x/server-go/examples/locale/list-currencies.md b/docs/examples/1.8.x/server-go/examples/locale/list-currencies.md new file mode 100644 index 0000000000..5046497987 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/locale/list-currencies.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/locale" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := locale.New(client) + +response, error := service.ListCurrencies()) diff --git a/docs/examples/1.8.x/server-go/examples/locale/list-languages.md b/docs/examples/1.8.x/server-go/examples/locale/list-languages.md new file mode 100644 index 0000000000..2737401b59 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/locale/list-languages.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/locale" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := locale.New(client) + +response, error := service.ListLanguages()) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..ae9a95eba4 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-apns-provider.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateAPNSProvider( + "<PROVIDER_ID>", + "<NAME>", + messaging.WithCreateAPNSProviderAuthKey("<AUTH_KEY>"), + messaging.WithCreateAPNSProviderAuthKeyId("<AUTH_KEY_ID>"), + messaging.WithCreateAPNSProviderTeamId("<TEAM_ID>"), + messaging.WithCreateAPNSProviderBundleId("<BUNDLE_ID>"), + messaging.WithCreateAPNSProviderSandbox(false), + messaging.WithCreateAPNSProviderEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-email.md b/docs/examples/1.8.x/server-go/examples/messaging/create-email.md new file mode 100644 index 0000000000..2c9a09a396 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-email.md @@ -0,0 +1,30 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateEmail( + "<MESSAGE_ID>", + "<SUBJECT>", + "<CONTENT>", + messaging.WithCreateEmailTopics([]interface{}{}), + messaging.WithCreateEmailUsers([]interface{}{}), + messaging.WithCreateEmailTargets([]interface{}{}), + messaging.WithCreateEmailCc([]interface{}{}), + messaging.WithCreateEmailBcc([]interface{}{}), + messaging.WithCreateEmailAttachments([]interface{}{}), + messaging.WithCreateEmailDraft(false), + messaging.WithCreateEmailHtml(false), + messaging.WithCreateEmailScheduledAt(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..dd6733bc0d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-fcm-provider.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateFCMProvider( + "<PROVIDER_ID>", + "<NAME>", + messaging.WithCreateFCMProviderServiceAccountJSON(map[string]interface{}{}), + messaging.WithCreateFCMProviderEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..cbeefd4ebf --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,28 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateMailgunProvider( + "<PROVIDER_ID>", + "<NAME>", + messaging.WithCreateMailgunProviderApiKey("<API_KEY>"), + messaging.WithCreateMailgunProviderDomain("<DOMAIN>"), + messaging.WithCreateMailgunProviderIsEuRegion(false), + messaging.WithCreateMailgunProviderFromName("<FROM_NAME>"), + messaging.WithCreateMailgunProviderFromEmail("email@example.com"), + messaging.WithCreateMailgunProviderReplyToName("<REPLY_TO_NAME>"), + messaging.WithCreateMailgunProviderReplyToEmail("email@example.com"), + messaging.WithCreateMailgunProviderEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..3cc3f90cdf --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateMsg91Provider( + "<PROVIDER_ID>", + "<NAME>", + messaging.WithCreateMsg91ProviderTemplateId("<TEMPLATE_ID>"), + messaging.WithCreateMsg91ProviderSenderId("<SENDER_ID>"), + messaging.WithCreateMsg91ProviderAuthKey("<AUTH_KEY>"), + messaging.WithCreateMsg91ProviderEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-push.md b/docs/examples/1.8.x/server-go/examples/messaging/create-push.md new file mode 100644 index 0000000000..fe2371bacd --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-push.md @@ -0,0 +1,37 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreatePush( + "<MESSAGE_ID>", + messaging.WithCreatePushTitle("<TITLE>"), + messaging.WithCreatePushBody("<BODY>"), + messaging.WithCreatePushTopics([]interface{}{}), + messaging.WithCreatePushUsers([]interface{}{}), + messaging.WithCreatePushTargets([]interface{}{}), + messaging.WithCreatePushData(map[string]interface{}{}), + messaging.WithCreatePushAction("<ACTION>"), + messaging.WithCreatePushImage("[ID1:ID2]"), + messaging.WithCreatePushIcon("<ICON>"), + messaging.WithCreatePushSound("<SOUND>"), + messaging.WithCreatePushColor("<COLOR>"), + messaging.WithCreatePushTag("<TAG>"), + messaging.WithCreatePushBadge(0), + messaging.WithCreatePushDraft(false), + messaging.WithCreatePushScheduledAt(""), + messaging.WithCreatePushContentAvailable(false), + messaging.WithCreatePushCritical(false), + messaging.WithCreatePushPriority("normal"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..c2a6787711 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateSendgridProvider( + "<PROVIDER_ID>", + "<NAME>", + messaging.WithCreateSendgridProviderApiKey("<API_KEY>"), + messaging.WithCreateSendgridProviderFromName("<FROM_NAME>"), + messaging.WithCreateSendgridProviderFromEmail("email@example.com"), + messaging.WithCreateSendgridProviderReplyToName("<REPLY_TO_NAME>"), + messaging.WithCreateSendgridProviderReplyToEmail("email@example.com"), + messaging.WithCreateSendgridProviderEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-sms.md b/docs/examples/1.8.x/server-go/examples/messaging/create-sms.md new file mode 100644 index 0000000000..cb7d62e49c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-sms.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateSMS( + "<MESSAGE_ID>", + "<CONTENT>", + messaging.WithCreateSMSTopics([]interface{}{}), + messaging.WithCreateSMSUsers([]interface{}{}), + messaging.WithCreateSMSTargets([]interface{}{}), + messaging.WithCreateSMSDraft(false), + messaging.WithCreateSMSScheduledAt(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..c469aa57e8 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-smtp-provider.md @@ -0,0 +1,32 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateSMTPProvider( + "<PROVIDER_ID>", + "<NAME>", + "<HOST>", + messaging.WithCreateSMTPProviderPort(1), + messaging.WithCreateSMTPProviderUsername("<USERNAME>"), + messaging.WithCreateSMTPProviderPassword("<PASSWORD>"), + messaging.WithCreateSMTPProviderEncryption("none"), + messaging.WithCreateSMTPProviderAutoTLS(false), + messaging.WithCreateSMTPProviderMailer("<MAILER>"), + messaging.WithCreateSMTPProviderFromName("<FROM_NAME>"), + messaging.WithCreateSMTPProviderFromEmail("email@example.com"), + messaging.WithCreateSMTPProviderReplyToName("<REPLY_TO_NAME>"), + messaging.WithCreateSMTPProviderReplyToEmail("email@example.com"), + messaging.WithCreateSMTPProviderEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/server-go/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..ebc0f6bb39 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-subscriber.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithJWT("<YOUR_JWT>") +) + +service := messaging.New(client) + +response, error := service.CreateSubscriber( + "<TOPIC_ID>", + "<SUBSCRIBER_ID>", + "<TARGET_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..4605ad3713 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-telesign-provider.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateTelesignProvider( + "<PROVIDER_ID>", + "<NAME>", + messaging.WithCreateTelesignProviderFrom("+12065550100"), + messaging.WithCreateTelesignProviderCustomerId("<CUSTOMER_ID>"), + messaging.WithCreateTelesignProviderApiKey("<API_KEY>"), + messaging.WithCreateTelesignProviderEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..2101fab661 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateTextmagicProvider( + "<PROVIDER_ID>", + "<NAME>", + messaging.WithCreateTextmagicProviderFrom("+12065550100"), + messaging.WithCreateTextmagicProviderUsername("<USERNAME>"), + messaging.WithCreateTextmagicProviderApiKey("<API_KEY>"), + messaging.WithCreateTextmagicProviderEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-topic.md b/docs/examples/1.8.x/server-go/examples/messaging/create-topic.md new file mode 100644 index 0000000000..71814b8d86 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-topic.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateTopic( + "<TOPIC_ID>", + "<NAME>", + messaging.WithCreateTopicSubscribe(interface{}{"any"}), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..931a2538fa --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-twilio-provider.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateTwilioProvider( + "<PROVIDER_ID>", + "<NAME>", + messaging.WithCreateTwilioProviderFrom("+12065550100"), + messaging.WithCreateTwilioProviderAccountSid("<ACCOUNT_SID>"), + messaging.WithCreateTwilioProviderAuthToken("<AUTH_TOKEN>"), + messaging.WithCreateTwilioProviderEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..6ef3576137 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/create-vonage-provider.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.CreateVonageProvider( + "<PROVIDER_ID>", + "<NAME>", + messaging.WithCreateVonageProviderFrom("+12065550100"), + messaging.WithCreateVonageProviderApiKey("<API_KEY>"), + messaging.WithCreateVonageProviderApiSecret("<API_SECRET>"), + messaging.WithCreateVonageProviderEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/delete-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..f2a07bbb3c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/delete-provider.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.DeleteProvider( + "<PROVIDER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-go/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..dd8b9889ae --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/delete-subscriber.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithJWT("<YOUR_JWT>") +) + +service := messaging.New(client) + +response, error := service.DeleteSubscriber( + "<TOPIC_ID>", + "<SUBSCRIBER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/delete-topic.md b/docs/examples/1.8.x/server-go/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..7ebf870539 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/delete-topic.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.DeleteTopic( + "<TOPIC_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/delete.md b/docs/examples/1.8.x/server-go/examples/messaging/delete.md new file mode 100644 index 0000000000..f8400c6993 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/delete.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.Delete( + "<MESSAGE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/get-message.md b/docs/examples/1.8.x/server-go/examples/messaging/get-message.md new file mode 100644 index 0000000000..ff1b8fa05b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/get-message.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.GetMessage( + "<MESSAGE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/get-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/get-provider.md new file mode 100644 index 0000000000..34781802bf --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/get-provider.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.GetProvider( + "<PROVIDER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/server-go/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..7774204ca6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/get-subscriber.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.GetSubscriber( + "<TOPIC_ID>", + "<SUBSCRIBER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/get-topic.md b/docs/examples/1.8.x/server-go/examples/messaging/get-topic.md new file mode 100644 index 0000000000..2f258be446 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/get-topic.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.GetTopic( + "<TOPIC_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/server-go/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..aeb6c12f98 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/list-message-logs.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.ListMessageLogs( + "<MESSAGE_ID>", + messaging.WithListMessageLogsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/list-messages.md b/docs/examples/1.8.x/server-go/examples/messaging/list-messages.md new file mode 100644 index 0000000000..595072eb74 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/list-messages.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.ListMessages( + messaging.WithListMessagesQueries([]interface{}{}), + messaging.WithListMessagesSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-go/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..8f6ddc07b4 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/list-provider-logs.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.ListProviderLogs( + "<PROVIDER_ID>", + messaging.WithListProviderLogsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/list-providers.md b/docs/examples/1.8.x/server-go/examples/messaging/list-providers.md new file mode 100644 index 0000000000..2fbde76d7a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/list-providers.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.ListProviders( + messaging.WithListProvidersQueries([]interface{}{}), + messaging.WithListProvidersSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-go/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..d08a1706b4 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.ListSubscriberLogs( + "<SUBSCRIBER_ID>", + messaging.WithListSubscriberLogsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/server-go/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..40fb7c1f07 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/list-subscribers.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.ListSubscribers( + "<TOPIC_ID>", + messaging.WithListSubscribersQueries([]interface{}{}), + messaging.WithListSubscribersSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/list-targets.md b/docs/examples/1.8.x/server-go/examples/messaging/list-targets.md new file mode 100644 index 0000000000..16d9828499 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/list-targets.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.ListTargets( + "<MESSAGE_ID>", + messaging.WithListTargetsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-go/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..e147de400a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/list-topic-logs.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.ListTopicLogs( + "<TOPIC_ID>", + messaging.WithListTopicLogsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/list-topics.md b/docs/examples/1.8.x/server-go/examples/messaging/list-topics.md new file mode 100644 index 0000000000..e507de7da8 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/list-topics.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.ListTopics( + messaging.WithListTopicsQueries([]interface{}{}), + messaging.WithListTopicsSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..f8c12e88ad --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-apns-provider.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateAPNSProvider( + "<PROVIDER_ID>", + messaging.WithUpdateAPNSProviderName("<NAME>"), + messaging.WithUpdateAPNSProviderEnabled(false), + messaging.WithUpdateAPNSProviderAuthKey("<AUTH_KEY>"), + messaging.WithUpdateAPNSProviderAuthKeyId("<AUTH_KEY_ID>"), + messaging.WithUpdateAPNSProviderTeamId("<TEAM_ID>"), + messaging.WithUpdateAPNSProviderBundleId("<BUNDLE_ID>"), + messaging.WithUpdateAPNSProviderSandbox(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-email.md b/docs/examples/1.8.x/server-go/examples/messaging/update-email.md new file mode 100644 index 0000000000..91d6ad900f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-email.md @@ -0,0 +1,30 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateEmail( + "<MESSAGE_ID>", + messaging.WithUpdateEmailTopics([]interface{}{}), + messaging.WithUpdateEmailUsers([]interface{}{}), + messaging.WithUpdateEmailTargets([]interface{}{}), + messaging.WithUpdateEmailSubject("<SUBJECT>"), + messaging.WithUpdateEmailContent("<CONTENT>"), + messaging.WithUpdateEmailDraft(false), + messaging.WithUpdateEmailHtml(false), + messaging.WithUpdateEmailCc([]interface{}{}), + messaging.WithUpdateEmailBcc([]interface{}{}), + messaging.WithUpdateEmailScheduledAt(""), + messaging.WithUpdateEmailAttachments([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..28fd91534b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-fcm-provider.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateFCMProvider( + "<PROVIDER_ID>", + messaging.WithUpdateFCMProviderName("<NAME>"), + messaging.WithUpdateFCMProviderEnabled(false), + messaging.WithUpdateFCMProviderServiceAccountJSON(map[string]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..d5f17b3d25 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,28 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateMailgunProvider( + "<PROVIDER_ID>", + messaging.WithUpdateMailgunProviderName("<NAME>"), + messaging.WithUpdateMailgunProviderApiKey("<API_KEY>"), + messaging.WithUpdateMailgunProviderDomain("<DOMAIN>"), + messaging.WithUpdateMailgunProviderIsEuRegion(false), + messaging.WithUpdateMailgunProviderEnabled(false), + messaging.WithUpdateMailgunProviderFromName("<FROM_NAME>"), + messaging.WithUpdateMailgunProviderFromEmail("email@example.com"), + messaging.WithUpdateMailgunProviderReplyToName("<REPLY_TO_NAME>"), + messaging.WithUpdateMailgunProviderReplyToEmail("<REPLY_TO_EMAIL>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..825d2d4940 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateMsg91Provider( + "<PROVIDER_ID>", + messaging.WithUpdateMsg91ProviderName("<NAME>"), + messaging.WithUpdateMsg91ProviderEnabled(false), + messaging.WithUpdateMsg91ProviderTemplateId("<TEMPLATE_ID>"), + messaging.WithUpdateMsg91ProviderSenderId("<SENDER_ID>"), + messaging.WithUpdateMsg91ProviderAuthKey("<AUTH_KEY>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-push.md b/docs/examples/1.8.x/server-go/examples/messaging/update-push.md new file mode 100644 index 0000000000..190627fa43 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-push.md @@ -0,0 +1,37 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdatePush( + "<MESSAGE_ID>", + messaging.WithUpdatePushTopics([]interface{}{}), + messaging.WithUpdatePushUsers([]interface{}{}), + messaging.WithUpdatePushTargets([]interface{}{}), + messaging.WithUpdatePushTitle("<TITLE>"), + messaging.WithUpdatePushBody("<BODY>"), + messaging.WithUpdatePushData(map[string]interface{}{}), + messaging.WithUpdatePushAction("<ACTION>"), + messaging.WithUpdatePushImage("[ID1:ID2]"), + messaging.WithUpdatePushIcon("<ICON>"), + messaging.WithUpdatePushSound("<SOUND>"), + messaging.WithUpdatePushColor("<COLOR>"), + messaging.WithUpdatePushTag("<TAG>"), + messaging.WithUpdatePushBadge(0), + messaging.WithUpdatePushDraft(false), + messaging.WithUpdatePushScheduledAt(""), + messaging.WithUpdatePushContentAvailable(false), + messaging.WithUpdatePushCritical(false), + messaging.WithUpdatePushPriority("normal"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..4a9f822c58 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateSendgridProvider( + "<PROVIDER_ID>", + messaging.WithUpdateSendgridProviderName("<NAME>"), + messaging.WithUpdateSendgridProviderEnabled(false), + messaging.WithUpdateSendgridProviderApiKey("<API_KEY>"), + messaging.WithUpdateSendgridProviderFromName("<FROM_NAME>"), + messaging.WithUpdateSendgridProviderFromEmail("email@example.com"), + messaging.WithUpdateSendgridProviderReplyToName("<REPLY_TO_NAME>"), + messaging.WithUpdateSendgridProviderReplyToEmail("<REPLY_TO_EMAIL>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-sms.md b/docs/examples/1.8.x/server-go/examples/messaging/update-sms.md new file mode 100644 index 0000000000..988de20082 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-sms.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateSMS( + "<MESSAGE_ID>", + messaging.WithUpdateSMSTopics([]interface{}{}), + messaging.WithUpdateSMSUsers([]interface{}{}), + messaging.WithUpdateSMSTargets([]interface{}{}), + messaging.WithUpdateSMSContent("<CONTENT>"), + messaging.WithUpdateSMSDraft(false), + messaging.WithUpdateSMSScheduledAt(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..1519750183 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-smtp-provider.md @@ -0,0 +1,32 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateSMTPProvider( + "<PROVIDER_ID>", + messaging.WithUpdateSMTPProviderName("<NAME>"), + messaging.WithUpdateSMTPProviderHost("<HOST>"), + messaging.WithUpdateSMTPProviderPort(1), + messaging.WithUpdateSMTPProviderUsername("<USERNAME>"), + messaging.WithUpdateSMTPProviderPassword("<PASSWORD>"), + messaging.WithUpdateSMTPProviderEncryption("none"), + messaging.WithUpdateSMTPProviderAutoTLS(false), + messaging.WithUpdateSMTPProviderMailer("<MAILER>"), + messaging.WithUpdateSMTPProviderFromName("<FROM_NAME>"), + messaging.WithUpdateSMTPProviderFromEmail("email@example.com"), + messaging.WithUpdateSMTPProviderReplyToName("<REPLY_TO_NAME>"), + messaging.WithUpdateSMTPProviderReplyToEmail("<REPLY_TO_EMAIL>"), + messaging.WithUpdateSMTPProviderEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..d00c6b6eb1 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-telesign-provider.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateTelesignProvider( + "<PROVIDER_ID>", + messaging.WithUpdateTelesignProviderName("<NAME>"), + messaging.WithUpdateTelesignProviderEnabled(false), + messaging.WithUpdateTelesignProviderCustomerId("<CUSTOMER_ID>"), + messaging.WithUpdateTelesignProviderApiKey("<API_KEY>"), + messaging.WithUpdateTelesignProviderFrom("<FROM>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..38e1bed245 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateTextmagicProvider( + "<PROVIDER_ID>", + messaging.WithUpdateTextmagicProviderName("<NAME>"), + messaging.WithUpdateTextmagicProviderEnabled(false), + messaging.WithUpdateTextmagicProviderUsername("<USERNAME>"), + messaging.WithUpdateTextmagicProviderApiKey("<API_KEY>"), + messaging.WithUpdateTextmagicProviderFrom("<FROM>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-topic.md b/docs/examples/1.8.x/server-go/examples/messaging/update-topic.md new file mode 100644 index 0000000000..f7c0044bc3 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-topic.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateTopic( + "<TOPIC_ID>", + messaging.WithUpdateTopicName("<NAME>"), + messaging.WithUpdateTopicSubscribe(interface{}{"any"}), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..644d6d87d5 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-twilio-provider.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateTwilioProvider( + "<PROVIDER_ID>", + messaging.WithUpdateTwilioProviderName("<NAME>"), + messaging.WithUpdateTwilioProviderEnabled(false), + messaging.WithUpdateTwilioProviderAccountSid("<ACCOUNT_SID>"), + messaging.WithUpdateTwilioProviderAuthToken("<AUTH_TOKEN>"), + messaging.WithUpdateTwilioProviderFrom("<FROM>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-go/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..01ebeb3334 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/messaging/update-vonage-provider.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/messaging" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := messaging.New(client) + +response, error := service.UpdateVonageProvider( + "<PROVIDER_ID>", + messaging.WithUpdateVonageProviderName("<NAME>"), + messaging.WithUpdateVonageProviderEnabled(false), + messaging.WithUpdateVonageProviderApiKey("<API_KEY>"), + messaging.WithUpdateVonageProviderApiSecret("<API_SECRET>"), + messaging.WithUpdateVonageProviderFrom("<FROM>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/create-deployment.md b/docs/examples/1.8.x/server-go/examples/sites/create-deployment.md new file mode 100644 index 0000000000..1c85372388 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/create-deployment.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.CreateDeployment( + "<SITE_ID>", + file.NewInputFile("/path/to/file.png", "file.png"), + false, + sites.WithCreateDeploymentInstallCommand("<INSTALL_COMMAND>"), + sites.WithCreateDeploymentBuildCommand("<BUILD_COMMAND>"), + sites.WithCreateDeploymentOutputDirectory("<OUTPUT_DIRECTORY>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-go/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..177dc48b57 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.CreateDuplicateDeployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/server-go/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..483d3e79ff --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/create-template-deployment.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.CreateTemplateDeployment( + "<SITE_ID>", + "<REPOSITORY>", + "<OWNER>", + "<ROOT_DIRECTORY>", + "<VERSION>", + sites.WithCreateTemplateDeploymentActivate(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/create-variable.md b/docs/examples/1.8.x/server-go/examples/sites/create-variable.md new file mode 100644 index 0000000000..7681f0d561 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/create-variable.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.CreateVariable( + "<SITE_ID>", + "<KEY>", + "<VALUE>", + sites.WithCreateVariableSecret(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-go/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..2e39147d6b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/create-vcs-deployment.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.CreateVcsDeployment( + "<SITE_ID>", + "branch", + "<REFERENCE>", + sites.WithCreateVcsDeploymentActivate(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/create.md b/docs/examples/1.8.x/server-go/examples/sites/create.md new file mode 100644 index 0000000000..e011baf92c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/create.md @@ -0,0 +1,36 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.Create( + "<SITE_ID>", + "<NAME>", + "analog", + "node-14.5", + sites.WithCreateEnabled(false), + sites.WithCreateLogging(false), + sites.WithCreateTimeout(1), + sites.WithCreateInstallCommand("<INSTALL_COMMAND>"), + sites.WithCreateBuildCommand("<BUILD_COMMAND>"), + sites.WithCreateOutputDirectory("<OUTPUT_DIRECTORY>"), + sites.WithCreateAdapter("static"), + sites.WithCreateInstallationId("<INSTALLATION_ID>"), + sites.WithCreateFallbackFile("<FALLBACK_FILE>"), + sites.WithCreateProviderRepositoryId("<PROVIDER_REPOSITORY_ID>"), + sites.WithCreateProviderBranch("<PROVIDER_BRANCH>"), + sites.WithCreateProviderSilentMode(false), + sites.WithCreateProviderRootDirectory("<PROVIDER_ROOT_DIRECTORY>"), + sites.WithCreateSpecification(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/delete-deployment.md b/docs/examples/1.8.x/server-go/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..36d313344a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/delete-deployment.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.DeleteDeployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/delete-log.md b/docs/examples/1.8.x/server-go/examples/sites/delete-log.md new file mode 100644 index 0000000000..34a77611f2 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/delete-log.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.DeleteLog( + "<SITE_ID>", + "<LOG_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/delete-variable.md b/docs/examples/1.8.x/server-go/examples/sites/delete-variable.md new file mode 100644 index 0000000000..00e6c5c4f7 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/delete-variable.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.DeleteVariable( + "<SITE_ID>", + "<VARIABLE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/delete.md b/docs/examples/1.8.x/server-go/examples/sites/delete.md new file mode 100644 index 0000000000..4a93cdb12c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/delete.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.Delete( + "<SITE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/server-go/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..b3f1101bc0 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/get-deployment-download.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.GetDeploymentDownload( + "<SITE_ID>", + "<DEPLOYMENT_ID>", + sites.WithGetDeploymentDownloadType("source"), +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/get-deployment.md b/docs/examples/1.8.x/server-go/examples/sites/get-deployment.md new file mode 100644 index 0000000000..28f4917467 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/get-deployment.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.GetDeployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/get-log.md b/docs/examples/1.8.x/server-go/examples/sites/get-log.md new file mode 100644 index 0000000000..1d5aacb2f0 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/get-log.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.GetLog( + "<SITE_ID>", + "<LOG_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/get-variable.md b/docs/examples/1.8.x/server-go/examples/sites/get-variable.md new file mode 100644 index 0000000000..91f1a0d1ea --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/get-variable.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.GetVariable( + "<SITE_ID>", + "<VARIABLE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/get.md b/docs/examples/1.8.x/server-go/examples/sites/get.md new file mode 100644 index 0000000000..9c1f38da3d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/get.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.Get( + "<SITE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/list-deployments.md b/docs/examples/1.8.x/server-go/examples/sites/list-deployments.md new file mode 100644 index 0000000000..b4dafaf145 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/list-deployments.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.ListDeployments( + "<SITE_ID>", + sites.WithListDeploymentsQueries([]interface{}{}), + sites.WithListDeploymentsSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/list-frameworks.md b/docs/examples/1.8.x/server-go/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..d876ac1acf --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/list-frameworks.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.ListFrameworks()) diff --git a/docs/examples/1.8.x/server-go/examples/sites/list-logs.md b/docs/examples/1.8.x/server-go/examples/sites/list-logs.md new file mode 100644 index 0000000000..64b6009adc --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/list-logs.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.ListLogs( + "<SITE_ID>", + sites.WithListLogsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/list-specifications.md b/docs/examples/1.8.x/server-go/examples/sites/list-specifications.md new file mode 100644 index 0000000000..f3a46b225f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/list-specifications.md @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.ListSpecifications()) diff --git a/docs/examples/1.8.x/server-go/examples/sites/list-variables.md b/docs/examples/1.8.x/server-go/examples/sites/list-variables.md new file mode 100644 index 0000000000..18d1e48033 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/list-variables.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.ListVariables( + "<SITE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/list.md b/docs/examples/1.8.x/server-go/examples/sites/list.md new file mode 100644 index 0000000000..83fea84293 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/list.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.List( + sites.WithListQueries([]interface{}{}), + sites.WithListSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/server-go/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..29dad9b1f6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/update-deployment-status.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.UpdateDeploymentStatus( + "<SITE_ID>", + "<DEPLOYMENT_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/server-go/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..176d641073 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/update-site-deployment.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.UpdateSiteDeployment( + "<SITE_ID>", + "<DEPLOYMENT_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/update-variable.md b/docs/examples/1.8.x/server-go/examples/sites/update-variable.md new file mode 100644 index 0000000000..99879be702 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/update-variable.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.UpdateVariable( + "<SITE_ID>", + "<VARIABLE_ID>", + "<KEY>", + sites.WithUpdateVariableValue("<VALUE>"), + sites.WithUpdateVariableSecret(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/sites/update.md b/docs/examples/1.8.x/server-go/examples/sites/update.md new file mode 100644 index 0000000000..fee0eb8bf6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/sites/update.md @@ -0,0 +1,36 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/sites" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := sites.New(client) + +response, error := service.Update( + "<SITE_ID>", + "<NAME>", + "analog", + sites.WithUpdateEnabled(false), + sites.WithUpdateLogging(false), + sites.WithUpdateTimeout(1), + sites.WithUpdateInstallCommand("<INSTALL_COMMAND>"), + sites.WithUpdateBuildCommand("<BUILD_COMMAND>"), + sites.WithUpdateOutputDirectory("<OUTPUT_DIRECTORY>"), + sites.WithUpdateBuildRuntime("node-14.5"), + sites.WithUpdateAdapter("static"), + sites.WithUpdateFallbackFile("<FALLBACK_FILE>"), + sites.WithUpdateInstallationId("<INSTALLATION_ID>"), + sites.WithUpdateProviderRepositoryId("<PROVIDER_REPOSITORY_ID>"), + sites.WithUpdateProviderBranch("<PROVIDER_BRANCH>"), + sites.WithUpdateProviderSilentMode(false), + sites.WithUpdateProviderRootDirectory("<PROVIDER_ROOT_DIRECTORY>"), + sites.WithUpdateSpecification(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/create-bucket.md b/docs/examples/1.8.x/server-go/examples/storage/create-bucket.md new file mode 100644 index 0000000000..64e3c40191 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/create-bucket.md @@ -0,0 +1,28 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := storage.New(client) + +response, error := service.CreateBucket( + "<BUCKET_ID>", + "<NAME>", + storage.WithCreateBucketPermissions(interface{}{"read("any")"}), + storage.WithCreateBucketFileSecurity(false), + storage.WithCreateBucketEnabled(false), + storage.WithCreateBucketMaximumFileSize(1), + storage.WithCreateBucketAllowedFileExtensions([]interface{}{}), + storage.WithCreateBucketCompression("none"), + storage.WithCreateBucketEncryption(false), + storage.WithCreateBucketAntivirus(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/create-file.md b/docs/examples/1.8.x/server-go/examples/storage/create-file.md new file mode 100644 index 0000000000..b195c66a8f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/create-file.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := storage.New(client) + +response, error := service.CreateFile( + "<BUCKET_ID>", + "<FILE_ID>", + file.NewInputFile("/path/to/file.png", "file.png"), + storage.WithCreateFilePermissions(interface{}{"read("any")"}), +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/delete-bucket.md b/docs/examples/1.8.x/server-go/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..8142212a9f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/delete-bucket.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := storage.New(client) + +response, error := service.DeleteBucket( + "<BUCKET_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/delete-file.md b/docs/examples/1.8.x/server-go/examples/storage/delete-file.md new file mode 100644 index 0000000000..af3f921c56 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/delete-file.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := storage.New(client) + +response, error := service.DeleteFile( + "<BUCKET_ID>", + "<FILE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/get-bucket.md b/docs/examples/1.8.x/server-go/examples/storage/get-bucket.md new file mode 100644 index 0000000000..c52ebbe004 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/get-bucket.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := storage.New(client) + +response, error := service.GetBucket( + "<BUCKET_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/get-file-download.md b/docs/examples/1.8.x/server-go/examples/storage/get-file-download.md new file mode 100644 index 0000000000..bc1d7333be --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/get-file-download.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := storage.New(client) + +response, error := service.GetFileDownload( + "<BUCKET_ID>", + "<FILE_ID>", + storage.WithGetFileDownloadToken("<TOKEN>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/get-file-preview.md b/docs/examples/1.8.x/server-go/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..956fbd191d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/get-file-preview.md @@ -0,0 +1,32 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := storage.New(client) + +response, error := service.GetFilePreview( + "<BUCKET_ID>", + "<FILE_ID>", + storage.WithGetFilePreviewWidth(0), + storage.WithGetFilePreviewHeight(0), + storage.WithGetFilePreviewGravity("center"), + storage.WithGetFilePreviewQuality(-1), + storage.WithGetFilePreviewBorderWidth(0), + storage.WithGetFilePreviewBorderColor(""), + storage.WithGetFilePreviewBorderRadius(0), + storage.WithGetFilePreviewOpacity(0), + storage.WithGetFilePreviewRotation(-360), + storage.WithGetFilePreviewBackground(""), + storage.WithGetFilePreviewOutput("jpg"), + storage.WithGetFilePreviewToken("<TOKEN>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/get-file-view.md b/docs/examples/1.8.x/server-go/examples/storage/get-file-view.md new file mode 100644 index 0000000000..a2189750be --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/get-file-view.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := storage.New(client) + +response, error := service.GetFileView( + "<BUCKET_ID>", + "<FILE_ID>", + storage.WithGetFileViewToken("<TOKEN>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/get-file.md b/docs/examples/1.8.x/server-go/examples/storage/get-file.md new file mode 100644 index 0000000000..383d4052da --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/get-file.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := storage.New(client) + +response, error := service.GetFile( + "<BUCKET_ID>", + "<FILE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/list-buckets.md b/docs/examples/1.8.x/server-go/examples/storage/list-buckets.md new file mode 100644 index 0000000000..3d10e6ab7f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/list-buckets.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := storage.New(client) + +response, error := service.ListBuckets( + storage.WithListBucketsQueries([]interface{}{}), + storage.WithListBucketsSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/list-files.md b/docs/examples/1.8.x/server-go/examples/storage/list-files.md new file mode 100644 index 0000000000..62a09b3f20 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/list-files.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := storage.New(client) + +response, error := service.ListFiles( + "<BUCKET_ID>", + storage.WithListFilesQueries([]interface{}{}), + storage.WithListFilesSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/update-bucket.md b/docs/examples/1.8.x/server-go/examples/storage/update-bucket.md new file mode 100644 index 0000000000..bb5f7aa76d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/update-bucket.md @@ -0,0 +1,28 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := storage.New(client) + +response, error := service.UpdateBucket( + "<BUCKET_ID>", + "<NAME>", + storage.WithUpdateBucketPermissions(interface{}{"read("any")"}), + storage.WithUpdateBucketFileSecurity(false), + storage.WithUpdateBucketEnabled(false), + storage.WithUpdateBucketMaximumFileSize(1), + storage.WithUpdateBucketAllowedFileExtensions([]interface{}{}), + storage.WithUpdateBucketCompression("none"), + storage.WithUpdateBucketEncryption(false), + storage.WithUpdateBucketAntivirus(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/storage/update-file.md b/docs/examples/1.8.x/server-go/examples/storage/update-file.md new file mode 100644 index 0000000000..79a75bab4c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/storage/update-file.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/storage" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := storage.New(client) + +response, error := service.UpdateFile( + "<BUCKET_ID>", + "<FILE_ID>", + storage.WithUpdateFileName("<NAME>"), + storage.WithUpdateFilePermissions(interface{}{"read("any")"}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..6b35615487 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateBooleanColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithCreateBooleanColumnDefault(false), + tablesdb.WithCreateBooleanColumnArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..24a8aa7567 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateDatetimeColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithCreateDatetimeColumnDefault(""), + tablesdb.WithCreateDatetimeColumnArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..918b3785c4 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-email-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateEmailColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithCreateEmailColumnDefault("email@example.com"), + tablesdb.WithCreateEmailColumnArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..9eaef4be4c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-enum-column.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateEnumColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + []interface{}{}, + false, + tablesdb.WithCreateEnumColumnDefault("<DEFAULT>"), + tablesdb.WithCreateEnumColumnArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..f630565e39 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-float-column.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateFloatColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithCreateFloatColumnMin(0), + tablesdb.WithCreateFloatColumnMax(0), + tablesdb.WithCreateFloatColumnDefault(0), + tablesdb.WithCreateFloatColumnArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-index.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..fb292b9914 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-index.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateIndex( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + "key", + []interface{}{}, + tablesdb.WithCreateIndexOrders([]interface{}{}), + tablesdb.WithCreateIndexLengths([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..a56f5eec8b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-integer-column.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateIntegerColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithCreateIntegerColumnMin(0), + tablesdb.WithCreateIntegerColumnMax(0), + tablesdb.WithCreateIntegerColumnDefault(0), + tablesdb.WithCreateIntegerColumnArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..358b4cfa4b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-ip-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateIpColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithCreateIpColumnDefault(""), + tablesdb.WithCreateIpColumnArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..77b23f872c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-line-column.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateLineColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithCreateLineColumnDefault(interface{}{[1, 2], [3, 4], [5, 6]}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..7faaf786f8 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-point-column.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreatePointColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithCreatePointColumnDefault(interface{}{1, 2}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..10946ef0fd --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreatePolygonColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithCreatePolygonColumnDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..0423509787 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateRelationshipColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<RELATED_TABLE_ID>", + "oneToOne", + tablesdb.WithCreateRelationshipColumnTwoWay(false), + tablesdb.WithCreateRelationshipColumnKey(""), + tablesdb.WithCreateRelationshipColumnTwoWayKey(""), + tablesdb.WithCreateRelationshipColumnOnDelete("cascade"), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-row.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..596f11cf75 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-row.md @@ -0,0 +1,29 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := tablesdb.New(client) + +response, error := service.CreateRow( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + map[string]interface{}{ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + tablesdb.WithCreateRowPermissions(interface{}{"read("any")"}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..2d83be06df --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-rows.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateRows( + "<DATABASE_ID>", + "<TABLE_ID>", + []interface{}{}, +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..b31f583806 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-string-column.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateStringColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + 1, + false, + tablesdb.WithCreateStringColumnDefault("<DEFAULT>"), + tablesdb.WithCreateStringColumnArray(false), + tablesdb.WithCreateStringColumnEncrypt(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-table.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..c454c08d6e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-table.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateTable( + "<DATABASE_ID>", + "<TABLE_ID>", + "<NAME>", + tablesdb.WithCreateTablePermissions(interface{}{"read("any")"}), + tablesdb.WithCreateTableRowSecurity(false), + tablesdb.WithCreateTableEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..55abd16818 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create-url-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.CreateUrlColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithCreateUrlColumnDefault("https://example.com"), + tablesdb.WithCreateUrlColumnArray(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/create.md b/docs/examples/1.8.x/server-go/examples/tablesdb/create.md new file mode 100644 index 0000000000..d09b6aeab8 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/create.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.Create( + "<DATABASE_ID>", + "<NAME>", + tablesdb.WithCreateEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..cd8d6c8983 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := tablesdb.New(client) + +response, error := service.DecrementRowColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + "", + tablesdb.WithDecrementRowColumnValue(0), + tablesdb.WithDecrementRowColumnMin(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..475f4a4e8c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/delete-column.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.DeleteColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/server-go/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..2c3b7759af --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/delete-index.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.DeleteIndex( + "<DATABASE_ID>", + "<TABLE_ID>", + "", +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/server-go/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..8571a54c6c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/delete-row.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := tablesdb.New(client) + +response, error := service.DeleteRow( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-go/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..364a4c942f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/delete-rows.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.DeleteRows( + "<DATABASE_ID>", + "<TABLE_ID>", + tablesdb.WithDeleteRowsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/server-go/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..9274fc61b5 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/delete-table.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.DeleteTable( + "<DATABASE_ID>", + "<TABLE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/delete.md b/docs/examples/1.8.x/server-go/examples/tablesdb/delete.md new file mode 100644 index 0000000000..fb00bf0666 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/delete.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.Delete( + "<DATABASE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/get-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..2cb626f921 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/get-column.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.GetColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/get-index.md b/docs/examples/1.8.x/server-go/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..a289d5efeb --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/get-index.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.GetIndex( + "<DATABASE_ID>", + "<TABLE_ID>", + "", +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/get-row.md b/docs/examples/1.8.x/server-go/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..3a555f07c5 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/get-row.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := tablesdb.New(client) + +response, error := service.GetRow( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + tablesdb.WithGetRowQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/get-table.md b/docs/examples/1.8.x/server-go/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..eb42f82c16 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/get-table.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.GetTable( + "<DATABASE_ID>", + "<TABLE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/get.md b/docs/examples/1.8.x/server-go/examples/tablesdb/get.md new file mode 100644 index 0000000000..9bf18901b6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/get.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.Get( + "<DATABASE_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..d072099cc6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/increment-row-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := tablesdb.New(client) + +response, error := service.IncrementRowColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + "", + tablesdb.WithIncrementRowColumnValue(0), + tablesdb.WithIncrementRowColumnMax(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/server-go/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..c6646c0f1d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/list-columns.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.ListColumns( + "<DATABASE_ID>", + "<TABLE_ID>", + tablesdb.WithListColumnsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-go/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..bc13bb7488 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/list-indexes.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.ListIndexes( + "<DATABASE_ID>", + "<TABLE_ID>", + tablesdb.WithListIndexesQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/server-go/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..34a7b6fb98 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/list-rows.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := tablesdb.New(client) + +response, error := service.ListRows( + "<DATABASE_ID>", + "<TABLE_ID>", + tablesdb.WithListRowsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/server-go/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..2029c538ee --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/list-tables.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.ListTables( + "<DATABASE_ID>", + tablesdb.WithListTablesQueries([]interface{}{}), + tablesdb.WithListTablesSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/list.md b/docs/examples/1.8.x/server-go/examples/tablesdb/list.md new file mode 100644 index 0000000000..99f35ae06d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/list.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.List( + tablesdb.WithListQueries([]interface{}{}), + tablesdb.WithListSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..9b0bdd302e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateBooleanColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + false, + tablesdb.WithUpdateBooleanColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..9c406cae6c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateDatetimeColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + "", + tablesdb.WithUpdateDatetimeColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..74483f31e3 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-email-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateEmailColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + "email@example.com", + tablesdb.WithUpdateEmailColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..f215172565 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-enum-column.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateEnumColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + []interface{}{}, + false, + "<DEFAULT>", + tablesdb.WithUpdateEnumColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..9daf2c2236 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-float-column.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateFloatColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + 0, + tablesdb.WithUpdateFloatColumnMin(0), + tablesdb.WithUpdateFloatColumnMax(0), + tablesdb.WithUpdateFloatColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..86a113522c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-integer-column.md @@ -0,0 +1,26 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateIntegerColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + 0, + tablesdb.WithUpdateIntegerColumnMin(0), + tablesdb.WithUpdateIntegerColumnMax(0), + tablesdb.WithUpdateIntegerColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..1c4bdb4f96 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-ip-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateIpColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + "", + tablesdb.WithUpdateIpColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..397e0b735a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-line-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateLineColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithUpdateLineColumnDefault(interface{}{[1, 2], [3, 4], [5, 6]}), + tablesdb.WithUpdateLineColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..970536a6af --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-point-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdatePointColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithUpdatePointColumnDefault(interface{}{1, 2}), + tablesdb.WithUpdatePointColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..8e627d178d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdatePolygonColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + tablesdb.WithUpdatePolygonColumnDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}), + tablesdb.WithUpdatePolygonColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..ed923a2d33 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateRelationshipColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + tablesdb.WithUpdateRelationshipColumnOnDelete("cascade"), + tablesdb.WithUpdateRelationshipColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-row.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..1e819bb589 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-row.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := tablesdb.New(client) + +response, error := service.UpdateRow( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + tablesdb.WithUpdateRowData(map[string]interface{}{}), + tablesdb.WithUpdateRowPermissions(interface{}{"read("any")"}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..3541dce134 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-rows.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateRows( + "<DATABASE_ID>", + "<TABLE_ID>", + tablesdb.WithUpdateRowsData(map[string]interface{}{}), + tablesdb.WithUpdateRowsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..4366602bd8 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-string-column.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateStringColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + "<DEFAULT>", + tablesdb.WithUpdateStringColumnSize(1), + tablesdb.WithUpdateStringColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-table.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..4eb692ac14 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-table.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateTable( + "<DATABASE_ID>", + "<TABLE_ID>", + "<NAME>", + tablesdb.WithUpdateTablePermissions(interface{}{"read("any")"}), + tablesdb.WithUpdateTableRowSecurity(false), + tablesdb.WithUpdateTableEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..998d0e773f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update-url-column.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpdateUrlColumn( + "<DATABASE_ID>", + "<TABLE_ID>", + "", + false, + "https://example.com", + tablesdb.WithUpdateUrlColumnNewKey(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/update.md b/docs/examples/1.8.x/server-go/examples/tablesdb/update.md new file mode 100644 index 0000000000..3ad3a0c2f5 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/update.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.Update( + "<DATABASE_ID>", + "<NAME>", + tablesdb.WithUpdateEnabled(false), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-go/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..9fec778142 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/upsert-row.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := tablesdb.New(client) + +response, error := service.UpsertRow( + "<DATABASE_ID>", + "<TABLE_ID>", + "<ROW_ID>", + tablesdb.WithUpsertRowData(map[string]interface{}{}), + tablesdb.WithUpsertRowPermissions(interface{}{"read("any")"}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-go/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..5ded736cd0 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tablesdb/upsert-rows.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tablesdb" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tablesdb.New(client) + +response, error := service.UpsertRows( + "<DATABASE_ID>", + "<TABLE_ID>", + []interface{}{}, +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/create-membership.md b/docs/examples/1.8.x/server-go/examples/teams/create-membership.md new file mode 100644 index 0000000000..b8a71c188e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/create-membership.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.CreateMembership( + "<TEAM_ID>", + []interface{}{}, + teams.WithCreateMembershipEmail("email@example.com"), + teams.WithCreateMembershipUserId("<USER_ID>"), + teams.WithCreateMembershipPhone("+12065550100"), + teams.WithCreateMembershipUrl("https://example.com"), + teams.WithCreateMembershipName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/create.md b/docs/examples/1.8.x/server-go/examples/teams/create.md new file mode 100644 index 0000000000..0a0fa5aae6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/create.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.Create( + "<TEAM_ID>", + "<NAME>", + teams.WithCreateRoles([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/delete-membership.md b/docs/examples/1.8.x/server-go/examples/teams/delete-membership.md new file mode 100644 index 0000000000..1d9e19832d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/delete-membership.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.DeleteMembership( + "<TEAM_ID>", + "<MEMBERSHIP_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/delete.md b/docs/examples/1.8.x/server-go/examples/teams/delete.md new file mode 100644 index 0000000000..8cf9892daa --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/delete.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.Delete( + "<TEAM_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/get-membership.md b/docs/examples/1.8.x/server-go/examples/teams/get-membership.md new file mode 100644 index 0000000000..47d63bbb2b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/get-membership.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.GetMembership( + "<TEAM_ID>", + "<MEMBERSHIP_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/get-prefs.md b/docs/examples/1.8.x/server-go/examples/teams/get-prefs.md new file mode 100644 index 0000000000..fd487d2c79 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/get-prefs.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.GetPrefs( + "<TEAM_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/get.md b/docs/examples/1.8.x/server-go/examples/teams/get.md new file mode 100644 index 0000000000..64dfb9b633 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/get.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.Get( + "<TEAM_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/list-memberships.md b/docs/examples/1.8.x/server-go/examples/teams/list-memberships.md new file mode 100644 index 0000000000..0e7ea18fd3 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/list-memberships.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.ListMemberships( + "<TEAM_ID>", + teams.WithListMembershipsQueries([]interface{}{}), + teams.WithListMembershipsSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/list.md b/docs/examples/1.8.x/server-go/examples/teams/list.md new file mode 100644 index 0000000000..579546fcc2 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/list.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.List( + teams.WithListQueries([]interface{}{}), + teams.WithListSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/update-membership-status.md b/docs/examples/1.8.x/server-go/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..72bb53e065 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/update-membership-status.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.UpdateMembershipStatus( + "<TEAM_ID>", + "<MEMBERSHIP_ID>", + "<USER_ID>", + "<SECRET>", +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/update-membership.md b/docs/examples/1.8.x/server-go/examples/teams/update-membership.md new file mode 100644 index 0000000000..4bfde07218 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/update-membership.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.UpdateMembership( + "<TEAM_ID>", + "<MEMBERSHIP_ID>", + []interface{}{}, +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/update-name.md b/docs/examples/1.8.x/server-go/examples/teams/update-name.md new file mode 100644 index 0000000000..02fba6b4bd --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/update-name.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.UpdateName( + "<TEAM_ID>", + "<NAME>", +) diff --git a/docs/examples/1.8.x/server-go/examples/teams/update-prefs.md b/docs/examples/1.8.x/server-go/examples/teams/update-prefs.md new file mode 100644 index 0000000000..a5f44c079f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/teams/update-prefs.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/teams" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithSession("") +) + +service := teams.New(client) + +response, error := service.UpdatePrefs( + "<TEAM_ID>", + map[string]interface{}{}, +) diff --git a/docs/examples/1.8.x/server-go/examples/tokens/create-file-token.md b/docs/examples/1.8.x/server-go/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..b05e5f7e4d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tokens/create-file-token.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tokens" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tokens.New(client) + +response, error := service.CreateFileToken( + "<BUCKET_ID>", + "<FILE_ID>", + tokens.WithCreateFileTokenExpire(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/tokens/delete.md b/docs/examples/1.8.x/server-go/examples/tokens/delete.md new file mode 100644 index 0000000000..807ba41025 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tokens/delete.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tokens" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tokens.New(client) + +response, error := service.Delete( + "<TOKEN_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/tokens/get.md b/docs/examples/1.8.x/server-go/examples/tokens/get.md new file mode 100644 index 0000000000..277e46210a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tokens/get.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tokens" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tokens.New(client) + +response, error := service.Get( + "<TOKEN_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/tokens/list.md b/docs/examples/1.8.x/server-go/examples/tokens/list.md new file mode 100644 index 0000000000..7686f065e7 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tokens/list.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tokens" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tokens.New(client) + +response, error := service.List( + "<BUCKET_ID>", + "<FILE_ID>", + tokens.WithListQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/tokens/update.md b/docs/examples/1.8.x/server-go/examples/tokens/update.md new file mode 100644 index 0000000000..b4bbc5476f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/tokens/update.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/tokens" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := tokens.New(client) + +response, error := service.Update( + "<TOKEN_ID>", + tokens.WithUpdateExpire(""), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/server-go/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..f5b651a1e8 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-argon-2-user.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreateArgon2User( + "<USER_ID>", + "email@example.com", + "password", + users.WithCreateArgon2UserName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-go/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..b021f96ff5 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-bcrypt-user.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreateBcryptUser( + "<USER_ID>", + "email@example.com", + "password", + users.WithCreateBcryptUserName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-jwt.md b/docs/examples/1.8.x/server-go/examples/users/create-jwt.md new file mode 100644 index 0000000000..426f832ba0 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-jwt.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreateJWT( + "<USER_ID>", + users.WithCreateJWTSessionId("<SESSION_ID>"), + users.WithCreateJWTDuration(0), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-md-5-user.md b/docs/examples/1.8.x/server-go/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..0da3f6877e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-md-5-user.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreateMD5User( + "<USER_ID>", + "email@example.com", + "password", + users.WithCreateMD5UserName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-go/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..4808f63329 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreateMFARecoveryCodes( + "<USER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-go/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..28e77e3749 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-ph-pass-user.md @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreatePHPassUser( + "<USER_ID>", + "email@example.com", + "password", + users.WithCreatePHPassUserName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-go/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..51cc11bfa3 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreateScryptModifiedUser( + "<USER_ID>", + "email@example.com", + "password", + "<PASSWORD_SALT>", + "<PASSWORD_SALT_SEPARATOR>", + "<PASSWORD_SIGNER_KEY>", + users.WithCreateScryptModifiedUserName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/server-go/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..a64fcfbb29 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-scrypt-user.md @@ -0,0 +1,27 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreateScryptUser( + "<USER_ID>", + "email@example.com", + "password", + "<PASSWORD_SALT>", + 0, + 0, + 0, + 0, + users.WithCreateScryptUserName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-session.md b/docs/examples/1.8.x/server-go/examples/users/create-session.md new file mode 100644 index 0000000000..7bbd39de91 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-session.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreateSession( + "<USER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-sha-user.md b/docs/examples/1.8.x/server-go/examples/users/create-sha-user.md new file mode 100644 index 0000000000..721159851b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-sha-user.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreateSHAUser( + "<USER_ID>", + "email@example.com", + "password", + users.WithCreateSHAUserPasswordVersion("sha1"), + users.WithCreateSHAUserName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-target.md b/docs/examples/1.8.x/server-go/examples/users/create-target.md new file mode 100644 index 0000000000..8d4f2841b1 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-target.md @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreateTarget( + "<USER_ID>", + "<TARGET_ID>", + "email", + "<IDENTIFIER>", + users.WithCreateTargetProviderId("<PROVIDER_ID>"), + users.WithCreateTargetName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create-token.md b/docs/examples/1.8.x/server-go/examples/users/create-token.md new file mode 100644 index 0000000000..44d96c1f70 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create-token.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.CreateToken( + "<USER_ID>", + users.WithCreateTokenLength(4), + users.WithCreateTokenExpire(60), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/create.md b/docs/examples/1.8.x/server-go/examples/users/create.md new file mode 100644 index 0000000000..b4d1afca6b --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/create.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.Create( + "<USER_ID>", + users.WithCreateEmail("email@example.com"), + users.WithCreatePhone("+12065550100"), + users.WithCreatePassword(""), + users.WithCreateName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/delete-identity.md b/docs/examples/1.8.x/server-go/examples/users/delete-identity.md new file mode 100644 index 0000000000..14baa6607d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/delete-identity.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.DeleteIdentity( + "<IDENTITY_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-go/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..d32a5c3e31 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.DeleteMFAAuthenticator( + "<USER_ID>", + "totp", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/delete-session.md b/docs/examples/1.8.x/server-go/examples/users/delete-session.md new file mode 100644 index 0000000000..3162ae92b4 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/delete-session.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.DeleteSession( + "<USER_ID>", + "<SESSION_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/delete-sessions.md b/docs/examples/1.8.x/server-go/examples/users/delete-sessions.md new file mode 100644 index 0000000000..8d0bbfc155 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/delete-sessions.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.DeleteSessions( + "<USER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/delete-target.md b/docs/examples/1.8.x/server-go/examples/users/delete-target.md new file mode 100644 index 0000000000..2fa4ae910a --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/delete-target.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.DeleteTarget( + "<USER_ID>", + "<TARGET_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/delete.md b/docs/examples/1.8.x/server-go/examples/users/delete.md new file mode 100644 index 0000000000..72a4122b0f --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/delete.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.Delete( + "<USER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-go/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..ff24b6ff9c --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.GetMFARecoveryCodes( + "<USER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/get-prefs.md b/docs/examples/1.8.x/server-go/examples/users/get-prefs.md new file mode 100644 index 0000000000..e4a05d1ce3 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/get-prefs.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.GetPrefs( + "<USER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/get-target.md b/docs/examples/1.8.x/server-go/examples/users/get-target.md new file mode 100644 index 0000000000..b4b99c7ef7 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/get-target.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.GetTarget( + "<USER_ID>", + "<TARGET_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/get.md b/docs/examples/1.8.x/server-go/examples/users/get.md new file mode 100644 index 0000000000..85a8440dee --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/get.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.Get( + "<USER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/list-identities.md b/docs/examples/1.8.x/server-go/examples/users/list-identities.md new file mode 100644 index 0000000000..047b2165f7 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/list-identities.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.ListIdentities( + users.WithListIdentitiesQueries([]interface{}{}), + users.WithListIdentitiesSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/list-logs.md b/docs/examples/1.8.x/server-go/examples/users/list-logs.md new file mode 100644 index 0000000000..56f3397939 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/list-logs.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.ListLogs( + "<USER_ID>", + users.WithListLogsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/list-memberships.md b/docs/examples/1.8.x/server-go/examples/users/list-memberships.md new file mode 100644 index 0000000000..fd2f1329fd --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/list-memberships.md @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.ListMemberships( + "<USER_ID>", + users.WithListMembershipsQueries([]interface{}{}), + users.WithListMembershipsSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/server-go/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..9a3c32631d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/list-mfa-factors.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.ListMFAFactors( + "<USER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/list-sessions.md b/docs/examples/1.8.x/server-go/examples/users/list-sessions.md new file mode 100644 index 0000000000..6b55a9a5fb --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/list-sessions.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.ListSessions( + "<USER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/list-targets.md b/docs/examples/1.8.x/server-go/examples/users/list-targets.md new file mode 100644 index 0000000000..ac5ba41c97 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/list-targets.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.ListTargets( + "<USER_ID>", + users.WithListTargetsQueries([]interface{}{}), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/list.md b/docs/examples/1.8.x/server-go/examples/users/list.md new file mode 100644 index 0000000000..cffc9793f0 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/list.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.List( + users.WithListQueries([]interface{}{}), + users.WithListSearch("<SEARCH>"), +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-email-verification.md b/docs/examples/1.8.x/server-go/examples/users/update-email-verification.md new file mode 100644 index 0000000000..c2326b4c91 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-email-verification.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdateEmailVerification( + "<USER_ID>", + false, +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-email.md b/docs/examples/1.8.x/server-go/examples/users/update-email.md new file mode 100644 index 0000000000..ac3938a637 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-email.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdateEmail( + "<USER_ID>", + "email@example.com", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-labels.md b/docs/examples/1.8.x/server-go/examples/users/update-labels.md new file mode 100644 index 0000000000..01c37f53ac --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-labels.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdateLabels( + "<USER_ID>", + []interface{}{}, +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-go/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..f79ac5c575 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdateMFARecoveryCodes( + "<USER_ID>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-mfa.md b/docs/examples/1.8.x/server-go/examples/users/update-mfa.md new file mode 100644 index 0000000000..9cff007fe0 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-mfa.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdateMFA( + "<USER_ID>", + false, +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-name.md b/docs/examples/1.8.x/server-go/examples/users/update-name.md new file mode 100644 index 0000000000..73255e25bc --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-name.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdateName( + "<USER_ID>", + "<NAME>", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-password.md b/docs/examples/1.8.x/server-go/examples/users/update-password.md new file mode 100644 index 0000000000..5aa6e9ef6e --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-password.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdatePassword( + "<USER_ID>", + "", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-phone-verification.md b/docs/examples/1.8.x/server-go/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..e90febf7d6 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-phone-verification.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdatePhoneVerification( + "<USER_ID>", + false, +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-phone.md b/docs/examples/1.8.x/server-go/examples/users/update-phone.md new file mode 100644 index 0000000000..602a012a2d --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-phone.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdatePhone( + "<USER_ID>", + "+12065550100", +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-prefs.md b/docs/examples/1.8.x/server-go/examples/users/update-prefs.md new file mode 100644 index 0000000000..dd607f3c42 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-prefs.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdatePrefs( + "<USER_ID>", + map[string]interface{}{}, +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-status.md b/docs/examples/1.8.x/server-go/examples/users/update-status.md new file mode 100644 index 0000000000..f93dde9c39 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-status.md @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdateStatus( + "<USER_ID>", + false, +) diff --git a/docs/examples/1.8.x/server-go/examples/users/update-target.md b/docs/examples/1.8.x/server-go/examples/users/update-target.md new file mode 100644 index 0000000000..82f3d65de4 --- /dev/null +++ b/docs/examples/1.8.x/server-go/examples/users/update-target.md @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/users" +) + +client := client.New( + client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1") + client.WithProject("<YOUR_PROJECT_ID>") + client.WithKey("<YOUR_API_KEY>") +) + +service := users.New(client) + +response, error := service.UpdateTarget( + "<USER_ID>", + "<TARGET_ID>", + users.WithUpdateTargetIdentifier("<IDENTIFIER>"), + users.WithUpdateTargetProviderId("<PROVIDER_ID>"), + users.WithUpdateTargetName("<NAME>"), +) diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/server-graphql/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..92c12acee5 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-anonymous-session.md @@ -0,0 +1,33 @@ +mutation { + accountCreateAnonymousSession { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-email-password-session.md b/docs/examples/1.8.x/server-graphql/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..931bb4add0 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-email-password-session.md @@ -0,0 +1,36 @@ +mutation { + accountCreateEmailPasswordSession( + email: "email@example.com", + password: "password" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-email-token.md b/docs/examples/1.8.x/server-graphql/examples/account/create-email-token.md new file mode 100644 index 0000000000..de320b45ed --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-email-token.md @@ -0,0 +1,14 @@ +mutation { + accountCreateEmailToken( + userId: "<USER_ID>", + email: "email@example.com", + phrase: false + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-jwt.md b/docs/examples/1.8.x/server-graphql/examples/account/create-jwt.md new file mode 100644 index 0000000000..a5204f1256 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-jwt.md @@ -0,0 +1,5 @@ +mutation { + accountCreateJWT { + jwt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/server-graphql/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..4024a5b3a9 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-magic-url-token.md @@ -0,0 +1,15 @@ +mutation { + accountCreateMagicURLToken( + userId: "<USER_ID>", + email: "email@example.com", + url: "https://example.com", + phrase: false + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-graphql/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..8605340168 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-mfa-authenticator.md @@ -0,0 +1,8 @@ +mutation { + accountCreateMFAAuthenticator( + type: "totp" + ) { + secret + uri + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-graphql/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..aff5a10123 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-mfa-challenge.md @@ -0,0 +1,10 @@ +mutation { + accountCreateMFAChallenge( + factor: "email" + ) { + _id + _createdAt + userId + expire + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-graphql/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..4cb6d36d42 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,5 @@ +mutation { + accountCreateMFARecoveryCodes { + recoveryCodes + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-phone-token.md b/docs/examples/1.8.x/server-graphql/examples/account/create-phone-token.md new file mode 100644 index 0000000000..b56c4eb4e4 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-phone-token.md @@ -0,0 +1,13 @@ +mutation { + accountCreatePhoneToken( + userId: "<USER_ID>", + phone: "+12065550100" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-phone-verification.md b/docs/examples/1.8.x/server-graphql/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..a4cad59b1a --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-phone-verification.md @@ -0,0 +1,10 @@ +mutation { + accountCreatePhoneVerification { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-recovery.md b/docs/examples/1.8.x/server-graphql/examples/account/create-recovery.md new file mode 100644 index 0000000000..ad31fd82d7 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-recovery.md @@ -0,0 +1,13 @@ +mutation { + accountCreateRecovery( + email: "email@example.com", + url: "https://example.com" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-session.md b/docs/examples/1.8.x/server-graphql/examples/account/create-session.md new file mode 100644 index 0000000000..f473d14207 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-session.md @@ -0,0 +1,36 @@ +mutation { + accountCreateSession( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create-verification.md b/docs/examples/1.8.x/server-graphql/examples/account/create-verification.md new file mode 100644 index 0000000000..df50dda529 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create-verification.md @@ -0,0 +1,12 @@ +mutation { + accountCreateVerification( + url: "https://example.com" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/create.md b/docs/examples/1.8.x/server-graphql/examples/account/create.md new file mode 100644 index 0000000000..0d39394a3d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/create.md @@ -0,0 +1,40 @@ +mutation { + accountCreate( + userId: "<USER_ID>", + email: "email@example.com", + password: "", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/delete-identity.md b/docs/examples/1.8.x/server-graphql/examples/account/delete-identity.md new file mode 100644 index 0000000000..f3c2e2e7b9 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/delete-identity.md @@ -0,0 +1,7 @@ +mutation { + accountDeleteIdentity( + identityId: "<IDENTITY_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-graphql/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..03e876e3f9 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,7 @@ +mutation { + accountDeleteMFAAuthenticator( + type: "totp" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/delete-session.md b/docs/examples/1.8.x/server-graphql/examples/account/delete-session.md new file mode 100644 index 0000000000..09aff38fdd --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/delete-session.md @@ -0,0 +1,7 @@ +mutation { + accountDeleteSession( + sessionId: "<SESSION_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/delete-sessions.md b/docs/examples/1.8.x/server-graphql/examples/account/delete-sessions.md new file mode 100644 index 0000000000..b0d61daa81 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/delete-sessions.md @@ -0,0 +1,5 @@ +mutation { + accountDeleteSessions { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-graphql/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/account/get-prefs.md b/docs/examples/1.8.x/server-graphql/examples/account/get-prefs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/account/get-session.md b/docs/examples/1.8.x/server-graphql/examples/account/get-session.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/account/get.md b/docs/examples/1.8.x/server-graphql/examples/account/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/account/list-identities.md b/docs/examples/1.8.x/server-graphql/examples/account/list-identities.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/account/list-logs.md b/docs/examples/1.8.x/server-graphql/examples/account/list-logs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/server-graphql/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/account/list-sessions.md b/docs/examples/1.8.x/server-graphql/examples/account/list-sessions.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-email.md b/docs/examples/1.8.x/server-graphql/examples/account/update-email.md new file mode 100644 index 0000000000..c879e24a43 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-email.md @@ -0,0 +1,38 @@ +mutation { + accountUpdateEmail( + email: "email@example.com", + password: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/server-graphql/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..075bc91d17 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-magic-url-session.md @@ -0,0 +1,36 @@ +mutation { + accountUpdateMagicURLSession( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-graphql/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..b3021b70b8 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-mfa-authenticator.md @@ -0,0 +1,38 @@ +mutation { + accountUpdateMFAAuthenticator( + type: "totp", + otp: "<OTP>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-graphql/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..bf389f1eff --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-mfa-challenge.md @@ -0,0 +1,36 @@ +mutation { + accountUpdateMFAChallenge( + challengeId: "<CHALLENGE_ID>", + otp: "<OTP>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-graphql/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..dc46be71ad --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,5 @@ +mutation { + accountUpdateMFARecoveryCodes { + recoveryCodes + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-mfa.md b/docs/examples/1.8.x/server-graphql/examples/account/update-mfa.md new file mode 100644 index 0000000000..787c2e0860 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-mfa.md @@ -0,0 +1,37 @@ +mutation { + accountUpdateMFA( + mfa: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-name.md b/docs/examples/1.8.x/server-graphql/examples/account/update-name.md new file mode 100644 index 0000000000..8ba2c99d9c --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-name.md @@ -0,0 +1,37 @@ +mutation { + accountUpdateName( + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-password.md b/docs/examples/1.8.x/server-graphql/examples/account/update-password.md new file mode 100644 index 0000000000..f3619a10d2 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-password.md @@ -0,0 +1,38 @@ +mutation { + accountUpdatePassword( + password: "", + oldPassword: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-phone-session.md b/docs/examples/1.8.x/server-graphql/examples/account/update-phone-session.md new file mode 100644 index 0000000000..199e774ab0 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-phone-session.md @@ -0,0 +1,36 @@ +mutation { + accountUpdatePhoneSession( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-phone-verification.md b/docs/examples/1.8.x/server-graphql/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..dd62298bb9 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-phone-verification.md @@ -0,0 +1,13 @@ +mutation { + accountUpdatePhoneVerification( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-phone.md b/docs/examples/1.8.x/server-graphql/examples/account/update-phone.md new file mode 100644 index 0000000000..adecb71168 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-phone.md @@ -0,0 +1,38 @@ +mutation { + accountUpdatePhone( + phone: "+12065550100", + password: "password" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-prefs.md b/docs/examples/1.8.x/server-graphql/examples/account/update-prefs.md new file mode 100644 index 0000000000..8138cf0227 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-prefs.md @@ -0,0 +1,37 @@ +mutation { + accountUpdatePrefs( + prefs: "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-recovery.md b/docs/examples/1.8.x/server-graphql/examples/account/update-recovery.md new file mode 100644 index 0000000000..2d15fdcaa1 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-recovery.md @@ -0,0 +1,14 @@ +mutation { + accountUpdateRecovery( + userId: "<USER_ID>", + secret: "<SECRET>", + password: "" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-session.md b/docs/examples/1.8.x/server-graphql/examples/account/update-session.md new file mode 100644 index 0000000000..29a8979872 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-session.md @@ -0,0 +1,35 @@ +mutation { + accountUpdateSession( + sessionId: "<SESSION_ID>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-status.md b/docs/examples/1.8.x/server-graphql/examples/account/update-status.md new file mode 100644 index 0000000000..c17f556842 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-status.md @@ -0,0 +1,35 @@ +mutation { + accountUpdateStatus { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/account/update-verification.md b/docs/examples/1.8.x/server-graphql/examples/account/update-verification.md new file mode 100644 index 0000000000..11e63c7da3 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/account/update-verification.md @@ -0,0 +1,13 @@ +mutation { + accountUpdateVerification( + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/avatars/get-browser.md b/docs/examples/1.8.x/server-graphql/examples/avatars/get-browser.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/server-graphql/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/avatars/get-favicon.md b/docs/examples/1.8.x/server-graphql/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/avatars/get-flag.md b/docs/examples/1.8.x/server-graphql/examples/avatars/get-flag.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/avatars/get-image.md b/docs/examples/1.8.x/server-graphql/examples/avatars/get-image.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/avatars/get-initials.md b/docs/examples/1.8.x/server-graphql/examples/avatars/get-initials.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/avatars/get-qr.md b/docs/examples/1.8.x/server-graphql/examples/avatars/get-qr.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..aa0bfa832e --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-boolean-attribute.md @@ -0,0 +1,20 @@ +mutation { + databasesCreateBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: false, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-collection.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-collection.md new file mode 100644 index 0000000000..7ee68b41c7 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-collection.md @@ -0,0 +1,32 @@ +mutation { + databasesCreateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: ["read("any")"], + documentSecurity: false, + enabled: false + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..47601df0d8 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-datetime-attribute.md @@ -0,0 +1,21 @@ +mutation { + databasesCreateDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-document.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-document.md new file mode 100644 index 0000000000..39e4bba1cb --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-document.md @@ -0,0 +1,18 @@ +mutation { + databasesCreateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read("any")"] + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-documents.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-documents.md new file mode 100644 index 0000000000..8ce79dcbb5 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-documents.md @@ -0,0 +1,19 @@ +mutation { + databasesCreateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [] + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..e5845ccd47 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-email-attribute.md @@ -0,0 +1,21 @@ +mutation { + databasesCreateEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "email@example.com", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..d13c080e4a --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-enum-attribute.md @@ -0,0 +1,23 @@ +mutation { + databasesCreateEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + elements: [], + required: false, + default: "<DEFAULT>", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + elements + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..2a270c3aff --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-float-attribute.md @@ -0,0 +1,24 @@ +mutation { + databasesCreateFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + min: 0, + max: 0, + default: 0, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-index.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-index.md new file mode 100644 index 0000000000..38e64980b2 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-index.md @@ -0,0 +1,22 @@ +mutation { + databasesCreateIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + type: "key", + attributes: [], + orders: [], + lengths: [] + ) { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..8c79706817 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-integer-attribute.md @@ -0,0 +1,24 @@ +mutation { + databasesCreateIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + min: 0, + max: 0, + default: 0, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..0f4ad9e139 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-ip-attribute.md @@ -0,0 +1,21 @@ +mutation { + databasesCreateIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..3ecff7a87d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-line-attribute.md @@ -0,0 +1,19 @@ +mutation { + databasesCreateLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..f3ba5285d4 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-point-attribute.md @@ -0,0 +1,19 @@ +mutation { + databasesCreatePointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [1, 2] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..19caa389a5 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-polygon-attribute.md @@ -0,0 +1,19 @@ +mutation { + databasesCreatePolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..f66b87d6af --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-relationship-attribute.md @@ -0,0 +1,27 @@ +mutation { + databasesCreateRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + relatedCollectionId: "<RELATED_COLLECTION_ID>", + type: "oneToOne", + twoWay: false, + key: "", + twoWayKey: "", + onDelete: "cascade" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + relatedCollection + relationType + twoWay + twoWayKey + onDelete + side + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..489f9ce015 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-string-attribute.md @@ -0,0 +1,24 @@ +mutation { + databasesCreateStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + size: 1, + required: false, + default: "<DEFAULT>", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..89ad873e52 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create-url-attribute.md @@ -0,0 +1,21 @@ +mutation { + databasesCreateUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "https://example.com", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/create.md b/docs/examples/1.8.x/server-graphql/examples/databases/create.md new file mode 100644 index 0000000000..6058ddc8be --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/create.md @@ -0,0 +1,14 @@ +mutation { + databasesCreate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..2e7970049d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +mutation { + databasesDecrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, + min: 0 + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/delete-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..af0f9d6615 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/delete-attribute.md @@ -0,0 +1,9 @@ +mutation { + databasesDeleteAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/delete-collection.md b/docs/examples/1.8.x/server-graphql/examples/databases/delete-collection.md new file mode 100644 index 0000000000..8683bd87a4 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/delete-collection.md @@ -0,0 +1,8 @@ +mutation { + databasesDeleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/delete-document.md b/docs/examples/1.8.x/server-graphql/examples/databases/delete-document.md new file mode 100644 index 0000000000..848371bca0 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/delete-document.md @@ -0,0 +1,9 @@ +mutation { + databasesDeleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/delete-documents.md b/docs/examples/1.8.x/server-graphql/examples/databases/delete-documents.md new file mode 100644 index 0000000000..5822d3b950 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/delete-documents.md @@ -0,0 +1,19 @@ +mutation { + databasesDeleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [] + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/delete-index.md b/docs/examples/1.8.x/server-graphql/examples/databases/delete-index.md new file mode 100644 index 0000000000..a2389cf9d4 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/delete-index.md @@ -0,0 +1,9 @@ +mutation { + databasesDeleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/delete.md b/docs/examples/1.8.x/server-graphql/examples/databases/delete.md new file mode 100644 index 0000000000..7cd4c92341 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/delete.md @@ -0,0 +1,7 @@ +mutation { + databasesDelete( + databaseId: "<DATABASE_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/get-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/get-attribute.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/get-collection.md b/docs/examples/1.8.x/server-graphql/examples/databases/get-collection.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/get-document.md b/docs/examples/1.8.x/server-graphql/examples/databases/get-document.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/get-index.md b/docs/examples/1.8.x/server-graphql/examples/databases/get-index.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/get.md b/docs/examples/1.8.x/server-graphql/examples/databases/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..322ed69ced --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +mutation { + databasesIncrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, + max: 0 + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/list-attributes.md b/docs/examples/1.8.x/server-graphql/examples/databases/list-attributes.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/list-collections.md b/docs/examples/1.8.x/server-graphql/examples/databases/list-collections.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/list-documents.md b/docs/examples/1.8.x/server-graphql/examples/databases/list-documents.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/list-indexes.md b/docs/examples/1.8.x/server-graphql/examples/databases/list-indexes.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/list.md b/docs/examples/1.8.x/server-graphql/examples/databases/list.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..d508e62139 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-boolean-attribute.md @@ -0,0 +1,20 @@ +mutation { + databasesUpdateBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: false, + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-collection.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-collection.md new file mode 100644 index 0000000000..ad43b879d2 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-collection.md @@ -0,0 +1,32 @@ +mutation { + databasesUpdateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: ["read("any")"], + documentSecurity: false, + enabled: false + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + documentSecurity + attributes + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + attributes + lengths + orders + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..a21b910edc --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-datetime-attribute.md @@ -0,0 +1,21 @@ +mutation { + databasesUpdateDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-document.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-document.md new file mode 100644 index 0000000000..aea605d9d7 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-document.md @@ -0,0 +1,18 @@ +mutation { + databasesUpdateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{}", + permissions: ["read("any")"] + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-documents.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-documents.md new file mode 100644 index 0000000000..83c0c07f84 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-documents.md @@ -0,0 +1,20 @@ +mutation { + databasesUpdateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: "{}", + queries: [] + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..6c83d80e16 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-email-attribute.md @@ -0,0 +1,21 @@ +mutation { + databasesUpdateEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "email@example.com", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..378e32f9b8 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-enum-attribute.md @@ -0,0 +1,23 @@ +mutation { + databasesUpdateEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + elements: [], + required: false, + default: "<DEFAULT>", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + elements + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..c70232e749 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-float-attribute.md @@ -0,0 +1,24 @@ +mutation { + databasesUpdateFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: 0, + min: 0, + max: 0, + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..b24af5f260 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-integer-attribute.md @@ -0,0 +1,24 @@ +mutation { + databasesUpdateIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: 0, + min: 0, + max: 0, + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..7a26224200 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-ip-attribute.md @@ -0,0 +1,21 @@ +mutation { + databasesUpdateIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..2f96ecf958 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-line-attribute.md @@ -0,0 +1,20 @@ +mutation { + databasesUpdateLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]], + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..b031c3a6ea --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-point-attribute.md @@ -0,0 +1,20 @@ +mutation { + databasesUpdatePointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [1, 2], + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..59498299c6 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-polygon-attribute.md @@ -0,0 +1,20 @@ +mutation { + databasesUpdatePolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..6694540d93 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-relationship-attribute.md @@ -0,0 +1,24 @@ +mutation { + databasesUpdateRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + onDelete: "cascade", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + relatedCollection + relationType + twoWay + twoWayKey + onDelete + side + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..f9398c9ca1 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-string-attribute.md @@ -0,0 +1,23 @@ +mutation { + databasesUpdateStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "<DEFAULT>", + size: 1, + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/server-graphql/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..f9f14a04f6 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update-url-attribute.md @@ -0,0 +1,21 @@ +mutation { + databasesUpdateUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "https://example.com", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/update.md b/docs/examples/1.8.x/server-graphql/examples/databases/update.md new file mode 100644 index 0000000000..bbb7bc6156 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/update.md @@ -0,0 +1,14 @@ +mutation { + databasesUpdate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/upsert-document.md b/docs/examples/1.8.x/server-graphql/examples/databases/upsert-document.md new file mode 100644 index 0000000000..9d1e753081 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/upsert-document.md @@ -0,0 +1,18 @@ +mutation { + databasesUpsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: "{}", + permissions: ["read("any")"] + ) { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/databases/upsert-documents.md b/docs/examples/1.8.x/server-graphql/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..2bfb765915 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/databases/upsert-documents.md @@ -0,0 +1,19 @@ +mutation { + databasesUpsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [] + ) { + total + documents { + _id + _sequence + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/create-deployment.md b/docs/examples/1.8.x/server-graphql/examples/functions/create-deployment.md new file mode 100644 index 0000000000..3751448e57 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/create-deployment.md @@ -0,0 +1,24 @@ +POST /v1/functions/{functionId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="operations" + +{ "query": "mutation { functionsCreateDeployment(functionId: $functionId, code: $code, activate: $activate, entrypoint: $entrypoint, commands: $commands) { id }" }, "variables": { "functionId": "<FUNCTION_ID>", "code": null, "activate": false, "entrypoint": "<ENTRYPOINT>", "commands": "<COMMANDS>" } } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="map" + +{ "0": ["variables.code"], } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="0"; filename="code.ext" + +File contents + +--cec8e8123c05ba25-- diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-graphql/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..bc3587fcec --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,35 @@ +mutation { + functionsCreateDuplicateDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>", + buildId: "<BUILD_ID>" + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/create-execution.md b/docs/examples/1.8.x/server-graphql/examples/functions/create-execution.md new file mode 100644 index 0000000000..ff0ecbe739 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/create-execution.md @@ -0,0 +1,36 @@ +mutation { + functionsCreateExecution( + functionId: "<FUNCTION_ID>", + body: "<BODY>", + async: false, + path: "<PATH>", + method: "GET", + headers: "{}", + scheduledAt: "<SCHEDULED_AT>" + ) { + _id + _createdAt + _updatedAt + _permissions + functionId + deploymentId + trigger + status + requestMethod + requestPath + requestHeaders { + name + value + } + responseStatusCode + responseBody + responseHeaders { + name + value + } + logs + errors + duration + scheduledAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/server-graphql/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..0ce968e5f4 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/create-template-deployment.md @@ -0,0 +1,38 @@ +mutation { + functionsCreateTemplateDeployment( + functionId: "<FUNCTION_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + version: "<VERSION>", + activate: false + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/create-variable.md b/docs/examples/1.8.x/server-graphql/examples/functions/create-variable.md new file mode 100644 index 0000000000..6c64922320 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/create-variable.md @@ -0,0 +1,17 @@ +mutation { + functionsCreateVariable( + functionId: "<FUNCTION_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-graphql/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..60a78c41ca --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/create-vcs-deployment.md @@ -0,0 +1,36 @@ +mutation { + functionsCreateVcsDeployment( + functionId: "<FUNCTION_ID>", + type: "branch", + reference: "<REFERENCE>", + activate: false + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/create.md b/docs/examples/1.8.x/server-graphql/examples/functions/create.md new file mode 100644 index 0000000000..2df77be8ec --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/create.md @@ -0,0 +1,60 @@ +mutation { + functionsCreate( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: "node-14.5", + execute: ["any"], + events: [], + schedule: "", + timeout: 1, + enabled: false, + logging: false, + entrypoint: "<ENTRYPOINT>", + commands: "<COMMANDS>", + scopes: [], + installationId: "<INSTALLATION_ID>", + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", + providerBranch: "<PROVIDER_BRANCH>", + providerSilentMode: false, + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", + specification: "" + ) { + _id + _createdAt + _updatedAt + execute + name + enabled + live + logging + runtime + deploymentId + deploymentCreatedAt + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + events + schedule + timeout + entrypoint + commands + version + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + specification + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/delete-deployment.md b/docs/examples/1.8.x/server-graphql/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..8d83f28d4f --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/delete-deployment.md @@ -0,0 +1,8 @@ +mutation { + functionsDeleteDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/delete-execution.md b/docs/examples/1.8.x/server-graphql/examples/functions/delete-execution.md new file mode 100644 index 0000000000..c6e950afc9 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/delete-execution.md @@ -0,0 +1,8 @@ +mutation { + functionsDeleteExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/delete-variable.md b/docs/examples/1.8.x/server-graphql/examples/functions/delete-variable.md new file mode 100644 index 0000000000..9bc2d9b6e6 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/delete-variable.md @@ -0,0 +1,8 @@ +mutation { + functionsDeleteVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/delete.md b/docs/examples/1.8.x/server-graphql/examples/functions/delete.md new file mode 100644 index 0000000000..db019bf376 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/delete.md @@ -0,0 +1,7 @@ +mutation { + functionsDelete( + functionId: "<FUNCTION_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/server-graphql/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/get-deployment.md b/docs/examples/1.8.x/server-graphql/examples/functions/get-deployment.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/get-execution.md b/docs/examples/1.8.x/server-graphql/examples/functions/get-execution.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/get-variable.md b/docs/examples/1.8.x/server-graphql/examples/functions/get-variable.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/get.md b/docs/examples/1.8.x/server-graphql/examples/functions/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/list-deployments.md b/docs/examples/1.8.x/server-graphql/examples/functions/list-deployments.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/list-executions.md b/docs/examples/1.8.x/server-graphql/examples/functions/list-executions.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/list-runtimes.md b/docs/examples/1.8.x/server-graphql/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/list-specifications.md b/docs/examples/1.8.x/server-graphql/examples/functions/list-specifications.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/list-variables.md b/docs/examples/1.8.x/server-graphql/examples/functions/list-variables.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/list.md b/docs/examples/1.8.x/server-graphql/examples/functions/list.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/server-graphql/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..68735b35ca --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/update-deployment-status.md @@ -0,0 +1,34 @@ +mutation { + functionsUpdateDeploymentStatus( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/server-graphql/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..3ff2220fda --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/update-function-deployment.md @@ -0,0 +1,44 @@ +mutation { + functionsUpdateFunctionDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + execute + name + enabled + live + logging + runtime + deploymentId + deploymentCreatedAt + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + events + schedule + timeout + entrypoint + commands + version + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + specification + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/update-variable.md b/docs/examples/1.8.x/server-graphql/examples/functions/update-variable.md new file mode 100644 index 0000000000..15c8e3bdf3 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/update-variable.md @@ -0,0 +1,18 @@ +mutation { + functionsUpdateVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/functions/update.md b/docs/examples/1.8.x/server-graphql/examples/functions/update.md new file mode 100644 index 0000000000..7510cdc50d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/functions/update.md @@ -0,0 +1,60 @@ +mutation { + functionsUpdate( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: "node-14.5", + execute: ["any"], + events: [], + schedule: "", + timeout: 1, + enabled: false, + logging: false, + entrypoint: "<ENTRYPOINT>", + commands: "<COMMANDS>", + scopes: [], + installationId: "<INSTALLATION_ID>", + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", + providerBranch: "<PROVIDER_BRANCH>", + providerSilentMode: false, + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", + specification: "" + ) { + _id + _createdAt + _updatedAt + execute + name + enabled + live + logging + runtime + deploymentId + deploymentCreatedAt + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + scopes + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + events + schedule + timeout + entrypoint + commands + version + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + specification + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-antivirus.md b/docs/examples/1.8.x/server-graphql/examples/health/get-antivirus.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-cache.md b/docs/examples/1.8.x/server-graphql/examples/health/get-cache.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-certificate.md b/docs/examples/1.8.x/server-graphql/examples/health/get-certificate.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-db.md b/docs/examples/1.8.x/server-graphql/examples/health/get-db.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/server-graphql/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-pub-sub.md b/docs/examples/1.8.x/server-graphql/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-builds.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-databases.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-functions.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-logs.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-mails.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-usage.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-graphql/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-storage-local.md b/docs/examples/1.8.x/server-graphql/examples/health/get-storage-local.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-storage.md b/docs/examples/1.8.x/server-graphql/examples/health/get-storage.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get-time.md b/docs/examples/1.8.x/server-graphql/examples/health/get-time.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/health/get.md b/docs/examples/1.8.x/server-graphql/examples/health/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/locale/get.md b/docs/examples/1.8.x/server-graphql/examples/locale/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/locale/list-codes.md b/docs/examples/1.8.x/server-graphql/examples/locale/list-codes.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/locale/list-continents.md b/docs/examples/1.8.x/server-graphql/examples/locale/list-continents.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/server-graphql/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/server-graphql/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/locale/list-countries.md b/docs/examples/1.8.x/server-graphql/examples/locale/list-countries.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/locale/list-currencies.md b/docs/examples/1.8.x/server-graphql/examples/locale/list-currencies.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/locale/list-languages.md b/docs/examples/1.8.x/server-graphql/examples/locale/list-languages.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..7e2f1480e9 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-apns-provider.md @@ -0,0 +1,22 @@ +mutation { + messagingCreateAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + authKey: "<AUTH_KEY>", + authKeyId: "<AUTH_KEY_ID>", + teamId: "<TEAM_ID>", + bundleId: "<BUNDLE_ID>", + sandbox: false, + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-email.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-email.md new file mode 100644 index 0000000000..a1e35aad19 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-email.md @@ -0,0 +1,30 @@ +mutation { + messagingCreateEmail( + messageId: "<MESSAGE_ID>", + subject: "<SUBJECT>", + content: "<CONTENT>", + topics: [], + users: [], + targets: [], + cc: [], + bcc: [], + attachments: [], + draft: false, + html: false, + scheduledAt: "" + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..b2e524536f --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-fcm-provider.md @@ -0,0 +1,18 @@ +mutation { + messagingCreateFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + serviceAccountJSON: "{}", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..9da1e23847 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,24 @@ +mutation { + messagingCreateMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", + domain: "<DOMAIN>", + isEuRegion: false, + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "email@example.com", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..ddaf2d4c2b --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,20 @@ +mutation { + messagingCreateMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + templateId: "<TEMPLATE_ID>", + senderId: "<SENDER_ID>", + authKey: "<AUTH_KEY>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-push.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-push.md new file mode 100644 index 0000000000..92264d1b67 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-push.md @@ -0,0 +1,37 @@ +mutation { + messagingCreatePush( + messageId: "<MESSAGE_ID>", + title: "<TITLE>", + body: "<BODY>", + topics: [], + users: [], + targets: [], + data: "{}", + action: "<ACTION>", + image: "[ID1:ID2]", + icon: "<ICON>", + sound: "<SOUND>", + color: "<COLOR>", + tag: "<TAG>", + badge: 0, + draft: false, + scheduledAt: "", + contentAvailable: false, + critical: false, + priority: "normal" + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..cda0652d67 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,22 @@ +mutation { + messagingCreateSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "email@example.com", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-sms.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-sms.md new file mode 100644 index 0000000000..1adeff586f --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-sms.md @@ -0,0 +1,25 @@ +mutation { + messagingCreateSMS( + messageId: "<MESSAGE_ID>", + content: "<CONTENT>", + topics: [], + users: [], + targets: [], + draft: false, + scheduledAt: "" + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..ea16765677 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-smtp-provider.md @@ -0,0 +1,28 @@ +mutation { + messagingCreateSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + host: "<HOST>", + port: 1, + username: "<USERNAME>", + password: "<PASSWORD>", + encryption: "none", + autoTLS: false, + mailer: "<MAILER>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "email@example.com", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..bab53612b7 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-subscriber.md @@ -0,0 +1,27 @@ +mutation { + messagingCreateSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>", + targetId: "<TARGET_ID>" + ) { + _id + _createdAt + _updatedAt + targetId + target { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + userId + userName + topicId + providerType + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..7960a8427f --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-telesign-provider.md @@ -0,0 +1,20 @@ +mutation { + messagingCreateTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", + customerId: "<CUSTOMER_ID>", + apiKey: "<API_KEY>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..e082097b70 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,20 @@ +mutation { + messagingCreateTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", + username: "<USERNAME>", + apiKey: "<API_KEY>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-topic.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-topic.md new file mode 100644 index 0000000000..6216c4cda5 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-topic.md @@ -0,0 +1,16 @@ +mutation { + messagingCreateTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", + subscribe: ["any"] + ) { + _id + _createdAt + _updatedAt + name + emailTotal + smsTotal + pushTotal + subscribe + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..ac14d1d32b --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-twilio-provider.md @@ -0,0 +1,20 @@ +mutation { + messagingCreateTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", + accountSid: "<ACCOUNT_SID>", + authToken: "<AUTH_TOKEN>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..ca7a710896 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/create-vonage-provider.md @@ -0,0 +1,20 @@ +mutation { + messagingCreateVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", + apiKey: "<API_KEY>", + apiSecret: "<API_SECRET>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/delete-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..8d9ac35953 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/delete-provider.md @@ -0,0 +1,7 @@ +mutation { + messagingDeleteProvider( + providerId: "<PROVIDER_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-graphql/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..ededffcaac --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/delete-subscriber.md @@ -0,0 +1,8 @@ +mutation { + messagingDeleteSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/delete-topic.md b/docs/examples/1.8.x/server-graphql/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..e49cd1ed91 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/delete-topic.md @@ -0,0 +1,7 @@ +mutation { + messagingDeleteTopic( + topicId: "<TOPIC_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/delete.md b/docs/examples/1.8.x/server-graphql/examples/messaging/delete.md new file mode 100644 index 0000000000..495557ef18 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/delete.md @@ -0,0 +1,7 @@ +mutation { + messagingDelete( + messageId: "<MESSAGE_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/get-message.md b/docs/examples/1.8.x/server-graphql/examples/messaging/get-message.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/get-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/get-provider.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/server-graphql/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/get-topic.md b/docs/examples/1.8.x/server-graphql/examples/messaging/get-topic.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/server-graphql/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/list-messages.md b/docs/examples/1.8.x/server-graphql/examples/messaging/list-messages.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-graphql/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/list-providers.md b/docs/examples/1.8.x/server-graphql/examples/messaging/list-providers.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-graphql/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/server-graphql/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/list-targets.md b/docs/examples/1.8.x/server-graphql/examples/messaging/list-targets.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-graphql/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/list-topics.md b/docs/examples/1.8.x/server-graphql/examples/messaging/list-topics.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..c1eb27aaeb --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-apns-provider.md @@ -0,0 +1,22 @@ +mutation { + messagingUpdateAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + authKey: "<AUTH_KEY>", + authKeyId: "<AUTH_KEY_ID>", + teamId: "<TEAM_ID>", + bundleId: "<BUNDLE_ID>", + sandbox: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-email.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-email.md new file mode 100644 index 0000000000..1d1302efc4 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-email.md @@ -0,0 +1,30 @@ +mutation { + messagingUpdateEmail( + messageId: "<MESSAGE_ID>", + topics: [], + users: [], + targets: [], + subject: "<SUBJECT>", + content: "<CONTENT>", + draft: false, + html: false, + cc: [], + bcc: [], + scheduledAt: "", + attachments: [] + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..db3be401ee --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-fcm-provider.md @@ -0,0 +1,18 @@ +mutation { + messagingUpdateFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + serviceAccountJSON: "{}" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..6c26d52ff2 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,24 @@ +mutation { + messagingUpdateMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", + domain: "<DOMAIN>", + isEuRegion: false, + enabled: false, + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "<REPLY_TO_EMAIL>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..a6552a4734 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,20 @@ +mutation { + messagingUpdateMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + templateId: "<TEMPLATE_ID>", + senderId: "<SENDER_ID>", + authKey: "<AUTH_KEY>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-push.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-push.md new file mode 100644 index 0000000000..8ee2f57610 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-push.md @@ -0,0 +1,37 @@ +mutation { + messagingUpdatePush( + messageId: "<MESSAGE_ID>", + topics: [], + users: [], + targets: [], + title: "<TITLE>", + body: "<BODY>", + data: "{}", + action: "<ACTION>", + image: "[ID1:ID2]", + icon: "<ICON>", + sound: "<SOUND>", + color: "<COLOR>", + tag: "<TAG>", + badge: 0, + draft: false, + scheduledAt: "", + contentAvailable: false, + critical: false, + priority: "normal" + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..319dcea461 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,22 @@ +mutation { + messagingUpdateSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + apiKey: "<API_KEY>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "<REPLY_TO_EMAIL>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-sms.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-sms.md new file mode 100644 index 0000000000..e056cd6d8a --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-sms.md @@ -0,0 +1,25 @@ +mutation { + messagingUpdateSMS( + messageId: "<MESSAGE_ID>", + topics: [], + users: [], + targets: [], + content: "<CONTENT>", + draft: false, + scheduledAt: "" + ) { + _id + _createdAt + _updatedAt + providerType + topics + users + targets + scheduledAt + deliveredAt + deliveryErrors + deliveredTotal + data + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..dada7d3fb3 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-smtp-provider.md @@ -0,0 +1,28 @@ +mutation { + messagingUpdateSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + host: "<HOST>", + port: 1, + username: "<USERNAME>", + password: "<PASSWORD>", + encryption: "none", + autoTLS: false, + mailer: "<MAILER>", + fromName: "<FROM_NAME>", + fromEmail: "email@example.com", + replyToName: "<REPLY_TO_NAME>", + replyToEmail: "<REPLY_TO_EMAIL>", + enabled: false + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..c9c96c0d5d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-telesign-provider.md @@ -0,0 +1,20 @@ +mutation { + messagingUpdateTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + customerId: "<CUSTOMER_ID>", + apiKey: "<API_KEY>", + from: "<FROM>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..3fd68ed8e9 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,20 @@ +mutation { + messagingUpdateTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + username: "<USERNAME>", + apiKey: "<API_KEY>", + from: "<FROM>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-topic.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-topic.md new file mode 100644 index 0000000000..8d3dc84c72 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-topic.md @@ -0,0 +1,16 @@ +mutation { + messagingUpdateTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", + subscribe: ["any"] + ) { + _id + _createdAt + _updatedAt + name + emailTotal + smsTotal + pushTotal + subscribe + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..6f10839567 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-twilio-provider.md @@ -0,0 +1,20 @@ +mutation { + messagingUpdateTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + accountSid: "<ACCOUNT_SID>", + authToken: "<AUTH_TOKEN>", + from: "<FROM>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-graphql/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..f42670a428 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/messaging/update-vonage-provider.md @@ -0,0 +1,20 @@ +mutation { + messagingUpdateVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + enabled: false, + apiKey: "<API_KEY>", + apiSecret: "<API_SECRET>", + from: "<FROM>" + ) { + _id + _createdAt + _updatedAt + name + provider + enabled + type + credentials + options + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/create-deployment.md b/docs/examples/1.8.x/server-graphql/examples/sites/create-deployment.md new file mode 100644 index 0000000000..26970a18a8 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/create-deployment.md @@ -0,0 +1,24 @@ +POST /v1/sites/{siteId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="operations" + +{ "query": "mutation { sitesCreateDeployment(siteId: $siteId, code: $code, activate: $activate, installCommand: $installCommand, buildCommand: $buildCommand, outputDirectory: $outputDirectory) { id }" }, "variables": { "siteId": "<SITE_ID>", "code": null, "activate": false, "installCommand": "<INSTALL_COMMAND>", "buildCommand": "<BUILD_COMMAND>", "outputDirectory": "<OUTPUT_DIRECTORY>" } } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="map" + +{ "0": ["variables.code"], } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="0"; filename="code.ext" + +File contents + +--cec8e8123c05ba25-- diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-graphql/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..1b2d3dc131 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,34 @@ +mutation { + sitesCreateDuplicateDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/server-graphql/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..f63d8c5e5a --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/create-template-deployment.md @@ -0,0 +1,38 @@ +mutation { + sitesCreateTemplateDeployment( + siteId: "<SITE_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + version: "<VERSION>", + activate: false + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/create-variable.md b/docs/examples/1.8.x/server-graphql/examples/sites/create-variable.md new file mode 100644 index 0000000000..6bc92de43a --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/create-variable.md @@ -0,0 +1,17 @@ +mutation { + sitesCreateVariable( + siteId: "<SITE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-graphql/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..6c5241e734 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/create-vcs-deployment.md @@ -0,0 +1,36 @@ +mutation { + sitesCreateVcsDeployment( + siteId: "<SITE_ID>", + type: "branch", + reference: "<REFERENCE>", + activate: false + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/create.md b/docs/examples/1.8.x/server-graphql/examples/sites/create.md new file mode 100644 index 0000000000..bb89ac9344 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/create.md @@ -0,0 +1,61 @@ +mutation { + sitesCreate( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: "analog", + buildRuntime: "node-14.5", + enabled: false, + logging: false, + timeout: 1, + installCommand: "<INSTALL_COMMAND>", + buildCommand: "<BUILD_COMMAND>", + outputDirectory: "<OUTPUT_DIRECTORY>", + adapter: "static", + installationId: "<INSTALLATION_ID>", + fallbackFile: "<FALLBACK_FILE>", + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", + providerBranch: "<PROVIDER_BRANCH>", + providerSilentMode: false, + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", + specification: "" + ) { + _id + _createdAt + _updatedAt + name + enabled + live + logging + framework + deploymentId + deploymentCreatedAt + deploymentScreenshotLight + deploymentScreenshotDark + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + timeout + installCommand + buildCommand + outputDirectory + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + specification + buildRuntime + adapter + fallbackFile + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/delete-deployment.md b/docs/examples/1.8.x/server-graphql/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..443a951cee --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/delete-deployment.md @@ -0,0 +1,8 @@ +mutation { + sitesDeleteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/delete-log.md b/docs/examples/1.8.x/server-graphql/examples/sites/delete-log.md new file mode 100644 index 0000000000..60f27218c0 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/delete-log.md @@ -0,0 +1,8 @@ +mutation { + sitesDeleteLog( + siteId: "<SITE_ID>", + logId: "<LOG_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/delete-variable.md b/docs/examples/1.8.x/server-graphql/examples/sites/delete-variable.md new file mode 100644 index 0000000000..2f86eddff1 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/delete-variable.md @@ -0,0 +1,8 @@ +mutation { + sitesDeleteVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/delete.md b/docs/examples/1.8.x/server-graphql/examples/sites/delete.md new file mode 100644 index 0000000000..35138f6d4f --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/delete.md @@ -0,0 +1,7 @@ +mutation { + sitesDelete( + siteId: "<SITE_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/server-graphql/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/get-deployment.md b/docs/examples/1.8.x/server-graphql/examples/sites/get-deployment.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/get-log.md b/docs/examples/1.8.x/server-graphql/examples/sites/get-log.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/get-variable.md b/docs/examples/1.8.x/server-graphql/examples/sites/get-variable.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/get.md b/docs/examples/1.8.x/server-graphql/examples/sites/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/list-deployments.md b/docs/examples/1.8.x/server-graphql/examples/sites/list-deployments.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/list-frameworks.md b/docs/examples/1.8.x/server-graphql/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/list-logs.md b/docs/examples/1.8.x/server-graphql/examples/sites/list-logs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/list-specifications.md b/docs/examples/1.8.x/server-graphql/examples/sites/list-specifications.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/list-variables.md b/docs/examples/1.8.x/server-graphql/examples/sites/list-variables.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/list.md b/docs/examples/1.8.x/server-graphql/examples/sites/list.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/server-graphql/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..24064428e2 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/update-deployment-status.md @@ -0,0 +1,34 @@ +mutation { + sitesUpdateDeploymentStatus( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + type + resourceId + resourceType + entrypoint + sourceSize + buildSize + totalSize + buildId + activate + screenshotLight + screenshotDark + status + buildLogs + buildDuration + providerRepositoryName + providerRepositoryOwner + providerRepositoryUrl + providerCommitHash + providerCommitAuthorUrl + providerCommitAuthor + providerCommitMessage + providerCommitUrl + providerBranch + providerBranchUrl + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/server-graphql/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..6c09c03735 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/update-site-deployment.md @@ -0,0 +1,45 @@ +mutation { + sitesUpdateSiteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" + ) { + _id + _createdAt + _updatedAt + name + enabled + live + logging + framework + deploymentId + deploymentCreatedAt + deploymentScreenshotLight + deploymentScreenshotDark + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + timeout + installCommand + buildCommand + outputDirectory + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + specification + buildRuntime + adapter + fallbackFile + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/update-variable.md b/docs/examples/1.8.x/server-graphql/examples/sites/update-variable.md new file mode 100644 index 0000000000..240dca60f3 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/update-variable.md @@ -0,0 +1,18 @@ +mutation { + sitesUpdateVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false + ) { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/sites/update.md b/docs/examples/1.8.x/server-graphql/examples/sites/update.md new file mode 100644 index 0000000000..801eca3161 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/sites/update.md @@ -0,0 +1,61 @@ +mutation { + sitesUpdate( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: "analog", + enabled: false, + logging: false, + timeout: 1, + installCommand: "<INSTALL_COMMAND>", + buildCommand: "<BUILD_COMMAND>", + outputDirectory: "<OUTPUT_DIRECTORY>", + buildRuntime: "node-14.5", + adapter: "static", + fallbackFile: "<FALLBACK_FILE>", + installationId: "<INSTALLATION_ID>", + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", + providerBranch: "<PROVIDER_BRANCH>", + providerSilentMode: false, + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", + specification: "" + ) { + _id + _createdAt + _updatedAt + name + enabled + live + logging + framework + deploymentId + deploymentCreatedAt + deploymentScreenshotLight + deploymentScreenshotDark + latestDeploymentId + latestDeploymentCreatedAt + latestDeploymentStatus + vars { + _id + _createdAt + _updatedAt + key + value + secret + resourceType + resourceId + } + timeout + installCommand + buildCommand + outputDirectory + installationId + providerRepositoryId + providerBranch + providerRootDirectory + providerSilentMode + specification + buildRuntime + adapter + fallbackFile + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/create-bucket.md b/docs/examples/1.8.x/server-graphql/examples/storage/create-bucket.md new file mode 100644 index 0000000000..45d03802d2 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/storage/create-bucket.md @@ -0,0 +1,27 @@ +mutation { + storageCreateBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: ["read("any")"], + fileSecurity: false, + enabled: false, + maximumFileSize: 1, + allowedFileExtensions: [], + compression: "none", + encryption: false, + antivirus: false + ) { + _id + _createdAt + _updatedAt + _permissions + fileSecurity + name + enabled + maximumFileSize + allowedFileExtensions + compression + encryption + antivirus + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/create-file.md b/docs/examples/1.8.x/server-graphql/examples/storage/create-file.md new file mode 100644 index 0000000000..70bf6cbb1f --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/storage/create-file.md @@ -0,0 +1,26 @@ +POST /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="operations" + +{ "query": "mutation { storageCreateFile(bucketId: $bucketId, fileId: $fileId, file: $file, permissions: $permissions) { id }" }, "variables": { "bucketId": "<BUCKET_ID>", "fileId": "<FILE_ID>", "file": null, "permissions": ["read("any")"] } } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="map" + +{ "0": ["variables.file"], } + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="0"; filename="file.ext" + +File contents + +--cec8e8123c05ba25-- diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/delete-bucket.md b/docs/examples/1.8.x/server-graphql/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..3dadd1f072 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/storage/delete-bucket.md @@ -0,0 +1,7 @@ +mutation { + storageDeleteBucket( + bucketId: "<BUCKET_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/delete-file.md b/docs/examples/1.8.x/server-graphql/examples/storage/delete-file.md new file mode 100644 index 0000000000..17ec89931a --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/storage/delete-file.md @@ -0,0 +1,8 @@ +mutation { + storageDeleteFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/get-bucket.md b/docs/examples/1.8.x/server-graphql/examples/storage/get-bucket.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/get-file-download.md b/docs/examples/1.8.x/server-graphql/examples/storage/get-file-download.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/get-file-preview.md b/docs/examples/1.8.x/server-graphql/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/get-file-view.md b/docs/examples/1.8.x/server-graphql/examples/storage/get-file-view.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/get-file.md b/docs/examples/1.8.x/server-graphql/examples/storage/get-file.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/list-buckets.md b/docs/examples/1.8.x/server-graphql/examples/storage/list-buckets.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/list-files.md b/docs/examples/1.8.x/server-graphql/examples/storage/list-files.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/update-bucket.md b/docs/examples/1.8.x/server-graphql/examples/storage/update-bucket.md new file mode 100644 index 0000000000..8265a15a58 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/storage/update-bucket.md @@ -0,0 +1,27 @@ +mutation { + storageUpdateBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: ["read("any")"], + fileSecurity: false, + enabled: false, + maximumFileSize: 1, + allowedFileExtensions: [], + compression: "none", + encryption: false, + antivirus: false + ) { + _id + _createdAt + _updatedAt + _permissions + fileSecurity + name + enabled + maximumFileSize + allowedFileExtensions + compression + encryption + antivirus + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/storage/update-file.md b/docs/examples/1.8.x/server-graphql/examples/storage/update-file.md new file mode 100644 index 0000000000..b7832048c7 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/storage/update-file.md @@ -0,0 +1,20 @@ +mutation { + storageUpdateFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + name: "<NAME>", + permissions: ["read("any")"] + ) { + _id + bucketId + _createdAt + _updatedAt + _permissions + name + signature + mimeType + sizeOriginal + chunksTotal + chunksUploaded + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..e137c6bd3d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,20 @@ +mutation { + tablesDBCreateBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: false, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..bad8c08bd4 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,21 @@ +mutation { + tablesDBCreateDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..76d286f934 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-email-column.md @@ -0,0 +1,21 @@ +mutation { + tablesDBCreateEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "email@example.com", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..7a7b2d3950 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-enum-column.md @@ -0,0 +1,23 @@ +mutation { + tablesDBCreateEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + elements: [], + required: false, + default: "<DEFAULT>", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + elements + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..46cb266032 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-float-column.md @@ -0,0 +1,24 @@ +mutation { + tablesDBCreateFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + min: 0, + max: 0, + default: 0, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-index.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..530ac45773 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-index.md @@ -0,0 +1,22 @@ +mutation { + tablesDBCreateIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + type: "key", + columns: [], + orders: [], + lengths: [] + ) { + _id + _createdAt + _updatedAt + key + type + status + error + columns + lengths + orders + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..96e232a16d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-integer-column.md @@ -0,0 +1,24 @@ +mutation { + tablesDBCreateIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + min: 0, + max: 0, + default: 0, + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..5e48bbe805 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-ip-column.md @@ -0,0 +1,21 @@ +mutation { + tablesDBCreateIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..67fed4416c --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-line-column.md @@ -0,0 +1,19 @@ +mutation { + tablesDBCreateLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..20f31dc9c1 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-point-column.md @@ -0,0 +1,19 @@ +mutation { + tablesDBCreatePointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [1, 2] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..7f349c03b9 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,19 @@ +mutation { + tablesDBCreatePolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..9ecd70ab55 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,27 @@ +mutation { + tablesDBCreateRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + relatedTableId: "<RELATED_TABLE_ID>", + type: "oneToOne", + twoWay: false, + key: "", + twoWayKey: "", + onDelete: "cascade" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + relatedTable + relationType + twoWay + twoWayKey + onDelete + side + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-row.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..c7d2ec7d03 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-row.md @@ -0,0 +1,18 @@ +mutation { + tablesDBCreateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}", + permissions: ["read("any")"] + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..25dc9a367d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-rows.md @@ -0,0 +1,19 @@ +mutation { + tablesDBCreateRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: [] + ) { + total + rows { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..453e692aae --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-string-column.md @@ -0,0 +1,24 @@ +mutation { + tablesDBCreateStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + size: 1, + required: false, + default: "<DEFAULT>", + array: false, + encrypt: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-table.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..61203b9359 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-table.md @@ -0,0 +1,32 @@ +mutation { + tablesDBCreateTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", + permissions: ["read("any")"], + rowSecurity: false, + enabled: false + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + rowSecurity + columns + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + columns + lengths + orders + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..0fdbba66c2 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create-url-column.md @@ -0,0 +1,21 @@ +mutation { + tablesDBCreateUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "https://example.com", + array: false + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/create.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create.md new file mode 100644 index 0000000000..5e3490229b --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/create.md @@ -0,0 +1,14 @@ +mutation { + tablesDBCreate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..398ec19901 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,19 @@ +mutation { + tablesDBDecrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "", + value: 0, + min: 0 + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..5e7011bc6a --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-column.md @@ -0,0 +1,9 @@ +mutation { + tablesDBDeleteColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..3d58300005 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-index.md @@ -0,0 +1,9 @@ +mutation { + tablesDBDeleteIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..1a08b0f60d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-row.md @@ -0,0 +1,9 @@ +mutation { + tablesDBDeleteRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..dfa7c13779 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-rows.md @@ -0,0 +1,19 @@ +mutation { + tablesDBDeleteRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [] + ) { + total + rows { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..9894ba4cc5 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete-table.md @@ -0,0 +1,8 @@ +mutation { + tablesDBDeleteTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete.md new file mode 100644 index 0000000000..4c6bd3e645 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/delete.md @@ -0,0 +1,7 @@ +mutation { + tablesDBDelete( + databaseId: "<DATABASE_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/get-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/get-index.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/get-row.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/get-table.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/get.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..b7ff87f387 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/increment-row-column.md @@ -0,0 +1,19 @@ +mutation { + tablesDBIncrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "", + value: 0, + max: 0 + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/list.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/list.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..11fb782eeb --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,20 @@ +mutation { + tablesDBUpdateBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: false, + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..5e7cf0b761 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,21 @@ +mutation { + tablesDBUpdateDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..16274b798d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-email-column.md @@ -0,0 +1,21 @@ +mutation { + tablesDBUpdateEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "email@example.com", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..a14745bad9 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-enum-column.md @@ -0,0 +1,23 @@ +mutation { + tablesDBUpdateEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + elements: [], + required: false, + default: "<DEFAULT>", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + elements + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..6320721bd0 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-float-column.md @@ -0,0 +1,24 @@ +mutation { + tablesDBUpdateFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: 0, + min: 0, + max: 0, + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..57d7b27fec --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-integer-column.md @@ -0,0 +1,24 @@ +mutation { + tablesDBUpdateIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: 0, + min: 0, + max: 0, + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + min + max + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..c14f286718 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-ip-column.md @@ -0,0 +1,21 @@ +mutation { + tablesDBUpdateIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..ebb7bb1749 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-line-column.md @@ -0,0 +1,20 @@ +mutation { + tablesDBUpdateLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]], + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..81d75c3b19 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-point-column.md @@ -0,0 +1,20 @@ +mutation { + tablesDBUpdatePointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [1, 2], + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..3b291a452c --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,20 @@ +mutation { + tablesDBUpdatePolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..95ebb86fdd --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,24 @@ +mutation { + tablesDBUpdateRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + onDelete: "cascade", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + relatedTable + relationType + twoWay + twoWayKey + onDelete + side + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-row.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..5a5b288ab8 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-row.md @@ -0,0 +1,18 @@ +mutation { + tablesDBUpdateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: "{}", + permissions: ["read("any")"] + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..4816748352 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-rows.md @@ -0,0 +1,20 @@ +mutation { + tablesDBUpdateRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + data: "{}", + queries: [] + ) { + total + rows { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..cbbebf632a --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-string-column.md @@ -0,0 +1,23 @@ +mutation { + tablesDBUpdateStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "<DEFAULT>", + size: 1, + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + size + default + encrypt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-table.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..b19a3603b2 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-table.md @@ -0,0 +1,32 @@ +mutation { + tablesDBUpdateTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", + permissions: ["read("any")"], + rowSecurity: false, + enabled: false + ) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + enabled + rowSecurity + columns + indexes { + _id + _createdAt + _updatedAt + key + type + status + error + columns + lengths + orders + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..a823846347 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update-url-column.md @@ -0,0 +1,21 @@ +mutation { + tablesDBUpdateUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "https://example.com", + newKey: "" + ) { + key + type + status + error + required + array + _createdAt + _updatedAt + format + default + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/update.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update.md new file mode 100644 index 0000000000..9c77c69735 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/update.md @@ -0,0 +1,14 @@ +mutation { + tablesDBUpdate( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false + ) { + _id + name + _createdAt + _updatedAt + enabled + type + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..cc3b63de4a --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/upsert-row.md @@ -0,0 +1,18 @@ +mutation { + tablesDBUpsertRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: "{}", + permissions: ["read("any")"] + ) { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-graphql/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..f4e01c0af7 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tablesdb/upsert-rows.md @@ -0,0 +1,19 @@ +mutation { + tablesDBUpsertRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: [] + ) { + total + rows { + _id + _sequence + _tableId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/create-membership.md b/docs/examples/1.8.x/server-graphql/examples/teams/create-membership.md new file mode 100644 index 0000000000..fe741f080d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/teams/create-membership.md @@ -0,0 +1,25 @@ +mutation { + teamsCreateMembership( + teamId: "<TEAM_ID>", + roles: [], + email: "email@example.com", + userId: "<USER_ID>", + phone: "+12065550100", + url: "https://example.com", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + teamId + teamName + invited + joined + confirm + mfa + roles + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/create.md b/docs/examples/1.8.x/server-graphql/examples/teams/create.md new file mode 100644 index 0000000000..1f2a7ab3f2 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/teams/create.md @@ -0,0 +1,16 @@ +mutation { + teamsCreate( + teamId: "<TEAM_ID>", + name: "<NAME>", + roles: [] + ) { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/delete-membership.md b/docs/examples/1.8.x/server-graphql/examples/teams/delete-membership.md new file mode 100644 index 0000000000..e391b6f6fa --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/teams/delete-membership.md @@ -0,0 +1,8 @@ +mutation { + teamsDeleteMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/delete.md b/docs/examples/1.8.x/server-graphql/examples/teams/delete.md new file mode 100644 index 0000000000..df0d36c5b5 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/teams/delete.md @@ -0,0 +1,7 @@ +mutation { + teamsDelete( + teamId: "<TEAM_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/get-membership.md b/docs/examples/1.8.x/server-graphql/examples/teams/get-membership.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/get-prefs.md b/docs/examples/1.8.x/server-graphql/examples/teams/get-prefs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/get.md b/docs/examples/1.8.x/server-graphql/examples/teams/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/list-memberships.md b/docs/examples/1.8.x/server-graphql/examples/teams/list-memberships.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/list.md b/docs/examples/1.8.x/server-graphql/examples/teams/list.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/update-membership-status.md b/docs/examples/1.8.x/server-graphql/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..9b24450a86 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/teams/update-membership-status.md @@ -0,0 +1,22 @@ +mutation { + teamsUpdateMembershipStatus( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + userId: "<USER_ID>", + secret: "<SECRET>" + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + teamId + teamName + invited + joined + confirm + mfa + roles + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/update-membership.md b/docs/examples/1.8.x/server-graphql/examples/teams/update-membership.md new file mode 100644 index 0000000000..1c6a04f078 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/teams/update-membership.md @@ -0,0 +1,21 @@ +mutation { + teamsUpdateMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + roles: [] + ) { + _id + _createdAt + _updatedAt + userId + userName + userEmail + teamId + teamName + invited + joined + confirm + mfa + roles + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/update-name.md b/docs/examples/1.8.x/server-graphql/examples/teams/update-name.md new file mode 100644 index 0000000000..c40543b5cd --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/teams/update-name.md @@ -0,0 +1,15 @@ +mutation { + teamsUpdateName( + teamId: "<TEAM_ID>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + total + prefs { + data + } + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/teams/update-prefs.md b/docs/examples/1.8.x/server-graphql/examples/teams/update-prefs.md new file mode 100644 index 0000000000..95737e33f9 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/teams/update-prefs.md @@ -0,0 +1,8 @@ +mutation { + teamsUpdatePrefs( + teamId: "<TEAM_ID>", + prefs: "{}" + ) { + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tokens/create-file-token.md b/docs/examples/1.8.x/server-graphql/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..22cff062fa --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tokens/create-file-token.md @@ -0,0 +1,15 @@ +mutation { + tokensCreateFileToken( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + expire: "" + ) { + _id + _createdAt + resourceId + resourceType + expire + secret + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tokens/delete.md b/docs/examples/1.8.x/server-graphql/examples/tokens/delete.md new file mode 100644 index 0000000000..b13ad72f6b --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tokens/delete.md @@ -0,0 +1,7 @@ +mutation { + tokensDelete( + tokenId: "<TOKEN_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/tokens/get.md b/docs/examples/1.8.x/server-graphql/examples/tokens/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tokens/list.md b/docs/examples/1.8.x/server-graphql/examples/tokens/list.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/tokens/update.md b/docs/examples/1.8.x/server-graphql/examples/tokens/update.md new file mode 100644 index 0000000000..2f7324fd04 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/tokens/update.md @@ -0,0 +1,14 @@ +mutation { + tokensUpdate( + tokenId: "<TOKEN_ID>", + expire: "" + ) { + _id + _createdAt + resourceId + resourceType + expire + secret + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/server-graphql/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..7f99622e52 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-argon-2-user.md @@ -0,0 +1,40 @@ +mutation { + usersCreateArgon2User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-graphql/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..26659176eb --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-bcrypt-user.md @@ -0,0 +1,40 @@ +mutation { + usersCreateBcryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-jwt.md b/docs/examples/1.8.x/server-graphql/examples/users/create-jwt.md new file mode 100644 index 0000000000..bf0b1bd638 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-jwt.md @@ -0,0 +1,9 @@ +mutation { + usersCreateJWT( + userId: "<USER_ID>", + sessionId: "<SESSION_ID>", + duration: 0 + ) { + jwt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-md-5-user.md b/docs/examples/1.8.x/server-graphql/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..7e642b8233 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-md-5-user.md @@ -0,0 +1,40 @@ +mutation { + usersCreateMD5User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-graphql/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..5c329f5e0b --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +mutation { + usersCreateMFARecoveryCodes( + userId: "<USER_ID>" + ) { + recoveryCodes + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-graphql/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..4c06b007a2 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-ph-pass-user.md @@ -0,0 +1,40 @@ +mutation { + usersCreatePHPassUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-graphql/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..624ffcdd38 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,43 @@ +mutation { + usersCreateScryptModifiedUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordSaltSeparator: "<PASSWORD_SALT_SEPARATOR>", + passwordSignerKey: "<PASSWORD_SIGNER_KEY>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/server-graphql/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..68a5f4c75f --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-scrypt-user.md @@ -0,0 +1,45 @@ +mutation { + usersCreateScryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordCpu: 0, + passwordMemory: 0, + passwordParallel: 0, + passwordLength: 0, + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-session.md b/docs/examples/1.8.x/server-graphql/examples/users/create-session.md new file mode 100644 index 0000000000..701ddf501f --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-session.md @@ -0,0 +1,35 @@ +mutation { + usersCreateSession( + userId: "<USER_ID>" + ) { + _id + _createdAt + _updatedAt + userId + expire + provider + providerUid + providerAccessToken + providerAccessTokenExpiry + providerRefreshToken + ip + osCode + osName + osVersion + clientType + clientCode + clientName + clientVersion + clientEngine + clientEngineVersion + deviceName + deviceBrand + deviceModel + countryCode + countryName + current + factors + secret + mfaUpdatedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-sha-user.md b/docs/examples/1.8.x/server-graphql/examples/users/create-sha-user.md new file mode 100644 index 0000000000..f99da2752d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-sha-user.md @@ -0,0 +1,41 @@ +mutation { + usersCreateSHAUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordVersion: "sha1", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-target.md b/docs/examples/1.8.x/server-graphql/examples/users/create-target.md new file mode 100644 index 0000000000..7068c21aba --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-target.md @@ -0,0 +1,20 @@ +mutation { + usersCreateTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + providerType: "email", + identifier: "<IDENTIFIER>", + providerId: "<PROVIDER_ID>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create-token.md b/docs/examples/1.8.x/server-graphql/examples/users/create-token.md new file mode 100644 index 0000000000..78255f7676 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create-token.md @@ -0,0 +1,14 @@ +mutation { + usersCreateToken( + userId: "<USER_ID>", + length: 4, + expire: 60 + ) { + _id + _createdAt + userId + secret + expire + phrase + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/create.md b/docs/examples/1.8.x/server-graphql/examples/users/create.md new file mode 100644 index 0000000000..465da80432 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/create.md @@ -0,0 +1,41 @@ +mutation { + usersCreate( + userId: "<USER_ID>", + email: "email@example.com", + phone: "+12065550100", + password: "", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/delete-identity.md b/docs/examples/1.8.x/server-graphql/examples/users/delete-identity.md new file mode 100644 index 0000000000..1ea0d990b1 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/delete-identity.md @@ -0,0 +1,7 @@ +mutation { + usersDeleteIdentity( + identityId: "<IDENTITY_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-graphql/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..2e7ea73733 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,8 @@ +mutation { + usersDeleteMFAAuthenticator( + userId: "<USER_ID>", + type: "totp" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/delete-session.md b/docs/examples/1.8.x/server-graphql/examples/users/delete-session.md new file mode 100644 index 0000000000..7e6538b34a --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/delete-session.md @@ -0,0 +1,8 @@ +mutation { + usersDeleteSession( + userId: "<USER_ID>", + sessionId: "<SESSION_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/delete-sessions.md b/docs/examples/1.8.x/server-graphql/examples/users/delete-sessions.md new file mode 100644 index 0000000000..d1ccaa26f4 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/delete-sessions.md @@ -0,0 +1,7 @@ +mutation { + usersDeleteSessions( + userId: "<USER_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/delete-target.md b/docs/examples/1.8.x/server-graphql/examples/users/delete-target.md new file mode 100644 index 0000000000..92d0a16ac5 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/delete-target.md @@ -0,0 +1,8 @@ +mutation { + usersDeleteTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/delete.md b/docs/examples/1.8.x/server-graphql/examples/users/delete.md new file mode 100644 index 0000000000..2cf392b7f1 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/delete.md @@ -0,0 +1,7 @@ +mutation { + usersDelete( + userId: "<USER_ID>" + ) { + status + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-graphql/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/users/get-prefs.md b/docs/examples/1.8.x/server-graphql/examples/users/get-prefs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/users/get-target.md b/docs/examples/1.8.x/server-graphql/examples/users/get-target.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/users/get.md b/docs/examples/1.8.x/server-graphql/examples/users/get.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/users/list-identities.md b/docs/examples/1.8.x/server-graphql/examples/users/list-identities.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/users/list-logs.md b/docs/examples/1.8.x/server-graphql/examples/users/list-logs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/users/list-memberships.md b/docs/examples/1.8.x/server-graphql/examples/users/list-memberships.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/server-graphql/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/users/list-sessions.md b/docs/examples/1.8.x/server-graphql/examples/users/list-sessions.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/users/list-targets.md b/docs/examples/1.8.x/server-graphql/examples/users/list-targets.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/users/list.md b/docs/examples/1.8.x/server-graphql/examples/users/list.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-email-verification.md b/docs/examples/1.8.x/server-graphql/examples/users/update-email-verification.md new file mode 100644 index 0000000000..cda7278ac0 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-email-verification.md @@ -0,0 +1,38 @@ +mutation { + usersUpdateEmailVerification( + userId: "<USER_ID>", + emailVerification: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-email.md b/docs/examples/1.8.x/server-graphql/examples/users/update-email.md new file mode 100644 index 0000000000..408a74972b --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-email.md @@ -0,0 +1,38 @@ +mutation { + usersUpdateEmail( + userId: "<USER_ID>", + email: "email@example.com" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-labels.md b/docs/examples/1.8.x/server-graphql/examples/users/update-labels.md new file mode 100644 index 0000000000..cb3c5b6483 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-labels.md @@ -0,0 +1,38 @@ +mutation { + usersUpdateLabels( + userId: "<USER_ID>", + labels: [] + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-graphql/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..8881b1ad96 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +mutation { + usersUpdateMFARecoveryCodes( + userId: "<USER_ID>" + ) { + recoveryCodes + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-mfa.md b/docs/examples/1.8.x/server-graphql/examples/users/update-mfa.md new file mode 100644 index 0000000000..8c8f0a3787 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-mfa.md @@ -0,0 +1,38 @@ +mutation { + usersUpdateMFA( + userId: "<USER_ID>", + mfa: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-name.md b/docs/examples/1.8.x/server-graphql/examples/users/update-name.md new file mode 100644 index 0000000000..ec7e3dc27c --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-name.md @@ -0,0 +1,38 @@ +mutation { + usersUpdateName( + userId: "<USER_ID>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-password.md b/docs/examples/1.8.x/server-graphql/examples/users/update-password.md new file mode 100644 index 0000000000..95ef74c83d --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-password.md @@ -0,0 +1,38 @@ +mutation { + usersUpdatePassword( + userId: "<USER_ID>", + password: "" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-phone-verification.md b/docs/examples/1.8.x/server-graphql/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..c6afa54ba4 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-phone-verification.md @@ -0,0 +1,38 @@ +mutation { + usersUpdatePhoneVerification( + userId: "<USER_ID>", + phoneVerification: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-phone.md b/docs/examples/1.8.x/server-graphql/examples/users/update-phone.md new file mode 100644 index 0000000000..d3fc7d5f37 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-phone.md @@ -0,0 +1,38 @@ +mutation { + usersUpdatePhone( + userId: "<USER_ID>", + number: "+12065550100" + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-prefs.md b/docs/examples/1.8.x/server-graphql/examples/users/update-prefs.md new file mode 100644 index 0000000000..431664c2a1 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-prefs.md @@ -0,0 +1,8 @@ +mutation { + usersUpdatePrefs( + userId: "<USER_ID>", + prefs: "{}" + ) { + data + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-status.md b/docs/examples/1.8.x/server-graphql/examples/users/update-status.md new file mode 100644 index 0000000000..2499c1c258 --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-status.md @@ -0,0 +1,38 @@ +mutation { + usersUpdateStatus( + userId: "<USER_ID>", + status: false + ) { + _id + _createdAt + _updatedAt + name + password + hash + hashOptions + registration + status + labels + passwordUpdate + email + phone + emailVerification + phoneVerification + mfa + prefs { + data + } + targets { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } + accessedAt + } +} diff --git a/docs/examples/1.8.x/server-graphql/examples/users/update-target.md b/docs/examples/1.8.x/server-graphql/examples/users/update-target.md new file mode 100644 index 0000000000..1f7cc1147a --- /dev/null +++ b/docs/examples/1.8.x/server-graphql/examples/users/update-target.md @@ -0,0 +1,19 @@ +mutation { + usersUpdateTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + identifier: "<IDENTIFIER>", + providerId: "<PROVIDER_ID>", + name: "<NAME>" + ) { + _id + _createdAt + _updatedAt + name + userId + providerId + providerType + identifier + expired + } +} diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-anonymous-session.md b/docs/examples/1.8.x/server-kotlin/java/account/create-anonymous-session.md new file mode 100644 index 0000000000..d65c20a600 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-anonymous-session.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createAnonymousSession(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-email-password-session.md b/docs/examples/1.8.x/server-kotlin/java/account/create-email-password-session.md new file mode 100644 index 0000000000..633931089f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-email-password-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createEmailPasswordSession( + "email@example.com", // email + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-email-token.md b/docs/examples/1.8.x/server-kotlin/java/account/create-email-token.md new file mode 100644 index 0000000000..7a6a0d7fea --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-email-token.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createEmailToken( + "<USER_ID>", // userId + "email@example.com", // email + false, // phrase (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-jwt.md b/docs/examples/1.8.x/server-kotlin/java/account/create-jwt.md new file mode 100644 index 0000000000..3756edee25 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-jwt.md @@ -0,0 +1,18 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createJWT(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-magic-url-token.md b/docs/examples/1.8.x/server-kotlin/java/account/create-magic-url-token.md new file mode 100644 index 0000000000..df021f9568 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-magic-url-token.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createMagicURLToken( + "<USER_ID>", // userId + "email@example.com", // email + "https://example.com", // url (optional) + false, // phrase (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-kotlin/java/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..d38ddd3b44 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-mfa-authenticator.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticatorType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createMFAAuthenticator( + AuthenticatorType.TOTP, // type + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-kotlin/java/account/create-mfa-challenge.md new file mode 100644 index 0000000000..5c048cbace --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-mfa-challenge.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticationFactor; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createMFAChallenge( + AuthenticationFactor.EMAIL, // factor + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/java/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..6a47a17729 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-mfa-recovery-codes.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-kotlin/java/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..5b325f5c61 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-o-auth-2-token.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.OAuthProvider; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createOAuth2Token( + OAuthProvider.AMAZON, // provider + "https://example.com", // success (optional) + "https://example.com", // failure (optional) + listOf(), // scopes (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-phone-token.md b/docs/examples/1.8.x/server-kotlin/java/account/create-phone-token.md new file mode 100644 index 0000000000..14fb812687 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-phone-token.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createPhoneToken( + "<USER_ID>", // userId + "+12065550100", // phone + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-phone-verification.md b/docs/examples/1.8.x/server-kotlin/java/account/create-phone-verification.md new file mode 100644 index 0000000000..9e49c62880 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-phone-verification.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createPhoneVerification(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-recovery.md b/docs/examples/1.8.x/server-kotlin/java/account/create-recovery.md new file mode 100644 index 0000000000..f529ea4cb7 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-recovery.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createRecovery( + "email@example.com", // email + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-session.md b/docs/examples/1.8.x/server-kotlin/java/account/create-session.md new file mode 100644 index 0000000000..5bcdf99059 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.createSession( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create-verification.md b/docs/examples/1.8.x/server-kotlin/java/account/create-verification.md new file mode 100644 index 0000000000..65c8e8be49 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create-verification.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.createVerification( + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/create.md b/docs/examples/1.8.x/server-kotlin/java/account/create.md new file mode 100644 index 0000000000..d24bfb8592 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/create.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.create( + "<USER_ID>", // userId + "email@example.com", // email + "", // password + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/delete-identity.md b/docs/examples/1.8.x/server-kotlin/java/account/delete-identity.md new file mode 100644 index 0000000000..0d6f860a63 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/delete-identity.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.deleteIdentity( + "<IDENTITY_ID>", // identityId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-kotlin/java/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..20a6acda53 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/delete-mfa-authenticator.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticatorType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.deleteMFAAuthenticator( + AuthenticatorType.TOTP, // type + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/delete-session.md b/docs/examples/1.8.x/server-kotlin/java/account/delete-session.md new file mode 100644 index 0000000000..fd27d746b1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/delete-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.deleteSession( + "<SESSION_ID>", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/delete-sessions.md b/docs/examples/1.8.x/server-kotlin/java/account/delete-sessions.md new file mode 100644 index 0000000000..11076e72d2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/delete-sessions.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.deleteSessions(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/java/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..813a0a62c0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/get-mfa-recovery-codes.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.getMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/get-prefs.md b/docs/examples/1.8.x/server-kotlin/java/account/get-prefs.md new file mode 100644 index 0000000000..6614f92aaa --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/get-prefs.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.getPrefs(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/get-session.md b/docs/examples/1.8.x/server-kotlin/java/account/get-session.md new file mode 100644 index 0000000000..3f30d90256 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/get-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.getSession( + "<SESSION_ID>", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/get.md b/docs/examples/1.8.x/server-kotlin/java/account/get.md new file mode 100644 index 0000000000..70e2dfb97f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/get.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.get(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/list-identities.md b/docs/examples/1.8.x/server-kotlin/java/account/list-identities.md new file mode 100644 index 0000000000..ceb4b3099a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/list-identities.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.listIdentities( + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/list-logs.md b/docs/examples/1.8.x/server-kotlin/java/account/list-logs.md new file mode 100644 index 0000000000..de22fcec6a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/list-logs.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.listLogs( + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/list-mfa-factors.md b/docs/examples/1.8.x/server-kotlin/java/account/list-mfa-factors.md new file mode 100644 index 0000000000..0bdc378b08 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/list-mfa-factors.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.listMFAFactors(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/list-sessions.md b/docs/examples/1.8.x/server-kotlin/java/account/list-sessions.md new file mode 100644 index 0000000000..557832df82 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/list-sessions.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.listSessions(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-email.md b/docs/examples/1.8.x/server-kotlin/java/account/update-email.md new file mode 100644 index 0000000000..8529ba6a26 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-email.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateEmail( + "email@example.com", // email + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-magic-url-session.md b/docs/examples/1.8.x/server-kotlin/java/account/update-magic-url-session.md new file mode 100644 index 0000000000..b4735f49ea --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-magic-url-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updateMagicURLSession( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-kotlin/java/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..87e3852ccd --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-mfa-authenticator.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; +import io.appwrite.enums.AuthenticatorType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateMFAAuthenticator( + AuthenticatorType.TOTP, // type + "<OTP>", // otp + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-kotlin/java/account/update-mfa-challenge.md new file mode 100644 index 0000000000..5e1bebe629 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-mfa-challenge.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateMFAChallenge( + "<CHALLENGE_ID>", // challengeId + "<OTP>", // otp + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/java/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..7c303ddc64 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-mfa-recovery-codes.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-mfa.md b/docs/examples/1.8.x/server-kotlin/java/account/update-mfa.md new file mode 100644 index 0000000000..d1b60c5473 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-mfa.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateMFA( + false, // mfa + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-name.md b/docs/examples/1.8.x/server-kotlin/java/account/update-name.md new file mode 100644 index 0000000000..749fe268af --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-name.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateName( + "<NAME>", // name + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-password.md b/docs/examples/1.8.x/server-kotlin/java/account/update-password.md new file mode 100644 index 0000000000..8eaa08b460 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-password.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updatePassword( + "", // password + "password", // oldPassword (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-phone-session.md b/docs/examples/1.8.x/server-kotlin/java/account/update-phone-session.md new file mode 100644 index 0000000000..cbfdca58ec --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-phone-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>"); // Your project ID + +Account account = new Account(client); + +account.updatePhoneSession( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-phone-verification.md b/docs/examples/1.8.x/server-kotlin/java/account/update-phone-verification.md new file mode 100644 index 0000000000..998826544a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-phone-verification.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updatePhoneVerification( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-phone.md b/docs/examples/1.8.x/server-kotlin/java/account/update-phone.md new file mode 100644 index 0000000000..d54aa9cfb2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-phone.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updatePhone( + "+12065550100", // phone + "password", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-prefs.md b/docs/examples/1.8.x/server-kotlin/java/account/update-prefs.md new file mode 100644 index 0000000000..0b6893916b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-prefs.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updatePrefs( + mapOf( + "language" to "en", + "timezone" to "UTC", + "darkTheme" to true + ), // prefs + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-recovery.md b/docs/examples/1.8.x/server-kotlin/java/account/update-recovery.md new file mode 100644 index 0000000000..8ab16e18ce --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-recovery.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateRecovery( + "<USER_ID>", // userId + "<SECRET>", // secret + "", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-session.md b/docs/examples/1.8.x/server-kotlin/java/account/update-session.md new file mode 100644 index 0000000000..8233c054f5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateSession( + "<SESSION_ID>", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-status.md b/docs/examples/1.8.x/server-kotlin/java/account/update-status.md new file mode 100644 index 0000000000..d5f4f79476 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-status.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateStatus(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/account/update-verification.md b/docs/examples/1.8.x/server-kotlin/java/account/update-verification.md new file mode 100644 index 0000000000..dafe6db457 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/account/update-verification.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Account; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Account account = new Account(client); + +account.updateVerification( + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/avatars/get-browser.md b/docs/examples/1.8.x/server-kotlin/java/avatars/get-browser.md new file mode 100644 index 0000000000..9c3433eef5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/avatars/get-browser.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.Browser; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getBrowser( + Browser.AVANT_BROWSER, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/avatars/get-credit-card.md b/docs/examples/1.8.x/server-kotlin/java/avatars/get-credit-card.md new file mode 100644 index 0000000000..6904638106 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/avatars/get-credit-card.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.CreditCard; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getCreditCard( + CreditCard.AMERICAN_EXPRESS, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/avatars/get-favicon.md b/docs/examples/1.8.x/server-kotlin/java/avatars/get-favicon.md new file mode 100644 index 0000000000..f4e89cfadc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/avatars/get-favicon.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getFavicon( + "https://example.com", // url + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/avatars/get-flag.md b/docs/examples/1.8.x/server-kotlin/java/avatars/get-flag.md new file mode 100644 index 0000000000..159dcdcde6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/avatars/get-flag.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; +import io.appwrite.enums.Flag; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getFlag( + Flag.AFGHANISTAN, // code + 0, // width (optional) + 0, // height (optional) + -1, // quality (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/avatars/get-image.md b/docs/examples/1.8.x/server-kotlin/java/avatars/get-image.md new file mode 100644 index 0000000000..afad760c38 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/avatars/get-image.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getImage( + "https://example.com", // url + 0, // width (optional) + 0, // height (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/avatars/get-initials.md b/docs/examples/1.8.x/server-kotlin/java/avatars/get-initials.md new file mode 100644 index 0000000000..171b636f02 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/avatars/get-initials.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getInitials( + "<NAME>", // name (optional) + 0, // width (optional) + 0, // height (optional) + "", // background (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/avatars/get-qr.md b/docs/examples/1.8.x/server-kotlin/java/avatars/get-qr.md new file mode 100644 index 0000000000..113fd1fceb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/avatars/get-qr.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Avatars; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Avatars avatars = new Avatars(client); + +avatars.getQR( + "<TEXT>", // text + 1, // size (optional) + 0, // margin (optional) + false, // download (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..7585471443 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-boolean-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createBooleanAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + false, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-collection.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-collection.md new file mode 100644 index 0000000000..8ec51e698a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-collection.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<NAME>", // name + listOf("read("any")"), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..d95e048b09 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-datetime-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createDatetimeAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + "", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-document.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-document.md new file mode 100644 index 0000000000..d5e777d157 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-document.md @@ -0,0 +1,33 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.createDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), // data + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-documents.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-documents.md new file mode 100644 index 0000000000..0de0c276ed --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-documents.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + listOf(), // documents + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-email-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-email-attribute.md new file mode 100644 index 0000000000..b2ecc99a17 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-email-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createEmailAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + "email@example.com", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-enum-attribute.md new file mode 100644 index 0000000000..44202086b0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-enum-attribute.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createEnumAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + listOf(), // elements + false, // required + "<DEFAULT>", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-float-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-float-attribute.md new file mode 100644 index 0000000000..2263cdb5c6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-float-attribute.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createFloatAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + 0, // min (optional) + 0, // max (optional) + 0, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-index.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-index.md new file mode 100644 index 0000000000..fe2d9bf66d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-index.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; +import io.appwrite.enums.IndexType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + IndexType.KEY, // type + listOf(), // attributes + listOf(), // orders (optional) + listOf(), // lengths (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-integer-attribute.md new file mode 100644 index 0000000000..b084e7c974 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-integer-attribute.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createIntegerAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + 0, // min (optional) + 0, // max (optional) + 0, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-ip-attribute.md new file mode 100644 index 0000000000..ba62dba1d7 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-ip-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createIpAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + "", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-line-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-line-attribute.md new file mode 100644 index 0000000000..ad988b8773 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-line-attribute.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createLineAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + listOf([1, 2], [3, 4], [5, 6]), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-point-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-point-attribute.md new file mode 100644 index 0000000000..89d7cc7177 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-point-attribute.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createPointAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + listOf(1, 2), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..556fb38481 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-polygon-attribute.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createPolygonAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..a67f452647 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-relationship-attribute.md @@ -0,0 +1,31 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; +import io.appwrite.enums.RelationshipType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createRelationshipAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<RELATED_COLLECTION_ID>", // relatedCollectionId + RelationshipType.ONETOONE, // type + false, // twoWay (optional) + "", // key (optional) + "", // twoWayKey (optional) + RelationMutate.CASCADE, // onDelete (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-string-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-string-attribute.md new file mode 100644 index 0000000000..3286c7aa01 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-string-attribute.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createStringAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + 1, // size + false, // required + "<DEFAULT>", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create-url-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/create-url-attribute.md new file mode 100644 index 0000000000..d445d67e33 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create-url-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.createUrlAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + "https://example.com", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/create.md b/docs/examples/1.8.x/server-kotlin/java/databases/create.md new file mode 100644 index 0000000000..31cd37e169 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/create.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.create( + "<DATABASE_ID>", // databaseId + "<NAME>", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..a44cc51260 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/decrement-document-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.decrementDocumentAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "", // attribute + 0, // value (optional) + 0, // min (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/delete-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/delete-attribute.md new file mode 100644 index 0000000000..236d492adb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/delete-attribute.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.deleteAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/delete-collection.md b/docs/examples/1.8.x/server-kotlin/java/databases/delete-collection.md new file mode 100644 index 0000000000..5da2a3d684 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/delete-collection.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.deleteCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/delete-document.md b/docs/examples/1.8.x/server-kotlin/java/databases/delete-document.md new file mode 100644 index 0000000000..f6e6209f36 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/delete-document.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.deleteDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/delete-documents.md b/docs/examples/1.8.x/server-kotlin/java/databases/delete-documents.md new file mode 100644 index 0000000000..e8394b1ff9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/delete-documents.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.deleteDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/delete-index.md b/docs/examples/1.8.x/server-kotlin/java/databases/delete-index.md new file mode 100644 index 0000000000..6f68435779 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/delete-index.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.deleteIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/delete.md b/docs/examples/1.8.x/server-kotlin/java/databases/delete.md new file mode 100644 index 0000000000..b082491383 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/delete.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.delete( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/get-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/get-attribute.md new file mode 100644 index 0000000000..672f0b062e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/get-attribute.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.getAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/get-collection.md b/docs/examples/1.8.x/server-kotlin/java/databases/get-collection.md new file mode 100644 index 0000000000..59401be370 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/get-collection.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.getCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/get-document.md b/docs/examples/1.8.x/server-kotlin/java/databases/get-document.md new file mode 100644 index 0000000000..2719073a7d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/get-document.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.getDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/get-index.md b/docs/examples/1.8.x/server-kotlin/java/databases/get-index.md new file mode 100644 index 0000000000..61cfe84ee4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/get-index.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.getIndex( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/get.md b/docs/examples/1.8.x/server-kotlin/java/databases/get.md new file mode 100644 index 0000000000..b0e3742149 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/get.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.get( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/increment-document-attribute.md new file mode 100644 index 0000000000..b5b5054e25 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/increment-document-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.incrementDocumentAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + "", // attribute + 0, // value (optional) + 0, // max (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/list-attributes.md b/docs/examples/1.8.x/server-kotlin/java/databases/list-attributes.md new file mode 100644 index 0000000000..9681831a35 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/list-attributes.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.listAttributes( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/list-collections.md b/docs/examples/1.8.x/server-kotlin/java/databases/list-collections.md new file mode 100644 index 0000000000..32534474e1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/list-collections.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.listCollections( + "<DATABASE_ID>", // databaseId + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/list-documents.md b/docs/examples/1.8.x/server-kotlin/java/databases/list-documents.md new file mode 100644 index 0000000000..36982c0eb0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/list-documents.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.listDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/list-indexes.md b/docs/examples/1.8.x/server-kotlin/java/databases/list-indexes.md new file mode 100644 index 0000000000..8c912bb36c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/list-indexes.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.listIndexes( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/list.md b/docs/examples/1.8.x/server-kotlin/java/databases/list.md new file mode 100644 index 0000000000..758b9f75fe --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/list.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.list( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..3c95851027 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-boolean-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateBooleanAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + false, // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-collection.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-collection.md new file mode 100644 index 0000000000..6805c1149d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-collection.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateCollection( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<NAME>", // name + listOf("read("any")"), // permissions (optional) + false, // documentSecurity (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..3f451b83f2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-datetime-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateDatetimeAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + "", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-document.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-document.md new file mode 100644 index 0000000000..f7b05c9601 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-document.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.updateDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + mapOf( "a" to "b" ), // data (optional) + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-documents.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-documents.md new file mode 100644 index 0000000000..b4138b41d2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-documents.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + mapOf( "a" to "b" ), // data (optional) + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-email-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-email-attribute.md new file mode 100644 index 0000000000..1ff12217ba --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-email-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateEmailAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + "email@example.com", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-enum-attribute.md new file mode 100644 index 0000000000..89606806d9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-enum-attribute.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateEnumAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + listOf(), // elements + false, // required + "<DEFAULT>", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-float-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-float-attribute.md new file mode 100644 index 0000000000..0076987f85 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-float-attribute.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateFloatAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + 0, // default + 0, // min (optional) + 0, // max (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-integer-attribute.md new file mode 100644 index 0000000000..c39af22b36 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-integer-attribute.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateIntegerAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + 0, // default + 0, // min (optional) + 0, // max (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-ip-attribute.md new file mode 100644 index 0000000000..44b4da2abc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-ip-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateIpAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + "", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-line-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-line-attribute.md new file mode 100644 index 0000000000..6a4265bbda --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-line-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateLineAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + listOf([1, 2], [3, 4], [5, 6]), // default (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-point-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-point-attribute.md new file mode 100644 index 0000000000..38d48c27e8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-point-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updatePointAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + listOf(1, 2), // default (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..6e6fd08575 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-polygon-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updatePolygonAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // default (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..8af20e91a9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-relationship-attribute.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateRelationshipAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + RelationMutate.CASCADE, // onDelete (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-string-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-string-attribute.md new file mode 100644 index 0000000000..1f156f3dbb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-string-attribute.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateStringAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + "<DEFAULT>", // default + 1, // size (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update-url-attribute.md b/docs/examples/1.8.x/server-kotlin/java/databases/update-url-attribute.md new file mode 100644 index 0000000000..959054ab48 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update-url-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateUrlAttribute( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "", // key + false, // required + "https://example.com", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/update.md b/docs/examples/1.8.x/server-kotlin/java/databases/update.md new file mode 100644 index 0000000000..9928dae6f6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/update.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.update( + "<DATABASE_ID>", // databaseId + "<NAME>", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/upsert-document.md b/docs/examples/1.8.x/server-kotlin/java/databases/upsert-document.md new file mode 100644 index 0000000000..daa44141e2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/upsert-document.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.upsertDocument( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + "<DOCUMENT_ID>", // documentId + mapOf( "a" to "b" ), // data + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/databases/upsert-documents.md b/docs/examples/1.8.x/server-kotlin/java/databases/upsert-documents.md new file mode 100644 index 0000000000..95e9a33ef2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/databases/upsert-documents.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Databases databases = new Databases(client); + +databases.upsertDocuments( + "<DATABASE_ID>", // databaseId + "<COLLECTION_ID>", // collectionId + listOf(), // documents + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/create-deployment.md b/docs/examples/1.8.x/server-kotlin/java/functions/create-deployment.md new file mode 100644 index 0000000000..6e435f41fa --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/create-deployment.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.models.InputFile; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.createDeployment( + "<FUNCTION_ID>", // functionId + InputFile.fromPath("file.png"), // code + false, // activate + "<ENTRYPOINT>", // entrypoint (optional) + "<COMMANDS>", // commands (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-kotlin/java/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..6b9d9a131a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/create-duplicate-deployment.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.createDuplicateDeployment( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + "<BUILD_ID>", // buildId (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/create-execution.md b/docs/examples/1.8.x/server-kotlin/java/functions/create-execution.md new file mode 100644 index 0000000000..93efa0adf8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/create-execution.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +functions.createExecution( + "<FUNCTION_ID>", // functionId + "<BODY>", // body (optional) + false, // async (optional) + "<PATH>", // path (optional) + ExecutionMethod.GET, // method (optional) + mapOf( "a" to "b" ), // headers (optional) + "<SCHEDULED_AT>", // scheduledAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/create-template-deployment.md b/docs/examples/1.8.x/server-kotlin/java/functions/create-template-deployment.md new file mode 100644 index 0000000000..53b5a9ae6a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/create-template-deployment.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.createTemplateDeployment( + "<FUNCTION_ID>", // functionId + "<REPOSITORY>", // repository + "<OWNER>", // owner + "<ROOT_DIRECTORY>", // rootDirectory + "<VERSION>", // version + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/create-variable.md b/docs/examples/1.8.x/server-kotlin/java/functions/create-variable.md new file mode 100644 index 0000000000..70764fbdc8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/create-variable.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.createVariable( + "<FUNCTION_ID>", // functionId + "<KEY>", // key + "<VALUE>", // value + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-kotlin/java/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..9274cd88c7 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/create-vcs-deployment.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; +import io.appwrite.enums.VCSDeploymentType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.createVcsDeployment( + "<FUNCTION_ID>", // functionId + VCSDeploymentType.BRANCH, // type + "<REFERENCE>", // reference + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/create.md b/docs/examples/1.8.x/server-kotlin/java/functions/create.md new file mode 100644 index 0000000000..71871287bb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/create.md @@ -0,0 +1,41 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; +import io.appwrite.enums.Runtime; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.create( + "<FUNCTION_ID>", // functionId + "<NAME>", // name + .NODE_14_5, // runtime + listOf("any"), // execute (optional) + listOf(), // events (optional) + "", // schedule (optional) + 1, // timeout (optional) + false, // enabled (optional) + false, // logging (optional) + "<ENTRYPOINT>", // entrypoint (optional) + "<COMMANDS>", // commands (optional) + listOf(), // scopes (optional) + "<INSTALLATION_ID>", // installationId (optional) + "<PROVIDER_REPOSITORY_ID>", // providerRepositoryId (optional) + "<PROVIDER_BRANCH>", // providerBranch (optional) + false, // providerSilentMode (optional) + "<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional) + "", // specification (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/delete-deployment.md b/docs/examples/1.8.x/server-kotlin/java/functions/delete-deployment.md new file mode 100644 index 0000000000..1a6279ff3f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/delete-deployment.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.deleteDeployment( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/delete-execution.md b/docs/examples/1.8.x/server-kotlin/java/functions/delete-execution.md new file mode 100644 index 0000000000..68f81e8ee4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/delete-execution.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.deleteExecution( + "<FUNCTION_ID>", // functionId + "<EXECUTION_ID>", // executionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/delete-variable.md b/docs/examples/1.8.x/server-kotlin/java/functions/delete-variable.md new file mode 100644 index 0000000000..c881bdc800 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/delete-variable.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.deleteVariable( + "<FUNCTION_ID>", // functionId + "<VARIABLE_ID>", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/delete.md b/docs/examples/1.8.x/server-kotlin/java/functions/delete.md new file mode 100644 index 0000000000..255fc002fa --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/delete.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.delete( + "<FUNCTION_ID>", // functionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/get-deployment-download.md b/docs/examples/1.8.x/server-kotlin/java/functions/get-deployment-download.md new file mode 100644 index 0000000000..d522b12caf --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/get-deployment-download.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.getDeploymentDownload( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + DeploymentDownloadType.SOURCE, // type (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/get-deployment.md b/docs/examples/1.8.x/server-kotlin/java/functions/get-deployment.md new file mode 100644 index 0000000000..b3000272b4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/get-deployment.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.getDeployment( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/get-execution.md b/docs/examples/1.8.x/server-kotlin/java/functions/get-execution.md new file mode 100644 index 0000000000..76e302fa82 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/get-execution.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +functions.getExecution( + "<FUNCTION_ID>", // functionId + "<EXECUTION_ID>", // executionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/get-variable.md b/docs/examples/1.8.x/server-kotlin/java/functions/get-variable.md new file mode 100644 index 0000000000..d54882b293 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/get-variable.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.getVariable( + "<FUNCTION_ID>", // functionId + "<VARIABLE_ID>", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/get.md b/docs/examples/1.8.x/server-kotlin/java/functions/get.md new file mode 100644 index 0000000000..aa55b93e07 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/get.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.get( + "<FUNCTION_ID>", // functionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/list-deployments.md b/docs/examples/1.8.x/server-kotlin/java/functions/list-deployments.md new file mode 100644 index 0000000000..16a10ca4a2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/list-deployments.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.listDeployments( + "<FUNCTION_ID>", // functionId + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/list-executions.md b/docs/examples/1.8.x/server-kotlin/java/functions/list-executions.md new file mode 100644 index 0000000000..25a9af80aa --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/list-executions.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Functions functions = new Functions(client); + +functions.listExecutions( + "<FUNCTION_ID>", // functionId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/list-runtimes.md b/docs/examples/1.8.x/server-kotlin/java/functions/list-runtimes.md new file mode 100644 index 0000000000..304a90d0da --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/list-runtimes.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.listRuntimes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/list-specifications.md b/docs/examples/1.8.x/server-kotlin/java/functions/list-specifications.md new file mode 100644 index 0000000000..e6c9c091d7 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/list-specifications.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.listSpecifications(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/list-variables.md b/docs/examples/1.8.x/server-kotlin/java/functions/list-variables.md new file mode 100644 index 0000000000..98c9ff4527 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/list-variables.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.listVariables( + "<FUNCTION_ID>", // functionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/list.md b/docs/examples/1.8.x/server-kotlin/java/functions/list.md new file mode 100644 index 0000000000..a9a320660d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/list.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.list( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/update-deployment-status.md b/docs/examples/1.8.x/server-kotlin/java/functions/update-deployment-status.md new file mode 100644 index 0000000000..8755fd9305 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/update-deployment-status.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.updateDeploymentStatus( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/update-function-deployment.md b/docs/examples/1.8.x/server-kotlin/java/functions/update-function-deployment.md new file mode 100644 index 0000000000..b88e87c1b9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/update-function-deployment.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.updateFunctionDeployment( + "<FUNCTION_ID>", // functionId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/update-variable.md b/docs/examples/1.8.x/server-kotlin/java/functions/update-variable.md new file mode 100644 index 0000000000..3a2b281332 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/update-variable.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.updateVariable( + "<FUNCTION_ID>", // functionId + "<VARIABLE_ID>", // variableId + "<KEY>", // key + "<VALUE>", // value (optional) + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/functions/update.md b/docs/examples/1.8.x/server-kotlin/java/functions/update.md new file mode 100644 index 0000000000..5956c57b73 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/functions/update.md @@ -0,0 +1,40 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Functions functions = new Functions(client); + +functions.update( + "<FUNCTION_ID>", // functionId + "<NAME>", // name + .NODE_14_5, // runtime (optional) + listOf("any"), // execute (optional) + listOf(), // events (optional) + "", // schedule (optional) + 1, // timeout (optional) + false, // enabled (optional) + false, // logging (optional) + "<ENTRYPOINT>", // entrypoint (optional) + "<COMMANDS>", // commands (optional) + listOf(), // scopes (optional) + "<INSTALLATION_ID>", // installationId (optional) + "<PROVIDER_REPOSITORY_ID>", // providerRepositoryId (optional) + "<PROVIDER_BRANCH>", // providerBranch (optional) + false, // providerSilentMode (optional) + "<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional) + "", // specification (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/graphql/mutation.md b/docs/examples/1.8.x/server-kotlin/java/graphql/mutation.md new file mode 100644 index 0000000000..778892457b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/graphql/mutation.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Graphql; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Graphql graphql = new Graphql(client); + +graphql.mutation( + mapOf( "a" to "b" ), // query + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/graphql/query.md b/docs/examples/1.8.x/server-kotlin/java/graphql/query.md new file mode 100644 index 0000000000..e109d523f8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/graphql/query.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Graphql; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Graphql graphql = new Graphql(client); + +graphql.query( + mapOf( "a" to "b" ), // query + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-antivirus.md b/docs/examples/1.8.x/server-kotlin/java/health/get-antivirus.md new file mode 100644 index 0000000000..ca3abf7100 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-antivirus.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getAntivirus(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-cache.md b/docs/examples/1.8.x/server-kotlin/java/health/get-cache.md new file mode 100644 index 0000000000..24a584c04b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-cache.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getCache(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-certificate.md b/docs/examples/1.8.x/server-kotlin/java/health/get-certificate.md new file mode 100644 index 0000000000..f4cb5a4e1e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-certificate.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getCertificate( + "", // domain (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-db.md b/docs/examples/1.8.x/server-kotlin/java/health/get-db.md new file mode 100644 index 0000000000..c7a7bef903 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-db.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getDB(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-failed-jobs.md b/docs/examples/1.8.x/server-kotlin/java/health/get-failed-jobs.md new file mode 100644 index 0000000000..d2b81bd0bf --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-failed-jobs.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; +import io.appwrite.enums.Name; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getFailedJobs( + .V1_DATABASE, // name + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-pub-sub.md b/docs/examples/1.8.x/server-kotlin/java/health/get-pub-sub.md new file mode 100644 index 0000000000..70210c4296 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-pub-sub.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getPubSub(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-builds.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-builds.md new file mode 100644 index 0000000000..2ca5d7f4e4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-builds.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueBuilds( + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-certificates.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-certificates.md new file mode 100644 index 0000000000..519817ae46 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-certificates.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueCertificates( + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-databases.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-databases.md new file mode 100644 index 0000000000..2f175668eb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-databases.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueDatabases( + "<NAME>", // name (optional) + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-deletes.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-deletes.md new file mode 100644 index 0000000000..e65aa9a528 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-deletes.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueDeletes( + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-functions.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-functions.md new file mode 100644 index 0000000000..720f114acb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-functions.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueFunctions( + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-logs.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-logs.md new file mode 100644 index 0000000000..09b0de4e63 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-logs.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueLogs( + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-mails.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-mails.md new file mode 100644 index 0000000000..b1ae357aef --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-mails.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueMails( + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-messaging.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-messaging.md new file mode 100644 index 0000000000..61c0b8cad7 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-messaging.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueMessaging( + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-migrations.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-migrations.md new file mode 100644 index 0000000000..0e7d669e7f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-migrations.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueMigrations( + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..e2f8062fcc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-stats-resources.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueStatsResources( + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-usage.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-usage.md new file mode 100644 index 0000000000..bfda61a544 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-usage.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueUsage( + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-webhooks.md new file mode 100644 index 0000000000..d9aed66db6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-queue-webhooks.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getQueueWebhooks( + 0, // threshold (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-storage-local.md b/docs/examples/1.8.x/server-kotlin/java/health/get-storage-local.md new file mode 100644 index 0000000000..65367cc252 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-storage-local.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getStorageLocal(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-storage.md b/docs/examples/1.8.x/server-kotlin/java/health/get-storage.md new file mode 100644 index 0000000000..3a0f0f8ed3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-storage.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getStorage(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get-time.md b/docs/examples/1.8.x/server-kotlin/java/health/get-time.md new file mode 100644 index 0000000000..f0ba668ab8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get-time.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.getTime(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/health/get.md b/docs/examples/1.8.x/server-kotlin/java/health/get.md new file mode 100644 index 0000000000..87a7c0a32d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/health/get.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Health; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Health health = new Health(client); + +health.get(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/locale/get.md b/docs/examples/1.8.x/server-kotlin/java/locale/get.md new file mode 100644 index 0000000000..2d5e0ac06d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/locale/get.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.get(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/locale/list-codes.md b/docs/examples/1.8.x/server-kotlin/java/locale/list-codes.md new file mode 100644 index 0000000000..9f07d1dbf1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/locale/list-codes.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listCodes(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/locale/list-continents.md b/docs/examples/1.8.x/server-kotlin/java/locale/list-continents.md new file mode 100644 index 0000000000..5d9e4b0fdb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/locale/list-continents.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listContinents(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/locale/list-countries-eu.md b/docs/examples/1.8.x/server-kotlin/java/locale/list-countries-eu.md new file mode 100644 index 0000000000..232a0ef8cf --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/locale/list-countries-eu.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listCountriesEU(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/locale/list-countries-phones.md b/docs/examples/1.8.x/server-kotlin/java/locale/list-countries-phones.md new file mode 100644 index 0000000000..a4739a5b93 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/locale/list-countries-phones.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listCountriesPhones(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/locale/list-countries.md b/docs/examples/1.8.x/server-kotlin/java/locale/list-countries.md new file mode 100644 index 0000000000..5b8f250f3c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/locale/list-countries.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listCountries(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/locale/list-currencies.md b/docs/examples/1.8.x/server-kotlin/java/locale/list-currencies.md new file mode 100644 index 0000000000..adf1d787c1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/locale/list-currencies.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listCurrencies(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/locale/list-languages.md b/docs/examples/1.8.x/server-kotlin/java/locale/list-languages.md new file mode 100644 index 0000000000..c92ea525f7 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/locale/list-languages.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Locale; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Locale locale = new Locale(client); + +locale.listLanguages(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-apns-provider.md new file mode 100644 index 0000000000..acae476a17 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-apns-provider.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createAPNSProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<AUTH_KEY>", // authKey (optional) + "<AUTH_KEY_ID>", // authKeyId (optional) + "<TEAM_ID>", // teamId (optional) + "<BUNDLE_ID>", // bundleId (optional) + false, // sandbox (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-email.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-email.md new file mode 100644 index 0000000000..d6ab5ee1bf --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-email.md @@ -0,0 +1,34 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createEmail( + "<MESSAGE_ID>", // messageId + "<SUBJECT>", // subject + "<CONTENT>", // content + listOf(), // topics (optional) + listOf(), // users (optional) + listOf(), // targets (optional) + listOf(), // cc (optional) + listOf(), // bcc (optional) + listOf(), // attachments (optional) + false, // draft (optional) + false, // html (optional) + "", // scheduledAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..0d67e28cf0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-fcm-provider.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createFCMProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + mapOf( "a" to "b" ), // serviceAccountJSON (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..272f9d2356 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-mailgun-provider.md @@ -0,0 +1,32 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createMailgunProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<API_KEY>", // apiKey (optional) + "<DOMAIN>", // domain (optional) + false, // isEuRegion (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "email@example.com", // replyToEmail (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..21005293ea --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-msg-91-provider.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createMsg91Provider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<TEMPLATE_ID>", // templateId (optional) + "<SENDER_ID>", // senderId (optional) + "<AUTH_KEY>", // authKey (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-push.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-push.md new file mode 100644 index 0000000000..277ab9655c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-push.md @@ -0,0 +1,41 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createPush( + "<MESSAGE_ID>", // messageId + "<TITLE>", // title (optional) + "<BODY>", // body (optional) + listOf(), // topics (optional) + listOf(), // users (optional) + listOf(), // targets (optional) + mapOf( "a" to "b" ), // data (optional) + "<ACTION>", // action (optional) + "[ID1:ID2]", // image (optional) + "<ICON>", // icon (optional) + "<SOUND>", // sound (optional) + "<COLOR>", // color (optional) + "<TAG>", // tag (optional) + 0, // badge (optional) + false, // draft (optional) + "", // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.NORMAL, // priority (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..84c5bf42f9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-sendgrid-provider.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createSendgridProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<API_KEY>", // apiKey (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "email@example.com", // replyToEmail (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-sms.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-sms.md new file mode 100644 index 0000000000..ca40cc33a8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-sms.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createSMS( + "<MESSAGE_ID>", // messageId + "<CONTENT>", // content + listOf(), // topics (optional) + listOf(), // users (optional) + listOf(), // targets (optional) + false, // draft (optional) + "", // scheduledAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..1f1a0f998f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-smtp-provider.md @@ -0,0 +1,36 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createSMTPProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "<HOST>", // host + 1, // port (optional) + "<USERNAME>", // username (optional) + "<PASSWORD>", // password (optional) + SmtpEncryption.NONE, // encryption (optional) + false, // autoTLS (optional) + "<MAILER>", // mailer (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "email@example.com", // replyToEmail (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-subscriber.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-subscriber.md new file mode 100644 index 0000000000..1ccb8fe60c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-subscriber.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>"); // Your secret JSON Web Token + +Messaging messaging = new Messaging(client); + +messaging.createSubscriber( + "<TOPIC_ID>", // topicId + "<SUBSCRIBER_ID>", // subscriberId + "<TARGET_ID>", // targetId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..6b64499419 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-telesign-provider.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createTelesignProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "+12065550100", // from (optional) + "<CUSTOMER_ID>", // customerId (optional) + "<API_KEY>", // apiKey (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..477d7d8c4b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-textmagic-provider.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createTextmagicProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "+12065550100", // from (optional) + "<USERNAME>", // username (optional) + "<API_KEY>", // apiKey (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-topic.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-topic.md new file mode 100644 index 0000000000..63a24b467d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-topic.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createTopic( + "<TOPIC_ID>", // topicId + "<NAME>", // name + listOf("any"), // subscribe (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..8d1b4da970 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-twilio-provider.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createTwilioProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "+12065550100", // from (optional) + "<ACCOUNT_SID>", // accountSid (optional) + "<AUTH_TOKEN>", // authToken (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..db1e476db2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/create-vonage-provider.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createVonageProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name + "+12065550100", // from (optional) + "<API_KEY>", // apiKey (optional) + "<API_SECRET>", // apiSecret (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/delete-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/delete-provider.md new file mode 100644 index 0000000000..b0fa837feb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/delete-provider.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.deleteProvider( + "<PROVIDER_ID>", // providerId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-kotlin/java/messaging/delete-subscriber.md new file mode 100644 index 0000000000..a3635b9db7 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/delete-subscriber.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>"); // Your secret JSON Web Token + +Messaging messaging = new Messaging(client); + +messaging.deleteSubscriber( + "<TOPIC_ID>", // topicId + "<SUBSCRIBER_ID>", // subscriberId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/delete-topic.md b/docs/examples/1.8.x/server-kotlin/java/messaging/delete-topic.md new file mode 100644 index 0000000000..7b598b25f4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/delete-topic.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.deleteTopic( + "<TOPIC_ID>", // topicId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/delete.md b/docs/examples/1.8.x/server-kotlin/java/messaging/delete.md new file mode 100644 index 0000000000..1395a39245 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/delete.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.delete( + "<MESSAGE_ID>", // messageId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/get-message.md b/docs/examples/1.8.x/server-kotlin/java/messaging/get-message.md new file mode 100644 index 0000000000..3860ff2347 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/get-message.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.getMessage( + "<MESSAGE_ID>", // messageId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/get-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/get-provider.md new file mode 100644 index 0000000000..9717b90b7d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/get-provider.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.getProvider( + "<PROVIDER_ID>", // providerId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/get-subscriber.md b/docs/examples/1.8.x/server-kotlin/java/messaging/get-subscriber.md new file mode 100644 index 0000000000..641a494b5c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/get-subscriber.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.getSubscriber( + "<TOPIC_ID>", // topicId + "<SUBSCRIBER_ID>", // subscriberId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/get-topic.md b/docs/examples/1.8.x/server-kotlin/java/messaging/get-topic.md new file mode 100644 index 0000000000..c9f2eff74b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/get-topic.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.getTopic( + "<TOPIC_ID>", // topicId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/list-message-logs.md b/docs/examples/1.8.x/server-kotlin/java/messaging/list-message-logs.md new file mode 100644 index 0000000000..0f94e46cd1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/list-message-logs.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listMessageLogs( + "<MESSAGE_ID>", // messageId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/list-messages.md b/docs/examples/1.8.x/server-kotlin/java/messaging/list-messages.md new file mode 100644 index 0000000000..006ba7c27f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/list-messages.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listMessages( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-kotlin/java/messaging/list-provider-logs.md new file mode 100644 index 0000000000..5f77f2d03d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/list-provider-logs.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listProviderLogs( + "<PROVIDER_ID>", // providerId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/list-providers.md b/docs/examples/1.8.x/server-kotlin/java/messaging/list-providers.md new file mode 100644 index 0000000000..b069dda04c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/list-providers.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listProviders( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-kotlin/java/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..b10e446a66 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/list-subscriber-logs.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listSubscriberLogs( + "<SUBSCRIBER_ID>", // subscriberId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/list-subscribers.md b/docs/examples/1.8.x/server-kotlin/java/messaging/list-subscribers.md new file mode 100644 index 0000000000..52ca5b0d01 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/list-subscribers.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listSubscribers( + "<TOPIC_ID>", // topicId + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/list-targets.md b/docs/examples/1.8.x/server-kotlin/java/messaging/list-targets.md new file mode 100644 index 0000000000..5b9f40e873 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/list-targets.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listTargets( + "<MESSAGE_ID>", // messageId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-kotlin/java/messaging/list-topic-logs.md new file mode 100644 index 0000000000..b2e9444419 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/list-topic-logs.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listTopicLogs( + "<TOPIC_ID>", // topicId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/list-topics.md b/docs/examples/1.8.x/server-kotlin/java/messaging/list-topics.md new file mode 100644 index 0000000000..e6408a60e1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/list-topics.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.listTopics( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-apns-provider.md new file mode 100644 index 0000000000..c5da5ba819 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-apns-provider.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateAPNSProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<AUTH_KEY>", // authKey (optional) + "<AUTH_KEY_ID>", // authKeyId (optional) + "<TEAM_ID>", // teamId (optional) + "<BUNDLE_ID>", // bundleId (optional) + false, // sandbox (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-email.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-email.md new file mode 100644 index 0000000000..56e9767861 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-email.md @@ -0,0 +1,34 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateEmail( + "<MESSAGE_ID>", // messageId + listOf(), // topics (optional) + listOf(), // users (optional) + listOf(), // targets (optional) + "<SUBJECT>", // subject (optional) + "<CONTENT>", // content (optional) + false, // draft (optional) + false, // html (optional) + listOf(), // cc (optional) + listOf(), // bcc (optional) + "", // scheduledAt (optional) + listOf(), // attachments (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..dd92f9321f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-fcm-provider.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateFCMProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + mapOf( "a" to "b" ), // serviceAccountJSON (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..5547ae8575 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-mailgun-provider.md @@ -0,0 +1,32 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateMailgunProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + "<API_KEY>", // apiKey (optional) + "<DOMAIN>", // domain (optional) + false, // isEuRegion (optional) + false, // enabled (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "<REPLY_TO_EMAIL>", // replyToEmail (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..d8e485629b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-msg-91-provider.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateMsg91Provider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<TEMPLATE_ID>", // templateId (optional) + "<SENDER_ID>", // senderId (optional) + "<AUTH_KEY>", // authKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-push.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-push.md new file mode 100644 index 0000000000..b7038de6a4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-push.md @@ -0,0 +1,41 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updatePush( + "<MESSAGE_ID>", // messageId + listOf(), // topics (optional) + listOf(), // users (optional) + listOf(), // targets (optional) + "<TITLE>", // title (optional) + "<BODY>", // body (optional) + mapOf( "a" to "b" ), // data (optional) + "<ACTION>", // action (optional) + "[ID1:ID2]", // image (optional) + "<ICON>", // icon (optional) + "<SOUND>", // sound (optional) + "<COLOR>", // color (optional) + "<TAG>", // tag (optional) + 0, // badge (optional) + false, // draft (optional) + "", // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.NORMAL, // priority (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..14a4e99f5b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-sendgrid-provider.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateSendgridProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<API_KEY>", // apiKey (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "<REPLY_TO_EMAIL>", // replyToEmail (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-sms.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-sms.md new file mode 100644 index 0000000000..c59505b68a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-sms.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateSMS( + "<MESSAGE_ID>", // messageId + listOf(), // topics (optional) + listOf(), // users (optional) + listOf(), // targets (optional) + "<CONTENT>", // content (optional) + false, // draft (optional) + "", // scheduledAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..36f120033a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-smtp-provider.md @@ -0,0 +1,36 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateSMTPProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + "<HOST>", // host (optional) + 1, // port (optional) + "<USERNAME>", // username (optional) + "<PASSWORD>", // password (optional) + SmtpEncryption.NONE, // encryption (optional) + false, // autoTLS (optional) + "<MAILER>", // mailer (optional) + "<FROM_NAME>", // fromName (optional) + "email@example.com", // fromEmail (optional) + "<REPLY_TO_NAME>", // replyToName (optional) + "<REPLY_TO_EMAIL>", // replyToEmail (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..8181bf1c82 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-telesign-provider.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateTelesignProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<CUSTOMER_ID>", // customerId (optional) + "<API_KEY>", // apiKey (optional) + "<FROM>", // from (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..bc156b7a31 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-textmagic-provider.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateTextmagicProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<USERNAME>", // username (optional) + "<API_KEY>", // apiKey (optional) + "<FROM>", // from (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-topic.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-topic.md new file mode 100644 index 0000000000..be9c44dc23 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-topic.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateTopic( + "<TOPIC_ID>", // topicId + "<NAME>", // name (optional) + listOf("any"), // subscribe (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..ed58ee9a24 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-twilio-provider.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateTwilioProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<ACCOUNT_SID>", // accountSid (optional) + "<AUTH_TOKEN>", // authToken (optional) + "<FROM>", // from (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-kotlin/java/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..d5bfe3610c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/messaging/update-vonage-provider.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateVonageProvider( + "<PROVIDER_ID>", // providerId + "<NAME>", // name (optional) + false, // enabled (optional) + "<API_KEY>", // apiKey (optional) + "<API_SECRET>", // apiSecret (optional) + "<FROM>", // from (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/create-deployment.md b/docs/examples/1.8.x/server-kotlin/java/sites/create-deployment.md new file mode 100644 index 0000000000..f370f802eb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/create-deployment.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.models.InputFile; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.createDeployment( + "<SITE_ID>", // siteId + InputFile.fromPath("file.png"), // code + false, // activate + "<INSTALL_COMMAND>", // installCommand (optional) + "<BUILD_COMMAND>", // buildCommand (optional) + "<OUTPUT_DIRECTORY>", // outputDirectory (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-kotlin/java/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..35e43b8943 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/create-duplicate-deployment.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.createDuplicateDeployment( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/create-template-deployment.md b/docs/examples/1.8.x/server-kotlin/java/sites/create-template-deployment.md new file mode 100644 index 0000000000..63aba4a067 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/create-template-deployment.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.createTemplateDeployment( + "<SITE_ID>", // siteId + "<REPOSITORY>", // repository + "<OWNER>", // owner + "<ROOT_DIRECTORY>", // rootDirectory + "<VERSION>", // version + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/create-variable.md b/docs/examples/1.8.x/server-kotlin/java/sites/create-variable.md new file mode 100644 index 0000000000..c77bec3796 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/create-variable.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.createVariable( + "<SITE_ID>", // siteId + "<KEY>", // key + "<VALUE>", // value + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-kotlin/java/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..754eb26419 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/create-vcs-deployment.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; +import io.appwrite.enums.VCSDeploymentType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.createVcsDeployment( + "<SITE_ID>", // siteId + VCSDeploymentType.BRANCH, // type + "<REFERENCE>", // reference + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/create.md b/docs/examples/1.8.x/server-kotlin/java/sites/create.md new file mode 100644 index 0000000000..19664ec57b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/create.md @@ -0,0 +1,42 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; +import io.appwrite.enums.Framework; +import io.appwrite.enums.BuildRuntime; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.create( + "<SITE_ID>", // siteId + "<NAME>", // name + .ANALOG, // framework + .NODE_14_5, // buildRuntime + false, // enabled (optional) + false, // logging (optional) + 1, // timeout (optional) + "<INSTALL_COMMAND>", // installCommand (optional) + "<BUILD_COMMAND>", // buildCommand (optional) + "<OUTPUT_DIRECTORY>", // outputDirectory (optional) + .STATIC, // adapter (optional) + "<INSTALLATION_ID>", // installationId (optional) + "<FALLBACK_FILE>", // fallbackFile (optional) + "<PROVIDER_REPOSITORY_ID>", // providerRepositoryId (optional) + "<PROVIDER_BRANCH>", // providerBranch (optional) + false, // providerSilentMode (optional) + "<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional) + "", // specification (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/delete-deployment.md b/docs/examples/1.8.x/server-kotlin/java/sites/delete-deployment.md new file mode 100644 index 0000000000..97c08ab159 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/delete-deployment.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.deleteDeployment( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/delete-log.md b/docs/examples/1.8.x/server-kotlin/java/sites/delete-log.md new file mode 100644 index 0000000000..d7189373b0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/delete-log.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.deleteLog( + "<SITE_ID>", // siteId + "<LOG_ID>", // logId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/delete-variable.md b/docs/examples/1.8.x/server-kotlin/java/sites/delete-variable.md new file mode 100644 index 0000000000..4e2b3ab7d4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/delete-variable.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.deleteVariable( + "<SITE_ID>", // siteId + "<VARIABLE_ID>", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/delete.md b/docs/examples/1.8.x/server-kotlin/java/sites/delete.md new file mode 100644 index 0000000000..fd07bb23c8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/delete.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.delete( + "<SITE_ID>", // siteId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/get-deployment-download.md b/docs/examples/1.8.x/server-kotlin/java/sites/get-deployment-download.md new file mode 100644 index 0000000000..5875c7262f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/get-deployment-download.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.getDeploymentDownload( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + DeploymentDownloadType.SOURCE, // type (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/get-deployment.md b/docs/examples/1.8.x/server-kotlin/java/sites/get-deployment.md new file mode 100644 index 0000000000..6af859ba9a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/get-deployment.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.getDeployment( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/get-log.md b/docs/examples/1.8.x/server-kotlin/java/sites/get-log.md new file mode 100644 index 0000000000..d33f2a658f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/get-log.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.getLog( + "<SITE_ID>", // siteId + "<LOG_ID>", // logId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/get-variable.md b/docs/examples/1.8.x/server-kotlin/java/sites/get-variable.md new file mode 100644 index 0000000000..1c8df0c08a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/get-variable.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.getVariable( + "<SITE_ID>", // siteId + "<VARIABLE_ID>", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/get.md b/docs/examples/1.8.x/server-kotlin/java/sites/get.md new file mode 100644 index 0000000000..660cad3bdb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/get.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.get( + "<SITE_ID>", // siteId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/list-deployments.md b/docs/examples/1.8.x/server-kotlin/java/sites/list-deployments.md new file mode 100644 index 0000000000..8bcec54efe --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/list-deployments.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.listDeployments( + "<SITE_ID>", // siteId + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/list-frameworks.md b/docs/examples/1.8.x/server-kotlin/java/sites/list-frameworks.md new file mode 100644 index 0000000000..df597177dd --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/list-frameworks.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.listFrameworks(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/list-logs.md b/docs/examples/1.8.x/server-kotlin/java/sites/list-logs.md new file mode 100644 index 0000000000..3532882a8d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/list-logs.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.listLogs( + "<SITE_ID>", // siteId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/list-specifications.md b/docs/examples/1.8.x/server-kotlin/java/sites/list-specifications.md new file mode 100644 index 0000000000..caad7325cf --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/list-specifications.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.listSpecifications(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/list-variables.md b/docs/examples/1.8.x/server-kotlin/java/sites/list-variables.md new file mode 100644 index 0000000000..f2a38b7e60 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/list-variables.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.listVariables( + "<SITE_ID>", // siteId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/list.md b/docs/examples/1.8.x/server-kotlin/java/sites/list.md new file mode 100644 index 0000000000..39a1c06407 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/list.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.list( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/update-deployment-status.md b/docs/examples/1.8.x/server-kotlin/java/sites/update-deployment-status.md new file mode 100644 index 0000000000..8dc3041f76 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/update-deployment-status.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.updateDeploymentStatus( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/update-site-deployment.md b/docs/examples/1.8.x/server-kotlin/java/sites/update-site-deployment.md new file mode 100644 index 0000000000..edbda7cf93 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/update-site-deployment.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.updateSiteDeployment( + "<SITE_ID>", // siteId + "<DEPLOYMENT_ID>", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/update-variable.md b/docs/examples/1.8.x/server-kotlin/java/sites/update-variable.md new file mode 100644 index 0000000000..9735ae34af --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/update-variable.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.updateVariable( + "<SITE_ID>", // siteId + "<VARIABLE_ID>", // variableId + "<KEY>", // key + "<VALUE>", // value (optional) + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/sites/update.md b/docs/examples/1.8.x/server-kotlin/java/sites/update.md new file mode 100644 index 0000000000..9a8b577ce0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/sites/update.md @@ -0,0 +1,41 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; +import io.appwrite.enums.Framework; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Sites sites = new Sites(client); + +sites.update( + "<SITE_ID>", // siteId + "<NAME>", // name + .ANALOG, // framework + false, // enabled (optional) + false, // logging (optional) + 1, // timeout (optional) + "<INSTALL_COMMAND>", // installCommand (optional) + "<BUILD_COMMAND>", // buildCommand (optional) + "<OUTPUT_DIRECTORY>", // outputDirectory (optional) + .NODE_14_5, // buildRuntime (optional) + .STATIC, // adapter (optional) + "<FALLBACK_FILE>", // fallbackFile (optional) + "<INSTALLATION_ID>", // installationId (optional) + "<PROVIDER_REPOSITORY_ID>", // providerRepositoryId (optional) + "<PROVIDER_BRANCH>", // providerBranch (optional) + false, // providerSilentMode (optional) + "<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional) + "", // specification (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/create-bucket.md b/docs/examples/1.8.x/server-kotlin/java/storage/create-bucket.md new file mode 100644 index 0000000000..a3a3308420 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/create-bucket.md @@ -0,0 +1,32 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +storage.createBucket( + "<BUCKET_ID>", // bucketId + "<NAME>", // name + listOf("read("any")"), // permissions (optional) + false, // fileSecurity (optional) + false, // enabled (optional) + 1, // maximumFileSize (optional) + listOf(), // allowedFileExtensions (optional) + .NONE, // compression (optional) + false, // encryption (optional) + false, // antivirus (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/create-file.md b/docs/examples/1.8.x/server-kotlin/java/storage/create-file.md new file mode 100644 index 0000000000..583f8569a5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/create-file.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.models.InputFile; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.createFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + InputFile.fromPath("file.png"), // file + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/delete-bucket.md b/docs/examples/1.8.x/server-kotlin/java/storage/delete-bucket.md new file mode 100644 index 0000000000..eb77754f92 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/delete-bucket.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +storage.deleteBucket( + "<BUCKET_ID>", // bucketId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/delete-file.md b/docs/examples/1.8.x/server-kotlin/java/storage/delete-file.md new file mode 100644 index 0000000000..8976fd198f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/delete-file.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.deleteFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/get-bucket.md b/docs/examples/1.8.x/server-kotlin/java/storage/get-bucket.md new file mode 100644 index 0000000000..a099f33dd8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/get-bucket.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +storage.getBucket( + "<BUCKET_ID>", // bucketId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/get-file-download.md b/docs/examples/1.8.x/server-kotlin/java/storage/get-file-download.md new file mode 100644 index 0000000000..edda2609b5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/get-file-download.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.getFileDownload( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + "<TOKEN>", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/get-file-preview.md b/docs/examples/1.8.x/server-kotlin/java/storage/get-file-preview.md new file mode 100644 index 0000000000..1a0ab596bc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/get-file-preview.md @@ -0,0 +1,36 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.getFilePreview( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + 0, // width (optional) + 0, // height (optional) + ImageGravity.CENTER, // gravity (optional) + -1, // quality (optional) + 0, // borderWidth (optional) + "", // borderColor (optional) + 0, // borderRadius (optional) + 0, // opacity (optional) + -360, // rotation (optional) + "", // background (optional) + ImageFormat.JPG, // output (optional) + "<TOKEN>", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/get-file-view.md b/docs/examples/1.8.x/server-kotlin/java/storage/get-file-view.md new file mode 100644 index 0000000000..178e50776c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/get-file-view.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.getFileView( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + "<TOKEN>", // token (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/get-file.md b/docs/examples/1.8.x/server-kotlin/java/storage/get-file.md new file mode 100644 index 0000000000..7a04c80e9e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/get-file.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.getFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/list-buckets.md b/docs/examples/1.8.x/server-kotlin/java/storage/list-buckets.md new file mode 100644 index 0000000000..9d85957803 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/list-buckets.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +storage.listBuckets( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/list-files.md b/docs/examples/1.8.x/server-kotlin/java/storage/list-files.md new file mode 100644 index 0000000000..f002754813 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/list-files.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.listFiles( + "<BUCKET_ID>", // bucketId + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/update-bucket.md b/docs/examples/1.8.x/server-kotlin/java/storage/update-bucket.md new file mode 100644 index 0000000000..2d80e2648c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/update-bucket.md @@ -0,0 +1,32 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Storage storage = new Storage(client); + +storage.updateBucket( + "<BUCKET_ID>", // bucketId + "<NAME>", // name + listOf("read("any")"), // permissions (optional) + false, // fileSecurity (optional) + false, // enabled (optional) + 1, // maximumFileSize (optional) + listOf(), // allowedFileExtensions (optional) + .NONE, // compression (optional) + false, // encryption (optional) + false, // antivirus (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/storage/update-file.md b/docs/examples/1.8.x/server-kotlin/java/storage/update-file.md new file mode 100644 index 0000000000..7f325f91fb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/storage/update-file.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Storage; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Storage storage = new Storage(client); + +storage.updateFile( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + "<NAME>", // name (optional) + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..14a96a1489 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-boolean-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createBooleanColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + false, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..6dd28b36c8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-datetime-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createDatetimeColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + "", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-email-column.md new file mode 100644 index 0000000000..e9f3d36892 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-email-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createEmailColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + "email@example.com", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..bc31bbe79e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-enum-column.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createEnumColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + listOf(), // elements + false, // required + "<DEFAULT>", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-float-column.md new file mode 100644 index 0000000000..51312d037a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-float-column.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createFloatColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + 0, // min (optional) + 0, // max (optional) + 0, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-index.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-index.md new file mode 100644 index 0000000000..991bd3429b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-index.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; +import io.appwrite.enums.IndexType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createIndex( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + IndexType.KEY, // type + listOf(), // columns + listOf(), // orders (optional) + listOf(), // lengths (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..1e0a3633a5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-integer-column.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createIntegerColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + 0, // min (optional) + 0, // max (optional) + 0, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..a963cc10a5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-ip-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createIpColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + "", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-line-column.md new file mode 100644 index 0000000000..afe029ebe8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-line-column.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createLineColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + listOf([1, 2], [3, 4], [5, 6]), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-point-column.md new file mode 100644 index 0000000000..2c9941b09c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-point-column.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createPointColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + listOf(1, 2), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..58ca798381 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-polygon-column.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createPolygonColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // default (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..956c1fa516 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-relationship-column.md @@ -0,0 +1,31 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; +import io.appwrite.enums.RelationshipType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createRelationshipColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<RELATED_TABLE_ID>", // relatedTableId + RelationshipType.ONETOONE, // type + false, // twoWay (optional) + "", // key (optional) + "", // twoWayKey (optional) + RelationMutate.CASCADE, // onDelete (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-row.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-row.md new file mode 100644 index 0000000000..6c7d84702d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-row.md @@ -0,0 +1,33 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), // data + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-rows.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-rows.md new file mode 100644 index 0000000000..21bdd21879 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-rows.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createRows( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + listOf(), // rows + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-string-column.md new file mode 100644 index 0000000000..3596340004 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-string-column.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createStringColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + 1, // size + false, // required + "<DEFAULT>", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-table.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-table.md new file mode 100644 index 0000000000..5bd3b6d0d9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-table.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createTable( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<NAME>", // name + listOf("read("any")"), // permissions (optional) + false, // rowSecurity (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-url-column.md new file mode 100644 index 0000000000..20c10e6296 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create-url-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createUrlColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + "https://example.com", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/create.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create.md new file mode 100644 index 0000000000..112e8e6d51 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/create.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.create( + "<DATABASE_ID>", // databaseId + "<NAME>", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..b9f250f48f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/decrement-row-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.decrementRowColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + "", // column + 0, // value (optional) + 0, // min (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-column.md new file mode 100644 index 0000000000..25d94d2fd0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-column.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-index.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-index.md new file mode 100644 index 0000000000..aa40dd07d8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-index.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteIndex( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-row.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-row.md new file mode 100644 index 0000000000..fd66525a8d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-row.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-rows.md new file mode 100644 index 0000000000..43b772e1a3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-rows.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteRows( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-table.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-table.md new file mode 100644 index 0000000000..dcd6daa930 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete-table.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteTable( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete.md new file mode 100644 index 0000000000..ea30c34411 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/delete.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.delete( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-column.md new file mode 100644 index 0000000000..42ed7760a9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-column.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-index.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-index.md new file mode 100644 index 0000000000..d14579d24a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-index.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getIndex( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-row.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-row.md new file mode 100644 index 0000000000..03cf3fb234 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-row.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-table.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-table.md new file mode 100644 index 0000000000..44862492df --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/get-table.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getTable( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/get.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/get.md new file mode 100644 index 0000000000..6480d62d46 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/get.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.get( + "<DATABASE_ID>", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..db48d05c37 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/increment-row-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.incrementRowColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + "", // column + 0, // value (optional) + 0, // max (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-columns.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-columns.md new file mode 100644 index 0000000000..f0e70d3dd4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-columns.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listColumns( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-indexes.md new file mode 100644 index 0000000000..1e5d1f9e11 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-indexes.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listIndexes( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-rows.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-rows.md new file mode 100644 index 0000000000..52cf2a1670 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-rows.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listRows( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-tables.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-tables.md new file mode 100644 index 0000000000..5e98cb60af --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/list-tables.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listTables( + "<DATABASE_ID>", // databaseId + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/list.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/list.md new file mode 100644 index 0000000000..34dc9dae01 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/list.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.list( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..d31932f235 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-boolean-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateBooleanColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + false, // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..b9fb3b23a3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-datetime-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateDatetimeColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + "", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-email-column.md new file mode 100644 index 0000000000..ed6b93b196 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-email-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateEmailColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + "email@example.com", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..5a8036aebc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-enum-column.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateEnumColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + listOf(), // elements + false, // required + "<DEFAULT>", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-float-column.md new file mode 100644 index 0000000000..0487c06bf5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-float-column.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateFloatColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + 0, // default + 0, // min (optional) + 0, // max (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..a9ed33a926 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-integer-column.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateIntegerColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + 0, // default + 0, // min (optional) + 0, // max (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..32509547c3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-ip-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateIpColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + "", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-line-column.md new file mode 100644 index 0000000000..4c65a907f7 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-line-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateLineColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + listOf([1, 2], [3, 4], [5, 6]), // default (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-point-column.md new file mode 100644 index 0000000000..56ac86a6f0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-point-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updatePointColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + listOf(1, 2), // default (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..189d473175 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-polygon-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updatePolygonColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // default (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..45aea8ae41 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-relationship-column.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateRelationshipColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + RelationMutate.CASCADE, // onDelete (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-row.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-row.md new file mode 100644 index 0000000000..bedc816f14 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-row.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + mapOf( "a" to "b" ), // data (optional) + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-rows.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-rows.md new file mode 100644 index 0000000000..169b57c3e5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-rows.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateRows( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + mapOf( "a" to "b" ), // data (optional) + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-string-column.md new file mode 100644 index 0000000000..36a2ed5990 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-string-column.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateStringColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + "<DEFAULT>", // default + 1, // size (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-table.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-table.md new file mode 100644 index 0000000000..e593a04641 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-table.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateTable( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<NAME>", // name + listOf("read("any")"), // permissions (optional) + false, // rowSecurity (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-url-column.md new file mode 100644 index 0000000000..d2273b9ef6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update-url-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateUrlColumn( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "", // key + false, // required + "https://example.com", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/update.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update.md new file mode 100644 index 0000000000..3b1da0c107 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/update.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.update( + "<DATABASE_ID>", // databaseId + "<NAME>", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/upsert-row.md new file mode 100644 index 0000000000..d6155fcd1b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/upsert-row.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.upsertRow( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + "<ROW_ID>", // rowId + mapOf( "a" to "b" ), // data (optional) + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-kotlin/java/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..da15f6a0db --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tablesdb/upsert-rows.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.upsertRows( + "<DATABASE_ID>", // databaseId + "<TABLE_ID>", // tableId + listOf(), // rows + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/create-membership.md b/docs/examples/1.8.x/server-kotlin/java/teams/create-membership.md new file mode 100644 index 0000000000..89e9d96ef6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/create-membership.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.createMembership( + "<TEAM_ID>", // teamId + listOf(), // roles + "email@example.com", // email (optional) + "<USER_ID>", // userId (optional) + "+12065550100", // phone (optional) + "https://example.com", // url (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/create.md b/docs/examples/1.8.x/server-kotlin/java/teams/create.md new file mode 100644 index 0000000000..28cc3dada1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/create.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.create( + "<TEAM_ID>", // teamId + "<NAME>", // name + listOf(), // roles (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/delete-membership.md b/docs/examples/1.8.x/server-kotlin/java/teams/delete-membership.md new file mode 100644 index 0000000000..3b414be028 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/delete-membership.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.deleteMembership( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/delete.md b/docs/examples/1.8.x/server-kotlin/java/teams/delete.md new file mode 100644 index 0000000000..07f5c12e4c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/delete.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.delete( + "<TEAM_ID>", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/get-membership.md b/docs/examples/1.8.x/server-kotlin/java/teams/get-membership.md new file mode 100644 index 0000000000..e7c1571af6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/get-membership.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.getMembership( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/get-prefs.md b/docs/examples/1.8.x/server-kotlin/java/teams/get-prefs.md new file mode 100644 index 0000000000..6d30814801 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/get-prefs.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.getPrefs( + "<TEAM_ID>", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/get.md b/docs/examples/1.8.x/server-kotlin/java/teams/get.md new file mode 100644 index 0000000000..a479e9aff2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/get.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.get( + "<TEAM_ID>", // teamId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/list-memberships.md b/docs/examples/1.8.x/server-kotlin/java/teams/list-memberships.md new file mode 100644 index 0000000000..9694482008 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/list-memberships.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.listMemberships( + "<TEAM_ID>", // teamId + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/list.md b/docs/examples/1.8.x/server-kotlin/java/teams/list.md new file mode 100644 index 0000000000..d0855ba841 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/list.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.list( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/update-membership-status.md b/docs/examples/1.8.x/server-kotlin/java/teams/update-membership-status.md new file mode 100644 index 0000000000..461cf4cbc3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/update-membership-status.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.updateMembershipStatus( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + "<USER_ID>", // userId + "<SECRET>", // secret + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/update-membership.md b/docs/examples/1.8.x/server-kotlin/java/teams/update-membership.md new file mode 100644 index 0000000000..d4816c57f1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/update-membership.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.updateMembership( + "<TEAM_ID>", // teamId + "<MEMBERSHIP_ID>", // membershipId + listOf(), // roles + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/update-name.md b/docs/examples/1.8.x/server-kotlin/java/teams/update-name.md new file mode 100644 index 0000000000..f2f1b02d93 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/update-name.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.updateName( + "<TEAM_ID>", // teamId + "<NAME>", // name + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/teams/update-prefs.md b/docs/examples/1.8.x/server-kotlin/java/teams/update-prefs.md new file mode 100644 index 0000000000..2ef05222df --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/teams/update-prefs.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Teams; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession(""); // The user session to authenticate with + +Teams teams = new Teams(client); + +teams.updatePrefs( + "<TEAM_ID>", // teamId + mapOf( "a" to "b" ), // prefs + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tokens/create-file-token.md b/docs/examples/1.8.x/server-kotlin/java/tokens/create-file-token.md new file mode 100644 index 0000000000..6996641d40 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tokens/create-file-token.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.createFileToken( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + "", // expire (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tokens/delete.md b/docs/examples/1.8.x/server-kotlin/java/tokens/delete.md new file mode 100644 index 0000000000..bf1874d2f8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tokens/delete.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.delete( + "<TOKEN_ID>", // tokenId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tokens/get.md b/docs/examples/1.8.x/server-kotlin/java/tokens/get.md new file mode 100644 index 0000000000..c55563c2e1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tokens/get.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.get( + "<TOKEN_ID>", // tokenId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tokens/list.md b/docs/examples/1.8.x/server-kotlin/java/tokens/list.md new file mode 100644 index 0000000000..a59e9f5ee8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tokens/list.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.list( + "<BUCKET_ID>", // bucketId + "<FILE_ID>", // fileId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/tokens/update.md b/docs/examples/1.8.x/server-kotlin/java/tokens/update.md new file mode 100644 index 0000000000..2a44f2d16e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/tokens/update.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.update( + "<TOKEN_ID>", // tokenId + "", // expire (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-argon-2-user.md b/docs/examples/1.8.x/server-kotlin/java/users/create-argon-2-user.md new file mode 100644 index 0000000000..c78f236cec --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-argon-2-user.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createArgon2User( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-kotlin/java/users/create-bcrypt-user.md new file mode 100644 index 0000000000..7b85f96054 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-bcrypt-user.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createBcryptUser( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-jwt.md b/docs/examples/1.8.x/server-kotlin/java/users/create-jwt.md new file mode 100644 index 0000000000..2b4d7e9c50 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-jwt.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createJWT( + "<USER_ID>", // userId + "<SESSION_ID>", // sessionId (optional) + 0, // duration (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-md-5-user.md b/docs/examples/1.8.x/server-kotlin/java/users/create-md-5-user.md new file mode 100644 index 0000000000..666e10792e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-md-5-user.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createMD5User( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/java/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..167c92cbbd --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-mfa-recovery-codes.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createMFARecoveryCodes( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-kotlin/java/users/create-ph-pass-user.md new file mode 100644 index 0000000000..048ba39cca --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-ph-pass-user.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createPHPassUser( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-kotlin/java/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..77a7d5fdb3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-scrypt-modified-user.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createScryptModifiedUser( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<PASSWORD_SALT>", // passwordSalt + "<PASSWORD_SALT_SEPARATOR>", // passwordSaltSeparator + "<PASSWORD_SIGNER_KEY>", // passwordSignerKey + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-scrypt-user.md b/docs/examples/1.8.x/server-kotlin/java/users/create-scrypt-user.md new file mode 100644 index 0000000000..0e81237ecf --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-scrypt-user.md @@ -0,0 +1,31 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createScryptUser( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + "<PASSWORD_SALT>", // passwordSalt + 0, // passwordCpu + 0, // passwordMemory + 0, // passwordParallel + 0, // passwordLength + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-session.md b/docs/examples/1.8.x/server-kotlin/java/users/create-session.md new file mode 100644 index 0000000000..8d9ce03d8e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-session.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createSession( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-sha-user.md b/docs/examples/1.8.x/server-kotlin/java/users/create-sha-user.md new file mode 100644 index 0000000000..ad729071c2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-sha-user.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createSHAUser( + "<USER_ID>", // userId + "email@example.com", // email + "password", // password + PasswordHash.SHA1, // passwordVersion (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-target.md b/docs/examples/1.8.x/server-kotlin/java/users/create-target.md new file mode 100644 index 0000000000..6681b170da --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-target.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; +import io.appwrite.enums.MessagingProviderType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createTarget( + "<USER_ID>", // userId + "<TARGET_ID>", // targetId + MessagingProviderType.EMAIL, // providerType + "<IDENTIFIER>", // identifier + "<PROVIDER_ID>", // providerId (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create-token.md b/docs/examples/1.8.x/server-kotlin/java/users/create-token.md new file mode 100644 index 0000000000..330b344b15 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create-token.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.createToken( + "<USER_ID>", // userId + 4, // length (optional) + 60, // expire (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/create.md b/docs/examples/1.8.x/server-kotlin/java/users/create.md new file mode 100644 index 0000000000..95a72bf7e0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/create.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.create( + "<USER_ID>", // userId + "email@example.com", // email (optional) + "+12065550100", // phone (optional) + "", // password (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/delete-identity.md b/docs/examples/1.8.x/server-kotlin/java/users/delete-identity.md new file mode 100644 index 0000000000..40c410db47 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/delete-identity.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.deleteIdentity( + "<IDENTITY_ID>", // identityId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-kotlin/java/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..c27b39ef53 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/delete-mfa-authenticator.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; +import io.appwrite.enums.AuthenticatorType; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.deleteMFAAuthenticator( + "<USER_ID>", // userId + AuthenticatorType.TOTP, // type + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/delete-session.md b/docs/examples/1.8.x/server-kotlin/java/users/delete-session.md new file mode 100644 index 0000000000..0e0a52baf8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/delete-session.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.deleteSession( + "<USER_ID>", // userId + "<SESSION_ID>", // sessionId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/delete-sessions.md b/docs/examples/1.8.x/server-kotlin/java/users/delete-sessions.md new file mode 100644 index 0000000000..6a3bbbf46f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/delete-sessions.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.deleteSessions( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/delete-target.md b/docs/examples/1.8.x/server-kotlin/java/users/delete-target.md new file mode 100644 index 0000000000..e38ee1d57d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/delete-target.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.deleteTarget( + "<USER_ID>", // userId + "<TARGET_ID>", // targetId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/delete.md b/docs/examples/1.8.x/server-kotlin/java/users/delete.md new file mode 100644 index 0000000000..d207f9af4b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/delete.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.delete( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/java/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..e617355701 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/get-mfa-recovery-codes.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.getMFARecoveryCodes( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/get-prefs.md b/docs/examples/1.8.x/server-kotlin/java/users/get-prefs.md new file mode 100644 index 0000000000..9ff3e4b308 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/get-prefs.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.getPrefs( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/get-target.md b/docs/examples/1.8.x/server-kotlin/java/users/get-target.md new file mode 100644 index 0000000000..05c802835d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/get-target.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.getTarget( + "<USER_ID>", // userId + "<TARGET_ID>", // targetId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/get.md b/docs/examples/1.8.x/server-kotlin/java/users/get.md new file mode 100644 index 0000000000..d8cd707c9c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/get.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.get( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/list-identities.md b/docs/examples/1.8.x/server-kotlin/java/users/list-identities.md new file mode 100644 index 0000000000..e0fc9d122a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/list-identities.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.listIdentities( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/list-logs.md b/docs/examples/1.8.x/server-kotlin/java/users/list-logs.md new file mode 100644 index 0000000000..86c94ee3a4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/list-logs.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.listLogs( + "<USER_ID>", // userId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/list-memberships.md b/docs/examples/1.8.x/server-kotlin/java/users/list-memberships.md new file mode 100644 index 0000000000..d0cee13275 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/list-memberships.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.listMemberships( + "<USER_ID>", // userId + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/list-mfa-factors.md b/docs/examples/1.8.x/server-kotlin/java/users/list-mfa-factors.md new file mode 100644 index 0000000000..c26f463b68 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/list-mfa-factors.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.listMFAFactors( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/list-sessions.md b/docs/examples/1.8.x/server-kotlin/java/users/list-sessions.md new file mode 100644 index 0000000000..7e13cb31c9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/list-sessions.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.listSessions( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/list-targets.md b/docs/examples/1.8.x/server-kotlin/java/users/list-targets.md new file mode 100644 index 0000000000..efa754273f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/list-targets.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.listTargets( + "<USER_ID>", // userId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/list.md b/docs/examples/1.8.x/server-kotlin/java/users/list.md new file mode 100644 index 0000000000..d587eaf46b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/list.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.list( + listOf(), // queries (optional) + "<SEARCH>", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-email-verification.md b/docs/examples/1.8.x/server-kotlin/java/users/update-email-verification.md new file mode 100644 index 0000000000..a79c87b4d6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-email-verification.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateEmailVerification( + "<USER_ID>", // userId + false, // emailVerification + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-email.md b/docs/examples/1.8.x/server-kotlin/java/users/update-email.md new file mode 100644 index 0000000000..24cdb00dff --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-email.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateEmail( + "<USER_ID>", // userId + "email@example.com", // email + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-labels.md b/docs/examples/1.8.x/server-kotlin/java/users/update-labels.md new file mode 100644 index 0000000000..379200a56b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-labels.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateLabels( + "<USER_ID>", // userId + listOf(), // labels + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/java/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..98522b6219 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-mfa-recovery-codes.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateMFARecoveryCodes( + "<USER_ID>", // userId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-mfa.md b/docs/examples/1.8.x/server-kotlin/java/users/update-mfa.md new file mode 100644 index 0000000000..dbcded6d93 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-mfa.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateMFA( + "<USER_ID>", // userId + false, // mfa + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-name.md b/docs/examples/1.8.x/server-kotlin/java/users/update-name.md new file mode 100644 index 0000000000..b4f889cb6d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-name.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateName( + "<USER_ID>", // userId + "<NAME>", // name + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-password.md b/docs/examples/1.8.x/server-kotlin/java/users/update-password.md new file mode 100644 index 0000000000..94e24da45d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-password.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updatePassword( + "<USER_ID>", // userId + "", // password + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-phone-verification.md b/docs/examples/1.8.x/server-kotlin/java/users/update-phone-verification.md new file mode 100644 index 0000000000..4a1d5a2900 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-phone-verification.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updatePhoneVerification( + "<USER_ID>", // userId + false, // phoneVerification + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-phone.md b/docs/examples/1.8.x/server-kotlin/java/users/update-phone.md new file mode 100644 index 0000000000..49477fad43 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-phone.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updatePhone( + "<USER_ID>", // userId + "+12065550100", // number + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-prefs.md b/docs/examples/1.8.x/server-kotlin/java/users/update-prefs.md new file mode 100644 index 0000000000..c5a9677a20 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-prefs.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updatePrefs( + "<USER_ID>", // userId + mapOf( "a" to "b" ), // prefs + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-status.md b/docs/examples/1.8.x/server-kotlin/java/users/update-status.md new file mode 100644 index 0000000000..6e875b982f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-status.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateStatus( + "<USER_ID>", // userId + false, // status + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/java/users/update-target.md b/docs/examples/1.8.x/server-kotlin/java/users/update-target.md new file mode 100644 index 0000000000..67b90bfbac --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/java/users/update-target.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; + +Client client = new Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>"); // Your secret API key + +Users users = new Users(client); + +users.updateTarget( + "<USER_ID>", // userId + "<TARGET_ID>", // targetId + "<IDENTIFIER>", // identifier (optional) + "<PROVIDER_ID>", // providerId (optional) + "<NAME>", // name (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-anonymous-session.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-anonymous-session.md new file mode 100644 index 0000000000..0ddc3835dc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-anonymous-session.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val response = account.createAnonymousSession() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-email-password-session.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-email-password-session.md new file mode 100644 index 0000000000..9c7af95e13 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-email-password-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val response = account.createEmailPasswordSession( + email = "email@example.com", + password = "password" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-email-token.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-email-token.md new file mode 100644 index 0000000000..84acd78a9c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-email-token.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val response = account.createEmailToken( + userId = "<USER_ID>", + email = "email@example.com", + phrase = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-jwt.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-jwt.md new file mode 100644 index 0000000000..4c04aa1215 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-jwt.md @@ -0,0 +1,11 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val response = account.createJWT() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-magic-url-token.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-magic-url-token.md new file mode 100644 index 0000000000..c1d8cba2cb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-magic-url-token.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val response = account.createMagicURLToken( + userId = "<USER_ID>", + email = "email@example.com", + url = "https://example.com", // optional + phrase = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..fed90b4a7b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-mfa-authenticator.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createMFAAuthenticator( + type = AuthenticatorType.TOTP +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-mfa-challenge.md new file mode 100644 index 0000000000..7213142a45 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-mfa-challenge.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticationFactor + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val response = account.createMFAChallenge( + factor = AuthenticationFactor.EMAIL +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..c01499b04b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createMFARecoveryCodes() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..1a8c1188b0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-o-auth-2-token.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.OAuthProvider + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +account.createOAuth2Token( + provider = OAuthProvider.AMAZON, + success = "https://example.com", // optional + failure = "https://example.com", // optional + scopes = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-phone-token.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-phone-token.md new file mode 100644 index 0000000000..be03e0659f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-phone-token.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val response = account.createPhoneToken( + userId = "<USER_ID>", + phone = "+12065550100" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-phone-verification.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-phone-verification.md new file mode 100644 index 0000000000..3ae45b3982 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-phone-verification.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createPhoneVerification() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-recovery.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-recovery.md new file mode 100644 index 0000000000..949219cfca --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-recovery.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createRecovery( + email = "email@example.com", + url = "https://example.com" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-session.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-session.md new file mode 100644 index 0000000000..5afb219ff0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val response = account.createSession( + userId = "<USER_ID>", + secret = "<SECRET>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create-verification.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-verification.md new file mode 100644 index 0000000000..f3441c9bdd --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create-verification.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.createVerification( + url = "https://example.com" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/create.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/create.md new file mode 100644 index 0000000000..80640ba830 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/create.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val response = account.create( + userId = "<USER_ID>", + email = "email@example.com", + password = "", + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-identity.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-identity.md new file mode 100644 index 0000000000..f9a5ce0a12 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-identity.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.deleteIdentity( + identityId = "<IDENTITY_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..9b06f8cd99 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-mfa-authenticator.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.deleteMFAAuthenticator( + type = AuthenticatorType.TOTP +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-session.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-session.md new file mode 100644 index 0000000000..31096ccc65 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.deleteSession( + sessionId = "<SESSION_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-sessions.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-sessions.md new file mode 100644 index 0000000000..dc29fb8aac --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/delete-sessions.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.deleteSessions() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..96567f4ca5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/get-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.getMFARecoveryCodes() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/get-prefs.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/get-prefs.md new file mode 100644 index 0000000000..299abbd929 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/get-prefs.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.getPrefs() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/get-session.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/get-session.md new file mode 100644 index 0000000000..e40297e60c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/get-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.getSession( + sessionId = "<SESSION_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/get.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/get.md new file mode 100644 index 0000000000..f65f4fd618 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/get.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.get() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/list-identities.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/list-identities.md new file mode 100644 index 0000000000..32eb86cb43 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/list-identities.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.listIdentities( + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/list-logs.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/list-logs.md new file mode 100644 index 0000000000..345b2f1f06 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/list-logs.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.listLogs( + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/list-mfa-factors.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/list-mfa-factors.md new file mode 100644 index 0000000000..0f073df3e9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/list-mfa-factors.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.listMFAFactors() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/list-sessions.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/list-sessions.md new file mode 100644 index 0000000000..899260cd5b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/list-sessions.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.listSessions() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-email.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-email.md new file mode 100644 index 0000000000..6ebe5e7ec9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-email.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateEmail( + email = "email@example.com", + password = "password" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-magic-url-session.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-magic-url-session.md new file mode 100644 index 0000000000..d4fe7f4861 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-magic-url-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val response = account.updateMagicURLSession( + userId = "<USER_ID>", + secret = "<SECRET>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..99764f2f0d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa-authenticator.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account +import io.appwrite.enums.AuthenticatorType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateMFAAuthenticator( + type = AuthenticatorType.TOTP, + otp = "<OTP>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa-challenge.md new file mode 100644 index 0000000000..de90873650 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa-challenge.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateMFAChallenge( + challengeId = "<CHALLENGE_ID>", + otp = "<OTP>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..05f6476e0f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateMFARecoveryCodes() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa.md new file mode 100644 index 0000000000..e12e8e00e2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-mfa.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateMFA( + mfa = false +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-name.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-name.md new file mode 100644 index 0000000000..ecb7a2bd2f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-name.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateName( + name = "<NAME>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-password.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-password.md new file mode 100644 index 0000000000..159aa79aef --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-password.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updatePassword( + password = "", + oldPassword = "password" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-phone-session.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-phone-session.md new file mode 100644 index 0000000000..1bcc4c0955 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-phone-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +val account = Account(client) + +val response = account.updatePhoneSession( + userId = "<USER_ID>", + secret = "<SECRET>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-phone-verification.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-phone-verification.md new file mode 100644 index 0000000000..36a2d9c73b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-phone-verification.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updatePhoneVerification( + userId = "<USER_ID>", + secret = "<SECRET>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-phone.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-phone.md new file mode 100644 index 0000000000..1ee4cbd39b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-phone.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updatePhone( + phone = "+12065550100", + password = "password" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-prefs.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-prefs.md new file mode 100644 index 0000000000..63e66ca44a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-prefs.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updatePrefs( + prefs = mapOf( + "language" to "en", + "timezone" to "UTC", + "darkTheme" to true + ) +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-recovery.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-recovery.md new file mode 100644 index 0000000000..e56381365d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-recovery.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateRecovery( + userId = "<USER_ID>", + secret = "<SECRET>", + password = "" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-session.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-session.md new file mode 100644 index 0000000000..ab3730af0e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateSession( + sessionId = "<SESSION_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-status.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-status.md new file mode 100644 index 0000000000..021f6143c0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-status.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateStatus() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/account/update-verification.md b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-verification.md new file mode 100644 index 0000000000..6402093410 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/account/update-verification.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Account + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val account = Account(client) + +val response = account.updateVerification( + userId = "<USER_ID>", + secret = "<SECRET>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-browser.md b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-browser.md new file mode 100644 index 0000000000..f289205ab0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-browser.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.Browser + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getBrowser( + code = Browser.AVANT_BROWSER, + width = 0, // optional + height = 0, // optional + quality = -1 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-credit-card.md b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-credit-card.md new file mode 100644 index 0000000000..1fd00a24bd --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-credit-card.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.CreditCard + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getCreditCard( + code = CreditCard.AMERICAN_EXPRESS, + width = 0, // optional + height = 0, // optional + quality = -1 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-favicon.md b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-favicon.md new file mode 100644 index 0000000000..d1f5d9bfe6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-favicon.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getFavicon( + url = "https://example.com" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-flag.md b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-flag.md new file mode 100644 index 0000000000..a16aefcffd --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-flag.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars +import io.appwrite.enums.Flag + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getFlag( + code = Flag.AFGHANISTAN, + width = 0, // optional + height = 0, // optional + quality = -1 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-image.md b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-image.md new file mode 100644 index 0000000000..98b9c07e7f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-image.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getImage( + url = "https://example.com", + width = 0, // optional + height = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-initials.md b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-initials.md new file mode 100644 index 0000000000..2aa165ccf8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-initials.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getInitials( + name = "<NAME>", // optional + width = 0, // optional + height = 0, // optional + background = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-qr.md b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-qr.md new file mode 100644 index 0000000000..abcf488cbb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/avatars/get-qr.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Avatars + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val avatars = Avatars(client) + +val result = avatars.getQR( + text = "<TEXT>", + size = 1, // optional + margin = 0, // optional + download = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..b80bd9497a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-boolean-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createBooleanAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = false, // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-collection.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-collection.md new file mode 100644 index 0000000000..de9679f559 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-collection.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + name = "<NAME>", + permissions = listOf("read("any")"), // optional + documentSecurity = false, // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..2d730562a9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-datetime-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createDatetimeAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = "", // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-document.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-document.md new file mode 100644 index 0000000000..1c1d628729 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-document.md @@ -0,0 +1,24 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.createDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-documents.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-documents.md new file mode 100644 index 0000000000..41a98dc016 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-documents.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documents = listOf() +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-email-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-email-attribute.md new file mode 100644 index 0000000000..2a5a9c2a60 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-email-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createEmailAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = "email@example.com", // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-enum-attribute.md new file mode 100644 index 0000000000..d9decdeba9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-enum-attribute.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createEnumAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + elements = listOf(), + required = false, + default = "<DEFAULT>", // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-float-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-float-attribute.md new file mode 100644 index 0000000000..5ca86a66af --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-float-attribute.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createFloatAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + min = 0, // optional + max = 0, // optional + default = 0, // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-index.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-index.md new file mode 100644 index 0000000000..da777ac906 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-index.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.enums.IndexType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + type = IndexType.KEY, + attributes = listOf(), + orders = listOf(), // optional + lengths = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-integer-attribute.md new file mode 100644 index 0000000000..748d01a849 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-integer-attribute.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createIntegerAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + min = 0, // optional + max = 0, // optional + default = 0, // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-ip-attribute.md new file mode 100644 index 0000000000..bfc610517a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-ip-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createIpAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = "", // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-line-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-line-attribute.md new file mode 100644 index 0000000000..af9a4d2425 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-line-attribute.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createLineAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = listOf([1, 2], [3, 4], [5, 6]) // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-point-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-point-attribute.md new file mode 100644 index 0000000000..04f095ee4e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-point-attribute.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createPointAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = listOf(1, 2) // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..ffeb3c4398 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-polygon-attribute.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createPolygonAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = listOf([[1, 2], [3, 4], [5, 6], [1, 2]]) // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..1bf610321a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-relationship-attribute.md @@ -0,0 +1,22 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases +import io.appwrite.enums.RelationshipType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createRelationshipAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + relatedCollectionId = "<RELATED_COLLECTION_ID>", + type = RelationshipType.ONETOONE, + twoWay = false, // optional + key = "", // optional + twoWayKey = "", // optional + onDelete = "cascade" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-string-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-string-attribute.md new file mode 100644 index 0000000000..333cb76763 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-string-attribute.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createStringAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + size = 1, + required = false, + default = "<DEFAULT>", // optional + array = false, // optional + encrypt = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-url-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-url-attribute.md new file mode 100644 index 0000000000..06057d4683 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create-url-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.createUrlAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = "https://example.com", // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/create.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create.md new file mode 100644 index 0000000000..04c64801d2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/create.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.create( + databaseId = "<DATABASE_ID>", + name = "<NAME>", + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..d0226c0bdb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.decrementDocumentAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + attribute = "", + value = 0, // optional + min = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-attribute.md new file mode 100644 index 0000000000..9a25155957 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-attribute.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.deleteAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-collection.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-collection.md new file mode 100644 index 0000000000..c46ca086b9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-collection.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.deleteCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-document.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-document.md new file mode 100644 index 0000000000..a9eea6b648 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-document.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.deleteDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-documents.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-documents.md new file mode 100644 index 0000000000..c4caa63aae --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-documents.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.deleteDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-index.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-index.md new file mode 100644 index 0000000000..37c75dcfe5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete-index.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.deleteIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete.md new file mode 100644 index 0000000000..07225698e2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/delete.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.delete( + databaseId = "<DATABASE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-attribute.md new file mode 100644 index 0000000000..a59facd7db --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-attribute.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.getAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-collection.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-collection.md new file mode 100644 index 0000000000..7f6e578db1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-collection.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.getCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-document.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-document.md new file mode 100644 index 0000000000..d21a19869b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-document.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.getDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-index.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-index.md new file mode 100644 index 0000000000..39ac7af9fb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/get-index.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.getIndex( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/get.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/get.md new file mode 100644 index 0000000000..6ebb0c109c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/get.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.get( + databaseId = "<DATABASE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/increment-document-attribute.md new file mode 100644 index 0000000000..b56ed91d75 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.incrementDocumentAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + attribute = "", + value = 0, // optional + max = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-attributes.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-attributes.md new file mode 100644 index 0000000000..5ddb0a6fea --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-attributes.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.listAttributes( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-collections.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-collections.md new file mode 100644 index 0000000000..5340903927 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-collections.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.listCollections( + databaseId = "<DATABASE_ID>", + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-documents.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-documents.md new file mode 100644 index 0000000000..ed9cb3165d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-documents.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.listDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-indexes.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-indexes.md new file mode 100644 index 0000000000..2ab2e6a1b2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/list-indexes.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.listIndexes( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/list.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/list.md new file mode 100644 index 0000000000..cd61a0e714 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/list.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.list( + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..4c9fd91d83 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-boolean-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateBooleanAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = false, + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-collection.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-collection.md new file mode 100644 index 0000000000..bd42ba07f4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-collection.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateCollection( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + name = "<NAME>", + permissions = listOf("read("any")"), // optional + documentSecurity = false, // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..082ae1c05a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-datetime-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateDatetimeAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = "", + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-document.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-document.md new file mode 100644 index 0000000000..4dd0349823 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-document.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.updateDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( "a" to "b" ), // optional + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-documents.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-documents.md new file mode 100644 index 0000000000..9d6c2b5ea8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-documents.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + data = mapOf( "a" to "b" ), // optional + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-email-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-email-attribute.md new file mode 100644 index 0000000000..026bd6447f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-email-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateEmailAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = "email@example.com", + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-enum-attribute.md new file mode 100644 index 0000000000..e68a29c20a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-enum-attribute.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateEnumAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + elements = listOf(), + required = false, + default = "<DEFAULT>", + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-float-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-float-attribute.md new file mode 100644 index 0000000000..58b110743e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-float-attribute.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateFloatAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = 0, + min = 0, // optional + max = 0, // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-integer-attribute.md new file mode 100644 index 0000000000..a00dcf95a0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-integer-attribute.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateIntegerAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = 0, + min = 0, // optional + max = 0, // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-ip-attribute.md new file mode 100644 index 0000000000..505e5ea18d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-ip-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateIpAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = "", + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-line-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-line-attribute.md new file mode 100644 index 0000000000..0d6b40a2d8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-line-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateLineAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = listOf([1, 2], [3, 4], [5, 6]), // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-point-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-point-attribute.md new file mode 100644 index 0000000000..68d5311c98 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-point-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updatePointAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = listOf(1, 2), // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..66bbdea11c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-polygon-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updatePolygonAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..001dd1a391 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-relationship-attribute.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateRelationshipAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + onDelete = "cascade", // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-string-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-string-attribute.md new file mode 100644 index 0000000000..364a6b5b7f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-string-attribute.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateStringAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = "<DEFAULT>", + size = 1, // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-url-attribute.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-url-attribute.md new file mode 100644 index 0000000000..a628cc57f8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update-url-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateUrlAttribute( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + key = "", + required = false, + default = "https://example.com", + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/update.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update.md new file mode 100644 index 0000000000..05f832738a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/update.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.update( + databaseId = "<DATABASE_ID>", + name = "<NAME>", + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/upsert-document.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/upsert-document.md new file mode 100644 index 0000000000..d8be0e13db --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/upsert-document.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.upsertDocument( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documentId = "<DOCUMENT_ID>", + data = mapOf( "a" to "b" ), + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/databases/upsert-documents.md b/docs/examples/1.8.x/server-kotlin/kotlin/databases/upsert-documents.md new file mode 100644 index 0000000000..ca861c61b2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/databases/upsert-documents.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val databases = Databases(client) + +val response = databases.upsertDocuments( + databaseId = "<DATABASE_ID>", + collectionId = "<COLLECTION_ID>", + documents = listOf() +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-deployment.md new file mode 100644 index 0000000000..ddc6e8b207 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-deployment.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.models.InputFile +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.createDeployment( + functionId = "<FUNCTION_ID>", + code = InputFile.fromPath("file.png"), + activate = false, + entrypoint = "<ENTRYPOINT>", // optional + commands = "<COMMANDS>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..a3395f118f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-duplicate-deployment.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.createDuplicateDeployment( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>", + buildId = "<BUILD_ID>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-execution.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-execution.md new file mode 100644 index 0000000000..2734412232 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-execution.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val functions = Functions(client) + +val response = functions.createExecution( + functionId = "<FUNCTION_ID>", + body = "<BODY>", // optional + async = false, // optional + path = "<PATH>", // optional + method = "GET", // optional + headers = mapOf( "a" to "b" ), // optional + scheduledAt = "<SCHEDULED_AT>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-template-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-template-deployment.md new file mode 100644 index 0000000000..90c311ec7a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-template-deployment.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.createTemplateDeployment( + functionId = "<FUNCTION_ID>", + repository = "<REPOSITORY>", + owner = "<OWNER>", + rootDirectory = "<ROOT_DIRECTORY>", + version = "<VERSION>", + activate = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-variable.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-variable.md new file mode 100644 index 0000000000..061bc20534 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-variable.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.createVariable( + functionId = "<FUNCTION_ID>", + key = "<KEY>", + value = "<VALUE>", + secret = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..08bb5a3097 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create-vcs-deployment.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions +import io.appwrite.enums.VCSDeploymentType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.createVcsDeployment( + functionId = "<FUNCTION_ID>", + type = VCSDeploymentType.BRANCH, + reference = "<REFERENCE>", + activate = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/create.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create.md new file mode 100644 index 0000000000..c0ea4de201 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/create.md @@ -0,0 +1,32 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions +import io.appwrite.enums.Runtime + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.create( + functionId = "<FUNCTION_ID>", + name = "<NAME>", + runtime = .NODE_14_5, + execute = listOf("any"), // optional + events = listOf(), // optional + schedule = "", // optional + timeout = 1, // optional + enabled = false, // optional + logging = false, // optional + entrypoint = "<ENTRYPOINT>", // optional + commands = "<COMMANDS>", // optional + scopes = listOf(), // optional + installationId = "<INSTALLATION_ID>", // optional + providerRepositoryId = "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch = "<PROVIDER_BRANCH>", // optional + providerSilentMode = false, // optional + providerRootDirectory = "<PROVIDER_ROOT_DIRECTORY>", // optional + specification = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete-deployment.md new file mode 100644 index 0000000000..937fc961da --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete-deployment.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.deleteDeployment( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete-execution.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete-execution.md new file mode 100644 index 0000000000..95994f822a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete-execution.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.deleteExecution( + functionId = "<FUNCTION_ID>", + executionId = "<EXECUTION_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete-variable.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete-variable.md new file mode 100644 index 0000000000..e1793675c9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete-variable.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.deleteVariable( + functionId = "<FUNCTION_ID>", + variableId = "<VARIABLE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete.md new file mode 100644 index 0000000000..9651744767 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/delete.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.delete( + functionId = "<FUNCTION_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-deployment-download.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-deployment-download.md new file mode 100644 index 0000000000..634cfae3b4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-deployment-download.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val result = functions.getDeploymentDownload( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>", + type = "source" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-deployment.md new file mode 100644 index 0000000000..eba4abb6df --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-deployment.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.getDeployment( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-execution.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-execution.md new file mode 100644 index 0000000000..480dbb76ba --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-execution.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val functions = Functions(client) + +val response = functions.getExecution( + functionId = "<FUNCTION_ID>", + executionId = "<EXECUTION_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-variable.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-variable.md new file mode 100644 index 0000000000..95359ef8fc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/get-variable.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.getVariable( + functionId = "<FUNCTION_ID>", + variableId = "<VARIABLE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/get.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/get.md new file mode 100644 index 0000000000..162fa22497 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/get.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.get( + functionId = "<FUNCTION_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-deployments.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-deployments.md new file mode 100644 index 0000000000..9318442afa --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-deployments.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.listDeployments( + functionId = "<FUNCTION_ID>", + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-executions.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-executions.md new file mode 100644 index 0000000000..926719cda8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-executions.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val functions = Functions(client) + +val response = functions.listExecutions( + functionId = "<FUNCTION_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-runtimes.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-runtimes.md new file mode 100644 index 0000000000..5b3673b84d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-runtimes.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.listRuntimes() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-specifications.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-specifications.md new file mode 100644 index 0000000000..0b2fb46a4b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-specifications.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.listSpecifications() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-variables.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-variables.md new file mode 100644 index 0000000000..7f576e8957 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list-variables.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.listVariables( + functionId = "<FUNCTION_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/list.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list.md new file mode 100644 index 0000000000..b10fdff53a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/list.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.list( + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/update-deployment-status.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/update-deployment-status.md new file mode 100644 index 0000000000..0e6e9c0abe --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/update-deployment-status.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.updateDeploymentStatus( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/update-function-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/update-function-deployment.md new file mode 100644 index 0000000000..a975e07efe --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/update-function-deployment.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.updateFunctionDeployment( + functionId = "<FUNCTION_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/update-variable.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/update-variable.md new file mode 100644 index 0000000000..106b340eb5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/update-variable.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.updateVariable( + functionId = "<FUNCTION_ID>", + variableId = "<VARIABLE_ID>", + key = "<KEY>", + value = "<VALUE>", // optional + secret = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/functions/update.md b/docs/examples/1.8.x/server-kotlin/kotlin/functions/update.md new file mode 100644 index 0000000000..7f0b33ebd7 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/functions/update.md @@ -0,0 +1,31 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val functions = Functions(client) + +val response = functions.update( + functionId = "<FUNCTION_ID>", + name = "<NAME>", + runtime = "node-14.5", // optional + execute = listOf("any"), // optional + events = listOf(), // optional + schedule = "", // optional + timeout = 1, // optional + enabled = false, // optional + logging = false, // optional + entrypoint = "<ENTRYPOINT>", // optional + commands = "<COMMANDS>", // optional + scopes = listOf(), // optional + installationId = "<INSTALLATION_ID>", // optional + providerRepositoryId = "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch = "<PROVIDER_BRANCH>", // optional + providerSilentMode = false, // optional + providerRootDirectory = "<PROVIDER_ROOT_DIRECTORY>", // optional + specification = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/graphql/mutation.md b/docs/examples/1.8.x/server-kotlin/kotlin/graphql/mutation.md new file mode 100644 index 0000000000..98081ab06b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/graphql/mutation.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Graphql + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val graphql = Graphql(client) + +val response = graphql.mutation( + query = mapOf( "a" to "b" ) +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/graphql/query.md b/docs/examples/1.8.x/server-kotlin/kotlin/graphql/query.md new file mode 100644 index 0000000000..dec8dd350c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/graphql/query.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Graphql + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val graphql = Graphql(client) + +val response = graphql.query( + query = mapOf( "a" to "b" ) +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-antivirus.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-antivirus.md new file mode 100644 index 0000000000..869b4c4804 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-antivirus.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getAntivirus() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-cache.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-cache.md new file mode 100644 index 0000000000..8b72ec414f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-cache.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getCache() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-certificate.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-certificate.md new file mode 100644 index 0000000000..74bf618704 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-certificate.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getCertificate( + domain = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-db.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-db.md new file mode 100644 index 0000000000..a55a1146f4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-db.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getDB() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-failed-jobs.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-failed-jobs.md new file mode 100644 index 0000000000..027df127cc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-failed-jobs.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health +import io.appwrite.enums.Name + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getFailedJobs( + name = .V1_DATABASE, + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-pub-sub.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-pub-sub.md new file mode 100644 index 0000000000..53c3820232 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-pub-sub.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getPubSub() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-builds.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-builds.md new file mode 100644 index 0000000000..371aad90f8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-builds.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueBuilds( + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-certificates.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-certificates.md new file mode 100644 index 0000000000..5c6adeecb5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-certificates.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueCertificates( + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-databases.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-databases.md new file mode 100644 index 0000000000..3a3405830d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-databases.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueDatabases( + name = "<NAME>", // optional + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-deletes.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-deletes.md new file mode 100644 index 0000000000..5d0b8a3381 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-deletes.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueDeletes( + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-functions.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-functions.md new file mode 100644 index 0000000000..7a42b61ba5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-functions.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueFunctions( + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-logs.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-logs.md new file mode 100644 index 0000000000..151025bfb6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-logs.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueLogs( + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-mails.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-mails.md new file mode 100644 index 0000000000..f5a905dd73 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-mails.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueMails( + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-messaging.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-messaging.md new file mode 100644 index 0000000000..4a837928eb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-messaging.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueMessaging( + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-migrations.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-migrations.md new file mode 100644 index 0000000000..853d294ed1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-migrations.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueMigrations( + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..6a76f528e2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-stats-resources.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueStatsResources( + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-usage.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-usage.md new file mode 100644 index 0000000000..e344b9eddc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-usage.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueUsage( + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-webhooks.md new file mode 100644 index 0000000000..f5ffc58d8d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-queue-webhooks.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getQueueWebhooks( + threshold = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-storage-local.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-storage-local.md new file mode 100644 index 0000000000..32a21aea0a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-storage-local.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getStorageLocal() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-storage.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-storage.md new file mode 100644 index 0000000000..8af609aad9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-storage.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getStorage() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get-time.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-time.md new file mode 100644 index 0000000000..8054ed7c69 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get-time.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.getTime() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/health/get.md b/docs/examples/1.8.x/server-kotlin/kotlin/health/get.md new file mode 100644 index 0000000000..0845320bb5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/health/get.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Health + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val health = Health(client) + +val response = health.get() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/locale/get.md b/docs/examples/1.8.x/server-kotlin/kotlin/locale/get.md new file mode 100644 index 0000000000..6840259c27 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/locale/get.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.get() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-codes.md b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-codes.md new file mode 100644 index 0000000000..fd0c4e413e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-codes.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listCodes() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-continents.md b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-continents.md new file mode 100644 index 0000000000..699d599f56 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-continents.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listContinents() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-countries-eu.md b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-countries-eu.md new file mode 100644 index 0000000000..13e86f3064 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-countries-eu.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listCountriesEU() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-countries-phones.md b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-countries-phones.md new file mode 100644 index 0000000000..b660ccf433 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-countries-phones.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listCountriesPhones() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-countries.md b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-countries.md new file mode 100644 index 0000000000..3457ceb4c5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-countries.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listCountries() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-currencies.md b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-currencies.md new file mode 100644 index 0000000000..80b2cc7e52 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-currencies.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listCurrencies() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-languages.md b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-languages.md new file mode 100644 index 0000000000..b36c1389a5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/locale/list-languages.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Locale + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val locale = Locale(client) + +val response = locale.listLanguages() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-apns-provider.md new file mode 100644 index 0000000000..5104edf3e2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-apns-provider.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createAPNSProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + authKey = "<AUTH_KEY>", // optional + authKeyId = "<AUTH_KEY_ID>", // optional + teamId = "<TEAM_ID>", // optional + bundleId = "<BUNDLE_ID>", // optional + sandbox = false, // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-email.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-email.md new file mode 100644 index 0000000000..f0f41e9e53 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-email.md @@ -0,0 +1,25 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createEmail( + messageId = "<MESSAGE_ID>", + subject = "<SUBJECT>", + content = "<CONTENT>", + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + cc = listOf(), // optional + bcc = listOf(), // optional + attachments = listOf(), // optional + draft = false, // optional + html = false, // optional + scheduledAt = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..b1a2ef8314 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-fcm-provider.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createFCMProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + serviceAccountJSON = mapOf( "a" to "b" ), // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..d205171dfe --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-mailgun-provider.md @@ -0,0 +1,23 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createMailgunProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + apiKey = "<API_KEY>", // optional + domain = "<DOMAIN>", // optional + isEuRegion = false, // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "email@example.com", // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..5ea3d223e9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-msg-91-provider.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createMsg91Provider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + templateId = "<TEMPLATE_ID>", // optional + senderId = "<SENDER_ID>", // optional + authKey = "<AUTH_KEY>", // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-push.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-push.md new file mode 100644 index 0000000000..5b07f5355b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-push.md @@ -0,0 +1,32 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createPush( + messageId = "<MESSAGE_ID>", + title = "<TITLE>", // optional + body = "<BODY>", // optional + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + data = mapOf( "a" to "b" ), // optional + action = "<ACTION>", // optional + image = "[ID1:ID2]", // optional + icon = "<ICON>", // optional + sound = "<SOUND>", // optional + color = "<COLOR>", // optional + tag = "<TAG>", // optional + badge = 0, // optional + draft = false, // optional + scheduledAt = "", // optional + contentAvailable = false, // optional + critical = false, // optional + priority = "normal" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..e96a052d5a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-sendgrid-provider.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createSendgridProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + apiKey = "<API_KEY>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "email@example.com", // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-sms.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-sms.md new file mode 100644 index 0000000000..54c06eb3e2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-sms.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createSMS( + messageId = "<MESSAGE_ID>", + content = "<CONTENT>", + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + draft = false, // optional + scheduledAt = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..ce50130e80 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-smtp-provider.md @@ -0,0 +1,27 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createSMTPProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + host = "<HOST>", + port = 1, // optional + username = "<USERNAME>", // optional + password = "<PASSWORD>", // optional + encryption = "none", // optional + autoTLS = false, // optional + mailer = "<MAILER>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "email@example.com", // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-subscriber.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-subscriber.md new file mode 100644 index 0000000000..44e3a72a1d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-subscriber.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>") // Your secret JSON Web Token + +val messaging = Messaging(client) + +val response = messaging.createSubscriber( + topicId = "<TOPIC_ID>", + subscriberId = "<SUBSCRIBER_ID>", + targetId = "<TARGET_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..cddd6d801a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-telesign-provider.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createTelesignProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + from = "+12065550100", // optional + customerId = "<CUSTOMER_ID>", // optional + apiKey = "<API_KEY>", // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..12eb62d957 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-textmagic-provider.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createTextmagicProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + from = "+12065550100", // optional + username = "<USERNAME>", // optional + apiKey = "<API_KEY>", // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-topic.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-topic.md new file mode 100644 index 0000000000..570be33e41 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-topic.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createTopic( + topicId = "<TOPIC_ID>", + name = "<NAME>", + subscribe = listOf("any") // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..c05b835d52 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-twilio-provider.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createTwilioProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + from = "+12065550100", // optional + accountSid = "<ACCOUNT_SID>", // optional + authToken = "<AUTH_TOKEN>", // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..7e049d8313 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/create-vonage-provider.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createVonageProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", + from = "+12065550100", // optional + apiKey = "<API_KEY>", // optional + apiSecret = "<API_SECRET>", // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete-provider.md new file mode 100644 index 0000000000..4989da8cd3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete-provider.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.deleteProvider( + providerId = "<PROVIDER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete-subscriber.md new file mode 100644 index 0000000000..0f99f251a3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete-subscriber.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>") // Your secret JSON Web Token + +val messaging = Messaging(client) + +val response = messaging.deleteSubscriber( + topicId = "<TOPIC_ID>", + subscriberId = "<SUBSCRIBER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete-topic.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete-topic.md new file mode 100644 index 0000000000..8a52c9f9a5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete-topic.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.deleteTopic( + topicId = "<TOPIC_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete.md new file mode 100644 index 0000000000..7e4ec51c93 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/delete.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.delete( + messageId = "<MESSAGE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-message.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-message.md new file mode 100644 index 0000000000..710d356113 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-message.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.getMessage( + messageId = "<MESSAGE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-provider.md new file mode 100644 index 0000000000..c678d4d984 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-provider.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.getProvider( + providerId = "<PROVIDER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-subscriber.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-subscriber.md new file mode 100644 index 0000000000..59b335a2e6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-subscriber.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.getSubscriber( + topicId = "<TOPIC_ID>", + subscriberId = "<SUBSCRIBER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-topic.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-topic.md new file mode 100644 index 0000000000..c189898e95 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/get-topic.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.getTopic( + topicId = "<TOPIC_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-message-logs.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-message-logs.md new file mode 100644 index 0000000000..e1463f8911 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-message-logs.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listMessageLogs( + messageId = "<MESSAGE_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-messages.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-messages.md new file mode 100644 index 0000000000..618f8c493e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-messages.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listMessages( + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-provider-logs.md new file mode 100644 index 0000000000..ab0a9f1260 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-provider-logs.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listProviderLogs( + providerId = "<PROVIDER_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-providers.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-providers.md new file mode 100644 index 0000000000..34c70a9c86 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-providers.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listProviders( + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..8a82af8f70 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-subscriber-logs.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listSubscriberLogs( + subscriberId = "<SUBSCRIBER_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-subscribers.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-subscribers.md new file mode 100644 index 0000000000..acf5249900 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-subscribers.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listSubscribers( + topicId = "<TOPIC_ID>", + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-targets.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-targets.md new file mode 100644 index 0000000000..ad500f0e38 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-targets.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listTargets( + messageId = "<MESSAGE_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-topic-logs.md new file mode 100644 index 0000000000..683b418032 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-topic-logs.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listTopicLogs( + topicId = "<TOPIC_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-topics.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-topics.md new file mode 100644 index 0000000000..125c6ffb82 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/list-topics.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.listTopics( + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-apns-provider.md new file mode 100644 index 0000000000..29b436e41d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-apns-provider.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateAPNSProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + authKey = "<AUTH_KEY>", // optional + authKeyId = "<AUTH_KEY_ID>", // optional + teamId = "<TEAM_ID>", // optional + bundleId = "<BUNDLE_ID>", // optional + sandbox = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-email.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-email.md new file mode 100644 index 0000000000..cd74bb4290 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-email.md @@ -0,0 +1,25 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateEmail( + messageId = "<MESSAGE_ID>", + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + subject = "<SUBJECT>", // optional + content = "<CONTENT>", // optional + draft = false, // optional + html = false, // optional + cc = listOf(), // optional + bcc = listOf(), // optional + scheduledAt = "", // optional + attachments = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..84e5635fb2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-fcm-provider.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateFCMProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + serviceAccountJSON = mapOf( "a" to "b" ) // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..4bec8d2a44 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-mailgun-provider.md @@ -0,0 +1,23 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateMailgunProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + apiKey = "<API_KEY>", // optional + domain = "<DOMAIN>", // optional + isEuRegion = false, // optional + enabled = false, // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "<REPLY_TO_EMAIL>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..3abaca75bb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-msg-91-provider.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateMsg91Provider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + templateId = "<TEMPLATE_ID>", // optional + senderId = "<SENDER_ID>", // optional + authKey = "<AUTH_KEY>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-push.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-push.md new file mode 100644 index 0000000000..710a37e518 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-push.md @@ -0,0 +1,32 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updatePush( + messageId = "<MESSAGE_ID>", + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + title = "<TITLE>", // optional + body = "<BODY>", // optional + data = mapOf( "a" to "b" ), // optional + action = "<ACTION>", // optional + image = "[ID1:ID2]", // optional + icon = "<ICON>", // optional + sound = "<SOUND>", // optional + color = "<COLOR>", // optional + tag = "<TAG>", // optional + badge = 0, // optional + draft = false, // optional + scheduledAt = "", // optional + contentAvailable = false, // optional + critical = false, // optional + priority = "normal" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..962aa694e6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-sendgrid-provider.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateSendgridProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + apiKey = "<API_KEY>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "<REPLY_TO_EMAIL>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-sms.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-sms.md new file mode 100644 index 0000000000..534e9addfc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-sms.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateSMS( + messageId = "<MESSAGE_ID>", + topics = listOf(), // optional + users = listOf(), // optional + targets = listOf(), // optional + content = "<CONTENT>", // optional + draft = false, // optional + scheduledAt = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..7652e53166 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-smtp-provider.md @@ -0,0 +1,27 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateSMTPProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + host = "<HOST>", // optional + port = 1, // optional + username = "<USERNAME>", // optional + password = "<PASSWORD>", // optional + encryption = "none", // optional + autoTLS = false, // optional + mailer = "<MAILER>", // optional + fromName = "<FROM_NAME>", // optional + fromEmail = "email@example.com", // optional + replyToName = "<REPLY_TO_NAME>", // optional + replyToEmail = "<REPLY_TO_EMAIL>", // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..83fb11a856 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-telesign-provider.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateTelesignProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + customerId = "<CUSTOMER_ID>", // optional + apiKey = "<API_KEY>", // optional + from = "<FROM>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..1e2ee1e2c8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-textmagic-provider.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateTextmagicProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + username = "<USERNAME>", // optional + apiKey = "<API_KEY>", // optional + from = "<FROM>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-topic.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-topic.md new file mode 100644 index 0000000000..0991fd0ee4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-topic.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateTopic( + topicId = "<TOPIC_ID>", + name = "<NAME>", // optional + subscribe = listOf("any") // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..1c86f9e853 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-twilio-provider.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateTwilioProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + accountSid = "<ACCOUNT_SID>", // optional + authToken = "<AUTH_TOKEN>", // optional + from = "<FROM>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..bf0ee2b75c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/messaging/update-vonage-provider.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateVonageProvider( + providerId = "<PROVIDER_ID>", + name = "<NAME>", // optional + enabled = false, // optional + apiKey = "<API_KEY>", // optional + apiSecret = "<API_SECRET>", // optional + from = "<FROM>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-deployment.md new file mode 100644 index 0000000000..ba2c24dd6b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-deployment.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.models.InputFile +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.createDeployment( + siteId = "<SITE_ID>", + code = InputFile.fromPath("file.png"), + activate = false, + installCommand = "<INSTALL_COMMAND>", // optional + buildCommand = "<BUILD_COMMAND>", // optional + outputDirectory = "<OUTPUT_DIRECTORY>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..06a3ce8467 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-duplicate-deployment.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.createDuplicateDeployment( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-template-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-template-deployment.md new file mode 100644 index 0000000000..bf246be089 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-template-deployment.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.createTemplateDeployment( + siteId = "<SITE_ID>", + repository = "<REPOSITORY>", + owner = "<OWNER>", + rootDirectory = "<ROOT_DIRECTORY>", + version = "<VERSION>", + activate = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-variable.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-variable.md new file mode 100644 index 0000000000..6eb466682f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-variable.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.createVariable( + siteId = "<SITE_ID>", + key = "<KEY>", + value = "<VALUE>", + secret = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..141cf3e658 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create-vcs-deployment.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites +import io.appwrite.enums.VCSDeploymentType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.createVcsDeployment( + siteId = "<SITE_ID>", + type = VCSDeploymentType.BRANCH, + reference = "<REFERENCE>", + activate = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/create.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create.md new file mode 100644 index 0000000000..a5e9719faf --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/create.md @@ -0,0 +1,33 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites +import io.appwrite.enums.Framework +import io.appwrite.enums.BuildRuntime + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.create( + siteId = "<SITE_ID>", + name = "<NAME>", + framework = .ANALOG, + buildRuntime = .NODE_14_5, + enabled = false, // optional + logging = false, // optional + timeout = 1, // optional + installCommand = "<INSTALL_COMMAND>", // optional + buildCommand = "<BUILD_COMMAND>", // optional + outputDirectory = "<OUTPUT_DIRECTORY>", // optional + adapter = "static", // optional + installationId = "<INSTALLATION_ID>", // optional + fallbackFile = "<FALLBACK_FILE>", // optional + providerRepositoryId = "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch = "<PROVIDER_BRANCH>", // optional + providerSilentMode = false, // optional + providerRootDirectory = "<PROVIDER_ROOT_DIRECTORY>", // optional + specification = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete-deployment.md new file mode 100644 index 0000000000..6d739183f1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete-deployment.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.deleteDeployment( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete-log.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete-log.md new file mode 100644 index 0000000000..c7d7b77824 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete-log.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.deleteLog( + siteId = "<SITE_ID>", + logId = "<LOG_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete-variable.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete-variable.md new file mode 100644 index 0000000000..7859a8a852 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete-variable.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.deleteVariable( + siteId = "<SITE_ID>", + variableId = "<VARIABLE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete.md new file mode 100644 index 0000000000..369b6144c3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/delete.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.delete( + siteId = "<SITE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-deployment-download.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-deployment-download.md new file mode 100644 index 0000000000..84324762cc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-deployment-download.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val result = sites.getDeploymentDownload( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>", + type = "source" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-deployment.md new file mode 100644 index 0000000000..f2a33a409e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-deployment.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.getDeployment( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-log.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-log.md new file mode 100644 index 0000000000..ff46f77d12 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-log.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.getLog( + siteId = "<SITE_ID>", + logId = "<LOG_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-variable.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-variable.md new file mode 100644 index 0000000000..ccab666607 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/get-variable.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.getVariable( + siteId = "<SITE_ID>", + variableId = "<VARIABLE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/get.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/get.md new file mode 100644 index 0000000000..7ced974ede --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/get.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.get( + siteId = "<SITE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-deployments.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-deployments.md new file mode 100644 index 0000000000..6bc29ccd0e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-deployments.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.listDeployments( + siteId = "<SITE_ID>", + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-frameworks.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-frameworks.md new file mode 100644 index 0000000000..cf02b75bc2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-frameworks.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.listFrameworks() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-logs.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-logs.md new file mode 100644 index 0000000000..d7979ded39 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-logs.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.listLogs( + siteId = "<SITE_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-specifications.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-specifications.md new file mode 100644 index 0000000000..56e864059a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-specifications.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.listSpecifications() diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-variables.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-variables.md new file mode 100644 index 0000000000..70ec49799b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list-variables.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.listVariables( + siteId = "<SITE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/list.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list.md new file mode 100644 index 0000000000..26e965177d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/list.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.list( + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/update-deployment-status.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/update-deployment-status.md new file mode 100644 index 0000000000..585fc324ed --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/update-deployment-status.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.updateDeploymentStatus( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/update-site-deployment.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/update-site-deployment.md new file mode 100644 index 0000000000..fb9bb726f8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/update-site-deployment.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.updateSiteDeployment( + siteId = "<SITE_ID>", + deploymentId = "<DEPLOYMENT_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/update-variable.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/update-variable.md new file mode 100644 index 0000000000..b32c27809a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/update-variable.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.updateVariable( + siteId = "<SITE_ID>", + variableId = "<VARIABLE_ID>", + key = "<KEY>", + value = "<VALUE>", // optional + secret = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/sites/update.md b/docs/examples/1.8.x/server-kotlin/kotlin/sites/update.md new file mode 100644 index 0000000000..4b4a938d95 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/sites/update.md @@ -0,0 +1,32 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites +import io.appwrite.enums.Framework + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val sites = Sites(client) + +val response = sites.update( + siteId = "<SITE_ID>", + name = "<NAME>", + framework = .ANALOG, + enabled = false, // optional + logging = false, // optional + timeout = 1, // optional + installCommand = "<INSTALL_COMMAND>", // optional + buildCommand = "<BUILD_COMMAND>", // optional + outputDirectory = "<OUTPUT_DIRECTORY>", // optional + buildRuntime = "node-14.5", // optional + adapter = "static", // optional + fallbackFile = "<FALLBACK_FILE>", // optional + installationId = "<INSTALLATION_ID>", // optional + providerRepositoryId = "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch = "<PROVIDER_BRANCH>", // optional + providerSilentMode = false, // optional + providerRootDirectory = "<PROVIDER_ROOT_DIRECTORY>", // optional + specification = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/create-bucket.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/create-bucket.md new file mode 100644 index 0000000000..0bca827872 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/create-bucket.md @@ -0,0 +1,23 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val storage = Storage(client) + +val response = storage.createBucket( + bucketId = "<BUCKET_ID>", + name = "<NAME>", + permissions = listOf("read("any")"), // optional + fileSecurity = false, // optional + enabled = false, // optional + maximumFileSize = 1, // optional + allowedFileExtensions = listOf(), // optional + compression = "none", // optional + encryption = false, // optional + antivirus = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/create-file.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/create-file.md new file mode 100644 index 0000000000..b22b32a665 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/create-file.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.models.InputFile +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val response = storage.createFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + file = InputFile.fromPath("file.png"), + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/delete-bucket.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/delete-bucket.md new file mode 100644 index 0000000000..4a0904ec63 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/delete-bucket.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val storage = Storage(client) + +val response = storage.deleteBucket( + bucketId = "<BUCKET_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/delete-file.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/delete-file.md new file mode 100644 index 0000000000..cf5e285db3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/delete-file.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val response = storage.deleteFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-bucket.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-bucket.md new file mode 100644 index 0000000000..e2a6a8f527 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-bucket.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val storage = Storage(client) + +val response = storage.getBucket( + bucketId = "<BUCKET_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file-download.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file-download.md new file mode 100644 index 0000000000..c14c966b8b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file-download.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val result = storage.getFileDownload( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + token = "<TOKEN>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file-preview.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file-preview.md new file mode 100644 index 0000000000..45122de2f8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file-preview.md @@ -0,0 +1,27 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val result = storage.getFilePreview( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + width = 0, // optional + height = 0, // optional + gravity = "center", // optional + quality = -1, // optional + borderWidth = 0, // optional + borderColor = "", // optional + borderRadius = 0, // optional + opacity = 0, // optional + rotation = -360, // optional + background = "", // optional + output = "jpg", // optional + token = "<TOKEN>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file-view.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file-view.md new file mode 100644 index 0000000000..fec1ec7162 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file-view.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val result = storage.getFileView( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + token = "<TOKEN>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file.md new file mode 100644 index 0000000000..a807177dce --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/get-file.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val response = storage.getFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/list-buckets.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/list-buckets.md new file mode 100644 index 0000000000..a8a066dc9f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/list-buckets.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val storage = Storage(client) + +val response = storage.listBuckets( + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/list-files.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/list-files.md new file mode 100644 index 0000000000..cb9a776775 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/list-files.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val response = storage.listFiles( + bucketId = "<BUCKET_ID>", + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/update-bucket.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/update-bucket.md new file mode 100644 index 0000000000..d475a6e5ed --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/update-bucket.md @@ -0,0 +1,23 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val storage = Storage(client) + +val response = storage.updateBucket( + bucketId = "<BUCKET_ID>", + name = "<NAME>", + permissions = listOf("read("any")"), // optional + fileSecurity = false, // optional + enabled = false, // optional + maximumFileSize = 1, // optional + allowedFileExtensions = listOf(), // optional + compression = "none", // optional + encryption = false, // optional + antivirus = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/storage/update-file.md b/docs/examples/1.8.x/server-kotlin/kotlin/storage/update-file.md new file mode 100644 index 0000000000..e82ea8125c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/storage/update-file.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Storage + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val storage = Storage(client) + +val response = storage.updateFile( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + name = "<NAME>", // optional + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..fac14d916f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-boolean-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createBooleanColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = false, // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..e40d8e4729 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-datetime-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createDatetimeColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = "", // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-email-column.md new file mode 100644 index 0000000000..e93e0b8907 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-email-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createEmailColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = "email@example.com", // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..1d19a589e0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-enum-column.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createEnumColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + elements = listOf(), + required = false, + default = "<DEFAULT>", // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-float-column.md new file mode 100644 index 0000000000..3c24b0d9fa --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-float-column.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createFloatColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + min = 0, // optional + max = 0, // optional + default = 0, // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-index.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-index.md new file mode 100644 index 0000000000..2492f71537 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-index.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.enums.IndexType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createIndex( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + type = IndexType.KEY, + columns = listOf(), + orders = listOf(), // optional + lengths = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..90c558c4dd --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-integer-column.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createIntegerColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + min = 0, // optional + max = 0, // optional + default = 0, // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..81412c7ac0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-ip-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createIpColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = "", // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-line-column.md new file mode 100644 index 0000000000..3dd9ebd083 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-line-column.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createLineColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = listOf([1, 2], [3, 4], [5, 6]) // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-point-column.md new file mode 100644 index 0000000000..7fd6ad7504 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-point-column.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createPointColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = listOf(1, 2) // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..218b4cba33 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-polygon-column.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createPolygonColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = listOf([[1, 2], [3, 4], [5, 6], [1, 2]]) // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..fbdf36532f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-relationship-column.md @@ -0,0 +1,22 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.enums.RelationshipType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createRelationshipColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + relatedTableId = "<RELATED_TABLE_ID>", + type = RelationshipType.ONETOONE, + twoWay = false, // optional + key = "", // optional + twoWayKey = "", // optional + onDelete = "cascade" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-row.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-row.md new file mode 100644 index 0000000000..774800d8f4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-row.md @@ -0,0 +1,24 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.createRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + data = mapOf( + "username" to "walter.obrien", + "email" to "walter.obrien@example.com", + "fullName" to "Walter O'Brien", + "age" to 30, + "isAdmin" to false + ), + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-rows.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-rows.md new file mode 100644 index 0000000000..1da47b5c18 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-rows.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createRows( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rows = listOf() +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-string-column.md new file mode 100644 index 0000000000..5b5d88db3c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-string-column.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createStringColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + size = 1, + required = false, + default = "<DEFAULT>", // optional + array = false, // optional + encrypt = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-table.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-table.md new file mode 100644 index 0000000000..88b50d22ad --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-table.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createTable( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + name = "<NAME>", + permissions = listOf("read("any")"), // optional + rowSecurity = false, // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-url-column.md new file mode 100644 index 0000000000..a0351e4f37 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create-url-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createUrlColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = "https://example.com", // optional + array = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create.md new file mode 100644 index 0000000000..4b025b853e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/create.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.create( + databaseId = "<DATABASE_ID>", + name = "<NAME>", + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..e284ec3980 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/decrement-row-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.decrementRowColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + column = "", + value = 0, // optional + min = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-column.md new file mode 100644 index 0000000000..05d341d1b3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-column.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-index.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-index.md new file mode 100644 index 0000000000..b5f2330d60 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-index.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteIndex( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-row.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-row.md new file mode 100644 index 0000000000..f24b9353e0 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-row.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-rows.md new file mode 100644 index 0000000000..c915a5c55a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-rows.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteRows( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-table.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-table.md new file mode 100644 index 0000000000..dce8e583ab --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete-table.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteTable( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete.md new file mode 100644 index 0000000000..3e335fa264 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/delete.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.delete( + databaseId = "<DATABASE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-column.md new file mode 100644 index 0000000000..c4cf24dd1f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-column.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.getColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-index.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-index.md new file mode 100644 index 0000000000..4db254740a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-index.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.getIndex( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-row.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-row.md new file mode 100644 index 0000000000..ec54631646 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-row.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.getRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-table.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-table.md new file mode 100644 index 0000000000..65afae84b3 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get-table.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.getTable( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get.md new file mode 100644 index 0000000000..e58da26fdb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/get.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.get( + databaseId = "<DATABASE_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..cac151e41b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/increment-row-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.incrementRowColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + column = "", + value = 0, // optional + max = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-columns.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-columns.md new file mode 100644 index 0000000000..85a9aabb28 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-columns.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.listColumns( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-indexes.md new file mode 100644 index 0000000000..db5aad4e80 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-indexes.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.listIndexes( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-rows.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-rows.md new file mode 100644 index 0000000000..b0f5df476b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-rows.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.listRows( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-tables.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-tables.md new file mode 100644 index 0000000000..1e8eb8f7c7 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list-tables.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.listTables( + databaseId = "<DATABASE_ID>", + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list.md new file mode 100644 index 0000000000..58b48a09ed --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/list.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.list( + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..43ab43bfea --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-boolean-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateBooleanColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = false, + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..077cff7169 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-datetime-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateDatetimeColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = "", + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-email-column.md new file mode 100644 index 0000000000..5becaa681d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-email-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateEmailColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = "email@example.com", + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..4351703edb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-enum-column.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateEnumColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + elements = listOf(), + required = false, + default = "<DEFAULT>", + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-float-column.md new file mode 100644 index 0000000000..6d40c3f3a1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-float-column.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateFloatColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = 0, + min = 0, // optional + max = 0, // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..9d6bfaa635 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-integer-column.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateIntegerColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = 0, + min = 0, // optional + max = 0, // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..fd04b98a13 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-ip-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateIpColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = "", + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-line-column.md new file mode 100644 index 0000000000..571d25206c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-line-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateLineColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = listOf([1, 2], [3, 4], [5, 6]), // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-point-column.md new file mode 100644 index 0000000000..2230e59f8e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-point-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updatePointColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = listOf(1, 2), // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..db3a46bc6c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-polygon-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updatePolygonColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..f69defd8ec --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-relationship-column.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateRelationshipColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + onDelete = "cascade", // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-row.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-row.md new file mode 100644 index 0000000000..9c5248f4e8 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-row.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + data = mapOf( "a" to "b" ), // optional + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-rows.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-rows.md new file mode 100644 index 0000000000..c285d5b4fb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-rows.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateRows( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + data = mapOf( "a" to "b" ), // optional + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-string-column.md new file mode 100644 index 0000000000..acdd3ad5f9 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-string-column.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateStringColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = "<DEFAULT>", + size = 1, // optional + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-table.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-table.md new file mode 100644 index 0000000000..52389087e7 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-table.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateTable( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + name = "<NAME>", + permissions = listOf("read("any")"), // optional + rowSecurity = false, // optional + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-url-column.md new file mode 100644 index 0000000000..fbe68c9a62 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update-url-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateUrlColumn( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + key = "", + required = false, + default = "https://example.com", + newKey = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update.md new file mode 100644 index 0000000000..48d1a8e300 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/update.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.update( + databaseId = "<DATABASE_ID>", + name = "<NAME>", + enabled = false // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/upsert-row.md new file mode 100644 index 0000000000..3fcbc61617 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/upsert-row.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.upsertRow( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rowId = "<ROW_ID>", + data = mapOf( "a" to "b" ), // optional + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..7059c6018b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tablesdb/upsert-rows.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.upsertRows( + databaseId = "<DATABASE_ID>", + tableId = "<TABLE_ID>", + rows = listOf() +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/create-membership.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/create-membership.md new file mode 100644 index 0000000000..33eb16568e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/create-membership.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.createMembership( + teamId = "<TEAM_ID>", + roles = listOf(), + email = "email@example.com", // optional + userId = "<USER_ID>", // optional + phone = "+12065550100", // optional + url = "https://example.com", // optional + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/create.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/create.md new file mode 100644 index 0000000000..6ec7e533d2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/create.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.create( + teamId = "<TEAM_ID>", + name = "<NAME>", + roles = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/delete-membership.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/delete-membership.md new file mode 100644 index 0000000000..48c924f37b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/delete-membership.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.deleteMembership( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/delete.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/delete.md new file mode 100644 index 0000000000..4b70ff2f18 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/delete.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.delete( + teamId = "<TEAM_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/get-membership.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/get-membership.md new file mode 100644 index 0000000000..a636c217da --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/get-membership.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.getMembership( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/get-prefs.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/get-prefs.md new file mode 100644 index 0000000000..2b73432d6c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/get-prefs.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.getPrefs( + teamId = "<TEAM_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/get.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/get.md new file mode 100644 index 0000000000..72b667776f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/get.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.get( + teamId = "<TEAM_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/list-memberships.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/list-memberships.md new file mode 100644 index 0000000000..287087394e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/list-memberships.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.listMemberships( + teamId = "<TEAM_ID>", + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/list.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/list.md new file mode 100644 index 0000000000..ee3e3e43b4 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/list.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.list( + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-membership-status.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-membership-status.md new file mode 100644 index 0000000000..b7a0d51ec5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-membership-status.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.updateMembershipStatus( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>", + userId = "<USER_ID>", + secret = "<SECRET>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-membership.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-membership.md new file mode 100644 index 0000000000..7a4377fb4d --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-membership.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.updateMembership( + teamId = "<TEAM_ID>", + membershipId = "<MEMBERSHIP_ID>", + roles = listOf() +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-name.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-name.md new file mode 100644 index 0000000000..2f13d7c460 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-name.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.updateName( + teamId = "<TEAM_ID>", + name = "<NAME>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-prefs.md b/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-prefs.md new file mode 100644 index 0000000000..62c7f01ca5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/teams/update-prefs.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Teams + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +val teams = Teams(client) + +val response = teams.updatePrefs( + teamId = "<TEAM_ID>", + prefs = mapOf( "a" to "b" ) +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tokens/create-file-token.md b/docs/examples/1.8.x/server-kotlin/kotlin/tokens/create-file-token.md new file mode 100644 index 0000000000..63d8fc301b --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tokens/create-file-token.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.createFileToken( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + expire = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tokens/delete.md b/docs/examples/1.8.x/server-kotlin/kotlin/tokens/delete.md new file mode 100644 index 0000000000..1831bc6a87 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tokens/delete.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.delete( + tokenId = "<TOKEN_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tokens/get.md b/docs/examples/1.8.x/server-kotlin/kotlin/tokens/get.md new file mode 100644 index 0000000000..70a47c2349 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tokens/get.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.get( + tokenId = "<TOKEN_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tokens/list.md b/docs/examples/1.8.x/server-kotlin/kotlin/tokens/list.md new file mode 100644 index 0000000000..697579065c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tokens/list.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.list( + bucketId = "<BUCKET_ID>", + fileId = "<FILE_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/tokens/update.md b/docs/examples/1.8.x/server-kotlin/kotlin/tokens/update.md new file mode 100644 index 0000000000..045ddaae4a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/tokens/update.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.update( + tokenId = "<TOKEN_ID>", + expire = "" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-argon-2-user.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-argon-2-user.md new file mode 100644 index 0000000000..27008a0415 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-argon-2-user.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createArgon2User( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-bcrypt-user.md new file mode 100644 index 0000000000..c7231307cf --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-bcrypt-user.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createBcryptUser( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-jwt.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-jwt.md new file mode 100644 index 0000000000..a556a901c5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-jwt.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createJWT( + userId = "<USER_ID>", + sessionId = "<SESSION_ID>", // optional + duration = 0 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-md-5-user.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-md-5-user.md new file mode 100644 index 0000000000..27b985920c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-md-5-user.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createMD5User( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..7a0b1c61da --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createMFARecoveryCodes( + userId = "<USER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-ph-pass-user.md new file mode 100644 index 0000000000..5441e49e6c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-ph-pass-user.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createPHPassUser( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..814883cae5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createScryptModifiedUser( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + passwordSalt = "<PASSWORD_SALT>", + passwordSaltSeparator = "<PASSWORD_SALT_SEPARATOR>", + passwordSignerKey = "<PASSWORD_SIGNER_KEY>", + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-scrypt-user.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-scrypt-user.md new file mode 100644 index 0000000000..619525a799 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-scrypt-user.md @@ -0,0 +1,22 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createScryptUser( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + passwordSalt = "<PASSWORD_SALT>", + passwordCpu = 0, + passwordMemory = 0, + passwordParallel = 0, + passwordLength = 0, + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-session.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-session.md new file mode 100644 index 0000000000..a67e605121 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-session.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createSession( + userId = "<USER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-sha-user.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-sha-user.md new file mode 100644 index 0000000000..17a157b2cd --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-sha-user.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createSHAUser( + userId = "<USER_ID>", + email = "email@example.com", + password = "password", + passwordVersion = "sha1", // optional + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-target.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-target.md new file mode 100644 index 0000000000..139c6ff049 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-target.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users +import io.appwrite.enums.MessagingProviderType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createTarget( + userId = "<USER_ID>", + targetId = "<TARGET_ID>", + providerType = MessagingProviderType.EMAIL, + identifier = "<IDENTIFIER>", + providerId = "<PROVIDER_ID>", // optional + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create-token.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-token.md new file mode 100644 index 0000000000..43492f4747 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create-token.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.createToken( + userId = "<USER_ID>", + length = 4, // optional + expire = 60 // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/create.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/create.md new file mode 100644 index 0000000000..27ae85ae6e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/create.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.create( + userId = "<USER_ID>", + email = "email@example.com", // optional + phone = "+12065550100", // optional + password = "", // optional + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-identity.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-identity.md new file mode 100644 index 0000000000..37b4ed2e71 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-identity.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.deleteIdentity( + identityId = "<IDENTITY_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..a7c80893bf --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-mfa-authenticator.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users +import io.appwrite.enums.AuthenticatorType + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.deleteMFAAuthenticator( + userId = "<USER_ID>", + type = AuthenticatorType.TOTP +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-session.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-session.md new file mode 100644 index 0000000000..e9e3c7c55e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-session.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.deleteSession( + userId = "<USER_ID>", + sessionId = "<SESSION_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-sessions.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-sessions.md new file mode 100644 index 0000000000..6288e1bc04 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-sessions.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.deleteSessions( + userId = "<USER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-target.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-target.md new file mode 100644 index 0000000000..f93be0677a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete-target.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.deleteTarget( + userId = "<USER_ID>", + targetId = "<TARGET_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/delete.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete.md new file mode 100644 index 0000000000..b938ac70d1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/delete.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.delete( + userId = "<USER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..1ad9197585 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/get-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.getMFARecoveryCodes( + userId = "<USER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/get-prefs.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/get-prefs.md new file mode 100644 index 0000000000..927a4a43a1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/get-prefs.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.getPrefs( + userId = "<USER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/get-target.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/get-target.md new file mode 100644 index 0000000000..556349c684 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/get-target.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.getTarget( + userId = "<USER_ID>", + targetId = "<TARGET_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/get.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/get.md new file mode 100644 index 0000000000..70f0ee9d5f --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/get.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.get( + userId = "<USER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/list-identities.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-identities.md new file mode 100644 index 0000000000..1ac0e5b887 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-identities.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.listIdentities( + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/list-logs.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-logs.md new file mode 100644 index 0000000000..a263293a7a --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-logs.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.listLogs( + userId = "<USER_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/list-memberships.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-memberships.md new file mode 100644 index 0000000000..7df13df4e2 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-memberships.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.listMemberships( + userId = "<USER_ID>", + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/list-mfa-factors.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-mfa-factors.md new file mode 100644 index 0000000000..9d0791cf13 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-mfa-factors.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.listMFAFactors( + userId = "<USER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/list-sessions.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-sessions.md new file mode 100644 index 0000000000..4ff34dd53e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-sessions.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.listSessions( + userId = "<USER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/list-targets.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-targets.md new file mode 100644 index 0000000000..0824acfd9e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/list-targets.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.listTargets( + userId = "<USER_ID>", + queries = listOf() // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/list.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/list.md new file mode 100644 index 0000000000..23dd217a6c --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/list.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.list( + queries = listOf(), // optional + search = "<SEARCH>" // optional +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-email-verification.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-email-verification.md new file mode 100644 index 0000000000..ebf2232f3e --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-email-verification.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateEmailVerification( + userId = "<USER_ID>", + emailVerification = false +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-email.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-email.md new file mode 100644 index 0000000000..a617705dbb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-email.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateEmail( + userId = "<USER_ID>", + email = "email@example.com" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-labels.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-labels.md new file mode 100644 index 0000000000..86f536f728 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-labels.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateLabels( + userId = "<USER_ID>", + labels = listOf() +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..80b92b4565 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateMFARecoveryCodes( + userId = "<USER_ID>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-mfa.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-mfa.md new file mode 100644 index 0000000000..d2f448e086 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-mfa.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateMFA( + userId = "<USER_ID>", + mfa = false +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-name.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-name.md new file mode 100644 index 0000000000..fedfce36bd --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-name.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateName( + userId = "<USER_ID>", + name = "<NAME>" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-password.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-password.md new file mode 100644 index 0000000000..4a0ad576e1 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-password.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updatePassword( + userId = "<USER_ID>", + password = "" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-phone-verification.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-phone-verification.md new file mode 100644 index 0000000000..6520ef4c95 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-phone-verification.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updatePhoneVerification( + userId = "<USER_ID>", + phoneVerification = false +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-phone.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-phone.md new file mode 100644 index 0000000000..7261f95db5 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-phone.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updatePhone( + userId = "<USER_ID>", + number = "+12065550100" +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-prefs.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-prefs.md new file mode 100644 index 0000000000..451f4ff4c6 --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-prefs.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updatePrefs( + userId = "<USER_ID>", + prefs = mapOf( "a" to "b" ) +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-status.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-status.md new file mode 100644 index 0000000000..a69ae30dbc --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-status.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateStatus( + userId = "<USER_ID>", + status = false +) diff --git a/docs/examples/1.8.x/server-kotlin/kotlin/users/update-target.md b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-target.md new file mode 100644 index 0000000000..a18fc63bcb --- /dev/null +++ b/docs/examples/1.8.x/server-kotlin/kotlin/users/update-target.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users + +val client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +val users = Users(client) + +val response = users.updateTarget( + userId = "<USER_ID>", + targetId = "<TARGET_ID>", + identifier = "<IDENTIFIER>", // optional + providerId = "<PROVIDER_ID>", // optional + name = "<NAME>" // optional +) diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..d8590b03cb --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-anonymous-session.md @@ -0,0 +1,9 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.createAnonymousSession(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-email-password-session.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..f173d2117a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-email-password-session.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.createEmailPasswordSession({ + email: 'email@example.com', + password: 'password' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-email-token.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-email-token.md new file mode 100644 index 0000000000..eb071b9e08 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-email-token.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.createEmailToken({ + userId: '<USER_ID>', + email: 'email@example.com', + phrase: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-jwt.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-jwt.md new file mode 100644 index 0000000000..2273646635 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-jwt.md @@ -0,0 +1,9 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.createJWT(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..59f7d10c53 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-magic-url-token.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.createMagicURLToken({ + userId: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..8dd6a599c0 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-mfa-authenticator.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createMFAAuthenticator({ + type: sdk.AuthenticatorType.Totp +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..4195f46892 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-mfa-challenge.md @@ -0,0 +1,11 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.createMFAChallenge({ + factor: sdk.AuthenticationFactor.Email +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..1392f44399 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..cc4f31552a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-o-auth-2-token.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.createOAuth2Token({ + provider: sdk.OAuthProvider.Amazon, + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-phone-token.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-phone-token.md new file mode 100644 index 0000000000..fe88e77b47 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-phone-token.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.createPhoneToken({ + userId: '<USER_ID>', + phone: '+12065550100' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-phone-verification.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..f7c87f0675 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-phone-verification.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createPhoneVerification(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-recovery.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-recovery.md new file mode 100644 index 0000000000..eab8af6de2 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-recovery.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createRecovery({ + email: 'email@example.com', + url: 'https://example.com' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-session.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-session.md new file mode 100644 index 0000000000..448f9017b5 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-session.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.createSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create-verification.md b/docs/examples/1.8.x/server-nodejs/examples/account/create-verification.md new file mode 100644 index 0000000000..02b9e78ddb --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create-verification.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createVerification({ + url: 'https://example.com' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/create.md b/docs/examples/1.8.x/server-nodejs/examples/account/create.md new file mode 100644 index 0000000000..7ba2d427d1 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/create.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.create({ + userId: '<USER_ID>', + email: 'email@example.com', + password: '', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/delete-identity.md b/docs/examples/1.8.x/server-nodejs/examples/account/delete-identity.md new file mode 100644 index 0000000000..222d4bf260 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/delete-identity.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.deleteIdentity({ + identityId: '<IDENTITY_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-nodejs/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..f3d8093ca2 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.deleteMFAAuthenticator({ + type: sdk.AuthenticatorType.Totp +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/delete-session.md b/docs/examples/1.8.x/server-nodejs/examples/account/delete-session.md new file mode 100644 index 0000000000..82e1bd6787 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/delete-session.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.deleteSession({ + sessionId: '<SESSION_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/delete-sessions.md b/docs/examples/1.8.x/server-nodejs/examples/account/delete-sessions.md new file mode 100644 index 0000000000..884c0e0ebc --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/delete-sessions.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.deleteSessions(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-nodejs/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..6461e6b586 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.getMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/get-prefs.md b/docs/examples/1.8.x/server-nodejs/examples/account/get-prefs.md new file mode 100644 index 0000000000..d0d7d31aaf --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/get-prefs.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.getPrefs(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/get-session.md b/docs/examples/1.8.x/server-nodejs/examples/account/get-session.md new file mode 100644 index 0000000000..edf3836851 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/get-session.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.getSession({ + sessionId: '<SESSION_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/get.md b/docs/examples/1.8.x/server-nodejs/examples/account/get.md new file mode 100644 index 0000000000..6ebb605ae8 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/get.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.get(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/list-identities.md b/docs/examples/1.8.x/server-nodejs/examples/account/list-identities.md new file mode 100644 index 0000000000..b124065db7 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/list-identities.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.listIdentities({ + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/list-logs.md b/docs/examples/1.8.x/server-nodejs/examples/account/list-logs.md new file mode 100644 index 0000000000..ca47edda5e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/list-logs.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.listLogs({ + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/server-nodejs/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..97f7f5fbc7 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/list-mfa-factors.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.listMFAFactors(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/list-sessions.md b/docs/examples/1.8.x/server-nodejs/examples/account/list-sessions.md new file mode 100644 index 0000000000..33fb527415 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/list-sessions.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.listSessions(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-email.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-email.md new file mode 100644 index 0000000000..58fea36be5 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-email.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateEmail({ + email: 'email@example.com', + password: 'password' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..d67d481bf8 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-magic-url-session.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.updateMagicURLSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..18e15754bc --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa-authenticator.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateMFAAuthenticator({ + type: sdk.AuthenticatorType.Totp, + otp: '<OTP>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..4903e1e298 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa-challenge.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateMFAChallenge({ + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..fd5c1fd56d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa.md new file mode 100644 index 0000000000..378c23fc0c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-mfa.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateMFA({ + mfa: false +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-name.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-name.md new file mode 100644 index 0000000000..f812116e7a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-name.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateName({ + name: '<NAME>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-password.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-password.md new file mode 100644 index 0000000000..e7e8437f5b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-password.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updatePassword({ + password: '', + oldPassword: 'password' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-phone-session.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-phone-session.md new file mode 100644 index 0000000000..7d9680025b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-phone-session.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const account = new sdk.Account(client); + +const result = await account.updatePhoneSession({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-phone-verification.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..af05baf59d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-phone-verification.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updatePhoneVerification({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-phone.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-phone.md new file mode 100644 index 0000000000..b1f1daa6c1 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-phone.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updatePhone({ + phone: '+12065550100', + password: 'password' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-prefs.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-prefs.md new file mode 100644 index 0000000000..ba41cf807e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-prefs.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updatePrefs({ + prefs: { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-recovery.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-recovery.md new file mode 100644 index 0000000000..c88b435238 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-recovery.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateRecovery({ + userId: '<USER_ID>', + secret: '<SECRET>', + password: '' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-session.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-session.md new file mode 100644 index 0000000000..c189f68e0a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-session.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateSession({ + sessionId: '<SESSION_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-status.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-status.md new file mode 100644 index 0000000000..1b70af5378 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-status.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateStatus(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/account/update-verification.md b/docs/examples/1.8.x/server-nodejs/examples/account/update-verification.md new file mode 100644 index 0000000000..d64b402e4b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/account/update-verification.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateVerification({ + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/avatars/get-browser.md b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-browser.md new file mode 100644 index 0000000000..9f3b2cce80 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-browser.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getBrowser({ + code: sdk.Browser.AvantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..1337d05fb9 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-credit-card.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getCreditCard({ + code: sdk.CreditCard.AmericanExpress, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/avatars/get-favicon.md b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..6f79cb664a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-favicon.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getFavicon({ + url: 'https://example.com' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/avatars/get-flag.md b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-flag.md new file mode 100644 index 0000000000..672c18bb77 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-flag.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getFlag({ + code: sdk.Flag.Afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/avatars/get-image.md b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-image.md new file mode 100644 index 0000000000..12aef10321 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-image.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getImage({ + url: 'https://example.com', + width: 0, // optional + height: 0 // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/avatars/get-initials.md b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-initials.md new file mode 100644 index 0000000000..584786f65c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-initials.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getInitials({ + name: '<NAME>', // optional + width: 0, // optional + height: 0, // optional + background: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/avatars/get-qr.md b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-qr.md new file mode 100644 index 0000000000..fd083807c8 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/avatars/get-qr.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const avatars = new sdk.Avatars(client); + +const result = await avatars.getQR({ + text: '<TEXT>', + size: 1, // optional + margin: 0, // optional + download: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..2e9b5629cc --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-boolean-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createBooleanAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: false, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-collection.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-collection.md new file mode 100644 index 0000000000..8ad770d907 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-collection.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..7ca8b553e9 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-datetime-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createDatetimeAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-document.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-document.md new file mode 100644 index 0000000000..175e06301e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-document.md @@ -0,0 +1,22 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.createDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-documents.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-documents.md new file mode 100644 index 0000000000..73d08aa21e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-documents.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [] +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..4afebf6560 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-email-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createEmailAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'email@example.com', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..5866eabb7d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-enum-attribute.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createEnumAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..7843c1658a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-float-attribute.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createFloatAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-index.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-index.md new file mode 100644 index 0000000000..ce5214a9ab --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-index.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + type: sdk.IndexType.Key, + attributes: [], + orders: [], // optional + lengths: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..e3752669b6 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-integer-attribute.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createIntegerAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..110e3a813f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-ip-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createIpAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..160bb5b9dc --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-line-attribute.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createLineAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..e65f5bd58d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-point-attribute.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createPointAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [1, 2] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..3d51887414 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-polygon-attribute.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createPolygonAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..b09c6a3b07 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-relationship-attribute.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createRelationshipAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + relatedCollectionId: '<RELATED_COLLECTION_ID>', + type: sdk.RelationshipType.OneToOne, + twoWay: false, // optional + key: '', // optional + twoWayKey: '', // optional + onDelete: sdk.RelationMutate.Cascade // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..57ed8f4ea2 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-string-attribute.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createStringAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + size: 1, + required: false, + default: '<DEFAULT>', // optional + array: false, // optional + encrypt: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..af3177f837 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create-url-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.createUrlAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'https://example.com', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/create.md b/docs/examples/1.8.x/server-nodejs/examples/databases/create.md new file mode 100644 index 0000000000..7392a85f37 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/create.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..87e4d7d25c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/decrement-document-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.decrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + min: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/delete-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..166aa1961b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/delete-attribute.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.deleteAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/delete-collection.md b/docs/examples/1.8.x/server-nodejs/examples/databases/delete-collection.md new file mode 100644 index 0000000000..f915076c3a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/delete-collection.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.deleteCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/delete-document.md b/docs/examples/1.8.x/server-nodejs/examples/databases/delete-document.md new file mode 100644 index 0000000000..429554b74b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/delete-document.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.deleteDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/delete-documents.md b/docs/examples/1.8.x/server-nodejs/examples/databases/delete-documents.md new file mode 100644 index 0000000000..0965d8ddaf --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/delete-documents.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.deleteDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/delete-index.md b/docs/examples/1.8.x/server-nodejs/examples/databases/delete-index.md new file mode 100644 index 0000000000..24f74c6975 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/delete-index.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.deleteIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/delete.md b/docs/examples/1.8.x/server-nodejs/examples/databases/delete.md new file mode 100644 index 0000000000..fc9ace4960 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/delete.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.delete({ + databaseId: '<DATABASE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/get-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/get-attribute.md new file mode 100644 index 0000000000..4c683034f8 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/get-attribute.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.getAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/get-collection.md b/docs/examples/1.8.x/server-nodejs/examples/databases/get-collection.md new file mode 100644 index 0000000000..4855471977 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/get-collection.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.getCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/get-document.md b/docs/examples/1.8.x/server-nodejs/examples/databases/get-document.md new file mode 100644 index 0000000000..7cc71cd0c3 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/get-document.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.getDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/get-index.md b/docs/examples/1.8.x/server-nodejs/examples/databases/get-index.md new file mode 100644 index 0000000000..d7edb84e34 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/get-index.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.getIndex({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/get.md b/docs/examples/1.8.x/server-nodejs/examples/databases/get.md new file mode 100644 index 0000000000..eb83ef7a85 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/get.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.get({ + databaseId: '<DATABASE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..2b47f5a75d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/increment-document-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.incrementDocumentAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + max: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/list-attributes.md b/docs/examples/1.8.x/server-nodejs/examples/databases/list-attributes.md new file mode 100644 index 0000000000..a69800c4d7 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/list-attributes.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.listAttributes({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/list-collections.md b/docs/examples/1.8.x/server-nodejs/examples/databases/list-collections.md new file mode 100644 index 0000000000..933b53ce83 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/list-collections.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.listCollections({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/list-documents.md b/docs/examples/1.8.x/server-nodejs/examples/databases/list-documents.md new file mode 100644 index 0000000000..148bf83c8f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/list-documents.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.listDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/list-indexes.md b/docs/examples/1.8.x/server-nodejs/examples/databases/list-indexes.md new file mode 100644 index 0000000000..f48112fccf --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/list-indexes.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.listIndexes({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/list.md b/docs/examples/1.8.x/server-nodejs/examples/databases/list.md new file mode 100644 index 0000000000..4ac7e47d46 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/list.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..224fc8e6f9 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-boolean-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateBooleanAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: false, + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-collection.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-collection.md new file mode 100644 index 0000000000..d0d25b74d6 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-collection.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateCollection({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..20034486fe --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-datetime-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateDatetimeAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-document.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-document.md new file mode 100644 index 0000000000..8a9a6856b4 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-document.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.updateDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-documents.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-documents.md new file mode 100644 index 0000000000..2cfb8c7800 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-documents.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: {}, // optional + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..738c533c33 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-email-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateEmailAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'email@example.com', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..f240cb0565 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-enum-attribute.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateEnumAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..877cad18bf --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-float-attribute.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateFloatAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..cf7101e5f5 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-integer-attribute.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateIntegerAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..d41bb85060 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-ip-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateIpAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..3c4d785def --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-line-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateLineAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..0da3b338a4 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-point-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updatePointAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [1, 2], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..c7767cb902 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-polygon-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updatePolygonAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..aa476c4160 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-relationship-attribute.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateRelationshipAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + onDelete: sdk.RelationMutate.Cascade, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..b0d7bea52e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-string-attribute.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateStringAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '<DEFAULT>', + size: 1, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..48d928151b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update-url-attribute.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateUrlAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'https://example.com', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/update.md b/docs/examples/1.8.x/server-nodejs/examples/databases/update.md new file mode 100644 index 0000000000..9a0dbd2eb1 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/update.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/upsert-document.md b/docs/examples/1.8.x/server-nodejs/examples/databases/upsert-document.md new file mode 100644 index 0000000000..5ec3e0541e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/upsert-document.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.upsertDocument({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/databases/upsert-documents.md b/docs/examples/1.8.x/server-nodejs/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..8deec536ff --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/databases/upsert-documents.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.upsertDocuments({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [] +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/create-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/functions/create-deployment.md new file mode 100644 index 0000000000..77946a7084 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/create-deployment.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); +const fs = require('fs'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createDeployment({ + functionId: '<FUNCTION_ID>', + code: InputFile.fromPath('/path/to/file', 'filename'), + activate: false, + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..03c68e7491 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createDuplicateDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + buildId: '<BUILD_ID>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/create-execution.md b/docs/examples/1.8.x/server-nodejs/examples/functions/create-execution.md new file mode 100644 index 0000000000..5b2c18cc86 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/create-execution.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const functions = new sdk.Functions(client); + +const result = await functions.createExecution({ + functionId: '<FUNCTION_ID>', + body: '<BODY>', // optional + async: false, // optional + path: '<PATH>', // optional + method: sdk.ExecutionMethod.GET, // optional + headers: {}, // optional + scheduledAt: '<SCHEDULED_AT>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..8f6395f8fb --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/create-template-deployment.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createTemplateDeployment({ + functionId: '<FUNCTION_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/create-variable.md b/docs/examples/1.8.x/server-nodejs/examples/functions/create-variable.md new file mode 100644 index 0000000000..45928395bd --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/create-variable.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createVariable({ + functionId: '<FUNCTION_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..0aabfcff8a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/create-vcs-deployment.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createVcsDeployment({ + functionId: '<FUNCTION_ID>', + type: sdk.VCSDeploymentType.Branch, + reference: '<REFERENCE>', + activate: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/create.md b/docs/examples/1.8.x/server-nodejs/examples/functions/create.md new file mode 100644 index 0000000000..d9f21ff796 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/create.md @@ -0,0 +1,29 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.create({ + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: sdk..Node145, + execute: ["any"], // optional + events: [], // optional + schedule: '', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/delete-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..9f9815b91d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/delete-deployment.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.deleteDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/delete-execution.md b/docs/examples/1.8.x/server-nodejs/examples/functions/delete-execution.md new file mode 100644 index 0000000000..cf9d1079cf --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/delete-execution.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.deleteExecution({ + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/delete-variable.md b/docs/examples/1.8.x/server-nodejs/examples/functions/delete-variable.md new file mode 100644 index 0000000000..70ee4f7abe --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/delete-variable.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.deleteVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/delete.md b/docs/examples/1.8.x/server-nodejs/examples/functions/delete.md new file mode 100644 index 0000000000..635f271a1c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/delete.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.delete({ + functionId: '<FUNCTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/server-nodejs/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..9e82998594 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/get-deployment-download.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.getDeploymentDownload({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: sdk.DeploymentDownloadType.Source // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/get-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/functions/get-deployment.md new file mode 100644 index 0000000000..c47081c718 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/get-deployment.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.getDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/get-execution.md b/docs/examples/1.8.x/server-nodejs/examples/functions/get-execution.md new file mode 100644 index 0000000000..ad3ff4874c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/get-execution.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const functions = new sdk.Functions(client); + +const result = await functions.getExecution({ + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/get-variable.md b/docs/examples/1.8.x/server-nodejs/examples/functions/get-variable.md new file mode 100644 index 0000000000..9f47331204 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/get-variable.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.getVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/get.md b/docs/examples/1.8.x/server-nodejs/examples/functions/get.md new file mode 100644 index 0000000000..463054d425 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/get.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.get({ + functionId: '<FUNCTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/list-deployments.md b/docs/examples/1.8.x/server-nodejs/examples/functions/list-deployments.md new file mode 100644 index 0000000000..e14c6d0441 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/list-deployments.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.listDeployments({ + functionId: '<FUNCTION_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/list-executions.md b/docs/examples/1.8.x/server-nodejs/examples/functions/list-executions.md new file mode 100644 index 0000000000..0d1ceb7223 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/list-executions.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const functions = new sdk.Functions(client); + +const result = await functions.listExecutions({ + functionId: '<FUNCTION_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/list-runtimes.md b/docs/examples/1.8.x/server-nodejs/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..a0f83b2273 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/list-runtimes.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.listRuntimes(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/list-specifications.md b/docs/examples/1.8.x/server-nodejs/examples/functions/list-specifications.md new file mode 100644 index 0000000000..f918c44053 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/list-specifications.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.listSpecifications(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/list-variables.md b/docs/examples/1.8.x/server-nodejs/examples/functions/list-variables.md new file mode 100644 index 0000000000..962a81005c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/list-variables.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.listVariables({ + functionId: '<FUNCTION_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/list.md b/docs/examples/1.8.x/server-nodejs/examples/functions/list.md new file mode 100644 index 0000000000..847c34531a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/list.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/server-nodejs/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..32b8a619cd --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/update-deployment-status.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.updateDeploymentStatus({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..b0d31325f1 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/update-function-deployment.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.updateFunctionDeployment({ + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/update-variable.md b/docs/examples/1.8.x/server-nodejs/examples/functions/update-variable.md new file mode 100644 index 0000000000..73ae49fbf2 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/update-variable.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.updateVariable({ + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', // optional + secret: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/functions/update.md b/docs/examples/1.8.x/server-nodejs/examples/functions/update.md new file mode 100644 index 0000000000..8ed2828f56 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/functions/update.md @@ -0,0 +1,29 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.update({ + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: sdk..Node145, // optional + execute: ["any"], // optional + events: [], // optional + schedule: '', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/graphql/mutation.md b/docs/examples/1.8.x/server-nodejs/examples/graphql/mutation.md new file mode 100644 index 0000000000..dffb7b3f3b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/graphql/mutation.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const graphql = new sdk.Graphql(client); + +const result = await graphql.mutation({ + query: {} +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/graphql/query.md b/docs/examples/1.8.x/server-nodejs/examples/graphql/query.md new file mode 100644 index 0000000000..1f873ed90d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/graphql/query.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const graphql = new sdk.Graphql(client); + +const result = await graphql.query({ + query: {} +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-antivirus.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-antivirus.md new file mode 100644 index 0000000000..9efa2d803c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-antivirus.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getAntivirus(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-cache.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-cache.md new file mode 100644 index 0000000000..014340123d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-cache.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getCache(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-certificate.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-certificate.md new file mode 100644 index 0000000000..ccb880078c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-certificate.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getCertificate({ + domain: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-db.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-db.md new file mode 100644 index 0000000000..0d86d08d1c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-db.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getDB(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..bf77aa26d8 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-failed-jobs.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getFailedJobs({ + name: sdk..V1Database, + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-pub-sub.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..b5b97374d5 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-pub-sub.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getPubSub(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-builds.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..8e28054718 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-builds.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueBuilds({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..89383ede8c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-certificates.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueCertificates({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-databases.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..784525573c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-databases.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueDatabases({ + name: '<NAME>', // optional + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..8248b5c41f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-deletes.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueDeletes({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-functions.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..5832a27439 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-functions.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueFunctions({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-logs.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..055c525be4 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-logs.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueLogs({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-mails.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..fb29d0813d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-mails.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueMails({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..cc8eb4be0a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-messaging.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueMessaging({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..ddc7f517c5 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-migrations.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueMigrations({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..dacf04c35a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-stats-resources.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueStatsResources({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-usage.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..5d06a7ce5b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-usage.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueUsage({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..f4d0af8a1e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-queue-webhooks.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueWebhooks({ + threshold: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-storage-local.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-storage-local.md new file mode 100644 index 0000000000..0ea8e0e27f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-storage-local.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getStorageLocal(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-storage.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-storage.md new file mode 100644 index 0000000000..d199800559 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-storage.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getStorage(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get-time.md b/docs/examples/1.8.x/server-nodejs/examples/health/get-time.md new file mode 100644 index 0000000000..cd4f42e33e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get-time.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getTime(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/health/get.md b/docs/examples/1.8.x/server-nodejs/examples/health/get.md new file mode 100644 index 0000000000..e10c4e28f5 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/health/get.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.get(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/locale/get.md b/docs/examples/1.8.x/server-nodejs/examples/locale/get.md new file mode 100644 index 0000000000..d57eb8f241 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/locale/get.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.get(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/locale/list-codes.md b/docs/examples/1.8.x/server-nodejs/examples/locale/list-codes.md new file mode 100644 index 0000000000..280d14ae6e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/locale/list-codes.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listCodes(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/locale/list-continents.md b/docs/examples/1.8.x/server-nodejs/examples/locale/list-continents.md new file mode 100644 index 0000000000..d04d6d6a47 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/locale/list-continents.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listContinents(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/server-nodejs/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..6e41074b61 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/locale/list-countries-eu.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listCountriesEU(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/server-nodejs/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..9621e9cbfc --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/locale/list-countries-phones.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listCountriesPhones(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/locale/list-countries.md b/docs/examples/1.8.x/server-nodejs/examples/locale/list-countries.md new file mode 100644 index 0000000000..a81b1581f3 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/locale/list-countries.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listCountries(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/locale/list-currencies.md b/docs/examples/1.8.x/server-nodejs/examples/locale/list-currencies.md new file mode 100644 index 0000000000..a585fd33ae --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/locale/list-currencies.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listCurrencies(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/locale/list-languages.md b/docs/examples/1.8.x/server-nodejs/examples/locale/list-languages.md new file mode 100644 index 0000000000..aea0fadf89 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/locale/list-languages.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const locale = new sdk.Locale(client); + +const result = await locale.listLanguages(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..cd1a53b365 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-apns-provider.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createAPNSProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-email.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-email.md new file mode 100644 index 0000000000..93fb2ef3b8 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-email.md @@ -0,0 +1,23 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createEmail({ + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + attachments: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..8041e7f2a8 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-fcm-provider.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + serviceAccountJSON: {}, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..dd8a0f6ad3 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,21 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + domain: '<DOMAIN>', // optional + isEuRegion: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..7168e8bba6 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-push.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-push.md new file mode 100644 index 0000000000..c0a7f4713f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-push.md @@ -0,0 +1,30 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createPush({ + messageId: '<MESSAGE_ID>', + title: '<TITLE>', // optional + body: '<BODY>', // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '[ID1:ID2]', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: null, // optional + draft: false, // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: sdk.MessagePriority.Normal // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..8b26b2f3f6 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-sms.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-sms.md new file mode 100644 index 0000000000..c477643b4b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-sms.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createSMS({ + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..241a0f0969 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-smtp-provider.md @@ -0,0 +1,25 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 1, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + encryption: sdk.SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..f86a424c2a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-subscriber.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..b558fbd210 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-telesign-provider.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..82141aeab8 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-topic.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-topic.md new file mode 100644 index 0000000000..ce91b54279 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-topic.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ["any"] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..b3d9ba6bfb --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-twilio-provider.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..b7a94ff527 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/create-vonage-provider.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/delete-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..590b8078ee --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/delete-provider.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.deleteProvider({ + providerId: '<PROVIDER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..77f2f8962f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/delete-subscriber.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +const messaging = new sdk.Messaging(client); + +const result = await messaging.deleteSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/delete-topic.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..58ca2fb382 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/delete-topic.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.deleteTopic({ + topicId: '<TOPIC_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/delete.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/delete.md new file mode 100644 index 0000000000..c2c0560d71 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/delete.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.delete({ + messageId: '<MESSAGE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/get-message.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/get-message.md new file mode 100644 index 0000000000..503da4828d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/get-message.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.getMessage({ + messageId: '<MESSAGE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/get-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/get-provider.md new file mode 100644 index 0000000000..f7c70587b4 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/get-provider.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.getProvider({ + providerId: '<PROVIDER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..befc566bf9 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/get-subscriber.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.getSubscriber({ + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/get-topic.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/get-topic.md new file mode 100644 index 0000000000..f537973f3c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/get-topic.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.getTopic({ + topicId: '<TOPIC_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..c2d32f014b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-message-logs.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listMessageLogs({ + messageId: '<MESSAGE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/list-messages.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-messages.md new file mode 100644 index 0000000000..2edc75f689 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-messages.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listMessages({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..35fd2cf9b0 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-provider-logs.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listProviderLogs({ + providerId: '<PROVIDER_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/list-providers.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-providers.md new file mode 100644 index 0000000000..2445597f3e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-providers.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listProviders({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..1da2c3bc27 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listSubscriberLogs({ + subscriberId: '<SUBSCRIBER_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..c2b594e4b2 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-subscribers.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listSubscribers({ + topicId: '<TOPIC_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/list-targets.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-targets.md new file mode 100644 index 0000000000..75a4aa60f6 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-targets.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listTargets({ + messageId: '<MESSAGE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..eacf4822b7 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-topic-logs.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listTopicLogs({ + topicId: '<TOPIC_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/list-topics.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-topics.md new file mode 100644 index 0000000000..3ff5538949 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/list-topics.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.listTopics({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..f57fe6aba5 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-apns-provider.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateAPNSProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-email.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-email.md new file mode 100644 index 0000000000..575b463545 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-email.md @@ -0,0 +1,23 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateEmail({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + subject: '<SUBJECT>', // optional + content: '<CONTENT>', // optional + draft: false, // optional + html: false, // optional + cc: [], // optional + bcc: [], // optional + scheduledAt: '', // optional + attachments: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..0a3134a91a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-fcm-provider.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateFCMProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + serviceAccountJSON: {} // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..fbe2d076f7 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,21 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateMailgunProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + apiKey: '<API_KEY>', // optional + domain: '<DOMAIN>', // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..7ecb3f031b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateMsg91Provider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-push.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-push.md new file mode 100644 index 0000000000..5e857f1ff6 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-push.md @@ -0,0 +1,30 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updatePush({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + title: '<TITLE>', // optional + body: '<BODY>', // optional + data: {}, // optional + action: '<ACTION>', // optional + image: '[ID1:ID2]', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: null, // optional + draft: false, // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: sdk.MessagePriority.Normal // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..340f275884 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateSendgridProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-sms.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-sms.md new file mode 100644 index 0000000000..a325b5afb3 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-sms.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateSMS({ + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + content: '<CONTENT>', // optional + draft: false, // optional + scheduledAt: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..7b2a81164b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-smtp-provider.md @@ -0,0 +1,25 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateSMTPProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + host: '<HOST>', // optional + port: 1, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + encryption: sdk.SmtpEncryption.None, // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..8e1e2364c1 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-telesign-provider.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateTelesignProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..8656723d14 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateTextmagicProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-topic.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-topic.md new file mode 100644 index 0000000000..cf34080fea --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-topic.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateTopic({ + topicId: '<TOPIC_ID>', + name: '<NAME>', // optional + subscribe: ["any"] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..6a201415fe --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-twilio-provider.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateTwilioProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + from: '<FROM>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..d99c07621c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/messaging/update-vonage-provider.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateVonageProvider({ + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + from: '<FROM>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/create-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/sites/create-deployment.md new file mode 100644 index 0000000000..dbd78e094e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/create-deployment.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); +const fs = require('fs'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createDeployment({ + siteId: '<SITE_ID>', + code: InputFile.fromPath('/path/to/file', 'filename'), + activate: false, + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..8d2bd4f604 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createDuplicateDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..7dfb4370e6 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/create-template-deployment.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createTemplateDeployment({ + siteId: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/create-variable.md b/docs/examples/1.8.x/server-nodejs/examples/sites/create-variable.md new file mode 100644 index 0000000000..2ec774c70b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/create-variable.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createVariable({ + siteId: '<SITE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..7f7c2196ba --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/create-vcs-deployment.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createVcsDeployment({ + siteId: '<SITE_ID>', + type: sdk.VCSDeploymentType.Branch, + reference: '<REFERENCE>', + activate: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/create.md b/docs/examples/1.8.x/server-nodejs/examples/sites/create.md new file mode 100644 index 0000000000..25c6715748 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/create.md @@ -0,0 +1,29 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.create({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: sdk..Analog, + buildRuntime: sdk..Node145, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + adapter: sdk..Static, // optional + installationId: '<INSTALLATION_ID>', // optional + fallbackFile: '<FALLBACK_FILE>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/delete-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..292f9e05d0 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/delete-deployment.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.deleteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/delete-log.md b/docs/examples/1.8.x/server-nodejs/examples/sites/delete-log.md new file mode 100644 index 0000000000..d1850e1ea3 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/delete-log.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.deleteLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/delete-variable.md b/docs/examples/1.8.x/server-nodejs/examples/sites/delete-variable.md new file mode 100644 index 0000000000..069ff8dc07 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/delete-variable.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.deleteVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/delete.md b/docs/examples/1.8.x/server-nodejs/examples/sites/delete.md new file mode 100644 index 0000000000..7f6ad8bc88 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/delete.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.delete({ + siteId: '<SITE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/server-nodejs/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..05e87058bc --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/get-deployment-download.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getDeploymentDownload({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: sdk.DeploymentDownloadType.Source // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/get-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/sites/get-deployment.md new file mode 100644 index 0000000000..68b6dcf549 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/get-deployment.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/get-log.md b/docs/examples/1.8.x/server-nodejs/examples/sites/get-log.md new file mode 100644 index 0000000000..3a22d90ff5 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/get-log.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getLog({ + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/get-variable.md b/docs/examples/1.8.x/server-nodejs/examples/sites/get-variable.md new file mode 100644 index 0000000000..7d0a759ec4 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/get-variable.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/get.md b/docs/examples/1.8.x/server-nodejs/examples/sites/get.md new file mode 100644 index 0000000000..6d8180802f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/get.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.get({ + siteId: '<SITE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/list-deployments.md b/docs/examples/1.8.x/server-nodejs/examples/sites/list-deployments.md new file mode 100644 index 0000000000..53a900ee77 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/list-deployments.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listDeployments({ + siteId: '<SITE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/list-frameworks.md b/docs/examples/1.8.x/server-nodejs/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..0376e4b552 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/list-frameworks.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listFrameworks(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/list-logs.md b/docs/examples/1.8.x/server-nodejs/examples/sites/list-logs.md new file mode 100644 index 0000000000..17428d71f1 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/list-logs.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listLogs({ + siteId: '<SITE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/list-specifications.md b/docs/examples/1.8.x/server-nodejs/examples/sites/list-specifications.md new file mode 100644 index 0000000000..24ec74c4aa --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/list-specifications.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listSpecifications(); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/list-variables.md b/docs/examples/1.8.x/server-nodejs/examples/sites/list-variables.md new file mode 100644 index 0000000000..498584ee60 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/list-variables.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listVariables({ + siteId: '<SITE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/list.md b/docs/examples/1.8.x/server-nodejs/examples/sites/list.md new file mode 100644 index 0000000000..2f2f884989 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/list.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/server-nodejs/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..88d55b0d9e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/update-deployment-status.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.updateDeploymentStatus({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/server-nodejs/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..bb3adc437d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/update-site-deployment.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.updateSiteDeployment({ + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/update-variable.md b/docs/examples/1.8.x/server-nodejs/examples/sites/update-variable.md new file mode 100644 index 0000000000..a7e3f6a1ca --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/update-variable.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.updateVariable({ + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', // optional + secret: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/sites/update.md b/docs/examples/1.8.x/server-nodejs/examples/sites/update.md new file mode 100644 index 0000000000..5cb52f7a3c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/sites/update.md @@ -0,0 +1,29 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.update({ + siteId: '<SITE_ID>', + name: '<NAME>', + framework: sdk..Analog, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + buildRuntime: sdk..Node145, // optional + adapter: sdk..Static, // optional + fallbackFile: '<FALLBACK_FILE>', // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/create-bucket.md b/docs/examples/1.8.x/server-nodejs/examples/storage/create-bucket.md new file mode 100644 index 0000000000..f1f029491a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/create-bucket.md @@ -0,0 +1,21 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new sdk.Storage(client); + +const result = await storage.createBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: sdk..None, // optional + encryption: false, // optional + antivirus: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/create-file.md b/docs/examples/1.8.x/server-nodejs/examples/storage/create-file.md new file mode 100644 index 0000000000..628faf7249 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/create-file.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); +const fs = require('fs'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.createFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: InputFile.fromPath('/path/to/file', 'filename'), + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/delete-bucket.md b/docs/examples/1.8.x/server-nodejs/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..a59844dd41 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/delete-bucket.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new sdk.Storage(client); + +const result = await storage.deleteBucket({ + bucketId: '<BUCKET_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/delete-file.md b/docs/examples/1.8.x/server-nodejs/examples/storage/delete-file.md new file mode 100644 index 0000000000..d973b5a50f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/delete-file.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.deleteFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/get-bucket.md b/docs/examples/1.8.x/server-nodejs/examples/storage/get-bucket.md new file mode 100644 index 0000000000..2dd16cc148 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/get-bucket.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new sdk.Storage(client); + +const result = await storage.getBucket({ + bucketId: '<BUCKET_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/get-file-download.md b/docs/examples/1.8.x/server-nodejs/examples/storage/get-file-download.md new file mode 100644 index 0000000000..253e63851b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/get-file-download.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.getFileDownload({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/get-file-preview.md b/docs/examples/1.8.x/server-nodejs/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..d188e0d8ae --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/get-file-preview.md @@ -0,0 +1,25 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.getFilePreview({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // optional + height: 0, // optional + gravity: sdk.ImageGravity.Center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: '', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: '', // optional + output: sdk.ImageFormat.Jpg, // optional + token: '<TOKEN>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/get-file-view.md b/docs/examples/1.8.x/server-nodejs/examples/storage/get-file-view.md new file mode 100644 index 0000000000..35c6ba2284 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/get-file-view.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.getFileView({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/get-file.md b/docs/examples/1.8.x/server-nodejs/examples/storage/get-file.md new file mode 100644 index 0000000000..a6c54c8670 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/get-file.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.getFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/list-buckets.md b/docs/examples/1.8.x/server-nodejs/examples/storage/list-buckets.md new file mode 100644 index 0000000000..a6dcf4004a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/list-buckets.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new sdk.Storage(client); + +const result = await storage.listBuckets({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/list-files.md b/docs/examples/1.8.x/server-nodejs/examples/storage/list-files.md new file mode 100644 index 0000000000..b22c1c1047 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/list-files.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.listFiles({ + bucketId: '<BUCKET_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/update-bucket.md b/docs/examples/1.8.x/server-nodejs/examples/storage/update-bucket.md new file mode 100644 index 0000000000..136ebafe1b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/update-bucket.md @@ -0,0 +1,21 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const storage = new sdk.Storage(client); + +const result = await storage.updateBucket({ + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: sdk..None, // optional + encryption: false, // optional + antivirus: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/storage/update-file.md b/docs/examples/1.8.x/server-nodejs/examples/storage/update-file.md new file mode 100644 index 0000000000..2d78d5fb91 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/storage/update-file.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const storage = new sdk.Storage(client); + +const result = await storage.updateFile({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // optional + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..129e646ae6 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: false, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..dcc6c1ed2d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..a250d4a908 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-email-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..f1e183088d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-enum-column.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..6dd4dfcf87 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-float-column.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-index.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..ec84b060a0 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-index.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + type: sdk.IndexType.Key, + columns: [], + orders: [], // optional + lengths: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..b682db47eb --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-integer-column.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..eaeb64aa86 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-ip-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..84b941c38d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-line-column.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createLineColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..c59e420ee3 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-point-column.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createPointColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [1, 2] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..36f2f4ca5c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createPolygonColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..09ebd96e2b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + relatedTableId: '<RELATED_TABLE_ID>', + type: sdk.RelationshipType.OneToOne, + twoWay: false, // optional + key: '', // optional + twoWayKey: '', // optional + onDelete: sdk.RelationMutate.Cascade // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-row.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..29ddab6652 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-row.md @@ -0,0 +1,22 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..61eb1d1db8 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-rows.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [] +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..dbe06329c1 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-string-column.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + size: 1, + required: false, + default: '<DEFAULT>', // optional + array: false, // optional + encrypt: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-table.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..1b252f1484 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-table.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..a37424e718 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create-url-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', // optional + array: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create.md new file mode 100644 index 0000000000..a16191d4db --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/create.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.create({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..e3b13a887e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.decrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, // optional + min: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..890393a252 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-column.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..472b5de8a1 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-index.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..9802f0d03e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-row.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..6f4d7cd68b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-rows.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..3c526e5d80 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete-table.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete.md new file mode 100644 index 0000000000..351a40f518 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/delete.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.delete({ + databaseId: '<DATABASE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..66bde58144 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-column.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.getColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-index.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..6dfa7320b0 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-index.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.getIndex({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-row.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..7ea3d1fca2 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-row.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.getRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-table.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..6d14204d19 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get-table.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.getTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get.md new file mode 100644 index 0000000000..137296610b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/get.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.get({ + databaseId: '<DATABASE_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..f5cac2ebaa --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/increment-row-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.incrementRowColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, // optional + max: null // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..b756a3d0bb --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-columns.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listColumns({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..1c99bf935a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-indexes.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listIndexes({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..6d3b883bd4 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-rows.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..f6d6608c1a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list-tables.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listTables({ + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list.md new file mode 100644 index 0000000000..6648ea789c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/list.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..aa1d5239ca --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateBooleanColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: false, + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..10badccd9b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateDatetimeColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..ff40472234 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-email-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateEmailColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..ccc70b113d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-enum-column.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateEnumColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..73add7d522 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-float-column.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateFloatColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..18cceb056a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-integer-column.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateIntegerColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..c0313d126c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-ip-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateIpColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..4ec0abe5f9 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-line-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateLineColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..cddb1989af --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-point-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updatePointColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [1, 2], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..963db8bae7 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updatePolygonColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..a91b47986c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateRelationshipColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + onDelete: sdk.RelationMutate.Cascade, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-row.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..1c7f0af197 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-row.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..31628d7150 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-rows.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + data: {}, // optional + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..f30614e80c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-string-column.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateStringColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '<DEFAULT>', + size: 1, // optional + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-table.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..b61fd6ac4e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-table.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateTable({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..cb2440a9d0 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update-url-column.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.updateUrlColumn({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', + newKey: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update.md new file mode 100644 index 0000000000..85f98ee112 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/update.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.update({ + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..9963bb6ced --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/upsert-row.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.upsertRow({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: {}, // optional + permissions: ["read("any")"] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..cca2b777bb --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tablesdb/upsert-rows.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.upsertRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [] +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/create-membership.md b/docs/examples/1.8.x/server-nodejs/examples/teams/create-membership.md new file mode 100644 index 0000000000..28cb901ca2 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/create-membership.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.createMembership({ + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // optional + userId: '<USER_ID>', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/create.md b/docs/examples/1.8.x/server-nodejs/examples/teams/create.md new file mode 100644 index 0000000000..8b1bd1d71f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/create.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.create({ + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/delete-membership.md b/docs/examples/1.8.x/server-nodejs/examples/teams/delete-membership.md new file mode 100644 index 0000000000..6fe5912391 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/delete-membership.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.deleteMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/delete.md b/docs/examples/1.8.x/server-nodejs/examples/teams/delete.md new file mode 100644 index 0000000000..ebccae91d9 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/delete.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.delete({ + teamId: '<TEAM_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/get-membership.md b/docs/examples/1.8.x/server-nodejs/examples/teams/get-membership.md new file mode 100644 index 0000000000..a8deb5519f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/get-membership.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.getMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/get-prefs.md b/docs/examples/1.8.x/server-nodejs/examples/teams/get-prefs.md new file mode 100644 index 0000000000..bf9d72207b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/get-prefs.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.getPrefs({ + teamId: '<TEAM_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/get.md b/docs/examples/1.8.x/server-nodejs/examples/teams/get.md new file mode 100644 index 0000000000..2f4cc115af --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/get.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.get({ + teamId: '<TEAM_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/list-memberships.md b/docs/examples/1.8.x/server-nodejs/examples/teams/list-memberships.md new file mode 100644 index 0000000000..3a18bbb001 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/list-memberships.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.listMemberships({ + teamId: '<TEAM_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/list.md b/docs/examples/1.8.x/server-nodejs/examples/teams/list.md new file mode 100644 index 0000000000..ef4ab51954 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/list.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/update-membership-status.md b/docs/examples/1.8.x/server-nodejs/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..f3b8ba2a67 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/update-membership-status.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.updateMembershipStatus({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/update-membership.md b/docs/examples/1.8.x/server-nodejs/examples/teams/update-membership.md new file mode 100644 index 0000000000..f09e8e9ab2 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/update-membership.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.updateMembership({ + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [] +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/update-name.md b/docs/examples/1.8.x/server-nodejs/examples/teams/update-name.md new file mode 100644 index 0000000000..aaad80f90f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/update-name.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.updateName({ + teamId: '<TEAM_ID>', + name: '<NAME>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/teams/update-prefs.md b/docs/examples/1.8.x/server-nodejs/examples/teams/update-prefs.md new file mode 100644 index 0000000000..7f16f62996 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/teams/update-prefs.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.updatePrefs({ + teamId: '<TEAM_ID>', + prefs: {} +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tokens/create-file-token.md b/docs/examples/1.8.x/server-nodejs/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..2353720627 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tokens/create-file-token.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.createFileToken({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + expire: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tokens/delete.md b/docs/examples/1.8.x/server-nodejs/examples/tokens/delete.md new file mode 100644 index 0000000000..659c03e5c9 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tokens/delete.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.delete({ + tokenId: '<TOKEN_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tokens/get.md b/docs/examples/1.8.x/server-nodejs/examples/tokens/get.md new file mode 100644 index 0000000000..68371c329e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tokens/get.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.get({ + tokenId: '<TOKEN_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tokens/list.md b/docs/examples/1.8.x/server-nodejs/examples/tokens/list.md new file mode 100644 index 0000000000..41833b80e7 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tokens/list.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.list({ + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/tokens/update.md b/docs/examples/1.8.x/server-nodejs/examples/tokens/update.md new file mode 100644 index 0000000000..8178dd0519 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/tokens/update.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.update({ + tokenId: '<TOKEN_ID>', + expire: '' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..46badb7ab8 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-argon-2-user.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createArgon2User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..9c9463289b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-bcrypt-user.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createBcryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-jwt.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-jwt.md new file mode 100644 index 0000000000..d46b9c6ace --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-jwt.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createJWT({ + userId: '<USER_ID>', + sessionId: '<SESSION_ID>', // optional + duration: 0 // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-md-5-user.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..c92227489d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-md-5-user.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createMD5User({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..5ebb6ac252 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createMFARecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..0a2207fc8a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-ph-pass-user.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createPHPassUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..bd30b25c0b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createScryptModifiedUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>', + passwordSignerKey: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..76f9e2fa12 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-scrypt-user.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createScryptUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordCpu: null, + passwordMemory: null, + passwordParallel: null, + passwordLength: null, + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-session.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-session.md new file mode 100644 index 0000000000..869e67f3ba --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-session.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createSession({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-sha-user.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-sha-user.md new file mode 100644 index 0000000000..bb940be6b1 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-sha-user.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createSHAUser({ + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordVersion: sdk.PasswordHash.Sha1, // optional + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-target.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-target.md new file mode 100644 index 0000000000..d856f3f92b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-target.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: sdk.MessagingProviderType.Email, + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create-token.md b/docs/examples/1.8.x/server-nodejs/examples/users/create-token.md new file mode 100644 index 0000000000..9f116920ed --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create-token.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.createToken({ + userId: '<USER_ID>', + length: 4, // optional + expire: 60 // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/create.md b/docs/examples/1.8.x/server-nodejs/examples/users/create.md new file mode 100644 index 0000000000..3095dd1b20 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/create.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.create({ + userId: '<USER_ID>', + email: 'email@example.com', // optional + phone: '+12065550100', // optional + password: '', // optional + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/delete-identity.md b/docs/examples/1.8.x/server-nodejs/examples/users/delete-identity.md new file mode 100644 index 0000000000..bcd0e9efbf --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/delete-identity.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.deleteIdentity({ + identityId: '<IDENTITY_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-nodejs/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..16061c7aaa --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.deleteMFAAuthenticator({ + userId: '<USER_ID>', + type: sdk.AuthenticatorType.Totp +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/delete-session.md b/docs/examples/1.8.x/server-nodejs/examples/users/delete-session.md new file mode 100644 index 0000000000..ce301fba6c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/delete-session.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.deleteSession({ + userId: '<USER_ID>', + sessionId: '<SESSION_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/delete-sessions.md b/docs/examples/1.8.x/server-nodejs/examples/users/delete-sessions.md new file mode 100644 index 0000000000..5495fcbc9d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/delete-sessions.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.deleteSessions({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/delete-target.md b/docs/examples/1.8.x/server-nodejs/examples/users/delete-target.md new file mode 100644 index 0000000000..33278f4ac9 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/delete-target.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.deleteTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/delete.md b/docs/examples/1.8.x/server-nodejs/examples/users/delete.md new file mode 100644 index 0000000000..13210442fa --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/delete.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.delete({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-nodejs/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..25f4e0b34f --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.getMFARecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/get-prefs.md b/docs/examples/1.8.x/server-nodejs/examples/users/get-prefs.md new file mode 100644 index 0000000000..cb9d54fd25 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/get-prefs.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.getPrefs({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/get-target.md b/docs/examples/1.8.x/server-nodejs/examples/users/get-target.md new file mode 100644 index 0000000000..0c320bf480 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/get-target.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.getTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/get.md b/docs/examples/1.8.x/server-nodejs/examples/users/get.md new file mode 100644 index 0000000000..594f034e0d --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/get.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.get({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/list-identities.md b/docs/examples/1.8.x/server-nodejs/examples/users/list-identities.md new file mode 100644 index 0000000000..2ff959c36a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/list-identities.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.listIdentities({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/list-logs.md b/docs/examples/1.8.x/server-nodejs/examples/users/list-logs.md new file mode 100644 index 0000000000..345d736c9e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/list-logs.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.listLogs({ + userId: '<USER_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/list-memberships.md b/docs/examples/1.8.x/server-nodejs/examples/users/list-memberships.md new file mode 100644 index 0000000000..4b2cc1fede --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/list-memberships.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.listMemberships({ + userId: '<USER_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/server-nodejs/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..79ffcff7b2 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/list-mfa-factors.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.listMFAFactors({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/list-sessions.md b/docs/examples/1.8.x/server-nodejs/examples/users/list-sessions.md new file mode 100644 index 0000000000..e1082c5d9e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/list-sessions.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.listSessions({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/list-targets.md b/docs/examples/1.8.x/server-nodejs/examples/users/list-targets.md new file mode 100644 index 0000000000..ded1bbe9cc --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/list-targets.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.listTargets({ + userId: '<USER_ID>', + queries: [] // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/list.md b/docs/examples/1.8.x/server-nodejs/examples/users/list.md new file mode 100644 index 0000000000..74e72f5473 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/list.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.list({ + queries: [], // optional + search: '<SEARCH>' // optional +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-email-verification.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-email-verification.md new file mode 100644 index 0000000000..14ab8fb479 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-email-verification.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateEmailVerification({ + userId: '<USER_ID>', + emailVerification: false +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-email.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-email.md new file mode 100644 index 0000000000..b8990cd10c --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-email.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateEmail({ + userId: '<USER_ID>', + email: 'email@example.com' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-labels.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-labels.md new file mode 100644 index 0000000000..8e6588d5aa --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-labels.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateLabels({ + userId: '<USER_ID>', + labels: [] +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..66513ae499 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateMFARecoveryCodes({ + userId: '<USER_ID>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-mfa.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-mfa.md new file mode 100644 index 0000000000..f867b0691b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-mfa.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateMFA({ + userId: '<USER_ID>', + mfa: false +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-name.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-name.md new file mode 100644 index 0000000000..914f2a313e --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-name.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateName({ + userId: '<USER_ID>', + name: '<NAME>' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-password.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-password.md new file mode 100644 index 0000000000..dd32ede72b --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-password.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updatePassword({ + userId: '<USER_ID>', + password: '' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-phone-verification.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..bccc61a747 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-phone-verification.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updatePhoneVerification({ + userId: '<USER_ID>', + phoneVerification: false +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-phone.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-phone.md new file mode 100644 index 0000000000..de534f6f96 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-phone.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updatePhone({ + userId: '<USER_ID>', + number: '+12065550100' +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-prefs.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-prefs.md new file mode 100644 index 0000000000..9b5d9d4803 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-prefs.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updatePrefs({ + userId: '<USER_ID>', + prefs: {} +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-status.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-status.md new file mode 100644 index 0000000000..c222030823 --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-status.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateStatus({ + userId: '<USER_ID>', + status: false +}); diff --git a/docs/examples/1.8.x/server-nodejs/examples/users/update-target.md b/docs/examples/1.8.x/server-nodejs/examples/users/update-target.md new file mode 100644 index 0000000000..e77dbb5d0a --- /dev/null +++ b/docs/examples/1.8.x/server-nodejs/examples/users/update-target.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setKey('<YOUR_API_KEY>'); // Your secret API key + +const users = new sdk.Users(client); + +const result = await users.updateTarget({ + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', // optional + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional +}); diff --git a/docs/examples/1.8.x/server-php/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/server-php/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..b3e811e18d --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-anonymous-session.md @@ -0,0 +1,12 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->createAnonymousSession(); diff --git a/docs/examples/1.8.x/server-php/examples/account/create-email-password-session.md b/docs/examples/1.8.x/server-php/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..827b1292c5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-email-password-session.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->createEmailPasswordSession( + email: 'email@example.com', + password: 'password' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/create-email-token.md b/docs/examples/1.8.x/server-php/examples/account/create-email-token.md new file mode 100644 index 0000000000..b2c553291b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-email-token.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->createEmailToken( + userId: '<USER_ID>', + email: 'email@example.com', + phrase: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/create-jwt.md b/docs/examples/1.8.x/server-php/examples/account/create-jwt.md new file mode 100644 index 0000000000..3dc486502d --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-jwt.md @@ -0,0 +1,12 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->createJWT(); diff --git a/docs/examples/1.8.x/server-php/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/server-php/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..639b199756 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-magic-url-token.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->createMagicURLToken( + userId: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', // optional + phrase: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-php/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..2eb50c3f00 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-mfa-authenticator.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; +use Appwrite\Enums\AuthenticatorType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createMFAAuthenticator( + type: AuthenticatorType::TOTP() +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-php/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..64471ef7e6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-mfa-challenge.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; +use Appwrite\Enums\AuthenticationFactor; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->createMFAChallenge( + factor: AuthenticationFactor::EMAIL() +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-php/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..031bc4dfa0 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-php/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-php/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..1f91db79fd --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-o-auth-2-token.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; +use Appwrite\Enums\OAuthProvider; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->createOAuth2Token( + provider: OAuthProvider::AMAZON(), + success: 'https://example.com', // optional + failure: 'https://example.com', // optional + scopes: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/create-phone-token.md b/docs/examples/1.8.x/server-php/examples/account/create-phone-token.md new file mode 100644 index 0000000000..93c185479e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-phone-token.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->createPhoneToken( + userId: '<USER_ID>', + phone: '+12065550100' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/create-phone-verification.md b/docs/examples/1.8.x/server-php/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..a152667313 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-phone-verification.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createPhoneVerification(); diff --git a/docs/examples/1.8.x/server-php/examples/account/create-recovery.md b/docs/examples/1.8.x/server-php/examples/account/create-recovery.md new file mode 100644 index 0000000000..c15e41d545 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-recovery.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createRecovery( + email: 'email@example.com', + url: 'https://example.com' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/create-session.md b/docs/examples/1.8.x/server-php/examples/account/create-session.md new file mode 100644 index 0000000000..2ff630a2c2 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-session.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->createSession( + userId: '<USER_ID>', + secret: '<SECRET>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/create-verification.md b/docs/examples/1.8.x/server-php/examples/account/create-verification.md new file mode 100644 index 0000000000..4628175fab --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create-verification.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->createVerification( + url: 'https://example.com' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/create.md b/docs/examples/1.8.x/server-php/examples/account/create.md new file mode 100644 index 0000000000..f92155b6ab --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/create.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->create( + userId: '<USER_ID>', + email: 'email@example.com', + password: '', + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/delete-identity.md b/docs/examples/1.8.x/server-php/examples/account/delete-identity.md new file mode 100644 index 0000000000..fd66d3ae24 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/delete-identity.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->deleteIdentity( + identityId: '<IDENTITY_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-php/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..524b9b3ea5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; +use Appwrite\Enums\AuthenticatorType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->deleteMFAAuthenticator( + type: AuthenticatorType::TOTP() +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/delete-session.md b/docs/examples/1.8.x/server-php/examples/account/delete-session.md new file mode 100644 index 0000000000..9233ae14e8 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/delete-session.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->deleteSession( + sessionId: '<SESSION_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/delete-sessions.md b/docs/examples/1.8.x/server-php/examples/account/delete-sessions.md new file mode 100644 index 0000000000..557fd6d3aa --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/delete-sessions.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->deleteSessions(); diff --git a/docs/examples/1.8.x/server-php/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-php/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..fc5aef27b5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->getMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-php/examples/account/get-prefs.md b/docs/examples/1.8.x/server-php/examples/account/get-prefs.md new file mode 100644 index 0000000000..c7077affe0 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/get-prefs.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->getPrefs(); diff --git a/docs/examples/1.8.x/server-php/examples/account/get-session.md b/docs/examples/1.8.x/server-php/examples/account/get-session.md new file mode 100644 index 0000000000..be2671348e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/get-session.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->getSession( + sessionId: '<SESSION_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/get.md b/docs/examples/1.8.x/server-php/examples/account/get.md new file mode 100644 index 0000000000..30cb7b2af5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/get.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->get(); diff --git a/docs/examples/1.8.x/server-php/examples/account/list-identities.md b/docs/examples/1.8.x/server-php/examples/account/list-identities.md new file mode 100644 index 0000000000..a7d0a85c66 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/list-identities.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->listIdentities( + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/list-logs.md b/docs/examples/1.8.x/server-php/examples/account/list-logs.md new file mode 100644 index 0000000000..cc7a173d2e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/list-logs.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->listLogs( + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/server-php/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..f7b6e2620d --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/list-mfa-factors.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->listMFAFactors(); diff --git a/docs/examples/1.8.x/server-php/examples/account/list-sessions.md b/docs/examples/1.8.x/server-php/examples/account/list-sessions.md new file mode 100644 index 0000000000..7f9749f7be --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/list-sessions.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->listSessions(); diff --git a/docs/examples/1.8.x/server-php/examples/account/update-email.md b/docs/examples/1.8.x/server-php/examples/account/update-email.md new file mode 100644 index 0000000000..c7c0d485ea --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-email.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateEmail( + email: 'email@example.com', + password: 'password' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/server-php/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..fc42cbe6d1 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-magic-url-session.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->updateMagicURLSession( + userId: '<USER_ID>', + secret: '<SECRET>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-php/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..8486e88cdd --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-mfa-authenticator.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; +use Appwrite\Enums\AuthenticatorType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateMFAAuthenticator( + type: AuthenticatorType::TOTP(), + otp: '<OTP>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-php/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..e5821e55be --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-mfa-challenge.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateMFAChallenge( + challengeId: '<CHALLENGE_ID>', + otp: '<OTP>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-php/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..f57e490f3f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateMFARecoveryCodes(); diff --git a/docs/examples/1.8.x/server-php/examples/account/update-mfa.md b/docs/examples/1.8.x/server-php/examples/account/update-mfa.md new file mode 100644 index 0000000000..a1978e63ac --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-mfa.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateMFA( + mfa: false +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-name.md b/docs/examples/1.8.x/server-php/examples/account/update-name.md new file mode 100644 index 0000000000..2603b6e68b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-name.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateName( + name: '<NAME>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-password.md b/docs/examples/1.8.x/server-php/examples/account/update-password.md new file mode 100644 index 0000000000..c5101381e4 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-password.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updatePassword( + password: '', + oldPassword: 'password' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-phone-session.md b/docs/examples/1.8.x/server-php/examples/account/update-phone-session.md new file mode 100644 index 0000000000..12d71c2fcd --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-phone-session.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>'); // Your project ID + +$account = new Account($client); + +$result = $account->updatePhoneSession( + userId: '<USER_ID>', + secret: '<SECRET>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-phone-verification.md b/docs/examples/1.8.x/server-php/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..df59922996 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-phone-verification.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updatePhoneVerification( + userId: '<USER_ID>', + secret: '<SECRET>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-phone.md b/docs/examples/1.8.x/server-php/examples/account/update-phone.md new file mode 100644 index 0000000000..853cb62fce --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-phone.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updatePhone( + phone: '+12065550100', + password: 'password' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-prefs.md b/docs/examples/1.8.x/server-php/examples/account/update-prefs.md new file mode 100644 index 0000000000..f6a1003099 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-prefs.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updatePrefs( + prefs: [ + 'language' => 'en', + 'timezone' => 'UTC', + 'darkTheme' => true + ] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-recovery.md b/docs/examples/1.8.x/server-php/examples/account/update-recovery.md new file mode 100644 index 0000000000..63518b0029 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-recovery.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateRecovery( + userId: '<USER_ID>', + secret: '<SECRET>', + password: '' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-session.md b/docs/examples/1.8.x/server-php/examples/account/update-session.md new file mode 100644 index 0000000000..11cb4c7d98 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-session.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateSession( + sessionId: '<SESSION_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/account/update-status.md b/docs/examples/1.8.x/server-php/examples/account/update-status.md new file mode 100644 index 0000000000..7c8075e5c7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-status.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateStatus(); diff --git a/docs/examples/1.8.x/server-php/examples/account/update-verification.md b/docs/examples/1.8.x/server-php/examples/account/update-verification.md new file mode 100644 index 0000000000..60ec0b3196 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/account/update-verification.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Account; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$account = new Account($client); + +$result = $account->updateVerification( + userId: '<USER_ID>', + secret: '<SECRET>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/avatars/get-browser.md b/docs/examples/1.8.x/server-php/examples/avatars/get-browser.md new file mode 100644 index 0000000000..2449c26032 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/avatars/get-browser.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; +use Appwrite\Enums\Browser; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getBrowser( + code: Browser::AVANTBROWSER(), + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/server-php/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..123b345a43 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/avatars/get-credit-card.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; +use Appwrite\Enums\CreditCard; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getCreditCard( + code: CreditCard::AMERICANEXPRESS(), + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/avatars/get-favicon.md b/docs/examples/1.8.x/server-php/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..1e671864c8 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/avatars/get-favicon.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getFavicon( + url: 'https://example.com' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/avatars/get-flag.md b/docs/examples/1.8.x/server-php/examples/avatars/get-flag.md new file mode 100644 index 0000000000..5b7d8babc7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/avatars/get-flag.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; +use Appwrite\Enums\Flag; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getFlag( + code: Flag::AFGHANISTAN(), + width: 0, // optional + height: 0, // optional + quality: -1 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/avatars/get-image.md b/docs/examples/1.8.x/server-php/examples/avatars/get-image.md new file mode 100644 index 0000000000..e1555453ec --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/avatars/get-image.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getImage( + url: 'https://example.com', + width: 0, // optional + height: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/avatars/get-initials.md b/docs/examples/1.8.x/server-php/examples/avatars/get-initials.md new file mode 100644 index 0000000000..d84e23a157 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/avatars/get-initials.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getInitials( + name: '<NAME>', // optional + width: 0, // optional + height: 0, // optional + background: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/avatars/get-qr.md b/docs/examples/1.8.x/server-php/examples/avatars/get-qr.md new file mode 100644 index 0000000000..0d5936af6b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/avatars/get-qr.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Avatars; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getQR( + text: '<TEXT>', + size: 1, // optional + margin: 0, // optional + download: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..805d022194 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-boolean-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createBooleanAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: false, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-collection.md b/docs/examples/1.8.x/server-php/examples/databases/create-collection.md new file mode 100644 index 0000000000..700d97177b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-collection.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..dd2fcecc80 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-datetime-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createDatetimeAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-document.md b/docs/examples/1.8.x/server-php/examples/databases/create-document.md new file mode 100644 index 0000000000..9f2e8f3643 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-document.md @@ -0,0 +1,25 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->createDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [ + 'username' => 'walter.obrien', + 'email' => 'walter.obrien@example.com', + 'fullName' => 'Walter O'Brien', + 'age' => 30, + 'isAdmin' => false + ], + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-documents.md b/docs/examples/1.8.x/server-php/examples/databases/create-documents.md new file mode 100644 index 0000000000..bc05f67260 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-documents.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..1274a4b9e1 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-email-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createEmailAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'email@example.com', // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..9abf2dfa1b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-enum-attribute.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createEnumAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..e6eecb5298 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-float-attribute.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createFloatAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-index.md b/docs/examples/1.8.x/server-php/examples/databases/create-index.md new file mode 100644 index 0000000000..9e8a221e13 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-index.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; +use Appwrite\Enums\IndexType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + type: IndexType::KEY(), + attributes: [], + orders: [], // optional + lengths: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..1dbeefa547 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-integer-attribute.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createIntegerAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..f42717caa4 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-ip-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createIpAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..56d007c67c --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-line-attribute.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createLineAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..dee0801178 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-point-attribute.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createPointAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [1, 2] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..d745589329 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-polygon-attribute.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createPolygonAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..caccd36031 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-relationship-attribute.md @@ -0,0 +1,23 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; +use Appwrite\Enums\RelationshipType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createRelationshipAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + relatedCollectionId: '<RELATED_COLLECTION_ID>', + type: RelationshipType::ONETOONE(), + twoWay: false, // optional + key: '', // optional + twoWayKey: '', // optional + onDelete: RelationMutate::CASCADE() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..5a4f72b6c8 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-string-attribute.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createStringAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + size: 1, + required: false, + default: '<DEFAULT>', // optional + array: false, // optional + encrypt: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..6b9bc800e5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create-url-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->createUrlAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'https://example.com', // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/create.md b/docs/examples/1.8.x/server-php/examples/databases/create.md new file mode 100644 index 0000000000..73c618874a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/create.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..6464a26818 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/decrement-document-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->decrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + min: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/delete-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..71b7162655 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/delete-attribute.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->deleteAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/delete-collection.md b/docs/examples/1.8.x/server-php/examples/databases/delete-collection.md new file mode 100644 index 0000000000..4e98dfdb4e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/delete-collection.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->deleteCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/delete-document.md b/docs/examples/1.8.x/server-php/examples/databases/delete-document.md new file mode 100644 index 0000000000..def7f24569 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/delete-document.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->deleteDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/delete-documents.md b/docs/examples/1.8.x/server-php/examples/databases/delete-documents.md new file mode 100644 index 0000000000..3552d85317 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/delete-documents.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->deleteDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/delete-index.md b/docs/examples/1.8.x/server-php/examples/databases/delete-index.md new file mode 100644 index 0000000000..79e476b6d0 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/delete-index.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->deleteIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/delete.md b/docs/examples/1.8.x/server-php/examples/databases/delete.md new file mode 100644 index 0000000000..c796b7c406 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/delete.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->delete( + databaseId: '<DATABASE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/get-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/get-attribute.md new file mode 100644 index 0000000000..ba82db4065 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/get-attribute.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->getAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/get-collection.md b/docs/examples/1.8.x/server-php/examples/databases/get-collection.md new file mode 100644 index 0000000000..ecddab053d --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/get-collection.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->getCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/get-document.md b/docs/examples/1.8.x/server-php/examples/databases/get-document.md new file mode 100644 index 0000000000..a3204c50a7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/get-document.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->getDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/get-index.md b/docs/examples/1.8.x/server-php/examples/databases/get-index.md new file mode 100644 index 0000000000..e9c6307671 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/get-index.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->getIndex( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/get.md b/docs/examples/1.8.x/server-php/examples/databases/get.md new file mode 100644 index 0000000000..9aa6395587 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/get.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->get( + databaseId: '<DATABASE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..9ad4bdfdec --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/increment-document-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->incrementDocumentAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + attribute: '', + value: null, // optional + max: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/list-attributes.md b/docs/examples/1.8.x/server-php/examples/databases/list-attributes.md new file mode 100644 index 0000000000..3105fc419c --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/list-attributes.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->listAttributes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/list-collections.md b/docs/examples/1.8.x/server-php/examples/databases/list-collections.md new file mode 100644 index 0000000000..533b26a055 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/list-collections.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->listCollections( + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/list-documents.md b/docs/examples/1.8.x/server-php/examples/databases/list-documents.md new file mode 100644 index 0000000000..07183ac8bf --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/list-documents.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->listDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/list-indexes.md b/docs/examples/1.8.x/server-php/examples/databases/list-indexes.md new file mode 100644 index 0000000000..65b45dae80 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/list-indexes.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->listIndexes( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/list.md b/docs/examples/1.8.x/server-php/examples/databases/list.md new file mode 100644 index 0000000000..6bba74da59 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/list.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->list( + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..2e4bee72fe --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-boolean-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateBooleanAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: false, + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-collection.md b/docs/examples/1.8.x/server-php/examples/databases/update-collection.md new file mode 100644 index 0000000000..dd030c0792 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-collection.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateCollection( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..b1a03ec028 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-datetime-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateDatetimeAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-document.md b/docs/examples/1.8.x/server-php/examples/databases/update-document.md new file mode 100644 index 0000000000..f1c8a34680 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-document.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->updateDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [], // optional + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-documents.md b/docs/examples/1.8.x/server-php/examples/databases/update-documents.md new file mode 100644 index 0000000000..51b4e18bc2 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-documents.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + data: [], // optional + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..dc9865f81a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-email-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateEmailAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'email@example.com', + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..f7cd0b7b83 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-enum-attribute.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateEnumAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..51f6ec9239 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-float-attribute.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateFloatAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..bdbd96ca12 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-integer-attribute.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateIntegerAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..130cd0cc9f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-ip-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateIpAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..86b8f646e8 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-line-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateLineAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..cdff22656c --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-point-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updatePointAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [1, 2], // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..c2736bd4bf --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-polygon-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updatePolygonAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..01783cf3bf --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-relationship-attribute.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateRelationshipAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + onDelete: RelationMutate::CASCADE(), // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..e0c8f992ea --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-string-attribute.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateStringAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: '<DEFAULT>', + size: 1, // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/server-php/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..c200463894 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update-url-attribute.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateUrlAttribute( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '', + required: false, + default: 'https://example.com', + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/update.md b/docs/examples/1.8.x/server-php/examples/databases/update.md new file mode 100644 index 0000000000..9b0b0789ca --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/update.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/upsert-document.md b/docs/examples/1.8.x/server-php/examples/databases/upsert-document.md new file mode 100644 index 0000000000..6cff8296a3 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/upsert-document.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->upsertDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: [], + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/databases/upsert-documents.md b/docs/examples/1.8.x/server-php/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..d9f9efda5c --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/databases/upsert-documents.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Databases; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->upsertDocuments( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documents: [] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/create-deployment.md b/docs/examples/1.8.x/server-php/examples/functions/create-deployment.md new file mode 100644 index 0000000000..7e48b89ca7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/create-deployment.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\InputFile; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createDeployment( + functionId: '<FUNCTION_ID>', + code: InputFile::withPath('file.png'), + activate: false, + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-php/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..a898762cb8 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createDuplicateDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + buildId: '<BUILD_ID>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/create-execution.md b/docs/examples/1.8.x/server-php/examples/functions/create-execution.md new file mode 100644 index 0000000000..cd11b5ea6e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/create-execution.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$functions = new Functions($client); + +$result = $functions->createExecution( + functionId: '<FUNCTION_ID>', + body: '<BODY>', // optional + async: false, // optional + path: '<PATH>', // optional + method: ExecutionMethod::GET(), // optional + headers: [], // optional + scheduledAt: '<SCHEDULED_AT>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/server-php/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..9d22bdc1b4 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/create-template-deployment.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createTemplateDeployment( + functionId: '<FUNCTION_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/create-variable.md b/docs/examples/1.8.x/server-php/examples/functions/create-variable.md new file mode 100644 index 0000000000..ec470d5457 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/create-variable.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createVariable( + functionId: '<FUNCTION_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-php/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..bb4622e67a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/create-vcs-deployment.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; +use Appwrite\Enums\VCSDeploymentType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->createVcsDeployment( + functionId: '<FUNCTION_ID>', + type: VCSDeploymentType::BRANCH(), + reference: '<REFERENCE>', + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/create.md b/docs/examples/1.8.x/server-php/examples/functions/create.md new file mode 100644 index 0000000000..3d37b8068e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/create.md @@ -0,0 +1,33 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; +use Appwrite\Enums\; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->create( + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: ::NODE145(), + execute: ["any"], // optional + events: [], // optional + schedule: '', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/delete-deployment.md b/docs/examples/1.8.x/server-php/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..20285d7610 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/delete-deployment.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->deleteDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/delete-execution.md b/docs/examples/1.8.x/server-php/examples/functions/delete-execution.md new file mode 100644 index 0000000000..e55a8b1892 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/delete-execution.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->deleteExecution( + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/delete-variable.md b/docs/examples/1.8.x/server-php/examples/functions/delete-variable.md new file mode 100644 index 0000000000..e1fb391d79 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/delete-variable.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->deleteVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/delete.md b/docs/examples/1.8.x/server-php/examples/functions/delete.md new file mode 100644 index 0000000000..9f87f5c9f0 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/delete.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->delete( + functionId: '<FUNCTION_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/server-php/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..7b3e18751e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/get-deployment-download.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->getDeploymentDownload( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType::SOURCE() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/get-deployment.md b/docs/examples/1.8.x/server-php/examples/functions/get-deployment.md new file mode 100644 index 0000000000..945933b2ad --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/get-deployment.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->getDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/get-execution.md b/docs/examples/1.8.x/server-php/examples/functions/get-execution.md new file mode 100644 index 0000000000..7dfeeed0c0 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/get-execution.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$functions = new Functions($client); + +$result = $functions->getExecution( + functionId: '<FUNCTION_ID>', + executionId: '<EXECUTION_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/get-variable.md b/docs/examples/1.8.x/server-php/examples/functions/get-variable.md new file mode 100644 index 0000000000..4c8d3d6b53 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/get-variable.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->getVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/get.md b/docs/examples/1.8.x/server-php/examples/functions/get.md new file mode 100644 index 0000000000..ca2160f6c9 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/get.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->get( + functionId: '<FUNCTION_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/list-deployments.md b/docs/examples/1.8.x/server-php/examples/functions/list-deployments.md new file mode 100644 index 0000000000..7bbaa0ed3e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/list-deployments.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->listDeployments( + functionId: '<FUNCTION_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/list-executions.md b/docs/examples/1.8.x/server-php/examples/functions/list-executions.md new file mode 100644 index 0000000000..77a8ba7223 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/list-executions.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$functions = new Functions($client); + +$result = $functions->listExecutions( + functionId: '<FUNCTION_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/list-runtimes.md b/docs/examples/1.8.x/server-php/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..6c77c42678 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/list-runtimes.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->listRuntimes(); diff --git a/docs/examples/1.8.x/server-php/examples/functions/list-specifications.md b/docs/examples/1.8.x/server-php/examples/functions/list-specifications.md new file mode 100644 index 0000000000..eec5c33c9d --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/list-specifications.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->listSpecifications(); diff --git a/docs/examples/1.8.x/server-php/examples/functions/list-variables.md b/docs/examples/1.8.x/server-php/examples/functions/list-variables.md new file mode 100644 index 0000000000..f85e85490c --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/list-variables.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->listVariables( + functionId: '<FUNCTION_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/list.md b/docs/examples/1.8.x/server-php/examples/functions/list.md new file mode 100644 index 0000000000..de914afc58 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/list.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->list( + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/server-php/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..de36d4e8ce --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/update-deployment-status.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->updateDeploymentStatus( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/server-php/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..38ba026ba1 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/update-function-deployment.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->updateFunctionDeployment( + functionId: '<FUNCTION_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/update-variable.md b/docs/examples/1.8.x/server-php/examples/functions/update-variable.md new file mode 100644 index 0000000000..b15597a622 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/update-variable.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->updateVariable( + functionId: '<FUNCTION_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', // optional + secret: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/functions/update.md b/docs/examples/1.8.x/server-php/examples/functions/update.md new file mode 100644 index 0000000000..ea8d863ae5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/functions/update.md @@ -0,0 +1,32 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Functions; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$functions = new Functions($client); + +$result = $functions->update( + functionId: '<FUNCTION_ID>', + name: '<NAME>', + runtime: ::NODE145(), // optional + execute: ["any"], // optional + events: [], // optional + schedule: '', // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: '<ENTRYPOINT>', // optional + commands: '<COMMANDS>', // optional + scopes: [], // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/graphql/mutation.md b/docs/examples/1.8.x/server-php/examples/graphql/mutation.md new file mode 100644 index 0000000000..c349bc2dbd --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/graphql/mutation.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Graphql; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$graphql = new Graphql($client); + +$result = $graphql->mutation( + query: [] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/graphql/query.md b/docs/examples/1.8.x/server-php/examples/graphql/query.md new file mode 100644 index 0000000000..e6e277c27b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/graphql/query.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Graphql; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$graphql = new Graphql($client); + +$result = $graphql->query( + query: [] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-antivirus.md b/docs/examples/1.8.x/server-php/examples/health/get-antivirus.md new file mode 100644 index 0000000000..47210646df --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-antivirus.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getAntivirus(); diff --git a/docs/examples/1.8.x/server-php/examples/health/get-cache.md b/docs/examples/1.8.x/server-php/examples/health/get-cache.md new file mode 100644 index 0000000000..2e81dae328 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-cache.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getCache(); diff --git a/docs/examples/1.8.x/server-php/examples/health/get-certificate.md b/docs/examples/1.8.x/server-php/examples/health/get-certificate.md new file mode 100644 index 0000000000..408581beac --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-certificate.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getCertificate( + domain: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-db.md b/docs/examples/1.8.x/server-php/examples/health/get-db.md new file mode 100644 index 0000000000..cfec70e604 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-db.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getDB(); diff --git a/docs/examples/1.8.x/server-php/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/server-php/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..02959db3b5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-failed-jobs.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; +use Appwrite\Enums\; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getFailedJobs( + name: ::V1DATABASE(), + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-pub-sub.md b/docs/examples/1.8.x/server-php/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..1c346caab6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-pub-sub.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getPubSub(); diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-builds.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..8c1f77433b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-builds.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueBuilds( + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..92fb79a98c --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-certificates.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueCertificates( + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-databases.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..745b469434 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-databases.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueDatabases( + name: '<NAME>', // optional + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..d3952685c4 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-deletes.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueDeletes( + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-functions.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..1a5bea2b4c --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-functions.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueFunctions( + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-logs.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..cf5e3b9d83 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-logs.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueLogs( + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-mails.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..132dfa68aa --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-mails.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueMails( + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..fd5fdb1ede --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-messaging.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueMessaging( + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..68110189e5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-migrations.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueMigrations( + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..d0bd6c054e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-stats-resources.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueStatsResources( + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-usage.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..627a85c845 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-usage.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueUsage( + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-php/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..d6ccd7cd83 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-queue-webhooks.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getQueueWebhooks( + threshold: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/health/get-storage-local.md b/docs/examples/1.8.x/server-php/examples/health/get-storage-local.md new file mode 100644 index 0000000000..041d24954c --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-storage-local.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getStorageLocal(); diff --git a/docs/examples/1.8.x/server-php/examples/health/get-storage.md b/docs/examples/1.8.x/server-php/examples/health/get-storage.md new file mode 100644 index 0000000000..377416ed13 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-storage.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getStorage(); diff --git a/docs/examples/1.8.x/server-php/examples/health/get-time.md b/docs/examples/1.8.x/server-php/examples/health/get-time.md new file mode 100644 index 0000000000..aa2699349d --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get-time.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->getTime(); diff --git a/docs/examples/1.8.x/server-php/examples/health/get.md b/docs/examples/1.8.x/server-php/examples/health/get.md new file mode 100644 index 0000000000..fec3e3f485 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/health/get.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Health; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$health = new Health($client); + +$result = $health->get(); diff --git a/docs/examples/1.8.x/server-php/examples/locale/get.md b/docs/examples/1.8.x/server-php/examples/locale/get.md new file mode 100644 index 0000000000..ef4c0432dd --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/locale/get.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->get(); diff --git a/docs/examples/1.8.x/server-php/examples/locale/list-codes.md b/docs/examples/1.8.x/server-php/examples/locale/list-codes.md new file mode 100644 index 0000000000..273fad0839 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/locale/list-codes.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listCodes(); diff --git a/docs/examples/1.8.x/server-php/examples/locale/list-continents.md b/docs/examples/1.8.x/server-php/examples/locale/list-continents.md new file mode 100644 index 0000000000..e8c7ca46df --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/locale/list-continents.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listContinents(); diff --git a/docs/examples/1.8.x/server-php/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/server-php/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..c5dd1d2ad6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/locale/list-countries-eu.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listCountriesEU(); diff --git a/docs/examples/1.8.x/server-php/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/server-php/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..7585c1071e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/locale/list-countries-phones.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listCountriesPhones(); diff --git a/docs/examples/1.8.x/server-php/examples/locale/list-countries.md b/docs/examples/1.8.x/server-php/examples/locale/list-countries.md new file mode 100644 index 0000000000..63a2e0b5f7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/locale/list-countries.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listCountries(); diff --git a/docs/examples/1.8.x/server-php/examples/locale/list-currencies.md b/docs/examples/1.8.x/server-php/examples/locale/list-currencies.md new file mode 100644 index 0000000000..d385018e7d --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/locale/list-currencies.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listCurrencies(); diff --git a/docs/examples/1.8.x/server-php/examples/locale/list-languages.md b/docs/examples/1.8.x/server-php/examples/locale/list-languages.md new file mode 100644 index 0000000000..f0ca4d4f04 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/locale/list-languages.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Locale; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$locale = new Locale($client); + +$result = $locale->listLanguages(); diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..2ce4b7f95b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-apns-provider.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createAPNSProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-email.md b/docs/examples/1.8.x/server-php/examples/messaging/create-email.md new file mode 100644 index 0000000000..9de24873bf --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-email.md @@ -0,0 +1,26 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createEmail( + messageId: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + attachments: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..8037c23197 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-fcm-provider.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createFCMProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + serviceAccountJSON: [], // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..6c62ee8837 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,24 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createMailgunProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + domain: '<DOMAIN>', // optional + isEuRegion: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..1eb954a2c6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createMsg91Provider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>', // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-push.md b/docs/examples/1.8.x/server-php/examples/messaging/create-push.md new file mode 100644 index 0000000000..46aeeb3b8b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-push.md @@ -0,0 +1,33 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createPush( + messageId: '<MESSAGE_ID>', + title: '<TITLE>', // optional + body: '<BODY>', // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + data: [], // optional + action: '<ACTION>', // optional + image: '[ID1:ID2]', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: null, // optional + draft: false, // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority::NORMAL() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..892d856305 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createSendgridProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-sms.md b/docs/examples/1.8.x/server-php/examples/messaging/create-sms.md new file mode 100644 index 0000000000..50623b5b63 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-sms.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createSMS( + messageId: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..017f20cc15 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-smtp-provider.md @@ -0,0 +1,28 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createSMTPProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 1, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + encryption: SmtpEncryption::NONE(), // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/server-php/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..3516fa3d6a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-subscriber.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +$messaging = new Messaging($client); + +$result = $messaging->createSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>', + targetId: '<TARGET_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..9006918029 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-telesign-provider.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createTelesignProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..5215d52642 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createTextmagicProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-topic.md b/docs/examples/1.8.x/server-php/examples/messaging/create-topic.md new file mode 100644 index 0000000000..e94141cc73 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-topic.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createTopic( + topicId: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ["any"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..c356828640 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-twilio-provider.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createTwilioProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..adeacbc45e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/create-vonage-provider.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createVonageProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/delete-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..f37d18b4fd --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/delete-provider.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->deleteProvider( + providerId: '<PROVIDER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-php/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..f7a8425920 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/delete-subscriber.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setJWT('<YOUR_JWT>'); // Your secret JSON Web Token + +$messaging = new Messaging($client); + +$result = $messaging->deleteSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/delete-topic.md b/docs/examples/1.8.x/server-php/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..2ec899b1d6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/delete-topic.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->deleteTopic( + topicId: '<TOPIC_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/delete.md b/docs/examples/1.8.x/server-php/examples/messaging/delete.md new file mode 100644 index 0000000000..5781838bdc --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/delete.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->delete( + messageId: '<MESSAGE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/get-message.md b/docs/examples/1.8.x/server-php/examples/messaging/get-message.md new file mode 100644 index 0000000000..cf922219c7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/get-message.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->getMessage( + messageId: '<MESSAGE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/get-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/get-provider.md new file mode 100644 index 0000000000..d19f5c65e5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/get-provider.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->getProvider( + providerId: '<PROVIDER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/server-php/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..e2a0d7ef35 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/get-subscriber.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->getSubscriber( + topicId: '<TOPIC_ID>', + subscriberId: '<SUBSCRIBER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/get-topic.md b/docs/examples/1.8.x/server-php/examples/messaging/get-topic.md new file mode 100644 index 0000000000..fc06cbbc95 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/get-topic.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->getTopic( + topicId: '<TOPIC_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/server-php/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..03231375f8 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/list-message-logs.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listMessageLogs( + messageId: '<MESSAGE_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/list-messages.md b/docs/examples/1.8.x/server-php/examples/messaging/list-messages.md new file mode 100644 index 0000000000..965fe08fc7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/list-messages.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listMessages( + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-php/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..761bb966d6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/list-provider-logs.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listProviderLogs( + providerId: '<PROVIDER_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/list-providers.md b/docs/examples/1.8.x/server-php/examples/messaging/list-providers.md new file mode 100644 index 0000000000..614e9c58f1 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/list-providers.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listProviders( + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-php/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..c710575a46 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listSubscriberLogs( + subscriberId: '<SUBSCRIBER_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/server-php/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..d2625cd555 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/list-subscribers.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listSubscribers( + topicId: '<TOPIC_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/list-targets.md b/docs/examples/1.8.x/server-php/examples/messaging/list-targets.md new file mode 100644 index 0000000000..1112d28003 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/list-targets.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listTargets( + messageId: '<MESSAGE_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-php/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..3bbb35a006 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/list-topic-logs.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listTopicLogs( + topicId: '<TOPIC_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/list-topics.md b/docs/examples/1.8.x/server-php/examples/messaging/list-topics.md new file mode 100644 index 0000000000..debb363133 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/list-topics.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->listTopics( + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..161a148563 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-apns-provider.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateAPNSProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + authKey: '<AUTH_KEY>', // optional + authKeyId: '<AUTH_KEY_ID>', // optional + teamId: '<TEAM_ID>', // optional + bundleId: '<BUNDLE_ID>', // optional + sandbox: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-email.md b/docs/examples/1.8.x/server-php/examples/messaging/update-email.md new file mode 100644 index 0000000000..dd0f645af6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-email.md @@ -0,0 +1,26 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateEmail( + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + subject: '<SUBJECT>', // optional + content: '<CONTENT>', // optional + draft: false, // optional + html: false, // optional + cc: [], // optional + bcc: [], // optional + scheduledAt: '', // optional + attachments: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..0df2b93af6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-fcm-provider.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateFCMProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + serviceAccountJSON: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..c99ebc7d73 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,24 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateMailgunProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + apiKey: '<API_KEY>', // optional + domain: '<DOMAIN>', // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..f6f557cce4 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateMsg91Provider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + templateId: '<TEMPLATE_ID>', // optional + senderId: '<SENDER_ID>', // optional + authKey: '<AUTH_KEY>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-push.md b/docs/examples/1.8.x/server-php/examples/messaging/update-push.md new file mode 100644 index 0000000000..e1df0b9132 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-push.md @@ -0,0 +1,33 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updatePush( + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + title: '<TITLE>', // optional + body: '<BODY>', // optional + data: [], // optional + action: '<ACTION>', // optional + image: '[ID1:ID2]', // optional + icon: '<ICON>', // optional + sound: '<SOUND>', // optional + color: '<COLOR>', // optional + tag: '<TAG>', // optional + badge: null, // optional + draft: false, // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority::NORMAL() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..b8473c16a3 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateSendgridProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-sms.md b/docs/examples/1.8.x/server-php/examples/messaging/update-sms.md new file mode 100644 index 0000000000..92d3ebbed7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-sms.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateSMS( + messageId: '<MESSAGE_ID>', + topics: [], // optional + users: [], // optional + targets: [], // optional + content: '<CONTENT>', // optional + draft: false, // optional + scheduledAt: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..3bc80d2789 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-smtp-provider.md @@ -0,0 +1,28 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateSMTPProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + host: '<HOST>', // optional + port: 1, // optional + username: '<USERNAME>', // optional + password: '<PASSWORD>', // optional + encryption: SmtpEncryption::NONE(), // optional + autoTLS: false, // optional + mailer: '<MAILER>', // optional + fromName: '<FROM_NAME>', // optional + fromEmail: 'email@example.com', // optional + replyToName: '<REPLY_TO_NAME>', // optional + replyToEmail: '<REPLY_TO_EMAIL>', // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..29a54bfaed --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-telesign-provider.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateTelesignProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + customerId: '<CUSTOMER_ID>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..e6a1ed1a1e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateTextmagicProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + username: '<USERNAME>', // optional + apiKey: '<API_KEY>', // optional + from: '<FROM>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-topic.md b/docs/examples/1.8.x/server-php/examples/messaging/update-topic.md new file mode 100644 index 0000000000..b1f9a32ec5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-topic.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateTopic( + topicId: '<TOPIC_ID>', + name: '<NAME>', // optional + subscribe: ["any"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..def821adc4 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-twilio-provider.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateTwilioProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + accountSid: '<ACCOUNT_SID>', // optional + authToken: '<AUTH_TOKEN>', // optional + from: '<FROM>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-php/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..0841e284eb --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/messaging/update-vonage-provider.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Messaging; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->updateVonageProvider( + providerId: '<PROVIDER_ID>', + name: '<NAME>', // optional + enabled: false, // optional + apiKey: '<API_KEY>', // optional + apiSecret: '<API_SECRET>', // optional + from: '<FROM>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/create-deployment.md b/docs/examples/1.8.x/server-php/examples/sites/create-deployment.md new file mode 100644 index 0000000000..30770b7871 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/create-deployment.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\InputFile; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createDeployment( + siteId: '<SITE_ID>', + code: InputFile::withPath('file.png'), + activate: false, + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-php/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..84f65cd025 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createDuplicateDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/server-php/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..f2d1f3cd8b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/create-template-deployment.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createTemplateDeployment( + siteId: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + rootDirectory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/create-variable.md b/docs/examples/1.8.x/server-php/examples/sites/create-variable.md new file mode 100644 index 0000000000..3097e19305 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/create-variable.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createVariable( + siteId: '<SITE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-php/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..7f63dffdf8 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/create-vcs-deployment.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; +use Appwrite\Enums\VCSDeploymentType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->createVcsDeployment( + siteId: '<SITE_ID>', + type: VCSDeploymentType::BRANCH(), + reference: '<REFERENCE>', + activate: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/create.md b/docs/examples/1.8.x/server-php/examples/sites/create.md new file mode 100644 index 0000000000..4a1c3a4fcb --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/create.md @@ -0,0 +1,34 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; +use Appwrite\Enums\; +use Appwrite\Enums\; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->create( + siteId: '<SITE_ID>', + name: '<NAME>', + framework: ::ANALOG(), + buildRuntime: ::NODE145(), + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + adapter: ::STATIC(), // optional + installationId: '<INSTALLATION_ID>', // optional + fallbackFile: '<FALLBACK_FILE>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/delete-deployment.md b/docs/examples/1.8.x/server-php/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..4e24748c37 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/delete-deployment.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->deleteDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/delete-log.md b/docs/examples/1.8.x/server-php/examples/sites/delete-log.md new file mode 100644 index 0000000000..b6e30643f6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/delete-log.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->deleteLog( + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/delete-variable.md b/docs/examples/1.8.x/server-php/examples/sites/delete-variable.md new file mode 100644 index 0000000000..663254303a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/delete-variable.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->deleteVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/delete.md b/docs/examples/1.8.x/server-php/examples/sites/delete.md new file mode 100644 index 0000000000..8e6363aa35 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/delete.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->delete( + siteId: '<SITE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/server-php/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..91c6b6e52a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/get-deployment-download.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getDeploymentDownload( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType::SOURCE() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/get-deployment.md b/docs/examples/1.8.x/server-php/examples/sites/get-deployment.md new file mode 100644 index 0000000000..19525d9274 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/get-deployment.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/get-log.md b/docs/examples/1.8.x/server-php/examples/sites/get-log.md new file mode 100644 index 0000000000..5ceb2b9110 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/get-log.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getLog( + siteId: '<SITE_ID>', + logId: '<LOG_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/get-variable.md b/docs/examples/1.8.x/server-php/examples/sites/get-variable.md new file mode 100644 index 0000000000..0cab412b2e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/get-variable.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->getVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/get.md b/docs/examples/1.8.x/server-php/examples/sites/get.md new file mode 100644 index 0000000000..e5ec061bad --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/get.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->get( + siteId: '<SITE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/list-deployments.md b/docs/examples/1.8.x/server-php/examples/sites/list-deployments.md new file mode 100644 index 0000000000..4d687ec59e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/list-deployments.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listDeployments( + siteId: '<SITE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/list-frameworks.md b/docs/examples/1.8.x/server-php/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..87df92d9ee --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/list-frameworks.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listFrameworks(); diff --git a/docs/examples/1.8.x/server-php/examples/sites/list-logs.md b/docs/examples/1.8.x/server-php/examples/sites/list-logs.md new file mode 100644 index 0000000000..5674e98f5e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/list-logs.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listLogs( + siteId: '<SITE_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/list-specifications.md b/docs/examples/1.8.x/server-php/examples/sites/list-specifications.md new file mode 100644 index 0000000000..42dae1b799 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/list-specifications.md @@ -0,0 +1,13 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listSpecifications(); diff --git a/docs/examples/1.8.x/server-php/examples/sites/list-variables.md b/docs/examples/1.8.x/server-php/examples/sites/list-variables.md new file mode 100644 index 0000000000..36aad640fe --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/list-variables.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->listVariables( + siteId: '<SITE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/list.md b/docs/examples/1.8.x/server-php/examples/sites/list.md new file mode 100644 index 0000000000..4e16c690bc --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/list.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->list( + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/server-php/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..2714b3570f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/update-deployment-status.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->updateDeploymentStatus( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/server-php/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..6e2614cb41 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/update-site-deployment.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->updateSiteDeployment( + siteId: '<SITE_ID>', + deploymentId: '<DEPLOYMENT_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/update-variable.md b/docs/examples/1.8.x/server-php/examples/sites/update-variable.md new file mode 100644 index 0000000000..84bafe28c4 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/update-variable.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->updateVariable( + siteId: '<SITE_ID>', + variableId: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', // optional + secret: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/sites/update.md b/docs/examples/1.8.x/server-php/examples/sites/update.md new file mode 100644 index 0000000000..f2ca54a987 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/sites/update.md @@ -0,0 +1,33 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Sites; +use Appwrite\Enums\; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$sites = new Sites($client); + +$result = $sites->update( + siteId: '<SITE_ID>', + name: '<NAME>', + framework: ::ANALOG(), + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: '<INSTALL_COMMAND>', // optional + buildCommand: '<BUILD_COMMAND>', // optional + outputDirectory: '<OUTPUT_DIRECTORY>', // optional + buildRuntime: ::NODE145(), // optional + adapter: ::STATIC(), // optional + fallbackFile: '<FALLBACK_FILE>', // optional + installationId: '<INSTALLATION_ID>', // optional + providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional + providerBranch: '<PROVIDER_BRANCH>', // optional + providerSilentMode: false, // optional + providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional + specification: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/create-bucket.md b/docs/examples/1.8.x/server-php/examples/storage/create-bucket.md new file mode 100644 index 0000000000..cd17ffedac --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/create-bucket.md @@ -0,0 +1,24 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$storage = new Storage($client); + +$result = $storage->createBucket( + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: ::NONE(), // optional + encryption: false, // optional + antivirus: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/create-file.md b/docs/examples/1.8.x/server-php/examples/storage/create-file.md new file mode 100644 index 0000000000..2d13305984 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/create-file.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\InputFile; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->createFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + file: InputFile::withPath('file.png'), + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/delete-bucket.md b/docs/examples/1.8.x/server-php/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..50adf35b6b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/delete-bucket.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$storage = new Storage($client); + +$result = $storage->deleteBucket( + bucketId: '<BUCKET_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/delete-file.md b/docs/examples/1.8.x/server-php/examples/storage/delete-file.md new file mode 100644 index 0000000000..d4c45eb66a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/delete-file.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->deleteFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/get-bucket.md b/docs/examples/1.8.x/server-php/examples/storage/get-bucket.md new file mode 100644 index 0000000000..e62c43d2d3 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/get-bucket.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$storage = new Storage($client); + +$result = $storage->getBucket( + bucketId: '<BUCKET_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/get-file-download.md b/docs/examples/1.8.x/server-php/examples/storage/get-file-download.md new file mode 100644 index 0000000000..defefa5948 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/get-file-download.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->getFileDownload( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/get-file-preview.md b/docs/examples/1.8.x/server-php/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..0b65fc326a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/get-file-preview.md @@ -0,0 +1,28 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->getFilePreview( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + width: 0, // optional + height: 0, // optional + gravity: ImageGravity::CENTER(), // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: '', // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: '', // optional + output: ImageFormat::JPG(), // optional + token: '<TOKEN>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/get-file-view.md b/docs/examples/1.8.x/server-php/examples/storage/get-file-view.md new file mode 100644 index 0000000000..dfc84ca102 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/get-file-view.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->getFileView( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + token: '<TOKEN>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/get-file.md b/docs/examples/1.8.x/server-php/examples/storage/get-file.md new file mode 100644 index 0000000000..6964144801 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/get-file.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->getFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/list-buckets.md b/docs/examples/1.8.x/server-php/examples/storage/list-buckets.md new file mode 100644 index 0000000000..a4538c6f3a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/list-buckets.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$storage = new Storage($client); + +$result = $storage->listBuckets( + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/list-files.md b/docs/examples/1.8.x/server-php/examples/storage/list-files.md new file mode 100644 index 0000000000..ede0e7c979 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/list-files.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->listFiles( + bucketId: '<BUCKET_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/update-bucket.md b/docs/examples/1.8.x/server-php/examples/storage/update-bucket.md new file mode 100644 index 0000000000..1517e36621 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/update-bucket.md @@ -0,0 +1,24 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$storage = new Storage($client); + +$result = $storage->updateBucket( + bucketId: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: ::NONE(), // optional + encryption: false, // optional + antivirus: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/storage/update-file.md b/docs/examples/1.8.x/server-php/examples/storage/update-file.md new file mode 100644 index 0000000000..7b467acfe3 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/storage/update-file.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Storage; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$storage = new Storage($client); + +$result = $storage->updateFile( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + name: '<NAME>', // optional + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..5f0a2de34b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createBooleanColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: false, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..9ea8e8f4d9 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createDatetimeColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..64f3a08299 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-email-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createEmailColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..0506a3364a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-enum-column.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createEnumColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..65a7f00f8b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-float-column.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createFloatColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-index.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..1a3fd13007 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-index.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; +use Appwrite\Enums\IndexType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + type: IndexType::KEY(), + columns: [], + orders: [], // optional + lengths: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..4bf96e8b93 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-integer-column.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createIntegerColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + min: null, // optional + max: null, // optional + default: null, // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..ab0032e449 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-ip-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createIpColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..69f2e66717 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-line-column.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createLineColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..006c9e0089 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-point-column.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createPointColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [1, 2] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..20fb27161e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createPolygonColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..031d1fd1aa --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,23 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; +use Appwrite\Enums\RelationshipType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createRelationshipColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + relatedTableId: '<RELATED_TABLE_ID>', + type: RelationshipType::ONETOONE(), + twoWay: false, // optional + key: '', // optional + twoWayKey: '', // optional + onDelete: RelationMutate::CASCADE() // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-row.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..fa5137b99e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-row.md @@ -0,0 +1,25 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: [ + 'username' => 'walter.obrien', + 'email' => 'walter.obrien@example.com', + 'fullName' => 'Walter O'Brien', + 'age' => 30, + 'isAdmin' => false + ], + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..011443859f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-rows.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..22fc7ccf9d --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-string-column.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createStringColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + size: 1, + required: false, + default: '<DEFAULT>', // optional + array: false, // optional + encrypt: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-table.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..46cf3885fb --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-table.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..fe25988a7e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create-url-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->createUrlColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', // optional + array: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/create.md b/docs/examples/1.8.x/server-php/examples/tablesdb/create.md new file mode 100644 index 0000000000..c3c4faaf01 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/create.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->create( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..a58bd71071 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->decrementRowColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, // optional + min: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..dd99fabc09 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/delete-column.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/server-php/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..1ef346fec3 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/delete-index.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/server-php/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..4ffc112d66 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/delete-row.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-php/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..10a3c87ff2 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/delete-rows.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/server-php/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..3cbb35de68 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/delete-table.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->deleteTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/delete.md b/docs/examples/1.8.x/server-php/examples/tablesdb/delete.md new file mode 100644 index 0000000000..ea996e9b19 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/delete.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->delete( + databaseId: '<DATABASE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/get-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..d1705a4175 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/get-column.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->getColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/get-index.md b/docs/examples/1.8.x/server-php/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..0d67648151 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/get-index.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->getIndex( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/get-row.md b/docs/examples/1.8.x/server-php/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..00ba9b65b5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/get-row.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->getRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/get-table.md b/docs/examples/1.8.x/server-php/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..ee8812f685 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/get-table.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->getTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/get.md b/docs/examples/1.8.x/server-php/examples/tablesdb/get.md new file mode 100644 index 0000000000..07f70987c5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/get.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->get( + databaseId: '<DATABASE_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..d72a1e374f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/increment-row-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->incrementRowColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + column: '', + value: null, // optional + max: null // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/server-php/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..d12d52d4f8 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/list-columns.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listColumns( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-php/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..cb51dbb5e3 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/list-indexes.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listIndexes( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/server-php/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..c3b713703e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/list-rows.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/server-php/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..05f044bc72 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/list-tables.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->listTables( + databaseId: '<DATABASE_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/list.md b/docs/examples/1.8.x/server-php/examples/tablesdb/list.md new file mode 100644 index 0000000000..c3f97c2330 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/list.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->list( + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..0c735167cd --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateBooleanColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: false, + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..52213c6e3c --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateDatetimeColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..d13de56b30 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-email-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateEmailColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..d54c0b38d0 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-enum-column.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateEnumColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..bb091abf94 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-float-column.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateFloatColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..2436bc2cee --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-integer-column.md @@ -0,0 +1,22 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateIntegerColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, // optional + max: null, // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..aa97752a91 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-ip-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateIpColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '', + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..56a557cbe6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-line-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateLineColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..abe8b737ca --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-point-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updatePointColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [1, 2], // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..2ff401151f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updatePolygonColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..834dc18cee --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateRelationshipColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + onDelete: RelationMutate::CASCADE(), // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-row.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..70e5d159fd --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-row.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: [], // optional + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..8a676289d2 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-rows.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + data: [], // optional + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..eb1acc15ed --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-string-column.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateStringColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: '<DEFAULT>', + size: 1, // optional + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-table.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..294d8d6751 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-table.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateTable( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..b64b3024da --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update-url-column.md @@ -0,0 +1,20 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->updateUrlColumn( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', + newKey: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/update.md b/docs/examples/1.8.x/server-php/examples/tablesdb/update.md new file mode 100644 index 0000000000..106b75e2b2 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/update.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->update( + databaseId: '<DATABASE_ID>', + name: '<NAME>', + enabled: false // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-php/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..235f0e577b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/upsert-row.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->upsertRow( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rowId: '<ROW_ID>', + data: [], // optional + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-php/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..c1890f1ea3 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tablesdb/upsert-rows.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\TablesDB; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tablesDB = new TablesDB($client); + +$result = $tablesDB->upsertRows( + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/create-membership.md b/docs/examples/1.8.x/server-php/examples/teams/create-membership.md new file mode 100644 index 0000000000..285368f9dd --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/create-membership.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->createMembership( + teamId: '<TEAM_ID>', + roles: [], + email: 'email@example.com', // optional + userId: '<USER_ID>', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/create.md b/docs/examples/1.8.x/server-php/examples/teams/create.md new file mode 100644 index 0000000000..643fa0eb11 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/create.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->create( + teamId: '<TEAM_ID>', + name: '<NAME>', + roles: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/delete-membership.md b/docs/examples/1.8.x/server-php/examples/teams/delete-membership.md new file mode 100644 index 0000000000..579b790c55 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/delete-membership.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->deleteMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/delete.md b/docs/examples/1.8.x/server-php/examples/teams/delete.md new file mode 100644 index 0000000000..9db4e7e9a7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/delete.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->delete( + teamId: '<TEAM_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/get-membership.md b/docs/examples/1.8.x/server-php/examples/teams/get-membership.md new file mode 100644 index 0000000000..bd6cbe8b42 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/get-membership.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->getMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/get-prefs.md b/docs/examples/1.8.x/server-php/examples/teams/get-prefs.md new file mode 100644 index 0000000000..fbade4fc2f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/get-prefs.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->getPrefs( + teamId: '<TEAM_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/get.md b/docs/examples/1.8.x/server-php/examples/teams/get.md new file mode 100644 index 0000000000..0dafa8a5d3 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/get.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->get( + teamId: '<TEAM_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/list-memberships.md b/docs/examples/1.8.x/server-php/examples/teams/list-memberships.md new file mode 100644 index 0000000000..817ea7fefc --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/list-memberships.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->listMemberships( + teamId: '<TEAM_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/list.md b/docs/examples/1.8.x/server-php/examples/teams/list.md new file mode 100644 index 0000000000..99d9895fe5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/list.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->list( + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/update-membership-status.md b/docs/examples/1.8.x/server-php/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..5dbfd4cb0f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/update-membership-status.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->updateMembershipStatus( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + userId: '<USER_ID>', + secret: '<SECRET>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/update-membership.md b/docs/examples/1.8.x/server-php/examples/teams/update-membership.md new file mode 100644 index 0000000000..10f135b01f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/update-membership.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->updateMembership( + teamId: '<TEAM_ID>', + membershipId: '<MEMBERSHIP_ID>', + roles: [] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/update-name.md b/docs/examples/1.8.x/server-php/examples/teams/update-name.md new file mode 100644 index 0000000000..bc13d924e4 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/update-name.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->updateName( + teamId: '<TEAM_ID>', + name: '<NAME>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/teams/update-prefs.md b/docs/examples/1.8.x/server-php/examples/teams/update-prefs.md new file mode 100644 index 0000000000..bd8d9de32f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/teams/update-prefs.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Teams; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setSession(''); // The user session to authenticate with + +$teams = new Teams($client); + +$result = $teams->updatePrefs( + teamId: '<TEAM_ID>', + prefs: [] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tokens/create-file-token.md b/docs/examples/1.8.x/server-php/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..e4f230217a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tokens/create-file-token.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Tokens; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->createFileToken( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + expire: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tokens/delete.md b/docs/examples/1.8.x/server-php/examples/tokens/delete.md new file mode 100644 index 0000000000..278be90b12 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tokens/delete.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Tokens; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->delete( + tokenId: '<TOKEN_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tokens/get.md b/docs/examples/1.8.x/server-php/examples/tokens/get.md new file mode 100644 index 0000000000..e7b4e1081b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tokens/get.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Tokens; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->get( + tokenId: '<TOKEN_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tokens/list.md b/docs/examples/1.8.x/server-php/examples/tokens/list.md new file mode 100644 index 0000000000..b89420bed1 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tokens/list.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Tokens; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->list( + bucketId: '<BUCKET_ID>', + fileId: '<FILE_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/tokens/update.md b/docs/examples/1.8.x/server-php/examples/tokens/update.md new file mode 100644 index 0000000000..ea95322a43 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/tokens/update.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Tokens; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$tokens = new Tokens($client); + +$result = $tokens->update( + tokenId: '<TOKEN_ID>', + expire: '' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/server-php/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..a9166ef3b0 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-argon-2-user.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createArgon2User( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-php/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..c9fd81e43a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-bcrypt-user.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createBcryptUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-jwt.md b/docs/examples/1.8.x/server-php/examples/users/create-jwt.md new file mode 100644 index 0000000000..1c1c6d40bd --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-jwt.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createJWT( + userId: '<USER_ID>', + sessionId: '<SESSION_ID>', // optional + duration: 0 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-md-5-user.md b/docs/examples/1.8.x/server-php/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..696cbbeb57 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-md-5-user.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createMD5User( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-php/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..ee96d2e277 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createMFARecoveryCodes( + userId: '<USER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-php/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..d56c4651f6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-ph-pass-user.md @@ -0,0 +1,18 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createPHPassUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-php/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..f579efb5f2 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createScryptModifiedUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>', + passwordSignerKey: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/server-php/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..b406b9404a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-scrypt-user.md @@ -0,0 +1,23 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createScryptUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordSalt: '<PASSWORD_SALT>', + passwordCpu: null, + passwordMemory: null, + passwordParallel: null, + passwordLength: null, + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-session.md b/docs/examples/1.8.x/server-php/examples/users/create-session.md new file mode 100644 index 0000000000..1589315f92 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-session.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createSession( + userId: '<USER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-sha-user.md b/docs/examples/1.8.x/server-php/examples/users/create-sha-user.md new file mode 100644 index 0000000000..0b9a27ed8e --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-sha-user.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createSHAUser( + userId: '<USER_ID>', + email: 'email@example.com', + password: 'password', + passwordVersion: PasswordHash::SHA1(), // optional + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-target.md b/docs/examples/1.8.x/server-php/examples/users/create-target.md new file mode 100644 index 0000000000..57946a440f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-target.md @@ -0,0 +1,21 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; +use Appwrite\Enums\MessagingProviderType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + providerType: MessagingProviderType::EMAIL(), + identifier: '<IDENTIFIER>', + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create-token.md b/docs/examples/1.8.x/server-php/examples/users/create-token.md new file mode 100644 index 0000000000..1b92f5171d --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create-token.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->createToken( + userId: '<USER_ID>', + length: 4, // optional + expire: 60 // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/create.md b/docs/examples/1.8.x/server-php/examples/users/create.md new file mode 100644 index 0000000000..595f24fbce --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/create.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->create( + userId: '<USER_ID>', + email: 'email@example.com', // optional + phone: '+12065550100', // optional + password: '', // optional + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/delete-identity.md b/docs/examples/1.8.x/server-php/examples/users/delete-identity.md new file mode 100644 index 0000000000..26b71eead2 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/delete-identity.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->deleteIdentity( + identityId: '<IDENTITY_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-php/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..f2f08ec172 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; +use Appwrite\Enums\AuthenticatorType; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->deleteMFAAuthenticator( + userId: '<USER_ID>', + type: AuthenticatorType::TOTP() +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/delete-session.md b/docs/examples/1.8.x/server-php/examples/users/delete-session.md new file mode 100644 index 0000000000..493cf53d2f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/delete-session.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->deleteSession( + userId: '<USER_ID>', + sessionId: '<SESSION_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/delete-sessions.md b/docs/examples/1.8.x/server-php/examples/users/delete-sessions.md new file mode 100644 index 0000000000..cd6d11e1d7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/delete-sessions.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->deleteSessions( + userId: '<USER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/delete-target.md b/docs/examples/1.8.x/server-php/examples/users/delete-target.md new file mode 100644 index 0000000000..0d85d3e4df --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/delete-target.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->deleteTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/delete.md b/docs/examples/1.8.x/server-php/examples/users/delete.md new file mode 100644 index 0000000000..883156ecd6 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/delete.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->delete( + userId: '<USER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-php/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..7937e6ad4b --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->getMFARecoveryCodes( + userId: '<USER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/get-prefs.md b/docs/examples/1.8.x/server-php/examples/users/get-prefs.md new file mode 100644 index 0000000000..5e99e14b52 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/get-prefs.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->getPrefs( + userId: '<USER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/get-target.md b/docs/examples/1.8.x/server-php/examples/users/get-target.md new file mode 100644 index 0000000000..31baf3c852 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/get-target.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->getTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/get.md b/docs/examples/1.8.x/server-php/examples/users/get.md new file mode 100644 index 0000000000..0ce39ae6e5 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/get.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->get( + userId: '<USER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/list-identities.md b/docs/examples/1.8.x/server-php/examples/users/list-identities.md new file mode 100644 index 0000000000..fd15b7b51a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/list-identities.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->listIdentities( + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/list-logs.md b/docs/examples/1.8.x/server-php/examples/users/list-logs.md new file mode 100644 index 0000000000..7aea2dc59a --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/list-logs.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->listLogs( + userId: '<USER_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/list-memberships.md b/docs/examples/1.8.x/server-php/examples/users/list-memberships.md new file mode 100644 index 0000000000..53c4b1b9cc --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/list-memberships.md @@ -0,0 +1,17 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->listMemberships( + userId: '<USER_ID>', + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/server-php/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..5dae790c94 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/list-mfa-factors.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->listMFAFactors( + userId: '<USER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/list-sessions.md b/docs/examples/1.8.x/server-php/examples/users/list-sessions.md new file mode 100644 index 0000000000..bdbd0e5e51 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/list-sessions.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->listSessions( + userId: '<USER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/list-targets.md b/docs/examples/1.8.x/server-php/examples/users/list-targets.md new file mode 100644 index 0000000000..005d51a531 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/list-targets.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->listTargets( + userId: '<USER_ID>', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/list.md b/docs/examples/1.8.x/server-php/examples/users/list.md new file mode 100644 index 0000000000..04217363f0 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/list.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->list( + queries: [], // optional + search: '<SEARCH>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-email-verification.md b/docs/examples/1.8.x/server-php/examples/users/update-email-verification.md new file mode 100644 index 0000000000..636f1d2404 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-email-verification.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateEmailVerification( + userId: '<USER_ID>', + emailVerification: false +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-email.md b/docs/examples/1.8.x/server-php/examples/users/update-email.md new file mode 100644 index 0000000000..21ec88b334 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-email.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateEmail( + userId: '<USER_ID>', + email: 'email@example.com' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-labels.md b/docs/examples/1.8.x/server-php/examples/users/update-labels.md new file mode 100644 index 0000000000..7d4ae5de50 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-labels.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateLabels( + userId: '<USER_ID>', + labels: [] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-php/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..8474755fd3 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,15 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateMFARecoveryCodes( + userId: '<USER_ID>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-mfa.md b/docs/examples/1.8.x/server-php/examples/users/update-mfa.md new file mode 100644 index 0000000000..c24916a680 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-mfa.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateMFA( + userId: '<USER_ID>', + mfa: false +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-name.md b/docs/examples/1.8.x/server-php/examples/users/update-name.md new file mode 100644 index 0000000000..09bb07cdd7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-name.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateName( + userId: '<USER_ID>', + name: '<NAME>' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-password.md b/docs/examples/1.8.x/server-php/examples/users/update-password.md new file mode 100644 index 0000000000..6d58605d5c --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-password.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updatePassword( + userId: '<USER_ID>', + password: '' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-phone-verification.md b/docs/examples/1.8.x/server-php/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..019fb3f148 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-phone-verification.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updatePhoneVerification( + userId: '<USER_ID>', + phoneVerification: false +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-phone.md b/docs/examples/1.8.x/server-php/examples/users/update-phone.md new file mode 100644 index 0000000000..13bd41bfa8 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-phone.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updatePhone( + userId: '<USER_ID>', + number: '+12065550100' +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-prefs.md b/docs/examples/1.8.x/server-php/examples/users/update-prefs.md new file mode 100644 index 0000000000..9491239271 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-prefs.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updatePrefs( + userId: '<USER_ID>', + prefs: [] +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-status.md b/docs/examples/1.8.x/server-php/examples/users/update-status.md new file mode 100644 index 0000000000..f29dc95e2f --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-status.md @@ -0,0 +1,16 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateStatus( + userId: '<USER_ID>', + status: false +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-php/examples/users/update-target.md b/docs/examples/1.8.x/server-php/examples/users/update-target.md new file mode 100644 index 0000000000..00ad27b9a7 --- /dev/null +++ b/docs/examples/1.8.x/server-php/examples/users/update-target.md @@ -0,0 +1,19 @@ +<?php + +use Appwrite\Client; +use Appwrite\Services\Users; + +$client = (new Client()) + ->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('<YOUR_PROJECT_ID>') // Your project ID + ->setKey('<YOUR_API_KEY>'); // Your secret API key + +$users = new Users($client); + +$result = $users->updateTarget( + userId: '<USER_ID>', + targetId: '<TARGET_ID>', + identifier: '<IDENTIFIER>', // optional + providerId: '<PROVIDER_ID>', // optional + name: '<NAME>' // optional +); \ No newline at end of file diff --git a/docs/examples/1.8.x/server-python/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/server-python/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..c3b7a87d27 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-anonymous-session.md @@ -0,0 +1,10 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.create_anonymous_session() diff --git a/docs/examples/1.8.x/server-python/examples/account/create-email-password-session.md b/docs/examples/1.8.x/server-python/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..e831821a6c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-email-password-session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.create_email_password_session( + email = 'email@example.com', + password = 'password' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/create-email-token.md b/docs/examples/1.8.x/server-python/examples/account/create-email-token.md new file mode 100644 index 0000000000..7ff4f6b8a9 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-email-token.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.create_email_token( + user_id = '<USER_ID>', + email = 'email@example.com', + phrase = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/account/create-jwt.md b/docs/examples/1.8.x/server-python/examples/account/create-jwt.md new file mode 100644 index 0000000000..172f45f996 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-jwt.md @@ -0,0 +1,10 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.create_jwt() diff --git a/docs/examples/1.8.x/server-python/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/server-python/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..14e76ed4d3 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-magic-url-token.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.create_magic_url_token( + user_id = '<USER_ID>', + email = 'email@example.com', + url = 'https://example.com', # optional + phrase = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-python/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..70cee1d60c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-mfa-authenticator.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.enums import AuthenticatorType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.create_mfa_authenticator( + type = AuthenticatorType.TOTP +) diff --git a/docs/examples/1.8.x/server-python/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-python/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..abd746c605 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-mfa-challenge.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.enums import AuthenticationFactor + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.create_mfa_challenge( + factor = AuthenticationFactor.EMAIL +) diff --git a/docs/examples/1.8.x/server-python/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-python/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..69aaa6091f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.create_mfa_recovery_codes() diff --git a/docs/examples/1.8.x/server-python/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-python/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..2dc171bb31 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-o-auth-2-token.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.enums import OAuthProvider + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.create_o_auth2_token( + provider = OAuthProvider.AMAZON, + success = 'https://example.com', # optional + failure = 'https://example.com', # optional + scopes = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/account/create-phone-token.md b/docs/examples/1.8.x/server-python/examples/account/create-phone-token.md new file mode 100644 index 0000000000..06c2b20414 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-phone-token.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.create_phone_token( + user_id = '<USER_ID>', + phone = '+12065550100' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/create-phone-verification.md b/docs/examples/1.8.x/server-python/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..c130646bee --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-phone-verification.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.create_phone_verification() diff --git a/docs/examples/1.8.x/server-python/examples/account/create-recovery.md b/docs/examples/1.8.x/server-python/examples/account/create-recovery.md new file mode 100644 index 0000000000..51c1777245 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-recovery.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.create_recovery( + email = 'email@example.com', + url = 'https://example.com' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/create-session.md b/docs/examples/1.8.x/server-python/examples/account/create-session.md new file mode 100644 index 0000000000..1048dfedb2 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.create_session( + user_id = '<USER_ID>', + secret = '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/create-verification.md b/docs/examples/1.8.x/server-python/examples/account/create-verification.md new file mode 100644 index 0000000000..d66fc2cd7d --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create-verification.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.create_verification( + url = 'https://example.com' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/create.md b/docs/examples/1.8.x/server-python/examples/account/create.md new file mode 100644 index 0000000000..7eda5a37fe --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/create.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.create( + user_id = '<USER_ID>', + email = 'email@example.com', + password = '', + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/account/delete-identity.md b/docs/examples/1.8.x/server-python/examples/account/delete-identity.md new file mode 100644 index 0000000000..0c894fa693 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/delete-identity.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.delete_identity( + identity_id = '<IDENTITY_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-python/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..83709c7aff --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.enums import AuthenticatorType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.delete_mfa_authenticator( + type = AuthenticatorType.TOTP +) diff --git a/docs/examples/1.8.x/server-python/examples/account/delete-session.md b/docs/examples/1.8.x/server-python/examples/account/delete-session.md new file mode 100644 index 0000000000..5967d7026a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/delete-session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.delete_session( + session_id = '<SESSION_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/delete-sessions.md b/docs/examples/1.8.x/server-python/examples/account/delete-sessions.md new file mode 100644 index 0000000000..5061f84c5d --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/delete-sessions.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.delete_sessions() diff --git a/docs/examples/1.8.x/server-python/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-python/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..c8fe494d0f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.get_mfa_recovery_codes() diff --git a/docs/examples/1.8.x/server-python/examples/account/get-prefs.md b/docs/examples/1.8.x/server-python/examples/account/get-prefs.md new file mode 100644 index 0000000000..d577b4b274 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/get-prefs.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.get_prefs() diff --git a/docs/examples/1.8.x/server-python/examples/account/get-session.md b/docs/examples/1.8.x/server-python/examples/account/get-session.md new file mode 100644 index 0000000000..3e2937b913 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/get-session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.get_session( + session_id = '<SESSION_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/get.md b/docs/examples/1.8.x/server-python/examples/account/get.md new file mode 100644 index 0000000000..542622851c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/get.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.get() diff --git a/docs/examples/1.8.x/server-python/examples/account/list-identities.md b/docs/examples/1.8.x/server-python/examples/account/list-identities.md new file mode 100644 index 0000000000..aeb23be747 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/list-identities.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.list_identities( + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/account/list-logs.md b/docs/examples/1.8.x/server-python/examples/account/list-logs.md new file mode 100644 index 0000000000..67d193d186 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/list-logs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.list_logs( + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/server-python/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..72a392465a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/list-mfa-factors.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.list_mfa_factors() diff --git a/docs/examples/1.8.x/server-python/examples/account/list-sessions.md b/docs/examples/1.8.x/server-python/examples/account/list-sessions.md new file mode 100644 index 0000000000..c553a7bce2 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/list-sessions.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.list_sessions() diff --git a/docs/examples/1.8.x/server-python/examples/account/update-email.md b/docs/examples/1.8.x/server-python/examples/account/update-email.md new file mode 100644 index 0000000000..14de4fd41e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-email.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_email( + email = 'email@example.com', + password = 'password' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/server-python/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..0146083030 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-magic-url-session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.update_magic_url_session( + user_id = '<USER_ID>', + secret = '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-python/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..d53607fe10 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-mfa-authenticator.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.account import Account +from appwrite.enums import AuthenticatorType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_mfa_authenticator( + type = AuthenticatorType.TOTP, + otp = '<OTP>' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-python/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..cfc58c58a2 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-mfa-challenge.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_mfa_challenge( + challenge_id = '<CHALLENGE_ID>', + otp = '<OTP>' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-python/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..51718eb03a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_mfa_recovery_codes() diff --git a/docs/examples/1.8.x/server-python/examples/account/update-mfa.md b/docs/examples/1.8.x/server-python/examples/account/update-mfa.md new file mode 100644 index 0000000000..7083d09642 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-mfa.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_mfa( + mfa = False +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-name.md b/docs/examples/1.8.x/server-python/examples/account/update-name.md new file mode 100644 index 0000000000..534a94e8bb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-name.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_name( + name = '<NAME>' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-password.md b/docs/examples/1.8.x/server-python/examples/account/update-password.md new file mode 100644 index 0000000000..3c072e32d7 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-password.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_password( + password = '', + old_password = 'password' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-phone-session.md b/docs/examples/1.8.x/server-python/examples/account/update-phone-session.md new file mode 100644 index 0000000000..52e77233a6 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-phone-session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account(client) + +result = account.update_phone_session( + user_id = '<USER_ID>', + secret = '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-phone-verification.md b/docs/examples/1.8.x/server-python/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..bcc57dee71 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-phone-verification.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_phone_verification( + user_id = '<USER_ID>', + secret = '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-phone.md b/docs/examples/1.8.x/server-python/examples/account/update-phone.md new file mode 100644 index 0000000000..a2cb7d3c83 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-phone.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_phone( + phone = '+12065550100', + password = 'password' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-prefs.md b/docs/examples/1.8.x/server-python/examples/account/update-prefs.md new file mode 100644 index 0000000000..8981af837a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-prefs.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_prefs( + prefs = { + "language": "en", + "timezone": "UTC", + "darkTheme": True + } +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-recovery.md b/docs/examples/1.8.x/server-python/examples/account/update-recovery.md new file mode 100644 index 0000000000..ed140abc0f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-recovery.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_recovery( + user_id = '<USER_ID>', + secret = '<SECRET>', + password = '' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-session.md b/docs/examples/1.8.x/server-python/examples/account/update-session.md new file mode 100644 index 0000000000..abee773edc --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_session( + session_id = '<SESSION_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/account/update-status.md b/docs/examples/1.8.x/server-python/examples/account/update-status.md new file mode 100644 index 0000000000..a5272f09de --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-status.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_status() diff --git a/docs/examples/1.8.x/server-python/examples/account/update-verification.md b/docs/examples/1.8.x/server-python/examples/account/update-verification.md new file mode 100644 index 0000000000..fbc7af5302 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/account/update-verification.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.account import Account + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +account = Account(client) + +result = account.update_verification( + user_id = '<USER_ID>', + secret = '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-python/examples/avatars/get-browser.md b/docs/examples/1.8.x/server-python/examples/avatars/get-browser.md new file mode 100644 index 0000000000..ff11b8b46f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/avatars/get-browser.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars +from appwrite.enums import Browser + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result = avatars.get_browser( + code = Browser.AVANT_BROWSER, + width = 0, # optional + height = 0, # optional + quality = -1 # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/server-python/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..286f4d346c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/avatars/get-credit-card.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars +from appwrite.enums import CreditCard + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result = avatars.get_credit_card( + code = CreditCard.AMERICAN_EXPRESS, + width = 0, # optional + height = 0, # optional + quality = -1 # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/avatars/get-favicon.md b/docs/examples/1.8.x/server-python/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..f034ea41f3 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/avatars/get-favicon.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result = avatars.get_favicon( + url = 'https://example.com' +) diff --git a/docs/examples/1.8.x/server-python/examples/avatars/get-flag.md b/docs/examples/1.8.x/server-python/examples/avatars/get-flag.md new file mode 100644 index 0000000000..6365a78b47 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/avatars/get-flag.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars +from appwrite.enums import Flag + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result = avatars.get_flag( + code = Flag.AFGHANISTAN, + width = 0, # optional + height = 0, # optional + quality = -1 # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/avatars/get-image.md b/docs/examples/1.8.x/server-python/examples/avatars/get-image.md new file mode 100644 index 0000000000..9272c4d8fb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/avatars/get-image.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result = avatars.get_image( + url = 'https://example.com', + width = 0, # optional + height = 0 # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/avatars/get-initials.md b/docs/examples/1.8.x/server-python/examples/avatars/get-initials.md new file mode 100644 index 0000000000..2729ff5133 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/avatars/get-initials.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result = avatars.get_initials( + name = '<NAME>', # optional + width = 0, # optional + height = 0, # optional + background = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/avatars/get-qr.md b/docs/examples/1.8.x/server-python/examples/avatars/get-qr.md new file mode 100644 index 0000000000..3fb76a7f7c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/avatars/get-qr.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +avatars = Avatars(client) + +result = avatars.get_qr( + text = '<TEXT>', + size = 1, # optional + margin = 0, # optional + download = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..f12f446d30 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-boolean-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_boolean_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = False, # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-collection.md b/docs/examples/1.8.x/server-python/examples/databases/create-collection.md new file mode 100644 index 0000000000..596d4a9383 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-collection.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + name = '<NAME>', + permissions = ["read("any")"], # optional + document_security = False, # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..8fd59e694f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-datetime-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_datetime_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = '', # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-document.md b/docs/examples/1.8.x/server-python/examples/databases/create-document.md new file mode 100644 index 0000000000..3d7dee1a4f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-document.md @@ -0,0 +1,23 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result = databases.create_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": False + }, + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-documents.md b/docs/examples/1.8.x/server-python/examples/databases/create-documents.md new file mode 100644 index 0000000000..1b94e5165a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-documents.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + documents = [] +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..230567aa46 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-email-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_email_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = 'email@example.com', # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..de1ceb9f1f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-enum-attribute.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_enum_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + elements = [], + required = False, + default = '<DEFAULT>', # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..53305c8d4e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-float-attribute.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_float_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + min = None, # optional + max = None, # optional + default = None, # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-index.md b/docs/examples/1.8.x/server-python/examples/databases/create-index.md new file mode 100644 index 0000000000..f7bb455d07 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-index.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.enums import IndexType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + type = IndexType.KEY, + attributes = [], + orders = [], # optional + lengths = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..92e8b0f86a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-integer-attribute.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_integer_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + min = None, # optional + max = None, # optional + default = None, # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..a7f424b22c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-ip-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_ip_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = '', # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..c61be8fb51 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-line-attribute.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_line_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = [[1, 2], [3, 4], [5, 6]] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..7acdb94399 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-point-attribute.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_point_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = [1, 2] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..c727b719f4 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-polygon-attribute.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_polygon_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..6c8f4dc5bb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-relationship-attribute.md @@ -0,0 +1,21 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases +from appwrite.enums import RelationshipType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_relationship_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + related_collection_id = '<RELATED_COLLECTION_ID>', + type = RelationshipType.ONETOONE, + two_way = False, # optional + key = '', # optional + two_way_key = '', # optional + on_delete = RelationMutate.CASCADE # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..dc434cccaf --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-string-attribute.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_string_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + size = 1, + required = False, + default = '<DEFAULT>', # optional + array = False, # optional + encrypt = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..af375733dd --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create-url-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create_url_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = 'https://example.com', # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/create.md b/docs/examples/1.8.x/server-python/examples/databases/create.md new file mode 100644 index 0000000000..0492203e4c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/create.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.create( + database_id = '<DATABASE_ID>', + name = '<NAME>', + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..3efedf766e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result = databases.decrement_document_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + attribute = '', + value = None, # optional + min = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/delete-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..e1c4eecd01 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/delete-attribute.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.delete_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '' +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/delete-collection.md b/docs/examples/1.8.x/server-python/examples/databases/delete-collection.md new file mode 100644 index 0000000000..02f1e1c536 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/delete-collection.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.delete_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/delete-document.md b/docs/examples/1.8.x/server-python/examples/databases/delete-document.md new file mode 100644 index 0000000000..57f8b3bd9d --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/delete-document.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result = databases.delete_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/delete-documents.md b/docs/examples/1.8.x/server-python/examples/databases/delete-documents.md new file mode 100644 index 0000000000..a315f0c200 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/delete-documents.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.delete_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/delete-index.md b/docs/examples/1.8.x/server-python/examples/databases/delete-index.md new file mode 100644 index 0000000000..006006421d --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/delete-index.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.delete_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '' +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/delete.md b/docs/examples/1.8.x/server-python/examples/databases/delete.md new file mode 100644 index 0000000000..be64e8c628 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.delete( + database_id = '<DATABASE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/get-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/get-attribute.md new file mode 100644 index 0000000000..dcdb0a6ea9 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/get-attribute.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.get_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '' +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/get-collection.md b/docs/examples/1.8.x/server-python/examples/databases/get-collection.md new file mode 100644 index 0000000000..0833b4fd7e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/get-collection.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.get_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/get-document.md b/docs/examples/1.8.x/server-python/examples/databases/get-document.md new file mode 100644 index 0000000000..aff5008fa0 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/get-document.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result = databases.get_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/get-index.md b/docs/examples/1.8.x/server-python/examples/databases/get-index.md new file mode 100644 index 0000000000..6971683072 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/get-index.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.get_index( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '' +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/get.md b/docs/examples/1.8.x/server-python/examples/databases/get.md new file mode 100644 index 0000000000..c8191a3777 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/get.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.get( + database_id = '<DATABASE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..9ae1cedfe4 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result = databases.increment_document_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + attribute = '', + value = None, # optional + max = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/list-attributes.md b/docs/examples/1.8.x/server-python/examples/databases/list-attributes.md new file mode 100644 index 0000000000..c97a5ced64 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/list-attributes.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.list_attributes( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/list-collections.md b/docs/examples/1.8.x/server-python/examples/databases/list-collections.md new file mode 100644 index 0000000000..17d0a3d878 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/list-collections.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.list_collections( + database_id = '<DATABASE_ID>', + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/list-documents.md b/docs/examples/1.8.x/server-python/examples/databases/list-documents.md new file mode 100644 index 0000000000..8b450cd020 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/list-documents.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result = databases.list_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/list-indexes.md b/docs/examples/1.8.x/server-python/examples/databases/list-indexes.md new file mode 100644 index 0000000000..1457151a4e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/list-indexes.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.list_indexes( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/list.md b/docs/examples/1.8.x/server-python/examples/databases/list.md new file mode 100644 index 0000000000..58336c9f89 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/list.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.list( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..a0f72a49fb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-boolean-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_boolean_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = False, + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-collection.md b/docs/examples/1.8.x/server-python/examples/databases/update-collection.md new file mode 100644 index 0000000000..2e5be50581 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-collection.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_collection( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + name = '<NAME>', + permissions = ["read("any")"], # optional + document_security = False, # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..29bc6be4d1 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-datetime-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_datetime_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = '', + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-document.md b/docs/examples/1.8.x/server-python/examples/databases/update-document.md new file mode 100644 index 0000000000..9ef6527934 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-document.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result = databases.update_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = {}, # optional + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-documents.md b/docs/examples/1.8.x/server-python/examples/databases/update-documents.md new file mode 100644 index 0000000000..5a50d1a912 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-documents.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + data = {}, # optional + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..c833789a37 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-email-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_email_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = 'email@example.com', + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..6186a72a66 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-enum-attribute.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_enum_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + elements = [], + required = False, + default = '<DEFAULT>', + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..68cb7d7929 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-float-attribute.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_float_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = None, + min = None, # optional + max = None, # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..05c6bfe915 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-integer-attribute.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_integer_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = None, + min = None, # optional + max = None, # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..550d3af641 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-ip-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_ip_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = '', + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..b1804f648b --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-line-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_line_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = [[1, 2], [3, 4], [5, 6]], # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..58def4b687 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-point-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_point_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = [1, 2], # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..c3625fe3e0 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-polygon-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_polygon_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..3b6c8e93e9 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-relationship-attribute.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_relationship_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + on_delete = RelationMutate.CASCADE, # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..5b66fb015c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-string-attribute.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_string_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = '<DEFAULT>', + size = 1, # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/server-python/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..4a6202760f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update-url-attribute.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update_url_attribute( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + key = '', + required = False, + default = 'https://example.com', + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/update.md b/docs/examples/1.8.x/server-python/examples/databases/update.md new file mode 100644 index 0000000000..35d2c0cc40 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/update.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.update( + database_id = '<DATABASE_ID>', + name = '<NAME>', + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/upsert-document.md b/docs/examples/1.8.x/server-python/examples/databases/upsert-document.md new file mode 100644 index 0000000000..c491ea4f44 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/upsert-document.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result = databases.upsert_document( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + document_id = '<DOCUMENT_ID>', + data = {}, + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/databases/upsert-documents.md b/docs/examples/1.8.x/server-python/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..5136d5fcb1 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/databases/upsert-documents.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases(client) + +result = databases.upsert_documents( + database_id = '<DATABASE_ID>', + collection_id = '<COLLECTION_ID>', + documents = [] +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/create-deployment.md b/docs/examples/1.8.x/server-python/examples/functions/create-deployment.md new file mode 100644 index 0000000000..0774005729 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/create-deployment.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.input_file import InputFile + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.create_deployment( + function_id = '<FUNCTION_ID>', + code = InputFile.from_path('file.png'), + activate = False, + entrypoint = '<ENTRYPOINT>', # optional + commands = '<COMMANDS>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-python/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..79315e4a1c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.create_duplicate_deployment( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>', + build_id = '<BUILD_ID>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/create-execution.md b/docs/examples/1.8.x/server-python/examples/functions/create-execution.md new file mode 100644 index 0000000000..f80b8646c2 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/create-execution.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +functions = Functions(client) + +result = functions.create_execution( + function_id = '<FUNCTION_ID>', + body = '<BODY>', # optional + async = False, # optional + path = '<PATH>', # optional + method = ExecutionMethod.GET, # optional + headers = {}, # optional + scheduled_at = '<SCHEDULED_AT>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/server-python/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..6083cc1cb3 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/create-template-deployment.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.create_template_deployment( + function_id = '<FUNCTION_ID>', + repository = '<REPOSITORY>', + owner = '<OWNER>', + root_directory = '<ROOT_DIRECTORY>', + version = '<VERSION>', + activate = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/create-variable.md b/docs/examples/1.8.x/server-python/examples/functions/create-variable.md new file mode 100644 index 0000000000..2089830eff --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/create-variable.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.create_variable( + function_id = '<FUNCTION_ID>', + key = '<KEY>', + value = '<VALUE>', + secret = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-python/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..4004baec27 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/create-vcs-deployment.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.enums import VCSDeploymentType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.create_vcs_deployment( + function_id = '<FUNCTION_ID>', + type = VCSDeploymentType.BRANCH, + reference = '<REFERENCE>', + activate = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/create.md b/docs/examples/1.8.x/server-python/examples/functions/create.md new file mode 100644 index 0000000000..8758e27e50 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/create.md @@ -0,0 +1,31 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions +from appwrite.enums import + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.create( + function_id = '<FUNCTION_ID>', + name = '<NAME>', + runtime = .NODE_14_5, + execute = ["any"], # optional + events = [], # optional + schedule = '', # optional + timeout = 1, # optional + enabled = False, # optional + logging = False, # optional + entrypoint = '<ENTRYPOINT>', # optional + commands = '<COMMANDS>', # optional + scopes = [], # optional + installation_id = '<INSTALLATION_ID>', # optional + provider_repository_id = '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch = '<PROVIDER_BRANCH>', # optional + provider_silent_mode = False, # optional + provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional + specification = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/delete-deployment.md b/docs/examples/1.8.x/server-python/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..f874b2d270 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/delete-deployment.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.delete_deployment( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/delete-execution.md b/docs/examples/1.8.x/server-python/examples/functions/delete-execution.md new file mode 100644 index 0000000000..df7ce7cb5b --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/delete-execution.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.delete_execution( + function_id = '<FUNCTION_ID>', + execution_id = '<EXECUTION_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/delete-variable.md b/docs/examples/1.8.x/server-python/examples/functions/delete-variable.md new file mode 100644 index 0000000000..a6e3dc853c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/delete-variable.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.delete_variable( + function_id = '<FUNCTION_ID>', + variable_id = '<VARIABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/delete.md b/docs/examples/1.8.x/server-python/examples/functions/delete.md new file mode 100644 index 0000000000..ed2fef76c7 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.delete( + function_id = '<FUNCTION_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/server-python/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..1b0673c468 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/get-deployment-download.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.get_deployment_download( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>', + type = DeploymentDownloadType.SOURCE # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/get-deployment.md b/docs/examples/1.8.x/server-python/examples/functions/get-deployment.md new file mode 100644 index 0000000000..59a1374e0f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/get-deployment.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.get_deployment( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/get-execution.md b/docs/examples/1.8.x/server-python/examples/functions/get-execution.md new file mode 100644 index 0000000000..a299f35195 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/get-execution.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +functions = Functions(client) + +result = functions.get_execution( + function_id = '<FUNCTION_ID>', + execution_id = '<EXECUTION_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/get-variable.md b/docs/examples/1.8.x/server-python/examples/functions/get-variable.md new file mode 100644 index 0000000000..629948e909 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/get-variable.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.get_variable( + function_id = '<FUNCTION_ID>', + variable_id = '<VARIABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/get.md b/docs/examples/1.8.x/server-python/examples/functions/get.md new file mode 100644 index 0000000000..eeab5a556b --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/get.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.get( + function_id = '<FUNCTION_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/list-deployments.md b/docs/examples/1.8.x/server-python/examples/functions/list-deployments.md new file mode 100644 index 0000000000..4eb92f60df --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/list-deployments.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.list_deployments( + function_id = '<FUNCTION_ID>', + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/list-executions.md b/docs/examples/1.8.x/server-python/examples/functions/list-executions.md new file mode 100644 index 0000000000..300fc0e51d --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/list-executions.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +functions = Functions(client) + +result = functions.list_executions( + function_id = '<FUNCTION_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/list-runtimes.md b/docs/examples/1.8.x/server-python/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..9c89a36f0c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/list-runtimes.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.list_runtimes() diff --git a/docs/examples/1.8.x/server-python/examples/functions/list-specifications.md b/docs/examples/1.8.x/server-python/examples/functions/list-specifications.md new file mode 100644 index 0000000000..d7d0036d35 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/list-specifications.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.list_specifications() diff --git a/docs/examples/1.8.x/server-python/examples/functions/list-variables.md b/docs/examples/1.8.x/server-python/examples/functions/list-variables.md new file mode 100644 index 0000000000..ebc19c5ba4 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/list-variables.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.list_variables( + function_id = '<FUNCTION_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/list.md b/docs/examples/1.8.x/server-python/examples/functions/list.md new file mode 100644 index 0000000000..b1d696d25a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/list.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.list( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/server-python/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..6c6a8bf121 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/update-deployment-status.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.update_deployment_status( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/server-python/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..da14309177 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/update-function-deployment.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.update_function_deployment( + function_id = '<FUNCTION_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/update-variable.md b/docs/examples/1.8.x/server-python/examples/functions/update-variable.md new file mode 100644 index 0000000000..f8bcc0376c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/update-variable.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.update_variable( + function_id = '<FUNCTION_ID>', + variable_id = '<VARIABLE_ID>', + key = '<KEY>', + value = '<VALUE>', # optional + secret = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/functions/update.md b/docs/examples/1.8.x/server-python/examples/functions/update.md new file mode 100644 index 0000000000..64ee39b29d --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/functions/update.md @@ -0,0 +1,30 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions(client) + +result = functions.update( + function_id = '<FUNCTION_ID>', + name = '<NAME>', + runtime = .NODE_14_5, # optional + execute = ["any"], # optional + events = [], # optional + schedule = '', # optional + timeout = 1, # optional + enabled = False, # optional + logging = False, # optional + entrypoint = '<ENTRYPOINT>', # optional + commands = '<COMMANDS>', # optional + scopes = [], # optional + installation_id = '<INSTALLATION_ID>', # optional + provider_repository_id = '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch = '<PROVIDER_BRANCH>', # optional + provider_silent_mode = False, # optional + provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional + specification = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/graphql/mutation.md b/docs/examples/1.8.x/server-python/examples/graphql/mutation.md new file mode 100644 index 0000000000..189892a4ad --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/graphql/mutation.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.graphql import Graphql + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +graphql = Graphql(client) + +result = graphql.mutation( + query = {} +) diff --git a/docs/examples/1.8.x/server-python/examples/graphql/query.md b/docs/examples/1.8.x/server-python/examples/graphql/query.md new file mode 100644 index 0000000000..585a5029b5 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/graphql/query.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.graphql import Graphql + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +graphql = Graphql(client) + +result = graphql.query( + query = {} +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-antivirus.md b/docs/examples/1.8.x/server-python/examples/health/get-antivirus.md new file mode 100644 index 0000000000..2b621472ee --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-antivirus.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_antivirus() diff --git a/docs/examples/1.8.x/server-python/examples/health/get-cache.md b/docs/examples/1.8.x/server-python/examples/health/get-cache.md new file mode 100644 index 0000000000..595c4bf0a5 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-cache.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_cache() diff --git a/docs/examples/1.8.x/server-python/examples/health/get-certificate.md b/docs/examples/1.8.x/server-python/examples/health/get-certificate.md new file mode 100644 index 0000000000..5b3e2c0ad3 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-certificate.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_certificate( + domain = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-db.md b/docs/examples/1.8.x/server-python/examples/health/get-db.md new file mode 100644 index 0000000000..47c7bd8efb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-db.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_db() diff --git a/docs/examples/1.8.x/server-python/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/server-python/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..5362a2d02a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-failed-jobs.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.health import Health +from appwrite.enums import + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_failed_jobs( + name = .V1_DATABASE, + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-pub-sub.md b/docs/examples/1.8.x/server-python/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..e5115d06b8 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-pub-sub.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_pub_sub() diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-builds.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..18ed8e3023 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-builds.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_builds( + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..b0a29e2d5b --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-certificates.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_certificates( + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-databases.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..491d1f7c35 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-databases.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_databases( + name = '<NAME>', # optional + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..fa860c6111 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-deletes.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_deletes( + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-functions.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..d4ca9388d9 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-functions.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_functions( + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-logs.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..1479f03634 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-logs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_logs( + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-mails.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..6835efeaa4 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-mails.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_mails( + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..34cbad2f31 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-messaging.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_messaging( + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..019db4e811 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-migrations.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_migrations( + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..92aebc3c91 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-stats-resources.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_stats_resources( + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-usage.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..266ca828b1 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-usage.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_usage( + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-python/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..df5e2d56db --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-queue-webhooks.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_queue_webhooks( + threshold = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/health/get-storage-local.md b/docs/examples/1.8.x/server-python/examples/health/get-storage-local.md new file mode 100644 index 0000000000..7d2ea44f45 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-storage-local.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_storage_local() diff --git a/docs/examples/1.8.x/server-python/examples/health/get-storage.md b/docs/examples/1.8.x/server-python/examples/health/get-storage.md new file mode 100644 index 0000000000..821d9f3986 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-storage.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_storage() diff --git a/docs/examples/1.8.x/server-python/examples/health/get-time.md b/docs/examples/1.8.x/server-python/examples/health/get-time.md new file mode 100644 index 0000000000..907e96499b --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get-time.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get_time() diff --git a/docs/examples/1.8.x/server-python/examples/health/get.md b/docs/examples/1.8.x/server-python/examples/health/get.md new file mode 100644 index 0000000000..c544fcc9b6 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/health/get.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health(client) + +result = health.get() diff --git a/docs/examples/1.8.x/server-python/examples/locale/get.md b/docs/examples/1.8.x/server-python/examples/locale/get.md new file mode 100644 index 0000000000..6f2a877b0c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/locale/get.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result = locale.get() diff --git a/docs/examples/1.8.x/server-python/examples/locale/list-codes.md b/docs/examples/1.8.x/server-python/examples/locale/list-codes.md new file mode 100644 index 0000000000..5f3e501fe1 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/locale/list-codes.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result = locale.list_codes() diff --git a/docs/examples/1.8.x/server-python/examples/locale/list-continents.md b/docs/examples/1.8.x/server-python/examples/locale/list-continents.md new file mode 100644 index 0000000000..0aead81734 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/locale/list-continents.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result = locale.list_continents() diff --git a/docs/examples/1.8.x/server-python/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/server-python/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..f88e331f43 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/locale/list-countries-eu.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result = locale.list_countries_eu() diff --git a/docs/examples/1.8.x/server-python/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/server-python/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..b1fdc1ae51 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/locale/list-countries-phones.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result = locale.list_countries_phones() diff --git a/docs/examples/1.8.x/server-python/examples/locale/list-countries.md b/docs/examples/1.8.x/server-python/examples/locale/list-countries.md new file mode 100644 index 0000000000..0c5b23cdd1 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/locale/list-countries.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result = locale.list_countries() diff --git a/docs/examples/1.8.x/server-python/examples/locale/list-currencies.md b/docs/examples/1.8.x/server-python/examples/locale/list-currencies.md new file mode 100644 index 0000000000..20009d6569 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/locale/list-currencies.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result = locale.list_currencies() diff --git a/docs/examples/1.8.x/server-python/examples/locale/list-languages.md b/docs/examples/1.8.x/server-python/examples/locale/list-languages.md new file mode 100644 index 0000000000..1962a8399e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/locale/list-languages.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +locale = Locale(client) + +result = locale.list_languages() diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..b57fa00f23 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-apns-provider.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_apns_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + auth_key = '<AUTH_KEY>', # optional + auth_key_id = '<AUTH_KEY_ID>', # optional + team_id = '<TEAM_ID>', # optional + bundle_id = '<BUNDLE_ID>', # optional + sandbox = False, # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-email.md b/docs/examples/1.8.x/server-python/examples/messaging/create-email.md new file mode 100644 index 0000000000..8b4c9d267e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-email.md @@ -0,0 +1,24 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_email( + message_id = '<MESSAGE_ID>', + subject = '<SUBJECT>', + content = '<CONTENT>', + topics = [], # optional + users = [], # optional + targets = [], # optional + cc = [], # optional + bcc = [], # optional + attachments = [], # optional + draft = False, # optional + html = False, # optional + scheduled_at = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..9c40eb7828 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-fcm-provider.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_fcm_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + service_account_json = {}, # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..6703f6fdcc --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,22 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_mailgun_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + api_key = '<API_KEY>', # optional + domain = '<DOMAIN>', # optional + is_eu_region = False, # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..9315dcdd30 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_msg91_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + template_id = '<TEMPLATE_ID>', # optional + sender_id = '<SENDER_ID>', # optional + auth_key = '<AUTH_KEY>', # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-push.md b/docs/examples/1.8.x/server-python/examples/messaging/create-push.md new file mode 100644 index 0000000000..8671b56a39 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-push.md @@ -0,0 +1,31 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_push( + message_id = '<MESSAGE_ID>', + title = '<TITLE>', # optional + body = '<BODY>', # optional + topics = [], # optional + users = [], # optional + targets = [], # optional + data = {}, # optional + action = '<ACTION>', # optional + image = '[ID1:ID2]', # optional + icon = '<ICON>', # optional + sound = '<SOUND>', # optional + color = '<COLOR>', # optional + tag = '<TAG>', # optional + badge = None, # optional + draft = False, # optional + scheduled_at = '', # optional + content_available = False, # optional + critical = False, # optional + priority = MessagePriority.NORMAL # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..46ff54f166 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_sendgrid_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + api_key = '<API_KEY>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-sms.md b/docs/examples/1.8.x/server-python/examples/messaging/create-sms.md new file mode 100644 index 0000000000..d1c7b495b2 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-sms.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_sms( + message_id = '<MESSAGE_ID>', + content = '<CONTENT>', + topics = [], # optional + users = [], # optional + targets = [], # optional + draft = False, # optional + scheduled_at = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..99914f0779 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-smtp-provider.md @@ -0,0 +1,26 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_smtp_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + host = '<HOST>', + port = 1, # optional + username = '<USERNAME>', # optional + password = '<PASSWORD>', # optional + encryption = SmtpEncryption.NONE, # optional + auto_tls = False, # optional + mailer = '<MAILER>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = 'email@example.com', # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/server-python/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..bc0c892b48 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-subscriber.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token + +messaging = Messaging(client) + +result = messaging.create_subscriber( + topic_id = '<TOPIC_ID>', + subscriber_id = '<SUBSCRIBER_ID>', + target_id = '<TARGET_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..aff09fe852 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-telesign-provider.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_telesign_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + from = '+12065550100', # optional + customer_id = '<CUSTOMER_ID>', # optional + api_key = '<API_KEY>', # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..46ded71cdd --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_textmagic_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + from = '+12065550100', # optional + username = '<USERNAME>', # optional + api_key = '<API_KEY>', # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-topic.md b/docs/examples/1.8.x/server-python/examples/messaging/create-topic.md new file mode 100644 index 0000000000..c1cb465e9b --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-topic.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_topic( + topic_id = '<TOPIC_ID>', + name = '<NAME>', + subscribe = ["any"] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..4438563abf --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-twilio-provider.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_twilio_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + from = '+12065550100', # optional + account_sid = '<ACCOUNT_SID>', # optional + auth_token = '<AUTH_TOKEN>', # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..6ffded5b53 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/create-vonage-provider.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_vonage_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', + from = '+12065550100', # optional + api_key = '<API_KEY>', # optional + api_secret = '<API_SECRET>', # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/delete-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..649e504c19 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/delete-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.delete_provider( + provider_id = '<PROVIDER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-python/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..c012a9ac97 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/delete-subscriber.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token + +messaging = Messaging(client) + +result = messaging.delete_subscriber( + topic_id = '<TOPIC_ID>', + subscriber_id = '<SUBSCRIBER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/delete-topic.md b/docs/examples/1.8.x/server-python/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..76f9093a5f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/delete-topic.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.delete_topic( + topic_id = '<TOPIC_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/delete.md b/docs/examples/1.8.x/server-python/examples/messaging/delete.md new file mode 100644 index 0000000000..0153ac90cb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.delete( + message_id = '<MESSAGE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/get-message.md b/docs/examples/1.8.x/server-python/examples/messaging/get-message.md new file mode 100644 index 0000000000..3fadcff7d3 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/get-message.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.get_message( + message_id = '<MESSAGE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/get-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/get-provider.md new file mode 100644 index 0000000000..58e6228053 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/get-provider.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.get_provider( + provider_id = '<PROVIDER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/server-python/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..ca997f21f0 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/get-subscriber.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.get_subscriber( + topic_id = '<TOPIC_ID>', + subscriber_id = '<SUBSCRIBER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/get-topic.md b/docs/examples/1.8.x/server-python/examples/messaging/get-topic.md new file mode 100644 index 0000000000..c238a98afe --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/get-topic.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.get_topic( + topic_id = '<TOPIC_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/server-python/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..f28c3e506f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/list-message-logs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.list_message_logs( + message_id = '<MESSAGE_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/list-messages.md b/docs/examples/1.8.x/server-python/examples/messaging/list-messages.md new file mode 100644 index 0000000000..211649d5fb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/list-messages.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.list_messages( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-python/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..da87e5939b --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/list-provider-logs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.list_provider_logs( + provider_id = '<PROVIDER_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/list-providers.md b/docs/examples/1.8.x/server-python/examples/messaging/list-providers.md new file mode 100644 index 0000000000..03e5c4ebbc --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/list-providers.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.list_providers( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-python/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..df8ec72911 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.list_subscriber_logs( + subscriber_id = '<SUBSCRIBER_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/server-python/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..f949b408e5 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/list-subscribers.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.list_subscribers( + topic_id = '<TOPIC_ID>', + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/list-targets.md b/docs/examples/1.8.x/server-python/examples/messaging/list-targets.md new file mode 100644 index 0000000000..786ee42b19 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/list-targets.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.list_targets( + message_id = '<MESSAGE_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-python/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..f8a3995295 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/list-topic-logs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.list_topic_logs( + topic_id = '<TOPIC_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/list-topics.md b/docs/examples/1.8.x/server-python/examples/messaging/list-topics.md new file mode 100644 index 0000000000..1c2cefc9cd --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/list-topics.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.list_topics( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..f695b61b8c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-apns-provider.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_apns_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + auth_key = '<AUTH_KEY>', # optional + auth_key_id = '<AUTH_KEY_ID>', # optional + team_id = '<TEAM_ID>', # optional + bundle_id = '<BUNDLE_ID>', # optional + sandbox = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-email.md b/docs/examples/1.8.x/server-python/examples/messaging/update-email.md new file mode 100644 index 0000000000..5731d5f29a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-email.md @@ -0,0 +1,24 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_email( + message_id = '<MESSAGE_ID>', + topics = [], # optional + users = [], # optional + targets = [], # optional + subject = '<SUBJECT>', # optional + content = '<CONTENT>', # optional + draft = False, # optional + html = False, # optional + cc = [], # optional + bcc = [], # optional + scheduled_at = '', # optional + attachments = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..0119d71b4f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-fcm-provider.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_fcm_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + service_account_json = {} # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..039475ffdc --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,22 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_mailgun_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + api_key = '<API_KEY>', # optional + domain = '<DOMAIN>', # optional + is_eu_region = False, # optional + enabled = False, # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = '<REPLY_TO_EMAIL>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..c5bd057912 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_msg91_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + template_id = '<TEMPLATE_ID>', # optional + sender_id = '<SENDER_ID>', # optional + auth_key = '<AUTH_KEY>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-push.md b/docs/examples/1.8.x/server-python/examples/messaging/update-push.md new file mode 100644 index 0000000000..e3bb02e71f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-push.md @@ -0,0 +1,31 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_push( + message_id = '<MESSAGE_ID>', + topics = [], # optional + users = [], # optional + targets = [], # optional + title = '<TITLE>', # optional + body = '<BODY>', # optional + data = {}, # optional + action = '<ACTION>', # optional + image = '[ID1:ID2]', # optional + icon = '<ICON>', # optional + sound = '<SOUND>', # optional + color = '<COLOR>', # optional + tag = '<TAG>', # optional + badge = None, # optional + draft = False, # optional + scheduled_at = '', # optional + content_available = False, # optional + critical = False, # optional + priority = MessagePriority.NORMAL # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..fc0a44d6cd --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_sendgrid_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + api_key = '<API_KEY>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = '<REPLY_TO_EMAIL>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-sms.md b/docs/examples/1.8.x/server-python/examples/messaging/update-sms.md new file mode 100644 index 0000000000..2eec4e215b --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-sms.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_sms( + message_id = '<MESSAGE_ID>', + topics = [], # optional + users = [], # optional + targets = [], # optional + content = '<CONTENT>', # optional + draft = False, # optional + scheduled_at = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..80019aad40 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-smtp-provider.md @@ -0,0 +1,26 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_smtp_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + host = '<HOST>', # optional + port = 1, # optional + username = '<USERNAME>', # optional + password = '<PASSWORD>', # optional + encryption = SmtpEncryption.NONE, # optional + auto_tls = False, # optional + mailer = '<MAILER>', # optional + from_name = '<FROM_NAME>', # optional + from_email = 'email@example.com', # optional + reply_to_name = '<REPLY_TO_NAME>', # optional + reply_to_email = '<REPLY_TO_EMAIL>', # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..193a26f830 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-telesign-provider.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_telesign_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + customer_id = '<CUSTOMER_ID>', # optional + api_key = '<API_KEY>', # optional + from = '<FROM>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..159f95490e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_textmagic_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + username = '<USERNAME>', # optional + api_key = '<API_KEY>', # optional + from = '<FROM>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-topic.md b/docs/examples/1.8.x/server-python/examples/messaging/update-topic.md new file mode 100644 index 0000000000..721f160642 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-topic.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_topic( + topic_id = '<TOPIC_ID>', + name = '<NAME>', # optional + subscribe = ["any"] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..b80c55b300 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-twilio-provider.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_twilio_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + account_sid = '<ACCOUNT_SID>', # optional + auth_token = '<AUTH_TOKEN>', # optional + from = '<FROM>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-python/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..b25f416cef --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/messaging/update-vonage-provider.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging(client) + +result = messaging.update_vonage_provider( + provider_id = '<PROVIDER_ID>', + name = '<NAME>', # optional + enabled = False, # optional + api_key = '<API_KEY>', # optional + api_secret = '<API_SECRET>', # optional + from = '<FROM>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/create-deployment.md b/docs/examples/1.8.x/server-python/examples/sites/create-deployment.md new file mode 100644 index 0000000000..de6472c4b0 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/create-deployment.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.input_file import InputFile + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.create_deployment( + site_id = '<SITE_ID>', + code = InputFile.from_path('file.png'), + activate = False, + install_command = '<INSTALL_COMMAND>', # optional + build_command = '<BUILD_COMMAND>', # optional + output_directory = '<OUTPUT_DIRECTORY>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-python/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..d79ab9d3d1 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.create_duplicate_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/server-python/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..ac05f9e663 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/create-template-deployment.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.create_template_deployment( + site_id = '<SITE_ID>', + repository = '<REPOSITORY>', + owner = '<OWNER>', + root_directory = '<ROOT_DIRECTORY>', + version = '<VERSION>', + activate = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/create-variable.md b/docs/examples/1.8.x/server-python/examples/sites/create-variable.md new file mode 100644 index 0000000000..739beff61f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/create-variable.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.create_variable( + site_id = '<SITE_ID>', + key = '<KEY>', + value = '<VALUE>', + secret = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-python/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..089e6c8141 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/create-vcs-deployment.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.enums import VCSDeploymentType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.create_vcs_deployment( + site_id = '<SITE_ID>', + type = VCSDeploymentType.BRANCH, + reference = '<REFERENCE>', + activate = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/create.md b/docs/examples/1.8.x/server-python/examples/sites/create.md new file mode 100644 index 0000000000..4950cd2116 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/create.md @@ -0,0 +1,32 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.enums import +from appwrite.enums import + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.create( + site_id = '<SITE_ID>', + name = '<NAME>', + framework = .ANALOG, + build_runtime = .NODE_14_5, + enabled = False, # optional + logging = False, # optional + timeout = 1, # optional + install_command = '<INSTALL_COMMAND>', # optional + build_command = '<BUILD_COMMAND>', # optional + output_directory = '<OUTPUT_DIRECTORY>', # optional + adapter = .STATIC, # optional + installation_id = '<INSTALLATION_ID>', # optional + fallback_file = '<FALLBACK_FILE>', # optional + provider_repository_id = '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch = '<PROVIDER_BRANCH>', # optional + provider_silent_mode = False, # optional + provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional + specification = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/delete-deployment.md b/docs/examples/1.8.x/server-python/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..029730ae3f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/delete-deployment.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.delete_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/delete-log.md b/docs/examples/1.8.x/server-python/examples/sites/delete-log.md new file mode 100644 index 0000000000..0b516e6840 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/delete-log.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.delete_log( + site_id = '<SITE_ID>', + log_id = '<LOG_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/delete-variable.md b/docs/examples/1.8.x/server-python/examples/sites/delete-variable.md new file mode 100644 index 0000000000..c078813b4a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/delete-variable.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.delete_variable( + site_id = '<SITE_ID>', + variable_id = '<VARIABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/delete.md b/docs/examples/1.8.x/server-python/examples/sites/delete.md new file mode 100644 index 0000000000..60670e63e0 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.delete( + site_id = '<SITE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/server-python/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..d6af564217 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/get-deployment-download.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.get_deployment_download( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>', + type = DeploymentDownloadType.SOURCE # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/get-deployment.md b/docs/examples/1.8.x/server-python/examples/sites/get-deployment.md new file mode 100644 index 0000000000..c4ee1de904 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/get-deployment.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.get_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/get-log.md b/docs/examples/1.8.x/server-python/examples/sites/get-log.md new file mode 100644 index 0000000000..ae5d8ac2df --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/get-log.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.get_log( + site_id = '<SITE_ID>', + log_id = '<LOG_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/get-variable.md b/docs/examples/1.8.x/server-python/examples/sites/get-variable.md new file mode 100644 index 0000000000..7f5f0f6480 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/get-variable.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.get_variable( + site_id = '<SITE_ID>', + variable_id = '<VARIABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/get.md b/docs/examples/1.8.x/server-python/examples/sites/get.md new file mode 100644 index 0000000000..f9532a0e1a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/get.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.get( + site_id = '<SITE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/list-deployments.md b/docs/examples/1.8.x/server-python/examples/sites/list-deployments.md new file mode 100644 index 0000000000..15ec24d232 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/list-deployments.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.list_deployments( + site_id = '<SITE_ID>', + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/list-frameworks.md b/docs/examples/1.8.x/server-python/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..6e3764695e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/list-frameworks.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.list_frameworks() diff --git a/docs/examples/1.8.x/server-python/examples/sites/list-logs.md b/docs/examples/1.8.x/server-python/examples/sites/list-logs.md new file mode 100644 index 0000000000..d3a9a193c1 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/list-logs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.list_logs( + site_id = '<SITE_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/list-specifications.md b/docs/examples/1.8.x/server-python/examples/sites/list-specifications.md new file mode 100644 index 0000000000..93b713c4b6 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/list-specifications.md @@ -0,0 +1,11 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.list_specifications() diff --git a/docs/examples/1.8.x/server-python/examples/sites/list-variables.md b/docs/examples/1.8.x/server-python/examples/sites/list-variables.md new file mode 100644 index 0000000000..5ff78e6a1a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/list-variables.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.list_variables( + site_id = '<SITE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/list.md b/docs/examples/1.8.x/server-python/examples/sites/list.md new file mode 100644 index 0000000000..1b344e1d0f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/list.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.list( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/server-python/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..492ee4f747 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/update-deployment-status.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.update_deployment_status( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/server-python/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..69014bbbcd --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/update-site-deployment.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.update_site_deployment( + site_id = '<SITE_ID>', + deployment_id = '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/update-variable.md b/docs/examples/1.8.x/server-python/examples/sites/update-variable.md new file mode 100644 index 0000000000..973f7f2e65 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/update-variable.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.update_variable( + site_id = '<SITE_ID>', + variable_id = '<VARIABLE_ID>', + key = '<KEY>', + value = '<VALUE>', # optional + secret = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/sites/update.md b/docs/examples/1.8.x/server-python/examples/sites/update.md new file mode 100644 index 0000000000..7d2d2865a4 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/sites/update.md @@ -0,0 +1,31 @@ +from appwrite.client import Client +from appwrite.services.sites import Sites +from appwrite.enums import + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites(client) + +result = sites.update( + site_id = '<SITE_ID>', + name = '<NAME>', + framework = .ANALOG, + enabled = False, # optional + logging = False, # optional + timeout = 1, # optional + install_command = '<INSTALL_COMMAND>', # optional + build_command = '<BUILD_COMMAND>', # optional + output_directory = '<OUTPUT_DIRECTORY>', # optional + build_runtime = .NODE_14_5, # optional + adapter = .STATIC, # optional + fallback_file = '<FALLBACK_FILE>', # optional + installation_id = '<INSTALLATION_ID>', # optional + provider_repository_id = '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch = '<PROVIDER_BRANCH>', # optional + provider_silent_mode = False, # optional + provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional + specification = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/create-bucket.md b/docs/examples/1.8.x/server-python/examples/storage/create-bucket.md new file mode 100644 index 0000000000..9672782b5c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/create-bucket.md @@ -0,0 +1,22 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage(client) + +result = storage.create_bucket( + bucket_id = '<BUCKET_ID>', + name = '<NAME>', + permissions = ["read("any")"], # optional + file_security = False, # optional + enabled = False, # optional + maximum_file_size = 1, # optional + allowed_file_extensions = [], # optional + compression = .NONE, # optional + encryption = False, # optional + antivirus = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/create-file.md b/docs/examples/1.8.x/server-python/examples/storage/create-file.md new file mode 100644 index 0000000000..6e57284b85 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/create-file.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage +from appwrite.input_file import InputFile + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result = storage.create_file( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + file = InputFile.from_path('file.png'), + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/delete-bucket.md b/docs/examples/1.8.x/server-python/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..dd8e8ebc43 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/delete-bucket.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage(client) + +result = storage.delete_bucket( + bucket_id = '<BUCKET_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/delete-file.md b/docs/examples/1.8.x/server-python/examples/storage/delete-file.md new file mode 100644 index 0000000000..17bc251e50 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/delete-file.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result = storage.delete_file( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/get-bucket.md b/docs/examples/1.8.x/server-python/examples/storage/get-bucket.md new file mode 100644 index 0000000000..e5eeb4c097 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/get-bucket.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage(client) + +result = storage.get_bucket( + bucket_id = '<BUCKET_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/get-file-download.md b/docs/examples/1.8.x/server-python/examples/storage/get-file-download.md new file mode 100644 index 0000000000..411abf8c79 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/get-file-download.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result = storage.get_file_download( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + token = '<TOKEN>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/get-file-preview.md b/docs/examples/1.8.x/server-python/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..47e3f23b55 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/get-file-preview.md @@ -0,0 +1,26 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result = storage.get_file_preview( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + width = 0, # optional + height = 0, # optional + gravity = ImageGravity.CENTER, # optional + quality = -1, # optional + border_width = 0, # optional + border_color = '', # optional + border_radius = 0, # optional + opacity = 0, # optional + rotation = -360, # optional + background = '', # optional + output = ImageFormat.JPG, # optional + token = '<TOKEN>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/get-file-view.md b/docs/examples/1.8.x/server-python/examples/storage/get-file-view.md new file mode 100644 index 0000000000..85cbad7902 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/get-file-view.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result = storage.get_file_view( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + token = '<TOKEN>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/get-file.md b/docs/examples/1.8.x/server-python/examples/storage/get-file.md new file mode 100644 index 0000000000..461543e3fd --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/get-file.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result = storage.get_file( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/list-buckets.md b/docs/examples/1.8.x/server-python/examples/storage/list-buckets.md new file mode 100644 index 0000000000..51a1ae6836 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/list-buckets.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage(client) + +result = storage.list_buckets( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/list-files.md b/docs/examples/1.8.x/server-python/examples/storage/list-files.md new file mode 100644 index 0000000000..4034bd477d --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/list-files.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result = storage.list_files( + bucket_id = '<BUCKET_ID>', + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/update-bucket.md b/docs/examples/1.8.x/server-python/examples/storage/update-bucket.md new file mode 100644 index 0000000000..f2e741a5aa --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/update-bucket.md @@ -0,0 +1,22 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage(client) + +result = storage.update_bucket( + bucket_id = '<BUCKET_ID>', + name = '<NAME>', + permissions = ["read("any")"], # optional + file_security = False, # optional + enabled = False, # optional + maximum_file_size = 1, # optional + allowed_file_extensions = [], # optional + compression = .NONE, # optional + encryption = False, # optional + antivirus = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/storage/update-file.md b/docs/examples/1.8.x/server-python/examples/storage/update-file.md new file mode 100644 index 0000000000..cf1e5779bb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/storage/update-file.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +storage = Storage(client) + +result = storage.update_file( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + name = '<NAME>', # optional + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..84702b4cac --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_boolean_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = False, # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..d5d15905c5 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_datetime_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = '', # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..0e2ccb473a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-email-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_email_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = 'email@example.com', # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..c2268cb271 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-enum-column.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_enum_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + elements = [], + required = False, + default = '<DEFAULT>', # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..9e35e838ca --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-float-column.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_float_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + min = None, # optional + max = None, # optional + default = None, # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-index.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..e4aaa83e66 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-index.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.enums import IndexType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_index( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + type = IndexType.KEY, + columns = [], + orders = [], # optional + lengths = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..0cc20fcf83 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-integer-column.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_integer_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + min = None, # optional + max = None, # optional + default = None, # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..50aa028349 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-ip-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_ip_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = '', # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..11591236cf --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-line-column.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_line_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = [[1, 2], [3, 4], [5, 6]] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..8f51e95ca2 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-point-column.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_point_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = [1, 2] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..cf4540e029 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_polygon_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..16acbf8fb8 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,21 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB +from appwrite.enums import RelationshipType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_relationship_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + related_table_id = '<RELATED_TABLE_ID>', + type = RelationshipType.ONETOONE, + two_way = False, # optional + key = '', # optional + two_way_key = '', # optional + on_delete = RelationMutate.CASCADE # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-row.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..d4c1cdad14 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-row.md @@ -0,0 +1,23 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result = tables_db.create_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + data = { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": False + }, + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..656a47aa0b --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-rows.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + rows = [] +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..778a0b4e94 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-string-column.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_string_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + size = 1, + required = False, + default = '<DEFAULT>', # optional + array = False, # optional + encrypt = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-table.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..f258ed880c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-table.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_table( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + name = '<NAME>', + permissions = ["read("any")"], # optional + row_security = False, # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..b235cdfceb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create-url-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create_url_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = 'https://example.com', # optional + array = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/create.md b/docs/examples/1.8.x/server-python/examples/tablesdb/create.md new file mode 100644 index 0000000000..9d64e9abf4 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/create.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.create( + database_id = '<DATABASE_ID>', + name = '<NAME>', + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..096bc4dbaa --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result = tables_db.decrement_row_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + column = '', + value = None, # optional + min = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..9014ccc93b --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/delete-column.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.delete_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '' +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/server-python/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..e19de0eba7 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/delete-index.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.delete_index( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '' +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/server-python/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..569b607020 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/delete-row.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result = tables_db.delete_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-python/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..c3e836e7c6 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/delete-rows.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.delete_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/server-python/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..a91b7bfb2c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/delete-table.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.delete_table( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/delete.md b/docs/examples/1.8.x/server-python/examples/tablesdb/delete.md new file mode 100644 index 0000000000..5bdc7152d7 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.delete( + database_id = '<DATABASE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/get-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..57be1dfaa4 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/get-column.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.get_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '' +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/get-index.md b/docs/examples/1.8.x/server-python/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..400bf71843 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/get-index.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.get_index( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '' +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/get-row.md b/docs/examples/1.8.x/server-python/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..c806214297 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/get-row.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result = tables_db.get_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/get-table.md b/docs/examples/1.8.x/server-python/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..b28cd3d4b1 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/get-table.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.get_table( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/get.md b/docs/examples/1.8.x/server-python/examples/tablesdb/get.md new file mode 100644 index 0000000000..6634350085 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/get.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.get( + database_id = '<DATABASE_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..bcb88f7a31 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/increment-row-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result = tables_db.increment_row_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + column = '', + value = None, # optional + max = None # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/server-python/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..a3179a9482 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/list-columns.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.list_columns( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-python/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..fe69041a34 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/list-indexes.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.list_indexes( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/server-python/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..9ae7549fb0 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/list-rows.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result = tables_db.list_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/server-python/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..2fab0d3adb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/list-tables.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.list_tables( + database_id = '<DATABASE_ID>', + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/list.md b/docs/examples/1.8.x/server-python/examples/tablesdb/list.md new file mode 100644 index 0000000000..43cee6a39a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/list.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.list( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..abe6b97b73 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_boolean_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = False, + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..1c150b50ac --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_datetime_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = '', + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..96a56ec7ae --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-email-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_email_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = 'email@example.com', + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..f07b6286d4 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-enum-column.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_enum_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + elements = [], + required = False, + default = '<DEFAULT>', + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..1dfcccde1b --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-float-column.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_float_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = None, + min = None, # optional + max = None, # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..a38c4dadb5 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-integer-column.md @@ -0,0 +1,20 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_integer_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = None, + min = None, # optional + max = None, # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..780a2b027f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-ip-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_ip_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = '', + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..2f02b61e24 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-line-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_line_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = [[1, 2], [3, 4], [5, 6]], # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..63fb30837f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-point-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_point_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = [1, 2], # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..07118b1c1e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_polygon_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..1cb93dbdf2 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_relationship_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + on_delete = RelationMutate.CASCADE, # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-row.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..86d0cf2b8a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-row.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result = tables_db.update_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + data = {}, # optional + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..386ddf8b88 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-rows.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + data = {}, # optional + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..f5106ae7f0 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-string-column.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_string_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = '<DEFAULT>', + size = 1, # optional + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-table.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..7e494f0c43 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-table.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_table( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + name = '<NAME>', + permissions = ["read("any")"], # optional + row_security = False, # optional + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..6e6c722b9f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update-url-column.md @@ -0,0 +1,18 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update_url_column( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + key = '', + required = False, + default = 'https://example.com', + new_key = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/update.md b/docs/examples/1.8.x/server-python/examples/tablesdb/update.md new file mode 100644 index 0000000000..15c4eb7b33 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/update.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.update( + database_id = '<DATABASE_ID>', + name = '<NAME>', + enabled = False # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-python/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..068fded0c3 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/upsert-row.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +tables_db = TablesDB(client) + +result = tables_db.upsert_row( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + row_id = '<ROW_ID>', + data = {}, # optional + permissions = ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-python/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..06436c0fa6 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tablesdb/upsert-rows.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tables_db import TablesDB + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB(client) + +result = tables_db.upsert_rows( + database_id = '<DATABASE_ID>', + table_id = '<TABLE_ID>', + rows = [] +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/create-membership.md b/docs/examples/1.8.x/server-python/examples/teams/create-membership.md new file mode 100644 index 0000000000..cb3bf73195 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/create-membership.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.create_membership( + team_id = '<TEAM_ID>', + roles = [], + email = 'email@example.com', # optional + user_id = '<USER_ID>', # optional + phone = '+12065550100', # optional + url = 'https://example.com', # optional + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/create.md b/docs/examples/1.8.x/server-python/examples/teams/create.md new file mode 100644 index 0000000000..f623151b27 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/create.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.create( + team_id = '<TEAM_ID>', + name = '<NAME>', + roles = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/delete-membership.md b/docs/examples/1.8.x/server-python/examples/teams/delete-membership.md new file mode 100644 index 0000000000..6fb218266f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/delete-membership.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.delete_membership( + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/delete.md b/docs/examples/1.8.x/server-python/examples/teams/delete.md new file mode 100644 index 0000000000..056114bfad --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.delete( + team_id = '<TEAM_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/get-membership.md b/docs/examples/1.8.x/server-python/examples/teams/get-membership.md new file mode 100644 index 0000000000..3c028a5c7e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/get-membership.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.get_membership( + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/get-prefs.md b/docs/examples/1.8.x/server-python/examples/teams/get-prefs.md new file mode 100644 index 0000000000..8d645897c6 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/get-prefs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.get_prefs( + team_id = '<TEAM_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/get.md b/docs/examples/1.8.x/server-python/examples/teams/get.md new file mode 100644 index 0000000000..55f172eadd --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/get.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.get( + team_id = '<TEAM_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/list-memberships.md b/docs/examples/1.8.x/server-python/examples/teams/list-memberships.md new file mode 100644 index 0000000000..6e6f15a284 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/list-memberships.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.list_memberships( + team_id = '<TEAM_ID>', + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/list.md b/docs/examples/1.8.x/server-python/examples/teams/list.md new file mode 100644 index 0000000000..bf91a50744 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/list.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.list( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/update-membership-status.md b/docs/examples/1.8.x/server-python/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..9c08421579 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/update-membership-status.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.update_membership_status( + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>', + user_id = '<USER_ID>', + secret = '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/update-membership.md b/docs/examples/1.8.x/server-python/examples/teams/update-membership.md new file mode 100644 index 0000000000..db20c5aaae --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/update-membership.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.update_membership( + team_id = '<TEAM_ID>', + membership_id = '<MEMBERSHIP_ID>', + roles = [] +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/update-name.md b/docs/examples/1.8.x/server-python/examples/teams/update-name.md new file mode 100644 index 0000000000..160b496932 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/update-name.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.update_name( + team_id = '<TEAM_ID>', + name = '<NAME>' +) diff --git a/docs/examples/1.8.x/server-python/examples/teams/update-prefs.md b/docs/examples/1.8.x/server-python/examples/teams/update-prefs.md new file mode 100644 index 0000000000..e82da1b64f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/teams/update-prefs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_session('') # The user session to authenticate with + +teams = Teams(client) + +result = teams.update_prefs( + team_id = '<TEAM_ID>', + prefs = {} +) diff --git a/docs/examples/1.8.x/server-python/examples/tokens/create-file-token.md b/docs/examples/1.8.x/server-python/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..f835a0ea8d --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tokens/create-file-token.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tokens import Tokens + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens(client) + +result = tokens.create_file_token( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + expire = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tokens/delete.md b/docs/examples/1.8.x/server-python/examples/tokens/delete.md new file mode 100644 index 0000000000..47619321ff --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tokens/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.tokens import Tokens + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens(client) + +result = tokens.delete( + token_id = '<TOKEN_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/tokens/get.md b/docs/examples/1.8.x/server-python/examples/tokens/get.md new file mode 100644 index 0000000000..0d6abb81d7 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tokens/get.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.tokens import Tokens + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens(client) + +result = tokens.get( + token_id = '<TOKEN_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/tokens/list.md b/docs/examples/1.8.x/server-python/examples/tokens/list.md new file mode 100644 index 0000000000..2694650ed3 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tokens/list.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.tokens import Tokens + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens(client) + +result = tokens.list( + bucket_id = '<BUCKET_ID>', + file_id = '<FILE_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/tokens/update.md b/docs/examples/1.8.x/server-python/examples/tokens/update.md new file mode 100644 index 0000000000..18b04445cc --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/tokens/update.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.tokens import Tokens + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens(client) + +result = tokens.update( + token_id = '<TOKEN_ID>', + expire = '' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/server-python/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..5e95cc26ac --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-argon-2-user.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_argon2_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-python/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..d3d9e21586 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-bcrypt-user.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_bcrypt_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-jwt.md b/docs/examples/1.8.x/server-python/examples/users/create-jwt.md new file mode 100644 index 0000000000..bed6c483e0 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-jwt.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_jwt( + user_id = '<USER_ID>', + session_id = '<SESSION_ID>', # optional + duration = 0 # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-md-5-user.md b/docs/examples/1.8.x/server-python/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..b1cbb53f23 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-md-5-user.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_md5_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-python/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..64a87c05ff --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_mfa_recovery_codes( + user_id = '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-python/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..33f65f44d9 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-ph-pass-user.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_ph_pass_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-python/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..9d644ce4ca --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_scrypt_modified_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + password_salt = '<PASSWORD_SALT>', + password_salt_separator = '<PASSWORD_SALT_SEPARATOR>', + password_signer_key = '<PASSWORD_SIGNER_KEY>', + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/server-python/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..f442ab9d3e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-scrypt-user.md @@ -0,0 +1,21 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_scrypt_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + password_salt = '<PASSWORD_SALT>', + password_cpu = None, + password_memory = None, + password_parallel = None, + password_length = None, + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-session.md b/docs/examples/1.8.x/server-python/examples/users/create-session.md new file mode 100644 index 0000000000..7e4c49fc95 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-session.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_session( + user_id = '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-sha-user.md b/docs/examples/1.8.x/server-python/examples/users/create-sha-user.md new file mode 100644 index 0000000000..5b4c8f831a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-sha-user.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_sha_user( + user_id = '<USER_ID>', + email = 'email@example.com', + password = 'password', + password_version = PasswordHash.SHA1, # optional + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-target.md b/docs/examples/1.8.x/server-python/examples/users/create-target.md new file mode 100644 index 0000000000..dfa64ac757 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-target.md @@ -0,0 +1,19 @@ +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.enums import MessagingProviderType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_target( + user_id = '<USER_ID>', + target_id = '<TARGET_ID>', + provider_type = MessagingProviderType.EMAIL, + identifier = '<IDENTIFIER>', + provider_id = '<PROVIDER_ID>', # optional + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create-token.md b/docs/examples/1.8.x/server-python/examples/users/create-token.md new file mode 100644 index 0000000000..b40658c312 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create-token.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create_token( + user_id = '<USER_ID>', + length = 4, # optional + expire = 60 # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/create.md b/docs/examples/1.8.x/server-python/examples/users/create.md new file mode 100644 index 0000000000..4c51a3fffb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/create.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.create( + user_id = '<USER_ID>', + email = 'email@example.com', # optional + phone = '+12065550100', # optional + password = '', # optional + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/delete-identity.md b/docs/examples/1.8.x/server-python/examples/users/delete-identity.md new file mode 100644 index 0000000000..412fbd393a --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/delete-identity.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete_identity( + identity_id = '<IDENTITY_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-python/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..6472498344 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.users import Users +from appwrite.enums import AuthenticatorType + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete_mfa_authenticator( + user_id = '<USER_ID>', + type = AuthenticatorType.TOTP +) diff --git a/docs/examples/1.8.x/server-python/examples/users/delete-session.md b/docs/examples/1.8.x/server-python/examples/users/delete-session.md new file mode 100644 index 0000000000..815a96ed37 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/delete-session.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete_session( + user_id = '<USER_ID>', + session_id = '<SESSION_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/delete-sessions.md b/docs/examples/1.8.x/server-python/examples/users/delete-sessions.md new file mode 100644 index 0000000000..2dde88f471 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/delete-sessions.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete_sessions( + user_id = '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/delete-target.md b/docs/examples/1.8.x/server-python/examples/users/delete-target.md new file mode 100644 index 0000000000..287f5a26cf --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/delete-target.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete_target( + user_id = '<USER_ID>', + target_id = '<TARGET_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/delete.md b/docs/examples/1.8.x/server-python/examples/users/delete.md new file mode 100644 index 0000000000..7032b0f81e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.delete( + user_id = '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-python/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..bca43b08ec --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.get_mfa_recovery_codes( + user_id = '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/get-prefs.md b/docs/examples/1.8.x/server-python/examples/users/get-prefs.md new file mode 100644 index 0000000000..ec9d363f8d --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/get-prefs.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.get_prefs( + user_id = '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/get-target.md b/docs/examples/1.8.x/server-python/examples/users/get-target.md new file mode 100644 index 0000000000..3b80b1ff7f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/get-target.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.get_target( + user_id = '<USER_ID>', + target_id = '<TARGET_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/get.md b/docs/examples/1.8.x/server-python/examples/users/get.md new file mode 100644 index 0000000000..267086a3df --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/get.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.get( + user_id = '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/list-identities.md b/docs/examples/1.8.x/server-python/examples/users/list-identities.md new file mode 100644 index 0000000000..0fc7811a3f --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/list-identities.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.list_identities( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/list-logs.md b/docs/examples/1.8.x/server-python/examples/users/list-logs.md new file mode 100644 index 0000000000..6cbbe498cb --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/list-logs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.list_logs( + user_id = '<USER_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/list-memberships.md b/docs/examples/1.8.x/server-python/examples/users/list-memberships.md new file mode 100644 index 0000000000..c0d2f2a468 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/list-memberships.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.list_memberships( + user_id = '<USER_ID>', + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/server-python/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..a2b59895e8 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/list-mfa-factors.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.list_mfa_factors( + user_id = '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/list-sessions.md b/docs/examples/1.8.x/server-python/examples/users/list-sessions.md new file mode 100644 index 0000000000..77b04c935e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/list-sessions.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.list_sessions( + user_id = '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/list-targets.md b/docs/examples/1.8.x/server-python/examples/users/list-targets.md new file mode 100644 index 0000000000..14107fa296 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/list-targets.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.list_targets( + user_id = '<USER_ID>', + queries = [] # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/list.md b/docs/examples/1.8.x/server-python/examples/users/list.md new file mode 100644 index 0000000000..778f33935d --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/list.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.list( + queries = [], # optional + search = '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-email-verification.md b/docs/examples/1.8.x/server-python/examples/users/update-email-verification.md new file mode 100644 index 0000000000..2605861416 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-email-verification.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_email_verification( + user_id = '<USER_ID>', + email_verification = False +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-email.md b/docs/examples/1.8.x/server-python/examples/users/update-email.md new file mode 100644 index 0000000000..c4a468e234 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-email.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_email( + user_id = '<USER_ID>', + email = 'email@example.com' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-labels.md b/docs/examples/1.8.x/server-python/examples/users/update-labels.md new file mode 100644 index 0000000000..b9af53a50e --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-labels.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_labels( + user_id = '<USER_ID>', + labels = [] +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-python/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..c0990e1ef7 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_mfa_recovery_codes( + user_id = '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-mfa.md b/docs/examples/1.8.x/server-python/examples/users/update-mfa.md new file mode 100644 index 0000000000..9b35701185 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-mfa.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_mfa( + user_id = '<USER_ID>', + mfa = False +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-name.md b/docs/examples/1.8.x/server-python/examples/users/update-name.md new file mode 100644 index 0000000000..1e328b4c48 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-name.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_name( + user_id = '<USER_ID>', + name = '<NAME>' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-password.md b/docs/examples/1.8.x/server-python/examples/users/update-password.md new file mode 100644 index 0000000000..d104184cad --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-password.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_password( + user_id = '<USER_ID>', + password = '' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-phone-verification.md b/docs/examples/1.8.x/server-python/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..1d2656c3f1 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-phone-verification.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_phone_verification( + user_id = '<USER_ID>', + phone_verification = False +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-phone.md b/docs/examples/1.8.x/server-python/examples/users/update-phone.md new file mode 100644 index 0000000000..14826bb54c --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-phone.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_phone( + user_id = '<USER_ID>', + number = '+12065550100' +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-prefs.md b/docs/examples/1.8.x/server-python/examples/users/update-prefs.md new file mode 100644 index 0000000000..76903b7611 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-prefs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_prefs( + user_id = '<USER_ID>', + prefs = {} +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-status.md b/docs/examples/1.8.x/server-python/examples/users/update-status.md new file mode 100644 index 0000000000..49c0516ee4 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-status.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_status( + user_id = '<USER_ID>', + status = False +) diff --git a/docs/examples/1.8.x/server-python/examples/users/update-target.md b/docs/examples/1.8.x/server-python/examples/users/update-target.md new file mode 100644 index 0000000000..119c5fab88 --- /dev/null +++ b/docs/examples/1.8.x/server-python/examples/users/update-target.md @@ -0,0 +1,17 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() +client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('<YOUR_PROJECT_ID>') # Your project ID +client.set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users(client) + +result = users.update_target( + user_id = '<USER_ID>', + target_id = '<TARGET_ID>', + identifier = '<IDENTIFIER>', # optional + provider_id = '<PROVIDER_ID>', # optional + name = '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/server-rest/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..b62c82a6a8 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-anonymous-session.md @@ -0,0 +1,6 @@ +POST /v1/account/sessions/anonymous HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-email-password-session.md b/docs/examples/1.8.x/server-rest/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..1103d2ebfb --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-email-password-session.md @@ -0,0 +1,10 @@ +POST /v1/account/sessions/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "email": "email@example.com", + "password": "password" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-email-token.md b/docs/examples/1.8.x/server-rest/examples/account/create-email-token.md new file mode 100644 index 0000000000..552b724b9c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-email-token.md @@ -0,0 +1,11 @@ +POST /v1/account/tokens/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "phrase": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-jwt.md b/docs/examples/1.8.x/server-rest/examples/account/create-jwt.md new file mode 100644 index 0000000000..62a7dee7e9 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-jwt.md @@ -0,0 +1,6 @@ +POST /v1/account/jwts HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/server-rest/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..29d68bd0fa --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-magic-url-token.md @@ -0,0 +1,12 @@ +POST /v1/account/tokens/magic-url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "url": "https://example.com", + "phrase": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-rest/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..62a068b6cf --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-mfa-authenticator.md @@ -0,0 +1,8 @@ +POST /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-rest/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..dd5ef4c731 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-mfa-challenge.md @@ -0,0 +1,9 @@ +POST /v1/account/mfa/challenge HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "factor": "email" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-rest/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..f09323df0b --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,8 @@ +POST /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-rest/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..8a0cab614f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-o-auth-2-token.md @@ -0,0 +1,4 @@ +GET /v1/account/tokens/oauth2/{provider} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-phone-token.md b/docs/examples/1.8.x/server-rest/examples/account/create-phone-token.md new file mode 100644 index 0000000000..5127c8377a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-phone-token.md @@ -0,0 +1,10 @@ +POST /v1/account/tokens/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "phone": "+12065550100" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-phone-verification.md b/docs/examples/1.8.x/server-rest/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..57b3b7d160 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-phone-verification.md @@ -0,0 +1,8 @@ +POST /v1/account/verification/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-recovery.md b/docs/examples/1.8.x/server-rest/examples/account/create-recovery.md new file mode 100644 index 0000000000..ea0146228b --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-recovery.md @@ -0,0 +1,12 @@ +POST /v1/account/recovery HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "email": "email@example.com", + "url": "https://example.com" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-session.md b/docs/examples/1.8.x/server-rest/examples/account/create-session.md new file mode 100644 index 0000000000..0acc50cda6 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-session.md @@ -0,0 +1,10 @@ +POST /v1/account/sessions/token HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/create-verification.md b/docs/examples/1.8.x/server-rest/examples/account/create-verification.md new file mode 100644 index 0000000000..ed5479dbe5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create-verification.md @@ -0,0 +1,11 @@ +POST /v1/account/verification HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "url": "https://example.com" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/create.md b/docs/examples/1.8.x/server-rest/examples/account/create.md new file mode 100644 index 0000000000..fa06bfcc1a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/create.md @@ -0,0 +1,12 @@ +POST /v1/account HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/delete-identity.md b/docs/examples/1.8.x/server-rest/examples/account/delete-identity.md new file mode 100644 index 0000000000..bacca18870 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/delete-identity.md @@ -0,0 +1,8 @@ +DELETE /v1/account/identities/{identityId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-rest/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..a0eb5a0869 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,8 @@ +DELETE /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/delete-session.md b/docs/examples/1.8.x/server-rest/examples/account/delete-session.md new file mode 100644 index 0000000000..c9b0f48d6f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/delete-session.md @@ -0,0 +1,8 @@ +DELETE /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/delete-sessions.md b/docs/examples/1.8.x/server-rest/examples/account/delete-sessions.md new file mode 100644 index 0000000000..0b3fcd1c45 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/delete-sessions.md @@ -0,0 +1,8 @@ +DELETE /v1/account/sessions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-rest/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..2ab10a2475 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,6 @@ +GET /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/account/get-prefs.md b/docs/examples/1.8.x/server-rest/examples/account/get-prefs.md new file mode 100644 index 0000000000..a038dacbfd --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/get-prefs.md @@ -0,0 +1,6 @@ +GET /v1/account/prefs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/account/get-session.md b/docs/examples/1.8.x/server-rest/examples/account/get-session.md new file mode 100644 index 0000000000..3e372a05ef --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/get-session.md @@ -0,0 +1,6 @@ +GET /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/account/get.md b/docs/examples/1.8.x/server-rest/examples/account/get.md new file mode 100644 index 0000000000..104b643074 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/get.md @@ -0,0 +1,6 @@ +GET /v1/account HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/account/list-identities.md b/docs/examples/1.8.x/server-rest/examples/account/list-identities.md new file mode 100644 index 0000000000..5acb221584 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/list-identities.md @@ -0,0 +1,6 @@ +GET /v1/account/identities HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/account/list-logs.md b/docs/examples/1.8.x/server-rest/examples/account/list-logs.md new file mode 100644 index 0000000000..8314123c9e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/list-logs.md @@ -0,0 +1,6 @@ +GET /v1/account/logs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/server-rest/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..c591143d4e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/list-mfa-factors.md @@ -0,0 +1,6 @@ +GET /v1/account/mfa/factors HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/account/list-sessions.md b/docs/examples/1.8.x/server-rest/examples/account/list-sessions.md new file mode 100644 index 0000000000..89ef6962c9 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/list-sessions.md @@ -0,0 +1,6 @@ +GET /v1/account/sessions HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-email.md b/docs/examples/1.8.x/server-rest/examples/account/update-email.md new file mode 100644 index 0000000000..382327e31b --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-email.md @@ -0,0 +1,12 @@ +PATCH /v1/account/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "email": "email@example.com", + "password": "password" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/server-rest/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..1a82afbfcc --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-magic-url-session.md @@ -0,0 +1,10 @@ +PUT /v1/account/sessions/magic-url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-rest/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..780472291c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-mfa-authenticator.md @@ -0,0 +1,11 @@ +PUT /v1/account/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "otp": "<OTP>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-rest/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..b6a7e92b28 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-mfa-challenge.md @@ -0,0 +1,12 @@ +PUT /v1/account/mfa/challenge HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "challengeId": "<CHALLENGE_ID>", + "otp": "<OTP>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-rest/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..74e9225f3e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,8 @@ +PATCH /v1/account/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-mfa.md b/docs/examples/1.8.x/server-rest/examples/account/update-mfa.md new file mode 100644 index 0000000000..a22b169751 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-mfa.md @@ -0,0 +1,11 @@ +PATCH /v1/account/mfa HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "mfa": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-name.md b/docs/examples/1.8.x/server-rest/examples/account/update-name.md new file mode 100644 index 0000000000..4c9c0e302c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-name.md @@ -0,0 +1,11 @@ +PATCH /v1/account/name HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-password.md b/docs/examples/1.8.x/server-rest/examples/account/update-password.md new file mode 100644 index 0000000000..c26f18a4f3 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-password.md @@ -0,0 +1,12 @@ +PATCH /v1/account/password HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "password": "", + "oldPassword": "password" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-phone-session.md b/docs/examples/1.8.x/server-rest/examples/account/update-phone-session.md new file mode 100644 index 0000000000..54872eecd2 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-phone-session.md @@ -0,0 +1,10 @@ +PUT /v1/account/sessions/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-phone-verification.md b/docs/examples/1.8.x/server-rest/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..1d4dc22520 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-phone-verification.md @@ -0,0 +1,12 @@ +PUT /v1/account/verification/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-phone.md b/docs/examples/1.8.x/server-rest/examples/account/update-phone.md new file mode 100644 index 0000000000..791caadb0d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-phone.md @@ -0,0 +1,12 @@ +PATCH /v1/account/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "phone": "+12065550100", + "password": "password" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-prefs.md b/docs/examples/1.8.x/server-rest/examples/account/update-prefs.md new file mode 100644 index 0000000000..0d7e4eab0c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-prefs.md @@ -0,0 +1,15 @@ +PATCH /v1/account/prefs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "prefs": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-recovery.md b/docs/examples/1.8.x/server-rest/examples/account/update-recovery.md new file mode 100644 index 0000000000..68919c29fb --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-recovery.md @@ -0,0 +1,13 @@ +PUT /v1/account/recovery HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>", + "password": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-session.md b/docs/examples/1.8.x/server-rest/examples/account/update-session.md new file mode 100644 index 0000000000..8e2257aeed --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-session.md @@ -0,0 +1,8 @@ +PATCH /v1/account/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-status.md b/docs/examples/1.8.x/server-rest/examples/account/update-status.md new file mode 100644 index 0000000000..557697fe5f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-status.md @@ -0,0 +1,8 @@ +PATCH /v1/account/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/account/update-verification.md b/docs/examples/1.8.x/server-rest/examples/account/update-verification.md new file mode 100644 index 0000000000..a4dcbf76a3 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/account/update-verification.md @@ -0,0 +1,12 @@ +PUT /v1/account/verification HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/avatars/get-browser.md b/docs/examples/1.8.x/server-rest/examples/avatars/get-browser.md new file mode 100644 index 0000000000..36999839cc --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/avatars/get-browser.md @@ -0,0 +1,7 @@ +GET /v1/avatars/browsers/{code} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/server-rest/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..c9126af289 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/avatars/get-credit-card.md @@ -0,0 +1,7 @@ +GET /v1/avatars/credit-cards/{code} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/avatars/get-favicon.md b/docs/examples/1.8.x/server-rest/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..5a928fc9cc --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/avatars/get-favicon.md @@ -0,0 +1,7 @@ +GET /v1/avatars/favicon HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/avatars/get-flag.md b/docs/examples/1.8.x/server-rest/examples/avatars/get-flag.md new file mode 100644 index 0000000000..c29ba10970 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/avatars/get-flag.md @@ -0,0 +1,7 @@ +GET /v1/avatars/flags/{code} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/avatars/get-image.md b/docs/examples/1.8.x/server-rest/examples/avatars/get-image.md new file mode 100644 index 0000000000..dfc9fdcd92 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/avatars/get-image.md @@ -0,0 +1,7 @@ +GET /v1/avatars/image HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/avatars/get-initials.md b/docs/examples/1.8.x/server-rest/examples/avatars/get-initials.md new file mode 100644 index 0000000000..c784f1ca56 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/avatars/get-initials.md @@ -0,0 +1,7 @@ +GET /v1/avatars/initials HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/avatars/get-qr.md b/docs/examples/1.8.x/server-rest/examples/avatars/get-qr.md new file mode 100644 index 0000000000..bac1987d4e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/avatars/get-qr.md @@ -0,0 +1,7 @@ +GET /v1/avatars/qr HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..b394a1779e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-boolean-attribute.md @@ -0,0 +1,13 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/boolean HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": false, + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-collection.md b/docs/examples/1.8.x/server-rest/examples/databases/create-collection.md new file mode 100644 index 0000000000..4f1e77728e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-collection.md @@ -0,0 +1,14 @@ +POST /v1/databases/{databaseId}/collections HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "collectionId": "<COLLECTION_ID>", + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "documentSecurity": false, + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..18e2a718d0 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-datetime-attribute.md @@ -0,0 +1,13 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/datetime HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": "", + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-document.md b/docs/examples/1.8.x/server-rest/examples/databases/create-document.md new file mode 100644 index 0000000000..57c38f0ba7 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-document.md @@ -0,0 +1,20 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "documentId": "<DOCUMENT_ID>", + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-documents.md b/docs/examples/1.8.x/server-rest/examples/databases/create-documents.md new file mode 100644 index 0000000000..cee5405fb2 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-documents.md @@ -0,0 +1,12 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "documents": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..1fdf1510cf --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-email-attribute.md @@ -0,0 +1,13 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": "email@example.com", + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..8cfd0d1dde --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-enum-attribute.md @@ -0,0 +1,14 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/enum HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "elements": [], + "required": false, + "default": "<DEFAULT>", + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..238c079c09 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-float-attribute.md @@ -0,0 +1,15 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/float HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "min": 0, + "max": 0, + "default": 0, + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-index.md b/docs/examples/1.8.x/server-rest/examples/databases/create-index.md new file mode 100644 index 0000000000..cf9f1a8dae --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-index.md @@ -0,0 +1,14 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "type": "key", + "attributes": [], + "orders": [], + "lengths": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..485af8eb4c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-integer-attribute.md @@ -0,0 +1,15 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/integer HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "min": 0, + "max": 0, + "default": 0, + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..f9368e0f79 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-ip-attribute.md @@ -0,0 +1,13 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/ip HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": "", + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..54d2de02de --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-line-attribute.md @@ -0,0 +1,12 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/line HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": [[1, 2], [3, 4], [5, 6]] +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..ade94fc085 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-point-attribute.md @@ -0,0 +1,12 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/point HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": [1, 2] +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..9b2f43b6ff --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-polygon-attribute.md @@ -0,0 +1,12 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/polygon HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": [[[1, 2], [3, 4], [5, 6], [1, 2]]] +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..34b5afb865 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-relationship-attribute.md @@ -0,0 +1,15 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/relationship HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "relatedCollectionId": "<RELATED_COLLECTION_ID>", + "type": "oneToOne", + "twoWay": false, + "key": "", + "twoWayKey": "", + "onDelete": "cascade" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..880fd04417 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-string-attribute.md @@ -0,0 +1,15 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/string HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "size": 1, + "required": false, + "default": "<DEFAULT>", + "array": false, + "encrypt": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..d1f8629a4b --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create-url-attribute.md @@ -0,0 +1,13 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": "https://example.com", + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/create.md b/docs/examples/1.8.x/server-rest/examples/databases/create.md new file mode 100644 index 0000000000..fd1ae143fa --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/create.md @@ -0,0 +1,12 @@ +POST /v1/databases HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "databaseId": "<DATABASE_ID>", + "name": "<NAME>", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..78694a804d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/decrement-document-attribute.md @@ -0,0 +1,13 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "value": 0, + "min": 0 +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/delete-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..5d8f7f2932 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/delete-attribute.md @@ -0,0 +1,7 @@ +DELETE /v1/databases/{databaseId}/collections/{collectionId}/attributes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/databases/delete-collection.md b/docs/examples/1.8.x/server-rest/examples/databases/delete-collection.md new file mode 100644 index 0000000000..96d044df4e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/delete-collection.md @@ -0,0 +1,7 @@ +DELETE /v1/databases/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/databases/delete-document.md b/docs/examples/1.8.x/server-rest/examples/databases/delete-document.md new file mode 100644 index 0000000000..b5580b04bf --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/delete-document.md @@ -0,0 +1,9 @@ +DELETE /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/databases/delete-documents.md b/docs/examples/1.8.x/server-rest/examples/databases/delete-documents.md new file mode 100644 index 0000000000..cb27719953 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/delete-documents.md @@ -0,0 +1,10 @@ +DELETE /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "queries": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/delete-index.md b/docs/examples/1.8.x/server-rest/examples/databases/delete-index.md new file mode 100644 index 0000000000..d8664ef7ca --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/delete-index.md @@ -0,0 +1,7 @@ +DELETE /v1/databases/{databaseId}/collections/{collectionId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/databases/delete.md b/docs/examples/1.8.x/server-rest/examples/databases/delete.md new file mode 100644 index 0000000000..85d5f7bb0e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/delete.md @@ -0,0 +1,7 @@ +DELETE /v1/databases/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/databases/get-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/get-attribute.md new file mode 100644 index 0000000000..60161187da --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/get-attribute.md @@ -0,0 +1,5 @@ +GET /v1/databases/{databaseId}/collections/{collectionId}/attributes/{key} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/databases/get-collection.md b/docs/examples/1.8.x/server-rest/examples/databases/get-collection.md new file mode 100644 index 0000000000..837138aaa0 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/get-collection.md @@ -0,0 +1,5 @@ +GET /v1/databases/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/databases/get-document.md b/docs/examples/1.8.x/server-rest/examples/databases/get-document.md new file mode 100644 index 0000000000..78a0e7d37c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/get-document.md @@ -0,0 +1,7 @@ +GET /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/databases/get-index.md b/docs/examples/1.8.x/server-rest/examples/databases/get-index.md new file mode 100644 index 0000000000..58665ed283 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/get-index.md @@ -0,0 +1,5 @@ +GET /v1/databases/{databaseId}/collections/{collectionId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/databases/get.md b/docs/examples/1.8.x/server-rest/examples/databases/get.md new file mode 100644 index 0000000000..644f251f56 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/get.md @@ -0,0 +1,5 @@ +GET /v1/databases/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..cd6b4122eb --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/increment-document-attribute.md @@ -0,0 +1,13 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "value": 0, + "max": 0 +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/list-attributes.md b/docs/examples/1.8.x/server-rest/examples/databases/list-attributes.md new file mode 100644 index 0000000000..1d16e3308d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/list-attributes.md @@ -0,0 +1,5 @@ +GET /v1/databases/{databaseId}/collections/{collectionId}/attributes HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/databases/list-collections.md b/docs/examples/1.8.x/server-rest/examples/databases/list-collections.md new file mode 100644 index 0000000000..18499144d3 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/list-collections.md @@ -0,0 +1,5 @@ +GET /v1/databases/{databaseId}/collections HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/databases/list-documents.md b/docs/examples/1.8.x/server-rest/examples/databases/list-documents.md new file mode 100644 index 0000000000..468956232d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/list-documents.md @@ -0,0 +1,7 @@ +GET /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/databases/list-indexes.md b/docs/examples/1.8.x/server-rest/examples/databases/list-indexes.md new file mode 100644 index 0000000000..1e1f134ef0 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/list-indexes.md @@ -0,0 +1,5 @@ +GET /v1/databases/{databaseId}/collections/{collectionId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/databases/list.md b/docs/examples/1.8.x/server-rest/examples/databases/list.md new file mode 100644 index 0000000000..3b9530eec4 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/list.md @@ -0,0 +1,5 @@ +GET /v1/databases HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..aeac097a06 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-boolean-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": false, + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-collection.md b/docs/examples/1.8.x/server-rest/examples/databases/update-collection.md new file mode 100644 index 0000000000..6d6e5603ed --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-collection.md @@ -0,0 +1,13 @@ +PUT /v1/databases/{databaseId}/collections/{collectionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "documentSecurity": false, + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..26f3c4e9f2 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-datetime-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": "", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-document.md b/docs/examples/1.8.x/server-rest/examples/databases/update-document.md new file mode 100644 index 0000000000..9a156375de --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-document.md @@ -0,0 +1,13 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "data": {}, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-documents.md b/docs/examples/1.8.x/server-rest/examples/databases/update-documents.md new file mode 100644 index 0000000000..69ea7a0d6f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-documents.md @@ -0,0 +1,11 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "data": {}, + "queries": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..3852754227 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-email-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/email/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": "email@example.com", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..003c0a2a21 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-enum-attribute.md @@ -0,0 +1,13 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "elements": [], + "required": false, + "default": "<DEFAULT>", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..8ceffcaa2d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-float-attribute.md @@ -0,0 +1,14 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/float/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "min": 0, + "max": 0, + "default": 0, + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..0386cbd470 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-integer-attribute.md @@ -0,0 +1,14 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "min": 0, + "max": 0, + "default": 0, + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..7909f960c0 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-ip-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": "", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..47bcbea4ab --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-line-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/line/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": [[1, 2], [3, 4], [5, 6]], + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..c0851c7d51 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-point-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/point/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": [1, 2], + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..4cfae215b9 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-polygon-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": [[[1, 2], [3, 4], [5, 6], [1, 2]]], + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..2461ff3053 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-relationship-attribute.md @@ -0,0 +1,11 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "onDelete": "cascade", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..e7debaa46f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-string-attribute.md @@ -0,0 +1,13 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/string/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": "<DEFAULT>", + "size": 1, + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/server-rest/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..4318ab4564 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update-url-attribute.md @@ -0,0 +1,12 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/url/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": "https://example.com", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/update.md b/docs/examples/1.8.x/server-rest/examples/databases/update.md new file mode 100644 index 0000000000..d57ad48927 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/update.md @@ -0,0 +1,11 @@ +PUT /v1/databases/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/upsert-document.md b/docs/examples/1.8.x/server-rest/examples/databases/upsert-document.md new file mode 100644 index 0000000000..97b61bfc7f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/upsert-document.md @@ -0,0 +1,13 @@ +PUT /v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "data": {}, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/server-rest/examples/databases/upsert-documents.md b/docs/examples/1.8.x/server-rest/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..4bcb9cb0c0 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/databases/upsert-documents.md @@ -0,0 +1,10 @@ +PUT /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "documents": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/functions/create-deployment.md b/docs/examples/1.8.x/server-rest/examples/functions/create-deployment.md new file mode 100644 index 0000000000..9366ab01d9 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/create-deployment.md @@ -0,0 +1,29 @@ +POST /v1/functions/{functionId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="entrypoint" + +"<ENTRYPOINT>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="commands" + +"<COMMANDS>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="code" + +cf 94 84 24 8d c4 91 10 0f dc 54 26 6c 8e 4b bc e8 ee 55 94 29 e7 94 89 19 26 28 01 26 29 3f 16... + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="activate" + +false + +--cec8e8123c05ba25-- diff --git a/docs/examples/1.8.x/server-rest/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-rest/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..f2ba3c5f13 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,11 @@ +POST /v1/functions/{functionId}/deployments/duplicate HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "deploymentId": "<DEPLOYMENT_ID>", + "buildId": "<BUILD_ID>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/functions/create-execution.md b/docs/examples/1.8.x/server-rest/examples/functions/create-execution.md new file mode 100644 index 0000000000..a2863046ce --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/create-execution.md @@ -0,0 +1,17 @@ +POST /v1/functions/{functionId}/executions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "body": "<BODY>", + "async": false, + "path": "<PATH>", + "method": "GET", + "headers": {}, + "scheduledAt": "<SCHEDULED_AT>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/server-rest/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..18ebf65efe --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/create-template-deployment.md @@ -0,0 +1,14 @@ +POST /v1/functions/{functionId}/deployments/template HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "repository": "<REPOSITORY>", + "owner": "<OWNER>", + "rootDirectory": "<ROOT_DIRECTORY>", + "version": "<VERSION>", + "activate": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/functions/create-variable.md b/docs/examples/1.8.x/server-rest/examples/functions/create-variable.md new file mode 100644 index 0000000000..7f71f07417 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/create-variable.md @@ -0,0 +1,12 @@ +POST /v1/functions/{functionId}/variables HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "<KEY>", + "value": "<VALUE>", + "secret": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-rest/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..cd409fa892 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/create-vcs-deployment.md @@ -0,0 +1,12 @@ +POST /v1/functions/{functionId}/deployments/vcs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "type": "branch", + "reference": "<REFERENCE>", + "activate": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/functions/create.md b/docs/examples/1.8.x/server-rest/examples/functions/create.md new file mode 100644 index 0000000000..2bccb0db4a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/create.md @@ -0,0 +1,27 @@ +POST /v1/functions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "functionId": "<FUNCTION_ID>", + "name": "<NAME>", + "runtime": "node-14.5", + "execute": ["any"], + "events": [], + "schedule": "", + "timeout": 1, + "enabled": false, + "logging": false, + "entrypoint": "<ENTRYPOINT>", + "commands": "<COMMANDS>", + "scopes": [], + "installationId": "<INSTALLATION_ID>", + "providerRepositoryId": "<PROVIDER_REPOSITORY_ID>", + "providerBranch": "<PROVIDER_BRANCH>", + "providerSilentMode": false, + "providerRootDirectory": "<PROVIDER_ROOT_DIRECTORY>", + "specification": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/functions/delete-deployment.md b/docs/examples/1.8.x/server-rest/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..81a80209a8 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/delete-deployment.md @@ -0,0 +1,7 @@ +DELETE /v1/functions/{functionId}/deployments/{deploymentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/functions/delete-execution.md b/docs/examples/1.8.x/server-rest/examples/functions/delete-execution.md new file mode 100644 index 0000000000..020a9efc3e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/delete-execution.md @@ -0,0 +1,7 @@ +DELETE /v1/functions/{functionId}/executions/{executionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/functions/delete-variable.md b/docs/examples/1.8.x/server-rest/examples/functions/delete-variable.md new file mode 100644 index 0000000000..88f4de15eb --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/delete-variable.md @@ -0,0 +1,7 @@ +DELETE /v1/functions/{functionId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/functions/delete.md b/docs/examples/1.8.x/server-rest/examples/functions/delete.md new file mode 100644 index 0000000000..2148d8148b --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/delete.md @@ -0,0 +1,7 @@ +DELETE /v1/functions/{functionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/server-rest/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..e9c9ce0073 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/get-deployment-download.md @@ -0,0 +1,6 @@ +GET /v1/functions/{functionId}/deployments/{deploymentId}/download HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/functions/get-deployment.md b/docs/examples/1.8.x/server-rest/examples/functions/get-deployment.md new file mode 100644 index 0000000000..aa6e92449b --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/get-deployment.md @@ -0,0 +1,5 @@ +GET /v1/functions/{functionId}/deployments/{deploymentId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/functions/get-execution.md b/docs/examples/1.8.x/server-rest/examples/functions/get-execution.md new file mode 100644 index 0000000000..54da369660 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/get-execution.md @@ -0,0 +1,7 @@ +GET /v1/functions/{functionId}/executions/{executionId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/functions/get-variable.md b/docs/examples/1.8.x/server-rest/examples/functions/get-variable.md new file mode 100644 index 0000000000..91f14f0db8 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/get-variable.md @@ -0,0 +1,5 @@ +GET /v1/functions/{functionId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/functions/get.md b/docs/examples/1.8.x/server-rest/examples/functions/get.md new file mode 100644 index 0000000000..fb0f049f6d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/get.md @@ -0,0 +1,5 @@ +GET /v1/functions/{functionId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/functions/list-deployments.md b/docs/examples/1.8.x/server-rest/examples/functions/list-deployments.md new file mode 100644 index 0000000000..db89edf692 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/list-deployments.md @@ -0,0 +1,5 @@ +GET /v1/functions/{functionId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/functions/list-executions.md b/docs/examples/1.8.x/server-rest/examples/functions/list-executions.md new file mode 100644 index 0000000000..5876a8ba46 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/list-executions.md @@ -0,0 +1,7 @@ +GET /v1/functions/{functionId}/executions HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/functions/list-runtimes.md b/docs/examples/1.8.x/server-rest/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..d8e4bc4272 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/list-runtimes.md @@ -0,0 +1,5 @@ +GET /v1/functions/runtimes HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/functions/list-specifications.md b/docs/examples/1.8.x/server-rest/examples/functions/list-specifications.md new file mode 100644 index 0000000000..1a84b56ac9 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/list-specifications.md @@ -0,0 +1,5 @@ +GET /v1/functions/specifications HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/functions/list-variables.md b/docs/examples/1.8.x/server-rest/examples/functions/list-variables.md new file mode 100644 index 0000000000..41bfde5e28 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/list-variables.md @@ -0,0 +1,5 @@ +GET /v1/functions/{functionId}/variables HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/functions/list.md b/docs/examples/1.8.x/server-rest/examples/functions/list.md new file mode 100644 index 0000000000..e12af0e774 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/list.md @@ -0,0 +1,5 @@ +GET /v1/functions HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/server-rest/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..ba4a882910 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/update-deployment-status.md @@ -0,0 +1,7 @@ +PATCH /v1/functions/{functionId}/deployments/{deploymentId}/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/server-rest/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..d649b2ea69 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/update-function-deployment.md @@ -0,0 +1,10 @@ +PATCH /v1/functions/{functionId}/deployment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "deploymentId": "<DEPLOYMENT_ID>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/functions/update-variable.md b/docs/examples/1.8.x/server-rest/examples/functions/update-variable.md new file mode 100644 index 0000000000..5a0ad6805d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/update-variable.md @@ -0,0 +1,12 @@ +PUT /v1/functions/{functionId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "<KEY>", + "value": "<VALUE>", + "secret": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/functions/update.md b/docs/examples/1.8.x/server-rest/examples/functions/update.md new file mode 100644 index 0000000000..cbaa3d62f8 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/functions/update.md @@ -0,0 +1,26 @@ +PUT /v1/functions/{functionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "runtime": "node-14.5", + "execute": ["any"], + "events": [], + "schedule": "", + "timeout": 1, + "enabled": false, + "logging": false, + "entrypoint": "<ENTRYPOINT>", + "commands": "<COMMANDS>", + "scopes": [], + "installationId": "<INSTALLATION_ID>", + "providerRepositoryId": "<PROVIDER_REPOSITORY_ID>", + "providerBranch": "<PROVIDER_BRANCH>", + "providerSilentMode": false, + "providerRootDirectory": "<PROVIDER_ROOT_DIRECTORY>", + "specification": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/graphql/mutation.md b/docs/examples/1.8.x/server-rest/examples/graphql/mutation.md new file mode 100644 index 0000000000..2d59370324 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/graphql/mutation.md @@ -0,0 +1,13 @@ +POST /v1/graphql/mutation HTTP/1.1 +Host: cloud.appwrite.io +X-Sdk-Graphql: true +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "query": {} +} diff --git a/docs/examples/1.8.x/server-rest/examples/graphql/query.md b/docs/examples/1.8.x/server-rest/examples/graphql/query.md new file mode 100644 index 0000000000..c7242de6ef --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/graphql/query.md @@ -0,0 +1,13 @@ +POST /v1/graphql HTTP/1.1 +Host: cloud.appwrite.io +X-Sdk-Graphql: true +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "query": {} +} diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-antivirus.md b/docs/examples/1.8.x/server-rest/examples/health/get-antivirus.md new file mode 100644 index 0000000000..f0e27277b1 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-antivirus.md @@ -0,0 +1,5 @@ +GET /v1/health/anti-virus HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-cache.md b/docs/examples/1.8.x/server-rest/examples/health/get-cache.md new file mode 100644 index 0000000000..e0628a1b8a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-cache.md @@ -0,0 +1,5 @@ +GET /v1/health/cache HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-certificate.md b/docs/examples/1.8.x/server-rest/examples/health/get-certificate.md new file mode 100644 index 0000000000..8928e8f25a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-certificate.md @@ -0,0 +1,5 @@ +GET /v1/health/certificate HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-db.md b/docs/examples/1.8.x/server-rest/examples/health/get-db.md new file mode 100644 index 0000000000..f636c9c8e7 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-db.md @@ -0,0 +1,5 @@ +GET /v1/health/db HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/server-rest/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..b9bfab3b73 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-failed-jobs.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/failed/{name} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-pub-sub.md b/docs/examples/1.8.x/server-rest/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..e9ab32729c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-pub-sub.md @@ -0,0 +1,5 @@ +GET /v1/health/pubsub HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-builds.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..c3d9189a65 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-builds.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/builds HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..d70ee360a8 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-certificates.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/certificates HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-databases.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..60fc6db3b2 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-databases.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/databases HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..5a9ce59da3 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-deletes.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/deletes HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-functions.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..854100e092 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-functions.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/functions HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-logs.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..9fa98f13f5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-logs.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/logs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-mails.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..2bb61550bb --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-mails.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/mails HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..5fd0f35919 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-messaging.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/messaging HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..2832b1c980 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-migrations.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/migrations HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..6500b1f84c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-stats-resources.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/stats-resources HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-usage.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..9c4e797f32 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-usage.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/stats-usage HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-rest/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..4db6cf7d8c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-queue-webhooks.md @@ -0,0 +1,5 @@ +GET /v1/health/queue/webhooks HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-storage-local.md b/docs/examples/1.8.x/server-rest/examples/health/get-storage-local.md new file mode 100644 index 0000000000..31c9b8725f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-storage-local.md @@ -0,0 +1,5 @@ +GET /v1/health/storage/local HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-storage.md b/docs/examples/1.8.x/server-rest/examples/health/get-storage.md new file mode 100644 index 0000000000..69c4ebd910 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-storage.md @@ -0,0 +1,5 @@ +GET /v1/health/storage HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get-time.md b/docs/examples/1.8.x/server-rest/examples/health/get-time.md new file mode 100644 index 0000000000..5396aac6fb --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get-time.md @@ -0,0 +1,5 @@ +GET /v1/health/time HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/health/get.md b/docs/examples/1.8.x/server-rest/examples/health/get.md new file mode 100644 index 0000000000..b37e30c4f8 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/health/get.md @@ -0,0 +1,5 @@ +GET /v1/health HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/locale/get.md b/docs/examples/1.8.x/server-rest/examples/locale/get.md new file mode 100644 index 0000000000..6c60c076b6 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/locale/get.md @@ -0,0 +1,7 @@ +GET /v1/locale HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/locale/list-codes.md b/docs/examples/1.8.x/server-rest/examples/locale/list-codes.md new file mode 100644 index 0000000000..3cc2aa9939 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/locale/list-codes.md @@ -0,0 +1,7 @@ +GET /v1/locale/codes HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/locale/list-continents.md b/docs/examples/1.8.x/server-rest/examples/locale/list-continents.md new file mode 100644 index 0000000000..8d2b0fa19d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/locale/list-continents.md @@ -0,0 +1,7 @@ +GET /v1/locale/continents HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/server-rest/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..ae341f5982 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/locale/list-countries-eu.md @@ -0,0 +1,7 @@ +GET /v1/locale/countries/eu HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/server-rest/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..9d59f37a19 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/locale/list-countries-phones.md @@ -0,0 +1,7 @@ +GET /v1/locale/countries/phones HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/locale/list-countries.md b/docs/examples/1.8.x/server-rest/examples/locale/list-countries.md new file mode 100644 index 0000000000..19205d538d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/locale/list-countries.md @@ -0,0 +1,7 @@ +GET /v1/locale/countries HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/locale/list-currencies.md b/docs/examples/1.8.x/server-rest/examples/locale/list-currencies.md new file mode 100644 index 0000000000..fbf6d63496 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/locale/list-currencies.md @@ -0,0 +1,7 @@ +GET /v1/locale/currencies HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/locale/list-languages.md b/docs/examples/1.8.x/server-rest/examples/locale/list-languages.md new file mode 100644 index 0000000000..7f1304d6ff --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/locale/list-languages.md @@ -0,0 +1,7 @@ +GET /v1/locale/languages HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..47d3b98615 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-apns-provider.md @@ -0,0 +1,17 @@ +POST /v1/messaging/providers/apns HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "authKey": "<AUTH_KEY>", + "authKeyId": "<AUTH_KEY_ID>", + "teamId": "<TEAM_ID>", + "bundleId": "<BUNDLE_ID>", + "sandbox": false, + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-email.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-email.md new file mode 100644 index 0000000000..01888007f4 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-email.md @@ -0,0 +1,21 @@ +POST /v1/messaging/messages/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "messageId": "<MESSAGE_ID>", + "subject": "<SUBJECT>", + "content": "<CONTENT>", + "topics": [], + "users": [], + "targets": [], + "cc": [], + "bcc": [], + "attachments": [], + "draft": false, + "html": false, + "scheduledAt": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..f234c80e6e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-fcm-provider.md @@ -0,0 +1,13 @@ +POST /v1/messaging/providers/fcm HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "serviceAccountJSON": {}, + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..fd138606e2 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,19 @@ +POST /v1/messaging/providers/mailgun HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "apiKey": "<API_KEY>", + "domain": "<DOMAIN>", + "isEuRegion": false, + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "email@example.com", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..edbd690d5d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,15 @@ +POST /v1/messaging/providers/msg91 HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "templateId": "<TEMPLATE_ID>", + "senderId": "<SENDER_ID>", + "authKey": "<AUTH_KEY>", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-push.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-push.md new file mode 100644 index 0000000000..a70702c014 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-push.md @@ -0,0 +1,28 @@ +POST /v1/messaging/messages/push HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "messageId": "<MESSAGE_ID>", + "title": "<TITLE>", + "body": "<BODY>", + "topics": [], + "users": [], + "targets": [], + "data": {}, + "action": "<ACTION>", + "image": "[ID1:ID2]", + "icon": "<ICON>", + "sound": "<SOUND>", + "color": "<COLOR>", + "tag": "<TAG>", + "badge": 0, + "draft": false, + "scheduledAt": "", + "contentAvailable": false, + "critical": false, + "priority": "normal" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..3fa7ee8dd8 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,17 @@ +POST /v1/messaging/providers/sendgrid HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "apiKey": "<API_KEY>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "email@example.com", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-sms.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-sms.md new file mode 100644 index 0000000000..51c4350c1c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-sms.md @@ -0,0 +1,16 @@ +POST /v1/messaging/messages/sms HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "messageId": "<MESSAGE_ID>", + "content": "<CONTENT>", + "topics": [], + "users": [], + "targets": [], + "draft": false, + "scheduledAt": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..5963ee474c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-smtp-provider.md @@ -0,0 +1,23 @@ +POST /v1/messaging/providers/smtp HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "host": "<HOST>", + "port": 1, + "username": "<USERNAME>", + "password": "<PASSWORD>", + "encryption": "none", + "autoTLS": false, + "mailer": "<MAILER>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "email@example.com", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..e22a626ac4 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-subscriber.md @@ -0,0 +1,13 @@ +POST /v1/messaging/topics/{topicId}/subscribers HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-JWT: <YOUR_JWT> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "subscriberId": "<SUBSCRIBER_ID>", + "targetId": "<TARGET_ID>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..a474db823f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-telesign-provider.md @@ -0,0 +1,15 @@ +POST /v1/messaging/providers/telesign HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "from": "+12065550100", + "customerId": "<CUSTOMER_ID>", + "apiKey": "<API_KEY>", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..caa7bcd014 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,15 @@ +POST /v1/messaging/providers/textmagic HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "from": "+12065550100", + "username": "<USERNAME>", + "apiKey": "<API_KEY>", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-topic.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-topic.md new file mode 100644 index 0000000000..9974584212 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-topic.md @@ -0,0 +1,12 @@ +POST /v1/messaging/topics HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "topicId": "<TOPIC_ID>", + "name": "<NAME>", + "subscribe": ["any"] +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..e612eed8be --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-twilio-provider.md @@ -0,0 +1,15 @@ +POST /v1/messaging/providers/twilio HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "from": "+12065550100", + "accountSid": "<ACCOUNT_SID>", + "authToken": "<AUTH_TOKEN>", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..fdd66526a9 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/create-vonage-provider.md @@ -0,0 +1,15 @@ +POST /v1/messaging/providers/vonage HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "providerId": "<PROVIDER_ID>", + "name": "<NAME>", + "from": "+12065550100", + "apiKey": "<API_KEY>", + "apiSecret": "<API_SECRET>", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/delete-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..cfd1ff3b30 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/delete-provider.md @@ -0,0 +1,7 @@ +DELETE /v1/messaging/providers/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-rest/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..8226237777 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/delete-subscriber.md @@ -0,0 +1,9 @@ +DELETE /v1/messaging/topics/{topicId}/subscribers/{subscriberId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-JWT: <YOUR_JWT> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/delete-topic.md b/docs/examples/1.8.x/server-rest/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..d340209e93 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/delete-topic.md @@ -0,0 +1,7 @@ +DELETE /v1/messaging/topics/{topicId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/delete.md b/docs/examples/1.8.x/server-rest/examples/messaging/delete.md new file mode 100644 index 0000000000..e076c96ebf --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/delete.md @@ -0,0 +1,7 @@ +DELETE /v1/messaging/messages/{messageId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/get-message.md b/docs/examples/1.8.x/server-rest/examples/messaging/get-message.md new file mode 100644 index 0000000000..ef9ef2c8df --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/get-message.md @@ -0,0 +1,5 @@ +GET /v1/messaging/messages/{messageId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/get-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/get-provider.md new file mode 100644 index 0000000000..361d634760 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/get-provider.md @@ -0,0 +1,5 @@ +GET /v1/messaging/providers/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/server-rest/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..c01c5876ac --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/get-subscriber.md @@ -0,0 +1,5 @@ +GET /v1/messaging/topics/{topicId}/subscribers/{subscriberId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/get-topic.md b/docs/examples/1.8.x/server-rest/examples/messaging/get-topic.md new file mode 100644 index 0000000000..df5256f5e3 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/get-topic.md @@ -0,0 +1,5 @@ +GET /v1/messaging/topics/{topicId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/server-rest/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..d8c982e7ea --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/list-message-logs.md @@ -0,0 +1,5 @@ +GET /v1/messaging/messages/{messageId}/logs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/list-messages.md b/docs/examples/1.8.x/server-rest/examples/messaging/list-messages.md new file mode 100644 index 0000000000..88964162e3 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/list-messages.md @@ -0,0 +1,5 @@ +GET /v1/messaging/messages HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-rest/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..46c0f76a10 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/list-provider-logs.md @@ -0,0 +1,5 @@ +GET /v1/messaging/providers/{providerId}/logs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/list-providers.md b/docs/examples/1.8.x/server-rest/examples/messaging/list-providers.md new file mode 100644 index 0000000000..e454b3101b --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/list-providers.md @@ -0,0 +1,5 @@ +GET /v1/messaging/providers HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-rest/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..7fb1192035 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,5 @@ +GET /v1/messaging/subscribers/{subscriberId}/logs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/server-rest/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..06f67c27c1 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/list-subscribers.md @@ -0,0 +1,5 @@ +GET /v1/messaging/topics/{topicId}/subscribers HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/list-targets.md b/docs/examples/1.8.x/server-rest/examples/messaging/list-targets.md new file mode 100644 index 0000000000..7c793cfae0 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/list-targets.md @@ -0,0 +1,5 @@ +GET /v1/messaging/messages/{messageId}/targets HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-rest/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..e371aeb2b5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/list-topic-logs.md @@ -0,0 +1,5 @@ +GET /v1/messaging/topics/{topicId}/logs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/list-topics.md b/docs/examples/1.8.x/server-rest/examples/messaging/list-topics.md new file mode 100644 index 0000000000..9f18e14b70 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/list-topics.md @@ -0,0 +1,5 @@ +GET /v1/messaging/topics HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..a55c593039 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-apns-provider.md @@ -0,0 +1,16 @@ +PATCH /v1/messaging/providers/apns/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "enabled": false, + "authKey": "<AUTH_KEY>", + "authKeyId": "<AUTH_KEY_ID>", + "teamId": "<TEAM_ID>", + "bundleId": "<BUNDLE_ID>", + "sandbox": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-email.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-email.md new file mode 100644 index 0000000000..0e1cd9b984 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-email.md @@ -0,0 +1,20 @@ +PATCH /v1/messaging/messages/email/{messageId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "topics": [], + "users": [], + "targets": [], + "subject": "<SUBJECT>", + "content": "<CONTENT>", + "draft": false, + "html": false, + "cc": [], + "bcc": [], + "scheduledAt": "", + "attachments": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..d485981c5b --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-fcm-provider.md @@ -0,0 +1,12 @@ +PATCH /v1/messaging/providers/fcm/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "enabled": false, + "serviceAccountJSON": {} +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..ec132692c5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,18 @@ +PATCH /v1/messaging/providers/mailgun/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "apiKey": "<API_KEY>", + "domain": "<DOMAIN>", + "isEuRegion": false, + "enabled": false, + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "<REPLY_TO_EMAIL>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..1013915e5d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,14 @@ +PATCH /v1/messaging/providers/msg91/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "enabled": false, + "templateId": "<TEMPLATE_ID>", + "senderId": "<SENDER_ID>", + "authKey": "<AUTH_KEY>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-push.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-push.md new file mode 100644 index 0000000000..b3b953bc31 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-push.md @@ -0,0 +1,27 @@ +PATCH /v1/messaging/messages/push/{messageId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "topics": [], + "users": [], + "targets": [], + "title": "<TITLE>", + "body": "<BODY>", + "data": {}, + "action": "<ACTION>", + "image": "[ID1:ID2]", + "icon": "<ICON>", + "sound": "<SOUND>", + "color": "<COLOR>", + "tag": "<TAG>", + "badge": 0, + "draft": false, + "scheduledAt": "", + "contentAvailable": false, + "critical": false, + "priority": "normal" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..fd30512320 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,16 @@ +PATCH /v1/messaging/providers/sendgrid/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "enabled": false, + "apiKey": "<API_KEY>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "<REPLY_TO_EMAIL>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-sms.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-sms.md new file mode 100644 index 0000000000..be246dfa41 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-sms.md @@ -0,0 +1,15 @@ +PATCH /v1/messaging/messages/sms/{messageId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "topics": [], + "users": [], + "targets": [], + "content": "<CONTENT>", + "draft": false, + "scheduledAt": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..9fc45d6726 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-smtp-provider.md @@ -0,0 +1,22 @@ +PATCH /v1/messaging/providers/smtp/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "host": "<HOST>", + "port": 1, + "username": "<USERNAME>", + "password": "<PASSWORD>", + "encryption": "none", + "autoTLS": false, + "mailer": "<MAILER>", + "fromName": "<FROM_NAME>", + "fromEmail": "email@example.com", + "replyToName": "<REPLY_TO_NAME>", + "replyToEmail": "<REPLY_TO_EMAIL>", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..919e99577e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-telesign-provider.md @@ -0,0 +1,14 @@ +PATCH /v1/messaging/providers/telesign/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "enabled": false, + "customerId": "<CUSTOMER_ID>", + "apiKey": "<API_KEY>", + "from": "<FROM>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..94f965c44a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,14 @@ +PATCH /v1/messaging/providers/textmagic/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "enabled": false, + "username": "<USERNAME>", + "apiKey": "<API_KEY>", + "from": "<FROM>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-topic.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-topic.md new file mode 100644 index 0000000000..75644d9828 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-topic.md @@ -0,0 +1,11 @@ +PATCH /v1/messaging/topics/{topicId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "subscribe": ["any"] +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..41d04c0c14 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-twilio-provider.md @@ -0,0 +1,14 @@ +PATCH /v1/messaging/providers/twilio/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "enabled": false, + "accountSid": "<ACCOUNT_SID>", + "authToken": "<AUTH_TOKEN>", + "from": "<FROM>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-rest/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..0344691e51 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/messaging/update-vonage-provider.md @@ -0,0 +1,14 @@ +PATCH /v1/messaging/providers/vonage/{providerId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "enabled": false, + "apiKey": "<API_KEY>", + "apiSecret": "<API_SECRET>", + "from": "<FROM>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/sites/create-deployment.md b/docs/examples/1.8.x/server-rest/examples/sites/create-deployment.md new file mode 100644 index 0000000000..226642f091 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/create-deployment.md @@ -0,0 +1,34 @@ +POST /v1/sites/{siteId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="installCommand" + +"<INSTALL_COMMAND>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="buildCommand" + +"<BUILD_COMMAND>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="outputDirectory" + +"<OUTPUT_DIRECTORY>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="code" + +cf 94 84 24 8d c4 91 10 0f dc 54 26 6c 8e 4b bc e8 ee 55 94 29 e7 94 89 19 26 28 01 26 29 3f 16... + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="activate" + +false + +--cec8e8123c05ba25-- diff --git a/docs/examples/1.8.x/server-rest/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-rest/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..dbee572372 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,10 @@ +POST /v1/sites/{siteId}/deployments/duplicate HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "deploymentId": "<DEPLOYMENT_ID>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/server-rest/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..3b21f4f754 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/create-template-deployment.md @@ -0,0 +1,14 @@ +POST /v1/sites/{siteId}/deployments/template HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "repository": "<REPOSITORY>", + "owner": "<OWNER>", + "rootDirectory": "<ROOT_DIRECTORY>", + "version": "<VERSION>", + "activate": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/sites/create-variable.md b/docs/examples/1.8.x/server-rest/examples/sites/create-variable.md new file mode 100644 index 0000000000..c34be9d619 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/create-variable.md @@ -0,0 +1,12 @@ +POST /v1/sites/{siteId}/variables HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "<KEY>", + "value": "<VALUE>", + "secret": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-rest/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..2e466da0f6 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/create-vcs-deployment.md @@ -0,0 +1,12 @@ +POST /v1/sites/{siteId}/deployments/vcs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "type": "branch", + "reference": "<REFERENCE>", + "activate": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/sites/create.md b/docs/examples/1.8.x/server-rest/examples/sites/create.md new file mode 100644 index 0000000000..23ac46eb67 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/create.md @@ -0,0 +1,27 @@ +POST /v1/sites HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "siteId": "<SITE_ID>", + "name": "<NAME>", + "framework": "analog", + "enabled": false, + "logging": false, + "timeout": 1, + "installCommand": "<INSTALL_COMMAND>", + "buildCommand": "<BUILD_COMMAND>", + "outputDirectory": "<OUTPUT_DIRECTORY>", + "buildRuntime": "node-14.5", + "adapter": "static", + "installationId": "<INSTALLATION_ID>", + "fallbackFile": "<FALLBACK_FILE>", + "providerRepositoryId": "<PROVIDER_REPOSITORY_ID>", + "providerBranch": "<PROVIDER_BRANCH>", + "providerSilentMode": false, + "providerRootDirectory": "<PROVIDER_ROOT_DIRECTORY>", + "specification": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/sites/delete-deployment.md b/docs/examples/1.8.x/server-rest/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..3df6aca50f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/delete-deployment.md @@ -0,0 +1,7 @@ +DELETE /v1/sites/{siteId}/deployments/{deploymentId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/sites/delete-log.md b/docs/examples/1.8.x/server-rest/examples/sites/delete-log.md new file mode 100644 index 0000000000..af1d1c339a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/delete-log.md @@ -0,0 +1,7 @@ +DELETE /v1/sites/{siteId}/logs/{logId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/sites/delete-variable.md b/docs/examples/1.8.x/server-rest/examples/sites/delete-variable.md new file mode 100644 index 0000000000..008ab4b190 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/delete-variable.md @@ -0,0 +1,7 @@ +DELETE /v1/sites/{siteId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/sites/delete.md b/docs/examples/1.8.x/server-rest/examples/sites/delete.md new file mode 100644 index 0000000000..0657fff9ef --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/delete.md @@ -0,0 +1,7 @@ +DELETE /v1/sites/{siteId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/server-rest/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..3ce065f600 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/get-deployment-download.md @@ -0,0 +1,6 @@ +GET /v1/sites/{siteId}/deployments/{deploymentId}/download HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/sites/get-deployment.md b/docs/examples/1.8.x/server-rest/examples/sites/get-deployment.md new file mode 100644 index 0000000000..2ad95813d9 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/get-deployment.md @@ -0,0 +1,5 @@ +GET /v1/sites/{siteId}/deployments/{deploymentId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/sites/get-log.md b/docs/examples/1.8.x/server-rest/examples/sites/get-log.md new file mode 100644 index 0000000000..41dd30dc8f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/get-log.md @@ -0,0 +1,5 @@ +GET /v1/sites/{siteId}/logs/{logId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/sites/get-variable.md b/docs/examples/1.8.x/server-rest/examples/sites/get-variable.md new file mode 100644 index 0000000000..c6d5e70211 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/get-variable.md @@ -0,0 +1,5 @@ +GET /v1/sites/{siteId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/sites/get.md b/docs/examples/1.8.x/server-rest/examples/sites/get.md new file mode 100644 index 0000000000..da7b67883f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/get.md @@ -0,0 +1,5 @@ +GET /v1/sites/{siteId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/sites/list-deployments.md b/docs/examples/1.8.x/server-rest/examples/sites/list-deployments.md new file mode 100644 index 0000000000..0bc5467894 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/list-deployments.md @@ -0,0 +1,5 @@ +GET /v1/sites/{siteId}/deployments HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/sites/list-frameworks.md b/docs/examples/1.8.x/server-rest/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..8c5f7ff318 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/list-frameworks.md @@ -0,0 +1,5 @@ +GET /v1/sites/frameworks HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/sites/list-logs.md b/docs/examples/1.8.x/server-rest/examples/sites/list-logs.md new file mode 100644 index 0000000000..57b35c4ef5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/list-logs.md @@ -0,0 +1,5 @@ +GET /v1/sites/{siteId}/logs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/sites/list-specifications.md b/docs/examples/1.8.x/server-rest/examples/sites/list-specifications.md new file mode 100644 index 0000000000..cf31760070 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/list-specifications.md @@ -0,0 +1,5 @@ +GET /v1/sites/specifications HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/sites/list-variables.md b/docs/examples/1.8.x/server-rest/examples/sites/list-variables.md new file mode 100644 index 0000000000..7e12fdfd02 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/list-variables.md @@ -0,0 +1,5 @@ +GET /v1/sites/{siteId}/variables HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/sites/list.md b/docs/examples/1.8.x/server-rest/examples/sites/list.md new file mode 100644 index 0000000000..dc4dc3695f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/list.md @@ -0,0 +1,5 @@ +GET /v1/sites HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/server-rest/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..d4f251c20f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/update-deployment-status.md @@ -0,0 +1,7 @@ +PATCH /v1/sites/{siteId}/deployments/{deploymentId}/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/server-rest/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..c288b2bf00 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/update-site-deployment.md @@ -0,0 +1,10 @@ +PATCH /v1/sites/{siteId}/deployment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "deploymentId": "<DEPLOYMENT_ID>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/sites/update-variable.md b/docs/examples/1.8.x/server-rest/examples/sites/update-variable.md new file mode 100644 index 0000000000..c7fe824ac4 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/update-variable.md @@ -0,0 +1,12 @@ +PUT /v1/sites/{siteId}/variables/{variableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "<KEY>", + "value": "<VALUE>", + "secret": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/sites/update.md b/docs/examples/1.8.x/server-rest/examples/sites/update.md new file mode 100644 index 0000000000..08ebe17fb8 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/sites/update.md @@ -0,0 +1,26 @@ +PUT /v1/sites/{siteId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "framework": "analog", + "enabled": false, + "logging": false, + "timeout": 1, + "installCommand": "<INSTALL_COMMAND>", + "buildCommand": "<BUILD_COMMAND>", + "outputDirectory": "<OUTPUT_DIRECTORY>", + "buildRuntime": "node-14.5", + "adapter": "static", + "fallbackFile": "<FALLBACK_FILE>", + "installationId": "<INSTALLATION_ID>", + "providerRepositoryId": "<PROVIDER_REPOSITORY_ID>", + "providerBranch": "<PROVIDER_BRANCH>", + "providerSilentMode": false, + "providerRootDirectory": "<PROVIDER_ROOT_DIRECTORY>", + "specification": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/storage/create-bucket.md b/docs/examples/1.8.x/server-rest/examples/storage/create-bucket.md new file mode 100644 index 0000000000..59f1c4f403 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/create-bucket.md @@ -0,0 +1,19 @@ +POST /v1/storage/buckets HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "bucketId": "<BUCKET_ID>", + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "fileSecurity": false, + "enabled": false, + "maximumFileSize": 1, + "allowedFileExtensions": [], + "compression": "none", + "encryption": false, + "antivirus": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/storage/create-file.md b/docs/examples/1.8.x/server-rest/examples/storage/create-file.md new file mode 100644 index 0000000000..055ed38ec0 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/create-file.md @@ -0,0 +1,26 @@ +POST /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: multipart/form-data; boundary="cec8e8123c05ba25" +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> +Content-Length: *Length of your entity body in bytes* + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="fileId" + +"<FILE_ID>" + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="file" + +cf 94 84 24 8d c4 91 10 0f dc 54 26 6c 8e 4b bc e8 ee 55 94 29 e7 94 89 19 26 28 01 26 29 3f 16... + +--cec8e8123c05ba25 +Content-Disposition: form-data; name="permissions[]" + +["read(\"any\")"] + +--cec8e8123c05ba25-- diff --git a/docs/examples/1.8.x/server-rest/examples/storage/delete-bucket.md b/docs/examples/1.8.x/server-rest/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..d6083186de --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/delete-bucket.md @@ -0,0 +1,7 @@ +DELETE /v1/storage/buckets/{bucketId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/storage/delete-file.md b/docs/examples/1.8.x/server-rest/examples/storage/delete-file.md new file mode 100644 index 0000000000..467fdf96d1 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/delete-file.md @@ -0,0 +1,9 @@ +DELETE /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/storage/get-bucket.md b/docs/examples/1.8.x/server-rest/examples/storage/get-bucket.md new file mode 100644 index 0000000000..2ad1e577c5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/get-bucket.md @@ -0,0 +1,5 @@ +GET /v1/storage/buckets/{bucketId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/storage/get-file-download.md b/docs/examples/1.8.x/server-rest/examples/storage/get-file-download.md new file mode 100644 index 0000000000..af382d3a9a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/get-file-download.md @@ -0,0 +1,7 @@ +GET /v1/storage/buckets/{bucketId}/files/{fileId}/download HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/storage/get-file-preview.md b/docs/examples/1.8.x/server-rest/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..e00f0ff76f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/get-file-preview.md @@ -0,0 +1,7 @@ +GET /v1/storage/buckets/{bucketId}/files/{fileId}/preview HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/storage/get-file-view.md b/docs/examples/1.8.x/server-rest/examples/storage/get-file-view.md new file mode 100644 index 0000000000..79f47dcabc --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/get-file-view.md @@ -0,0 +1,7 @@ +GET /v1/storage/buckets/{bucketId}/files/{fileId}/view HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/storage/get-file.md b/docs/examples/1.8.x/server-rest/examples/storage/get-file.md new file mode 100644 index 0000000000..4a479a78fc --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/get-file.md @@ -0,0 +1,7 @@ +GET /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/storage/list-buckets.md b/docs/examples/1.8.x/server-rest/examples/storage/list-buckets.md new file mode 100644 index 0000000000..bd61c61082 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/list-buckets.md @@ -0,0 +1,5 @@ +GET /v1/storage/buckets HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/storage/list-files.md b/docs/examples/1.8.x/server-rest/examples/storage/list-files.md new file mode 100644 index 0000000000..b040ad3a65 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/list-files.md @@ -0,0 +1,7 @@ +GET /v1/storage/buckets/{bucketId}/files HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/storage/update-bucket.md b/docs/examples/1.8.x/server-rest/examples/storage/update-bucket.md new file mode 100644 index 0000000000..0f966da0b5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/update-bucket.md @@ -0,0 +1,18 @@ +PUT /v1/storage/buckets/{bucketId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "fileSecurity": false, + "enabled": false, + "maximumFileSize": 1, + "allowedFileExtensions": [], + "compression": "none", + "encryption": false, + "antivirus": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/storage/update-file.md b/docs/examples/1.8.x/server-rest/examples/storage/update-file.md new file mode 100644 index 0000000000..1b0137a7de --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/storage/update-file.md @@ -0,0 +1,13 @@ +PUT /v1/storage/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "name": "<NAME>", + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..7e7fdbeb92 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,13 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/boolean HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": false, + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..c6fa72a1b1 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,13 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/datetime HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": "", + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..e65b46d1b7 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-email-column.md @@ -0,0 +1,13 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": "email@example.com", + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..edcdd402f4 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-enum-column.md @@ -0,0 +1,14 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/enum HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "elements": [], + "required": false, + "default": "<DEFAULT>", + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..14c0e61370 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-float-column.md @@ -0,0 +1,15 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/float HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "min": 0, + "max": 0, + "default": 0, + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-index.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..63e8daa511 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-index.md @@ -0,0 +1,14 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "type": "key", + "columns": [], + "orders": [], + "lengths": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..2c0bef6b86 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-integer-column.md @@ -0,0 +1,15 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/integer HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "min": 0, + "max": 0, + "default": 0, + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..d7b8c1f5ae --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-ip-column.md @@ -0,0 +1,13 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/ip HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": "", + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..7d70d59900 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-line-column.md @@ -0,0 +1,12 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/line HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": [[1, 2], [3, 4], [5, 6]] +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..5a99e7ba5e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-point-column.md @@ -0,0 +1,12 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/point HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": [1, 2] +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..64495e9424 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,12 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/polygon HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": [[[1, 2], [3, 4], [5, 6], [1, 2]]] +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..3032dc051d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,15 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/relationship HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "relatedTableId": "<RELATED_TABLE_ID>", + "type": "oneToOne", + "twoWay": false, + "key": "", + "twoWayKey": "", + "onDelete": "cascade" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-row.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..3c42d0f172 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-row.md @@ -0,0 +1,20 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "rowId": "<ROW_ID>", + "data": { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..176b4cdb02 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-rows.md @@ -0,0 +1,12 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "rows": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..919ad6a2e0 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-string-column.md @@ -0,0 +1,15 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/string HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "size": 1, + "required": false, + "default": "<DEFAULT>", + "array": false, + "encrypt": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-table.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..1625e8441b --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-table.md @@ -0,0 +1,14 @@ +POST /v1/tablesdb/{databaseId}/tables HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "tableId": "<TABLE_ID>", + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "rowSecurity": false, + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..f5627e22cb --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create-url-column.md @@ -0,0 +1,13 @@ +POST /v1/tablesdb/{databaseId}/tables/{tableId}/columns/url HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "key": "", + "required": false, + "default": "https://example.com", + "array": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/create.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/create.md new file mode 100644 index 0000000000..69789b081f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/create.md @@ -0,0 +1,12 @@ +POST /v1/tablesdb HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "databaseId": "<DATABASE_ID>", + "name": "<NAME>", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..26d8e1118c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,13 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "value": 0, + "min": 0 +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..3b919093b1 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-column.md @@ -0,0 +1,7 @@ +DELETE /v1/tablesdb/{databaseId}/tables/{tableId}/columns/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..bc86671c3f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-index.md @@ -0,0 +1,7 @@ +DELETE /v1/tablesdb/{databaseId}/tables/{tableId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..3dbbf45a3c --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-row.md @@ -0,0 +1,9 @@ +DELETE /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..c57d62ede3 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-rows.md @@ -0,0 +1,10 @@ +DELETE /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "queries": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..63eb1fd227 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete-table.md @@ -0,0 +1,7 @@ +DELETE /v1/tablesdb/{databaseId}/tables/{tableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/delete.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete.md new file mode 100644 index 0000000000..bcd4c02663 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/delete.md @@ -0,0 +1,7 @@ +DELETE /v1/tablesdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/get-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..92783ce733 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/get-column.md @@ -0,0 +1,5 @@ +GET /v1/tablesdb/{databaseId}/tables/{tableId}/columns/{key} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/get-index.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..0aeaed382d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/get-index.md @@ -0,0 +1,5 @@ +GET /v1/tablesdb/{databaseId}/tables/{tableId}/indexes/{key} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/get-row.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..9146d3653d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/get-row.md @@ -0,0 +1,7 @@ +GET /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/get-table.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..b8c0668b4e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/get-table.md @@ -0,0 +1,5 @@ +GET /v1/tablesdb/{databaseId}/tables/{tableId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/get.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/get.md new file mode 100644 index 0000000000..32ee29126a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/get.md @@ -0,0 +1,5 @@ +GET /v1/tablesdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..d687727806 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/increment-row-column.md @@ -0,0 +1,13 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "value": 0, + "max": 0 +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..ac81b3a157 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/list-columns.md @@ -0,0 +1,5 @@ +GET /v1/tablesdb/{databaseId}/tables/{tableId}/columns HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..5847bed650 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/list-indexes.md @@ -0,0 +1,5 @@ +GET /v1/tablesdb/{databaseId}/tables/{tableId}/indexes HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..dcff60e31e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/list-rows.md @@ -0,0 +1,7 @@ +GET /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..79ee0f6df8 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/list-tables.md @@ -0,0 +1,5 @@ +GET /v1/tablesdb/{databaseId}/tables HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/list.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/list.md new file mode 100644 index 0000000000..95cb1bac8d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/list.md @@ -0,0 +1,5 @@ +GET /v1/tablesdb HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..a06d826ac1 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,12 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": false, + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..0feea207c1 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,12 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": "", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..9955db12bc --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-email-column.md @@ -0,0 +1,12 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": "email@example.com", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..346d320024 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-enum-column.md @@ -0,0 +1,13 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "elements": [], + "required": false, + "default": "<DEFAULT>", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..9dc14f3d0f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-float-column.md @@ -0,0 +1,14 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "min": 0, + "max": 0, + "default": 0, + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..763c74fda6 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-integer-column.md @@ -0,0 +1,14 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "min": 0, + "max": 0, + "default": 0, + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..3336cfd7f5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-ip-column.md @@ -0,0 +1,12 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": "", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..97370a5f1f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-line-column.md @@ -0,0 +1,12 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": [[1, 2], [3, 4], [5, 6]], + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..7687f7eb67 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-point-column.md @@ -0,0 +1,12 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": [1, 2], + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..ace2b57e0d --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,12 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": [[[1, 2], [3, 4], [5, 6], [1, 2]]], + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..04af7914cb --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,11 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "onDelete": "cascade", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-row.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..51f10f7f97 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-row.md @@ -0,0 +1,13 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "data": {}, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..2f282d8e13 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-rows.md @@ -0,0 +1,11 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "data": {}, + "queries": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..a9345aabed --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-string-column.md @@ -0,0 +1,13 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": "<DEFAULT>", + "size": 1, + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-table.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..e223b0c4ca --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-table.md @@ -0,0 +1,13 @@ +PUT /v1/tablesdb/{databaseId}/tables/{tableId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "permissions": ["read(\"any\")"], + "rowSecurity": false, + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..7a7149fafa --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update-url-column.md @@ -0,0 +1,12 @@ +PATCH /v1/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "required": false, + "default": "https://example.com", + "newKey": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/update.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/update.md new file mode 100644 index 0000000000..843387c9da --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/update.md @@ -0,0 +1,11 @@ +PUT /v1/tablesdb/{databaseId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>", + "enabled": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..edb74043fb --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/upsert-row.md @@ -0,0 +1,13 @@ +PUT /v1/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "data": {}, + "permissions": ["read(\"any\")"] +} diff --git a/docs/examples/1.8.x/server-rest/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-rest/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..147e4f66c3 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tablesdb/upsert-rows.md @@ -0,0 +1,10 @@ +PUT /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "rows": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/teams/create-membership.md b/docs/examples/1.8.x/server-rest/examples/teams/create-membership.md new file mode 100644 index 0000000000..773208cb45 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/create-membership.md @@ -0,0 +1,17 @@ +POST /v1/teams/{teamId}/memberships HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "email": "email@example.com", + "userId": "<USER_ID>", + "phone": "+12065550100", + "roles": [], + "url": "https://example.com", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/teams/create.md b/docs/examples/1.8.x/server-rest/examples/teams/create.md new file mode 100644 index 0000000000..2e1881b5ff --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/create.md @@ -0,0 +1,14 @@ +POST /v1/teams HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "teamId": "<TEAM_ID>", + "name": "<NAME>", + "roles": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/teams/delete-membership.md b/docs/examples/1.8.x/server-rest/examples/teams/delete-membership.md new file mode 100644 index 0000000000..454a3f6f4a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/delete-membership.md @@ -0,0 +1,9 @@ +DELETE /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/teams/delete.md b/docs/examples/1.8.x/server-rest/examples/teams/delete.md new file mode 100644 index 0000000000..1bdf2a89ac --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/delete.md @@ -0,0 +1,9 @@ +DELETE /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + diff --git a/docs/examples/1.8.x/server-rest/examples/teams/get-membership.md b/docs/examples/1.8.x/server-rest/examples/teams/get-membership.md new file mode 100644 index 0000000000..8a90498292 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/get-membership.md @@ -0,0 +1,7 @@ +GET /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/teams/get-prefs.md b/docs/examples/1.8.x/server-rest/examples/teams/get-prefs.md new file mode 100644 index 0000000000..e541fd3fd8 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/get-prefs.md @@ -0,0 +1,6 @@ +GET /v1/teams/{teamId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/teams/get.md b/docs/examples/1.8.x/server-rest/examples/teams/get.md new file mode 100644 index 0000000000..491e04dc55 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/get.md @@ -0,0 +1,7 @@ +GET /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/teams/list-memberships.md b/docs/examples/1.8.x/server-rest/examples/teams/list-memberships.md new file mode 100644 index 0000000000..9b0fa00492 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/list-memberships.md @@ -0,0 +1,7 @@ +GET /v1/teams/{teamId}/memberships HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/teams/list.md b/docs/examples/1.8.x/server-rest/examples/teams/list.md new file mode 100644 index 0000000000..95b6178e31 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/list.md @@ -0,0 +1,7 @@ +GET /v1/teams HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> diff --git a/docs/examples/1.8.x/server-rest/examples/teams/update-membership-status.md b/docs/examples/1.8.x/server-rest/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..da2c9189cd --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/update-membership-status.md @@ -0,0 +1,12 @@ +PATCH /v1/teams/{teamId}/memberships/{membershipId}/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "userId": "<USER_ID>", + "secret": "<SECRET>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/teams/update-membership.md b/docs/examples/1.8.x/server-rest/examples/teams/update-membership.md new file mode 100644 index 0000000000..a5b8c28723 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/update-membership.md @@ -0,0 +1,12 @@ +PATCH /v1/teams/{teamId}/memberships/{membershipId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "roles": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/teams/update-name.md b/docs/examples/1.8.x/server-rest/examples/teams/update-name.md new file mode 100644 index 0000000000..1d32b77d39 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/update-name.md @@ -0,0 +1,12 @@ +PUT /v1/teams/{teamId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-Key: <YOUR_API_KEY> +X-Appwrite-JWT: <YOUR_JWT> + +{ + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/teams/update-prefs.md b/docs/examples/1.8.x/server-rest/examples/teams/update-prefs.md new file mode 100644 index 0000000000..e17dcdb260 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/teams/update-prefs.md @@ -0,0 +1,11 @@ +PUT /v1/teams/{teamId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Session: +X-Appwrite-JWT: <YOUR_JWT> + +{ + "prefs": {} +} diff --git a/docs/examples/1.8.x/server-rest/examples/tokens/create-file-token.md b/docs/examples/1.8.x/server-rest/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..712e843fbf --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tokens/create-file-token.md @@ -0,0 +1,10 @@ +POST /v1/tokens/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "expire": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/tokens/delete.md b/docs/examples/1.8.x/server-rest/examples/tokens/delete.md new file mode 100644 index 0000000000..a955b4aef5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tokens/delete.md @@ -0,0 +1,7 @@ +DELETE /v1/tokens/{tokenId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/tokens/get.md b/docs/examples/1.8.x/server-rest/examples/tokens/get.md new file mode 100644 index 0000000000..381945f58f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tokens/get.md @@ -0,0 +1,5 @@ +GET /v1/tokens/{tokenId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/tokens/list.md b/docs/examples/1.8.x/server-rest/examples/tokens/list.md new file mode 100644 index 0000000000..3b0782a81a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tokens/list.md @@ -0,0 +1,5 @@ +GET /v1/tokens/buckets/{bucketId}/files/{fileId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/tokens/update.md b/docs/examples/1.8.x/server-rest/examples/tokens/update.md new file mode 100644 index 0000000000..a98ed5ef0b --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/tokens/update.md @@ -0,0 +1,10 @@ +PATCH /v1/tokens/{tokenId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "expire": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/server-rest/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..4985ecefd0 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-argon-2-user.md @@ -0,0 +1,13 @@ +POST /v1/users/argon2 HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-rest/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..eaf1628252 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-bcrypt-user.md @@ -0,0 +1,13 @@ +POST /v1/users/bcrypt HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-jwt.md b/docs/examples/1.8.x/server-rest/examples/users/create-jwt.md new file mode 100644 index 0000000000..8342089042 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-jwt.md @@ -0,0 +1,11 @@ +POST /v1/users/{userId}/jwts HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "sessionId": "<SESSION_ID>", + "duration": 0 +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-md-5-user.md b/docs/examples/1.8.x/server-rest/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..6e82969f00 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-md-5-user.md @@ -0,0 +1,13 @@ +POST /v1/users/md5 HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-rest/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..bef314b585 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +PATCH /v1/users/{userId}/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-rest/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..b75c9e23c5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-ph-pass-user.md @@ -0,0 +1,13 @@ +POST /v1/users/phpass HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-rest/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..9fb5f8de0f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,16 @@ +POST /v1/users/scrypt-modified HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "passwordSalt": "<PASSWORD_SALT>", + "passwordSaltSeparator": "<PASSWORD_SALT_SEPARATOR>", + "passwordSignerKey": "<PASSWORD_SIGNER_KEY>", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/server-rest/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..ee8828f294 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-scrypt-user.md @@ -0,0 +1,18 @@ +POST /v1/users/scrypt HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "passwordSalt": "<PASSWORD_SALT>", + "passwordCpu": 0, + "passwordMemory": 0, + "passwordParallel": 0, + "passwordLength": 0, + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-session.md b/docs/examples/1.8.x/server-rest/examples/users/create-session.md new file mode 100644 index 0000000000..955e253d39 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-session.md @@ -0,0 +1,7 @@ +POST /v1/users/{userId}/sessions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-sha-user.md b/docs/examples/1.8.x/server-rest/examples/users/create-sha-user.md new file mode 100644 index 0000000000..7757b44500 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-sha-user.md @@ -0,0 +1,14 @@ +POST /v1/users/sha HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "password": "password", + "passwordVersion": "sha1", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-target.md b/docs/examples/1.8.x/server-rest/examples/users/create-target.md new file mode 100644 index 0000000000..08147220b2 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-target.md @@ -0,0 +1,14 @@ +POST /v1/users/{userId}/targets HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "targetId": "<TARGET_ID>", + "providerType": "email", + "identifier": "<IDENTIFIER>", + "providerId": "<PROVIDER_ID>", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/create-token.md b/docs/examples/1.8.x/server-rest/examples/users/create-token.md new file mode 100644 index 0000000000..2d3b58435a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create-token.md @@ -0,0 +1,11 @@ +POST /v1/users/{userId}/tokens HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "length": 4, + "expire": 60 +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/create.md b/docs/examples/1.8.x/server-rest/examples/users/create.md new file mode 100644 index 0000000000..d27b436580 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/create.md @@ -0,0 +1,14 @@ +POST /v1/users HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "userId": "<USER_ID>", + "email": "email@example.com", + "phone": "+12065550100", + "password": "", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/delete-identity.md b/docs/examples/1.8.x/server-rest/examples/users/delete-identity.md new file mode 100644 index 0000000000..a9b2cd04f6 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/delete-identity.md @@ -0,0 +1,7 @@ +DELETE /v1/users/identities/{identityId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-rest/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..92d51fefb5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,7 @@ +DELETE /v1/users/{userId}/mfa/authenticators/{type} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/users/delete-session.md b/docs/examples/1.8.x/server-rest/examples/users/delete-session.md new file mode 100644 index 0000000000..1ae56081ab --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/delete-session.md @@ -0,0 +1,7 @@ +DELETE /v1/users/{userId}/sessions/{sessionId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/users/delete-sessions.md b/docs/examples/1.8.x/server-rest/examples/users/delete-sessions.md new file mode 100644 index 0000000000..f620f1addc --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/delete-sessions.md @@ -0,0 +1,7 @@ +DELETE /v1/users/{userId}/sessions HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/users/delete-target.md b/docs/examples/1.8.x/server-rest/examples/users/delete-target.md new file mode 100644 index 0000000000..4ea75b979b --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/delete-target.md @@ -0,0 +1,7 @@ +DELETE /v1/users/{userId}/targets/{targetId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/users/delete.md b/docs/examples/1.8.x/server-rest/examples/users/delete.md new file mode 100644 index 0000000000..be2533f442 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/delete.md @@ -0,0 +1,7 @@ +DELETE /v1/users/{userId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-rest/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..1f561f02ad --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,5 @@ +GET /v1/users/{userId}/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/users/get-prefs.md b/docs/examples/1.8.x/server-rest/examples/users/get-prefs.md new file mode 100644 index 0000000000..4d55589a73 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/get-prefs.md @@ -0,0 +1,5 @@ +GET /v1/users/{userId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/users/get-target.md b/docs/examples/1.8.x/server-rest/examples/users/get-target.md new file mode 100644 index 0000000000..3613d7acb6 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/get-target.md @@ -0,0 +1,5 @@ +GET /v1/users/{userId}/targets/{targetId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/users/get.md b/docs/examples/1.8.x/server-rest/examples/users/get.md new file mode 100644 index 0000000000..53357720cf --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/get.md @@ -0,0 +1,5 @@ +GET /v1/users/{userId} HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/users/list-identities.md b/docs/examples/1.8.x/server-rest/examples/users/list-identities.md new file mode 100644 index 0000000000..40eed8beec --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/list-identities.md @@ -0,0 +1,5 @@ +GET /v1/users/identities HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/users/list-logs.md b/docs/examples/1.8.x/server-rest/examples/users/list-logs.md new file mode 100644 index 0000000000..526615b80f --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/list-logs.md @@ -0,0 +1,5 @@ +GET /v1/users/{userId}/logs HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/users/list-memberships.md b/docs/examples/1.8.x/server-rest/examples/users/list-memberships.md new file mode 100644 index 0000000000..24de2cdc59 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/list-memberships.md @@ -0,0 +1,5 @@ +GET /v1/users/{userId}/memberships HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/server-rest/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..eb2d3691de --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/list-mfa-factors.md @@ -0,0 +1,5 @@ +GET /v1/users/{userId}/mfa/factors HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/users/list-sessions.md b/docs/examples/1.8.x/server-rest/examples/users/list-sessions.md new file mode 100644 index 0000000000..33efecd536 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/list-sessions.md @@ -0,0 +1,5 @@ +GET /v1/users/{userId}/sessions HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/users/list-targets.md b/docs/examples/1.8.x/server-rest/examples/users/list-targets.md new file mode 100644 index 0000000000..229559c958 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/list-targets.md @@ -0,0 +1,5 @@ +GET /v1/users/{userId}/targets HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/users/list.md b/docs/examples/1.8.x/server-rest/examples/users/list.md new file mode 100644 index 0000000000..2938255449 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/list.md @@ -0,0 +1,5 @@ +GET /v1/users HTTP/1.1 +Host: cloud.appwrite.io +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-email-verification.md b/docs/examples/1.8.x/server-rest/examples/users/update-email-verification.md new file mode 100644 index 0000000000..1db5556964 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-email-verification.md @@ -0,0 +1,10 @@ +PATCH /v1/users/{userId}/verification HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "emailVerification": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-email.md b/docs/examples/1.8.x/server-rest/examples/users/update-email.md new file mode 100644 index 0000000000..48d871d8d4 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-email.md @@ -0,0 +1,10 @@ +PATCH /v1/users/{userId}/email HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "email": "email@example.com" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-labels.md b/docs/examples/1.8.x/server-rest/examples/users/update-labels.md new file mode 100644 index 0000000000..d6acca5c7a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-labels.md @@ -0,0 +1,10 @@ +PUT /v1/users/{userId}/labels HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "labels": [] +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-rest/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..91e657aec7 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,7 @@ +PUT /v1/users/{userId}/mfa/recovery-codes HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-mfa.md b/docs/examples/1.8.x/server-rest/examples/users/update-mfa.md new file mode 100644 index 0000000000..8a5d1f5052 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-mfa.md @@ -0,0 +1,10 @@ +PATCH /v1/users/{userId}/mfa HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "mfa": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-name.md b/docs/examples/1.8.x/server-rest/examples/users/update-name.md new file mode 100644 index 0000000000..ae1472387a --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-name.md @@ -0,0 +1,10 @@ +PATCH /v1/users/{userId}/name HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-password.md b/docs/examples/1.8.x/server-rest/examples/users/update-password.md new file mode 100644 index 0000000000..6f689670e5 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-password.md @@ -0,0 +1,10 @@ +PATCH /v1/users/{userId}/password HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "password": "" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-phone-verification.md b/docs/examples/1.8.x/server-rest/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..837874a1e2 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-phone-verification.md @@ -0,0 +1,10 @@ +PATCH /v1/users/{userId}/verification/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "phoneVerification": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-phone.md b/docs/examples/1.8.x/server-rest/examples/users/update-phone.md new file mode 100644 index 0000000000..a36f0cc656 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-phone.md @@ -0,0 +1,10 @@ +PATCH /v1/users/{userId}/phone HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "number": "+12065550100" +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-prefs.md b/docs/examples/1.8.x/server-rest/examples/users/update-prefs.md new file mode 100644 index 0000000000..5de942c081 --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-prefs.md @@ -0,0 +1,10 @@ +PATCH /v1/users/{userId}/prefs HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "prefs": {} +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-status.md b/docs/examples/1.8.x/server-rest/examples/users/update-status.md new file mode 100644 index 0000000000..95e29fb66e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-status.md @@ -0,0 +1,10 @@ +PATCH /v1/users/{userId}/status HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "status": false +} diff --git a/docs/examples/1.8.x/server-rest/examples/users/update-target.md b/docs/examples/1.8.x/server-rest/examples/users/update-target.md new file mode 100644 index 0000000000..c5f92f342e --- /dev/null +++ b/docs/examples/1.8.x/server-rest/examples/users/update-target.md @@ -0,0 +1,12 @@ +PATCH /v1/users/{userId}/targets/{targetId} HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.8.0 +X-Appwrite-Project: <YOUR_PROJECT_ID> +X-Appwrite-Key: <YOUR_API_KEY> + +{ + "identifier": "<IDENTIFIER>", + "providerId": "<PROVIDER_ID>", + "name": "<NAME>" +} diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/server-ruby/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..bcb25d66f5 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-anonymous-session.md @@ -0,0 +1,11 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.create_anonymous_session() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-email-password-session.md b/docs/examples/1.8.x/server-ruby/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..be5fc1c07a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-email-password-session.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.create_email_password_session( + email: 'email@example.com', + password: 'password' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-email-token.md b/docs/examples/1.8.x/server-ruby/examples/account/create-email-token.md new file mode 100644 index 0000000000..d75e310a36 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-email-token.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.create_email_token( + user_id: '<USER_ID>', + email: 'email@example.com', + phrase: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-jwt.md b/docs/examples/1.8.x/server-ruby/examples/account/create-jwt.md new file mode 100644 index 0000000000..8e5b6b78c8 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-jwt.md @@ -0,0 +1,11 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.create_jwt() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/server-ruby/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..9537d1fb3d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-magic-url-token.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.create_magic_url_token( + user_id: '<USER_ID>', + email: 'email@example.com', + url: 'https://example.com', # optional + phrase: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-ruby/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..a3cc71cd8a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-mfa-authenticator.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_mfa_authenticator( + type: AuthenticatorType::TOTP +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-ruby/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..ba34779ad2 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-mfa-challenge.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.create_mfa_challenge( + factor: AuthenticationFactor::EMAIL +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-ruby/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..db91cf533d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_mfa_recovery_codes() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-ruby/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..52bc5d6194 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-o-auth-2-token.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.create_o_auth2_token( + provider: OAuthProvider::AMAZON, + success: 'https://example.com', # optional + failure: 'https://example.com', # optional + scopes: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-phone-token.md b/docs/examples/1.8.x/server-ruby/examples/account/create-phone-token.md new file mode 100644 index 0000000000..81bedd0ce9 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-phone-token.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.create_phone_token( + user_id: '<USER_ID>', + phone: '+12065550100' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-phone-verification.md b/docs/examples/1.8.x/server-ruby/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..a7dec8f34e --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-phone-verification.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_phone_verification() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-recovery.md b/docs/examples/1.8.x/server-ruby/examples/account/create-recovery.md new file mode 100644 index 0000000000..e344bafc75 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-recovery.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_recovery( + email: 'email@example.com', + url: 'https://example.com' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-session.md b/docs/examples/1.8.x/server-ruby/examples/account/create-session.md new file mode 100644 index 0000000000..4b8ce216bc --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-session.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.create_session( + user_id: '<USER_ID>', + secret: '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create-verification.md b/docs/examples/1.8.x/server-ruby/examples/account/create-verification.md new file mode 100644 index 0000000000..2eba7c776d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create-verification.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.create_verification( + url: 'https://example.com' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/create.md b/docs/examples/1.8.x/server-ruby/examples/account/create.md new file mode 100644 index 0000000000..84228b8351 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/create.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.create( + user_id: '<USER_ID>', + email: 'email@example.com', + password: '', + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/delete-identity.md b/docs/examples/1.8.x/server-ruby/examples/account/delete-identity.md new file mode 100644 index 0000000000..e8f8e83814 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/delete-identity.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.delete_identity( + identity_id: '<IDENTITY_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-ruby/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..832ff6ae13 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.delete_mfa_authenticator( + type: AuthenticatorType::TOTP +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/delete-session.md b/docs/examples/1.8.x/server-ruby/examples/account/delete-session.md new file mode 100644 index 0000000000..7496cafe3a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/delete-session.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.delete_session( + session_id: '<SESSION_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/delete-sessions.md b/docs/examples/1.8.x/server-ruby/examples/account/delete-sessions.md new file mode 100644 index 0000000000..ca5d922483 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/delete-sessions.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.delete_sessions() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-ruby/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..26ffa9d61d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.get_mfa_recovery_codes() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/get-prefs.md b/docs/examples/1.8.x/server-ruby/examples/account/get-prefs.md new file mode 100644 index 0000000000..664454cf2f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/get-prefs.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.get_prefs() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/get-session.md b/docs/examples/1.8.x/server-ruby/examples/account/get-session.md new file mode 100644 index 0000000000..c433b22e46 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/get-session.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.get_session( + session_id: '<SESSION_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/get.md b/docs/examples/1.8.x/server-ruby/examples/account/get.md new file mode 100644 index 0000000000..f33050345d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/get.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.get() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/list-identities.md b/docs/examples/1.8.x/server-ruby/examples/account/list-identities.md new file mode 100644 index 0000000000..696e02dd5a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/list-identities.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.list_identities( + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/list-logs.md b/docs/examples/1.8.x/server-ruby/examples/account/list-logs.md new file mode 100644 index 0000000000..1f3366a2ed --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/list-logs.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.list_logs( + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/server-ruby/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..460ac87ac1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/list-mfa-factors.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.list_mfa_factors() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/list-sessions.md b/docs/examples/1.8.x/server-ruby/examples/account/list-sessions.md new file mode 100644 index 0000000000..b5968c498f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/list-sessions.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.list_sessions() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-email.md b/docs/examples/1.8.x/server-ruby/examples/account/update-email.md new file mode 100644 index 0000000000..24b43edebd --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-email.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_email( + email: 'email@example.com', + password: 'password' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/server-ruby/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..c96820f183 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-magic-url-session.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.update_magic_url_session( + user_id: '<USER_ID>', + secret: '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-ruby/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..5ff2adcbdc --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-mfa-authenticator.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_mfa_authenticator( + type: AuthenticatorType::TOTP, + otp: '<OTP>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-ruby/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..2f4b61d581 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-mfa-challenge.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_mfa_challenge( + challenge_id: '<CHALLENGE_ID>', + otp: '<OTP>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-ruby/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..ad1f2e5f0e --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_mfa_recovery_codes() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-mfa.md b/docs/examples/1.8.x/server-ruby/examples/account/update-mfa.md new file mode 100644 index 0000000000..b1b50f32fd --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-mfa.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_mfa( + mfa: false +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-name.md b/docs/examples/1.8.x/server-ruby/examples/account/update-name.md new file mode 100644 index 0000000000..ef8a5cbb4f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-name.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_name( + name: '<NAME>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-password.md b/docs/examples/1.8.x/server-ruby/examples/account/update-password.md new file mode 100644 index 0000000000..4b8705359b --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-password.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_password( + password: '', + old_password: 'password' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-phone-session.md b/docs/examples/1.8.x/server-ruby/examples/account/update-phone-session.md new file mode 100644 index 0000000000..b81c485c8c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-phone-session.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + +account = Account.new(client) + +result = account.update_phone_session( + user_id: '<USER_ID>', + secret: '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-phone-verification.md b/docs/examples/1.8.x/server-ruby/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..8dcf316e49 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-phone-verification.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_phone_verification( + user_id: '<USER_ID>', + secret: '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-phone.md b/docs/examples/1.8.x/server-ruby/examples/account/update-phone.md new file mode 100644 index 0000000000..ea758a8d8d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-phone.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_phone( + phone: '+12065550100', + password: 'password' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-prefs.md b/docs/examples/1.8.x/server-ruby/examples/account/update-prefs.md new file mode 100644 index 0000000000..7e4311d9c6 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-prefs.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_prefs( + prefs: { + "language" => "en", + "timezone" => "UTC", + "darkTheme" => true + } +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-recovery.md b/docs/examples/1.8.x/server-ruby/examples/account/update-recovery.md new file mode 100644 index 0000000000..42c483771c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-recovery.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_recovery( + user_id: '<USER_ID>', + secret: '<SECRET>', + password: '' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-session.md b/docs/examples/1.8.x/server-ruby/examples/account/update-session.md new file mode 100644 index 0000000000..34e00eec25 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-session.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_session( + session_id: '<SESSION_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-status.md b/docs/examples/1.8.x/server-ruby/examples/account/update-status.md new file mode 100644 index 0000000000..5c543b790c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-status.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_status() diff --git a/docs/examples/1.8.x/server-ruby/examples/account/update-verification.md b/docs/examples/1.8.x/server-ruby/examples/account/update-verification.md new file mode 100644 index 0000000000..9866ade95c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/account/update-verification.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +account = Account.new(client) + +result = account.update_verification( + user_id: '<USER_ID>', + secret: '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/avatars/get-browser.md b/docs/examples/1.8.x/server-ruby/examples/avatars/get-browser.md new file mode 100644 index 0000000000..36354d1dce --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/avatars/get-browser.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_browser( + code: Browser::AVANT_BROWSER, + width: 0, # optional + height: 0, # optional + quality: -1 # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/server-ruby/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..09a0245034 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/avatars/get-credit-card.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_credit_card( + code: CreditCard::AMERICAN_EXPRESS, + width: 0, # optional + height: 0, # optional + quality: -1 # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/avatars/get-favicon.md b/docs/examples/1.8.x/server-ruby/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..7c8bd4347f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/avatars/get-favicon.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_favicon( + url: 'https://example.com' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/avatars/get-flag.md b/docs/examples/1.8.x/server-ruby/examples/avatars/get-flag.md new file mode 100644 index 0000000000..61b7793048 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/avatars/get-flag.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_flag( + code: Flag::AFGHANISTAN, + width: 0, # optional + height: 0, # optional + quality: -1 # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/avatars/get-image.md b/docs/examples/1.8.x/server-ruby/examples/avatars/get-image.md new file mode 100644 index 0000000000..f46fad0c44 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/avatars/get-image.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_image( + url: 'https://example.com', + width: 0, # optional + height: 0 # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/avatars/get-initials.md b/docs/examples/1.8.x/server-ruby/examples/avatars/get-initials.md new file mode 100644 index 0000000000..85e5a6a422 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/avatars/get-initials.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_initials( + name: '<NAME>', # optional + width: 0, # optional + height: 0, # optional + background: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/avatars/get-qr.md b/docs/examples/1.8.x/server-ruby/examples/avatars/get-qr.md new file mode 100644 index 0000000000..9c6e34686c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/avatars/get-qr.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_qr( + text: '<TEXT>', + size: 1, # optional + margin: 0, # optional + download: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..158ea05623 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-boolean-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_boolean_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: false, # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-collection.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-collection.md new file mode 100644 index 0000000000..c22b34813e --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-collection.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], # optional + document_security: false, # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..af12b7965b --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-datetime-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_datetime_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: '', # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-document.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-document.md new file mode 100644 index 0000000000..22ce5745fd --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-document.md @@ -0,0 +1,24 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.create_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: { + "username" => "walter.obrien", + "email" => "walter.obrien@example.com", + "fullName" => "Walter O'Brien", + "age" => 30, + "isAdmin" => false + }, + permissions: ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-documents.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-documents.md new file mode 100644 index 0000000000..16abc5e465 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-documents.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + documents: [] +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..7f36f6b076 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-email-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_email_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: 'email@example.com', # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..c8e390a1a9 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-enum-attribute.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_enum_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..fa77f89902 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-float-attribute.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_float_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + min: null, # optional + max: null, # optional + default: null, # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-index.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-index.md new file mode 100644 index 0000000000..18c2f0ee6a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-index.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + type: IndexType::KEY, + attributes: [], + orders: [], # optional + lengths: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..a689502136 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-integer-attribute.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_integer_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + min: null, # optional + max: null, # optional + default: null, # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..7abeee9403 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-ip-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_ip_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: '', # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..33bdab7cf8 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-line-attribute.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_line_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..f50a99ffea --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-point-attribute.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_point_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: [1, 2] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..d7930a5ffe --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-polygon-attribute.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_polygon_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..b056f3bbb2 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-relationship-attribute.md @@ -0,0 +1,22 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_relationship_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + related_collection_id: '<RELATED_COLLECTION_ID>', + type: RelationshipType::ONETOONE, + two_way: false, # optional + key: '', # optional + two_way_key: '', # optional + on_delete: RelationMutate::CASCADE # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..d94af0f22f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-string-attribute.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_string_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + size: 1, + required: false, + default: '<DEFAULT>', # optional + array: false, # optional + encrypt: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..3ffd7321a1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create-url-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_url_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: 'https://example.com', # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/create.md b/docs/examples/1.8.x/server-ruby/examples/databases/create.md new file mode 100644 index 0000000000..62675e6ba7 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/create.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.create( + database_id: '<DATABASE_ID>', + name: '<NAME>', + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..9fd0191a0f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.decrement_document_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + attribute: '', + value: null, # optional + min: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/delete-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..816b31e43f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/delete-attribute.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/delete-collection.md b/docs/examples/1.8.x/server-ruby/examples/databases/delete-collection.md new file mode 100644 index 0000000000..28dd8d773c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/delete-collection.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/delete-document.md b/docs/examples/1.8.x/server-ruby/examples/databases/delete-document.md new file mode 100644 index 0000000000..2102d2695b --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/delete-document.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.delete_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/delete-documents.md b/docs/examples/1.8.x/server-ruby/examples/databases/delete-documents.md new file mode 100644 index 0000000000..d0f10d0b41 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/delete-documents.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/delete-index.md b/docs/examples/1.8.x/server-ruby/examples/databases/delete-index.md new file mode 100644 index 0000000000..b5d9231508 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/delete-index.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/delete.md b/docs/examples/1.8.x/server-ruby/examples/databases/delete.md new file mode 100644 index 0000000000..802f5d6bd4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/delete.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete( + database_id: '<DATABASE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/get-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/get-attribute.md new file mode 100644 index 0000000000..1558de656a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/get-attribute.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.get_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/get-collection.md b/docs/examples/1.8.x/server-ruby/examples/databases/get-collection.md new file mode 100644 index 0000000000..89ae0e32ac --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/get-collection.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.get_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/get-document.md b/docs/examples/1.8.x/server-ruby/examples/databases/get-document.md new file mode 100644 index 0000000000..f43a1a2924 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/get-document.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.get_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/get-index.md b/docs/examples/1.8.x/server-ruby/examples/databases/get-index.md new file mode 100644 index 0000000000..cd5fca3d60 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/get-index.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.get_index( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/get.md b/docs/examples/1.8.x/server-ruby/examples/databases/get.md new file mode 100644 index 0000000000..c042cd7c4e --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/get.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.get( + database_id: '<DATABASE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..3e8bfe0b2a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.increment_document_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + attribute: '', + value: null, # optional + max: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/list-attributes.md b/docs/examples/1.8.x/server-ruby/examples/databases/list-attributes.md new file mode 100644 index 0000000000..f1ec0dedcd --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/list-attributes.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.list_attributes( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/list-collections.md b/docs/examples/1.8.x/server-ruby/examples/databases/list-collections.md new file mode 100644 index 0000000000..26f3d35552 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/list-collections.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.list_collections( + database_id: '<DATABASE_ID>', + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/list-documents.md b/docs/examples/1.8.x/server-ruby/examples/databases/list-documents.md new file mode 100644 index 0000000000..6617198d3f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/list-documents.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.list_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/list-indexes.md b/docs/examples/1.8.x/server-ruby/examples/databases/list-indexes.md new file mode 100644 index 0000000000..f98c62a444 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/list-indexes.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.list_indexes( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/list.md b/docs/examples/1.8.x/server-ruby/examples/databases/list.md new file mode 100644 index 0000000000..2e093f73b1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/list.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.list( + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..72f0eac088 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-boolean-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_boolean_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: false, + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-collection.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-collection.md new file mode 100644 index 0000000000..d42a651cbb --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-collection.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_collection( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + name: '<NAME>', + permissions: ["read("any")"], # optional + document_security: false, # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..b726283323 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-datetime-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_datetime_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: '', + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-document.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-document.md new file mode 100644 index 0000000000..485eb0485a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-document.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.update_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: {}, # optional + permissions: ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-documents.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-documents.md new file mode 100644 index 0000000000..2f6907294f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-documents.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + data: {}, # optional + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..3324e39860 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-email-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_email_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: 'email@example.com', + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..72a0515467 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-enum-attribute.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_enum_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..738e6de36a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-float-attribute.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_float_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: null, + min: null, # optional + max: null, # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..dece44544f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-integer-attribute.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_integer_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: null, + min: null, # optional + max: null, # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..deceb732e4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-ip-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_ip_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: '', + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..c6e6e46f95 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-line-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_line_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]], # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..ce0b42b739 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-point-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_point_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: [1, 2], # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..c159822998 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-polygon-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_polygon_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..679edb823e --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-relationship-attribute.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_relationship_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + on_delete: RelationMutate::CASCADE, # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..66f458e800 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-string-attribute.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_string_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: '<DEFAULT>', + size: 1, # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/server-ruby/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..cbf417b6bf --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update-url-attribute.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_url_attribute( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + key: '', + required: false, + default: 'https://example.com', + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/update.md b/docs/examples/1.8.x/server-ruby/examples/databases/update.md new file mode 100644 index 0000000000..e5c02a11f1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/update.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.update( + database_id: '<DATABASE_ID>', + name: '<NAME>', + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/upsert-document.md b/docs/examples/1.8.x/server-ruby/examples/databases/upsert-document.md new file mode 100644 index 0000000000..238081864f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/upsert-document.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.upsert_document( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + document_id: '<DOCUMENT_ID>', + data: {}, + permissions: ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/databases/upsert-documents.md b/docs/examples/1.8.x/server-ruby/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..30c42aa439 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/databases/upsert-documents.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +databases = Databases.new(client) + +result = databases.upsert_documents( + database_id: '<DATABASE_ID>', + collection_id: '<COLLECTION_ID>', + documents: [] +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/create-deployment.md b/docs/examples/1.8.x/server-ruby/examples/functions/create-deployment.md new file mode 100644 index 0000000000..0ff3db31e9 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/create-deployment.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create_deployment( + function_id: '<FUNCTION_ID>', + code: InputFile.from_path('dir/file.png'), + activate: false, + entrypoint: '<ENTRYPOINT>', # optional + commands: '<COMMANDS>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-ruby/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..cd432afc95 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create_duplicate_deployment( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>', + build_id: '<BUILD_ID>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/create-execution.md b/docs/examples/1.8.x/server-ruby/examples/functions/create-execution.md new file mode 100644 index 0000000000..666b995d77 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/create-execution.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +functions = Functions.new(client) + +result = functions.create_execution( + function_id: '<FUNCTION_ID>', + body: '<BODY>', # optional + async: false, # optional + path: '<PATH>', # optional + method: ExecutionMethod::GET, # optional + headers: {}, # optional + scheduled_at: '<SCHEDULED_AT>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/server-ruby/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..a447b6e9aa --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/create-template-deployment.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create_template_deployment( + function_id: '<FUNCTION_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + root_directory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/create-variable.md b/docs/examples/1.8.x/server-ruby/examples/functions/create-variable.md new file mode 100644 index 0000000000..3c957d45f8 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/create-variable.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create_variable( + function_id: '<FUNCTION_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-ruby/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..75bd3c49f5 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/create-vcs-deployment.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create_vcs_deployment( + function_id: '<FUNCTION_ID>', + type: VCSDeploymentType::BRANCH, + reference: '<REFERENCE>', + activate: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/create.md b/docs/examples/1.8.x/server-ruby/examples/functions/create.md new file mode 100644 index 0000000000..cad021b5f8 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/create.md @@ -0,0 +1,32 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.create( + function_id: '<FUNCTION_ID>', + name: '<NAME>', + runtime: ::NODE_14_5, + execute: ["any"], # optional + events: [], # optional + schedule: '', # optional + timeout: 1, # optional + enabled: false, # optional + logging: false, # optional + entrypoint: '<ENTRYPOINT>', # optional + commands: '<COMMANDS>', # optional + scopes: [], # optional + installation_id: '<INSTALLATION_ID>', # optional + provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch: '<PROVIDER_BRANCH>', # optional + provider_silent_mode: false, # optional + provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional + specification: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/delete-deployment.md b/docs/examples/1.8.x/server-ruby/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..192172cf9c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/delete-deployment.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.delete_deployment( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/delete-execution.md b/docs/examples/1.8.x/server-ruby/examples/functions/delete-execution.md new file mode 100644 index 0000000000..4172aade32 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/delete-execution.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.delete_execution( + function_id: '<FUNCTION_ID>', + execution_id: '<EXECUTION_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/delete-variable.md b/docs/examples/1.8.x/server-ruby/examples/functions/delete-variable.md new file mode 100644 index 0000000000..ffbe69f106 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/delete-variable.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.delete_variable( + function_id: '<FUNCTION_ID>', + variable_id: '<VARIABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/delete.md b/docs/examples/1.8.x/server-ruby/examples/functions/delete.md new file mode 100644 index 0000000000..e5c59e39c0 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/delete.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.delete( + function_id: '<FUNCTION_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/server-ruby/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..a1a50a5f94 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/get-deployment-download.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.get_deployment_download( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType::SOURCE # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/get-deployment.md b/docs/examples/1.8.x/server-ruby/examples/functions/get-deployment.md new file mode 100644 index 0000000000..1651ae1285 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/get-deployment.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.get_deployment( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/get-execution.md b/docs/examples/1.8.x/server-ruby/examples/functions/get-execution.md new file mode 100644 index 0000000000..7ab910e785 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/get-execution.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +functions = Functions.new(client) + +result = functions.get_execution( + function_id: '<FUNCTION_ID>', + execution_id: '<EXECUTION_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/get-variable.md b/docs/examples/1.8.x/server-ruby/examples/functions/get-variable.md new file mode 100644 index 0000000000..5022cf84d6 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/get-variable.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.get_variable( + function_id: '<FUNCTION_ID>', + variable_id: '<VARIABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/get.md b/docs/examples/1.8.x/server-ruby/examples/functions/get.md new file mode 100644 index 0000000000..5cfd135028 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/get.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.get( + function_id: '<FUNCTION_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/list-deployments.md b/docs/examples/1.8.x/server-ruby/examples/functions/list-deployments.md new file mode 100644 index 0000000000..3df3dd3ee8 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/list-deployments.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.list_deployments( + function_id: '<FUNCTION_ID>', + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/list-executions.md b/docs/examples/1.8.x/server-ruby/examples/functions/list-executions.md new file mode 100644 index 0000000000..57b4ba26bc --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/list-executions.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +functions = Functions.new(client) + +result = functions.list_executions( + function_id: '<FUNCTION_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/list-runtimes.md b/docs/examples/1.8.x/server-ruby/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..1b6d25ee6d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/list-runtimes.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.list_runtimes() diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/list-specifications.md b/docs/examples/1.8.x/server-ruby/examples/functions/list-specifications.md new file mode 100644 index 0000000000..2c9cf7c470 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/list-specifications.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.list_specifications() diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/list-variables.md b/docs/examples/1.8.x/server-ruby/examples/functions/list-variables.md new file mode 100644 index 0000000000..dd3fc4f2ae --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/list-variables.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.list_variables( + function_id: '<FUNCTION_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/list.md b/docs/examples/1.8.x/server-ruby/examples/functions/list.md new file mode 100644 index 0000000000..0cab1c34d7 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/list.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.list( + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/server-ruby/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..6664e05079 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/update-deployment-status.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.update_deployment_status( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/server-ruby/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..68c5d7fdfd --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/update-function-deployment.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.update_function_deployment( + function_id: '<FUNCTION_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/update-variable.md b/docs/examples/1.8.x/server-ruby/examples/functions/update-variable.md new file mode 100644 index 0000000000..7c4e402820 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/update-variable.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.update_variable( + function_id: '<FUNCTION_ID>', + variable_id: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', # optional + secret: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/functions/update.md b/docs/examples/1.8.x/server-ruby/examples/functions/update.md new file mode 100644 index 0000000000..45b6e32ab3 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/functions/update.md @@ -0,0 +1,31 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +functions = Functions.new(client) + +result = functions.update( + function_id: '<FUNCTION_ID>', + name: '<NAME>', + runtime: ::NODE_14_5, # optional + execute: ["any"], # optional + events: [], # optional + schedule: '', # optional + timeout: 1, # optional + enabled: false, # optional + logging: false, # optional + entrypoint: '<ENTRYPOINT>', # optional + commands: '<COMMANDS>', # optional + scopes: [], # optional + installation_id: '<INSTALLATION_ID>', # optional + provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch: '<PROVIDER_BRANCH>', # optional + provider_silent_mode: false, # optional + provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional + specification: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/graphql/mutation.md b/docs/examples/1.8.x/server-ruby/examples/graphql/mutation.md new file mode 100644 index 0000000000..08ca6f30d2 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/graphql/mutation.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +graphql = Graphql.new(client) + +result = graphql.mutation( + query: {} +) diff --git a/docs/examples/1.8.x/server-ruby/examples/graphql/query.md b/docs/examples/1.8.x/server-ruby/examples/graphql/query.md new file mode 100644 index 0000000000..05e69506a1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/graphql/query.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +graphql = Graphql.new(client) + +result = graphql.query( + query: {} +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-antivirus.md b/docs/examples/1.8.x/server-ruby/examples/health/get-antivirus.md new file mode 100644 index 0000000000..5f8d06056d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-antivirus.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_antivirus() diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-cache.md b/docs/examples/1.8.x/server-ruby/examples/health/get-cache.md new file mode 100644 index 0000000000..01bd46cd0b --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-cache.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_cache() diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-certificate.md b/docs/examples/1.8.x/server-ruby/examples/health/get-certificate.md new file mode 100644 index 0000000000..64699d42d0 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-certificate.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_certificate( + domain: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-db.md b/docs/examples/1.8.x/server-ruby/examples/health/get-db.md new file mode 100644 index 0000000000..d9668339c5 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-db.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_db() diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/server-ruby/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..73e1983e3a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-failed-jobs.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_failed_jobs( + name: ::V1_DATABASE, + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-pub-sub.md b/docs/examples/1.8.x/server-ruby/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..86e9c409ed --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-pub-sub.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_pub_sub() diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-builds.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..9f876982ef --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-builds.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_builds( + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..d10c2feb39 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-certificates.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_certificates( + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-databases.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..37024d8144 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-databases.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_databases( + name: '<NAME>', # optional + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..2508be22ba --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-deletes.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_deletes( + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-functions.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..e5b56474bc --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-functions.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_functions( + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-logs.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..cb35ac333b --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-logs.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_logs( + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-mails.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..36cfec3d87 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-mails.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_mails( + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..d317f2a74c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-messaging.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_messaging( + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..3c68c865dc --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-migrations.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_migrations( + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..7024bac307 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-stats-resources.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_stats_resources( + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-usage.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..b687bd8789 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-usage.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_usage( + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..28f28ea78a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-queue-webhooks.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_queue_webhooks( + threshold: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-storage-local.md b/docs/examples/1.8.x/server-ruby/examples/health/get-storage-local.md new file mode 100644 index 0000000000..a122de50ee --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-storage-local.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_storage_local() diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-storage.md b/docs/examples/1.8.x/server-ruby/examples/health/get-storage.md new file mode 100644 index 0000000000..ee778643ec --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-storage.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_storage() diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get-time.md b/docs/examples/1.8.x/server-ruby/examples/health/get-time.md new file mode 100644 index 0000000000..9d345557a3 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get-time.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get_time() diff --git a/docs/examples/1.8.x/server-ruby/examples/health/get.md b/docs/examples/1.8.x/server-ruby/examples/health/get.md new file mode 100644 index 0000000000..4bbf0c0eb0 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/health/get.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +health = Health.new(client) + +result = health.get() diff --git a/docs/examples/1.8.x/server-ruby/examples/locale/get.md b/docs/examples/1.8.x/server-ruby/examples/locale/get.md new file mode 100644 index 0000000000..264da0e187 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/locale/get.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.get() diff --git a/docs/examples/1.8.x/server-ruby/examples/locale/list-codes.md b/docs/examples/1.8.x/server-ruby/examples/locale/list-codes.md new file mode 100644 index 0000000000..27632669f0 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/locale/list-codes.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_codes() diff --git a/docs/examples/1.8.x/server-ruby/examples/locale/list-continents.md b/docs/examples/1.8.x/server-ruby/examples/locale/list-continents.md new file mode 100644 index 0000000000..b78f130201 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/locale/list-continents.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_continents() diff --git a/docs/examples/1.8.x/server-ruby/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/server-ruby/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..8498f2bdda --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/locale/list-countries-eu.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_countries_eu() diff --git a/docs/examples/1.8.x/server-ruby/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/server-ruby/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..8fa087e920 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/locale/list-countries-phones.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_countries_phones() diff --git a/docs/examples/1.8.x/server-ruby/examples/locale/list-countries.md b/docs/examples/1.8.x/server-ruby/examples/locale/list-countries.md new file mode 100644 index 0000000000..a635a4e0b3 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/locale/list-countries.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_countries() diff --git a/docs/examples/1.8.x/server-ruby/examples/locale/list-currencies.md b/docs/examples/1.8.x/server-ruby/examples/locale/list-currencies.md new file mode 100644 index 0000000000..60e9d94df9 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/locale/list-currencies.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_currencies() diff --git a/docs/examples/1.8.x/server-ruby/examples/locale/list-languages.md b/docs/examples/1.8.x/server-ruby/examples/locale/list-languages.md new file mode 100644 index 0000000000..e5b9df1945 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/locale/list-languages.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +locale = Locale.new(client) + +result = locale.list_languages() diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..a280340847 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-apns-provider.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_apns_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + auth_key: '<AUTH_KEY>', # optional + auth_key_id: '<AUTH_KEY_ID>', # optional + team_id: '<TEAM_ID>', # optional + bundle_id: '<BUNDLE_ID>', # optional + sandbox: false, # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-email.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-email.md new file mode 100644 index 0000000000..573a5b83d4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-email.md @@ -0,0 +1,25 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_email( + message_id: '<MESSAGE_ID>', + subject: '<SUBJECT>', + content: '<CONTENT>', + topics: [], # optional + users: [], # optional + targets: [], # optional + cc: [], # optional + bcc: [], # optional + attachments: [], # optional + draft: false, # optional + html: false, # optional + scheduled_at: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..a1e8b67b51 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-fcm-provider.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_fcm_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + service_account_json: {}, # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..aa5b7f1899 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,23 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_mailgun_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + api_key: '<API_KEY>', # optional + domain: '<DOMAIN>', # optional + is_eu_region: false, # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: 'email@example.com', # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..35a192f148 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_msg91_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + template_id: '<TEMPLATE_ID>', # optional + sender_id: '<SENDER_ID>', # optional + auth_key: '<AUTH_KEY>', # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-push.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-push.md new file mode 100644 index 0000000000..5c58fa542b --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-push.md @@ -0,0 +1,32 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_push( + message_id: '<MESSAGE_ID>', + title: '<TITLE>', # optional + body: '<BODY>', # optional + topics: [], # optional + users: [], # optional + targets: [], # optional + data: {}, # optional + action: '<ACTION>', # optional + image: '[ID1:ID2]', # optional + icon: '<ICON>', # optional + sound: '<SOUND>', # optional + color: '<COLOR>', # optional + tag: '<TAG>', # optional + badge: null, # optional + draft: false, # optional + scheduled_at: '', # optional + content_available: false, # optional + critical: false, # optional + priority: MessagePriority::NORMAL # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..eae3ad3ece --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_sendgrid_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + api_key: '<API_KEY>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: 'email@example.com', # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-sms.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-sms.md new file mode 100644 index 0000000000..901ec40c05 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-sms.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_sms( + message_id: '<MESSAGE_ID>', + content: '<CONTENT>', + topics: [], # optional + users: [], # optional + targets: [], # optional + draft: false, # optional + scheduled_at: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..b062e574b4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-smtp-provider.md @@ -0,0 +1,27 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_smtp_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + host: '<HOST>', + port: 1, # optional + username: '<USERNAME>', # optional + password: '<PASSWORD>', # optional + encryption: SmtpEncryption::NONE, # optional + auto_tls: false, # optional + mailer: '<MAILER>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: 'email@example.com', # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..1f6fa43736 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-subscriber.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_jwt('<YOUR_JWT>') # Your secret JSON Web Token + +messaging = Messaging.new(client) + +result = messaging.create_subscriber( + topic_id: '<TOPIC_ID>', + subscriber_id: '<SUBSCRIBER_ID>', + target_id: '<TARGET_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..b26d9d2784 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-telesign-provider.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_telesign_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', # optional + customer_id: '<CUSTOMER_ID>', # optional + api_key: '<API_KEY>', # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..4fd1a3683e --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_textmagic_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', # optional + username: '<USERNAME>', # optional + api_key: '<API_KEY>', # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-topic.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-topic.md new file mode 100644 index 0000000000..da2cf5e57b --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-topic.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_topic( + topic_id: '<TOPIC_ID>', + name: '<NAME>', + subscribe: ["any"] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..a945602646 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-twilio-provider.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_twilio_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', # optional + account_sid: '<ACCOUNT_SID>', # optional + auth_token: '<AUTH_TOKEN>', # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..5a5f6eb72b --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/create-vonage-provider.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_vonage_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', + from: '+12065550100', # optional + api_key: '<API_KEY>', # optional + api_secret: '<API_SECRET>', # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/delete-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..3c19e1ba0f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/delete-provider.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.delete_provider( + provider_id: '<PROVIDER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-ruby/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..a82e5e94c2 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/delete-subscriber.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_jwt('<YOUR_JWT>') # Your secret JSON Web Token + +messaging = Messaging.new(client) + +result = messaging.delete_subscriber( + topic_id: '<TOPIC_ID>', + subscriber_id: '<SUBSCRIBER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/delete-topic.md b/docs/examples/1.8.x/server-ruby/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..cb58ee5c6c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/delete-topic.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.delete_topic( + topic_id: '<TOPIC_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/delete.md b/docs/examples/1.8.x/server-ruby/examples/messaging/delete.md new file mode 100644 index 0000000000..e3db26127d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/delete.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.delete( + message_id: '<MESSAGE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/get-message.md b/docs/examples/1.8.x/server-ruby/examples/messaging/get-message.md new file mode 100644 index 0000000000..f5449a0be4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/get-message.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.get_message( + message_id: '<MESSAGE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/get-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/get-provider.md new file mode 100644 index 0000000000..ddb28da4de --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/get-provider.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.get_provider( + provider_id: '<PROVIDER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/server-ruby/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..3c7d05334e --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/get-subscriber.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.get_subscriber( + topic_id: '<TOPIC_ID>', + subscriber_id: '<SUBSCRIBER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/get-topic.md b/docs/examples/1.8.x/server-ruby/examples/messaging/get-topic.md new file mode 100644 index 0000000000..9ff732fc26 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/get-topic.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.get_topic( + topic_id: '<TOPIC_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/server-ruby/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..f20d6fb491 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/list-message-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_message_logs( + message_id: '<MESSAGE_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/list-messages.md b/docs/examples/1.8.x/server-ruby/examples/messaging/list-messages.md new file mode 100644 index 0000000000..ffc5dcdbc6 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/list-messages.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_messages( + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-ruby/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..af3751a18f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/list-provider-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_provider_logs( + provider_id: '<PROVIDER_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/list-providers.md b/docs/examples/1.8.x/server-ruby/examples/messaging/list-providers.md new file mode 100644 index 0000000000..a857f0562f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/list-providers.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_providers( + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-ruby/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..06550e7067 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_subscriber_logs( + subscriber_id: '<SUBSCRIBER_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/server-ruby/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..07ebc99bab --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/list-subscribers.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_subscribers( + topic_id: '<TOPIC_ID>', + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/list-targets.md b/docs/examples/1.8.x/server-ruby/examples/messaging/list-targets.md new file mode 100644 index 0000000000..0407255d86 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/list-targets.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_targets( + message_id: '<MESSAGE_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-ruby/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..9b53c47f82 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/list-topic-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_topic_logs( + topic_id: '<TOPIC_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/list-topics.md b/docs/examples/1.8.x/server-ruby/examples/messaging/list-topics.md new file mode 100644 index 0000000000..5e7b6740cc --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/list-topics.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.list_topics( + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..b19704aaed --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-apns-provider.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_apns_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + auth_key: '<AUTH_KEY>', # optional + auth_key_id: '<AUTH_KEY_ID>', # optional + team_id: '<TEAM_ID>', # optional + bundle_id: '<BUNDLE_ID>', # optional + sandbox: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-email.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-email.md new file mode 100644 index 0000000000..aa3593292f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-email.md @@ -0,0 +1,25 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_email( + message_id: '<MESSAGE_ID>', + topics: [], # optional + users: [], # optional + targets: [], # optional + subject: '<SUBJECT>', # optional + content: '<CONTENT>', # optional + draft: false, # optional + html: false, # optional + cc: [], # optional + bcc: [], # optional + scheduled_at: '', # optional + attachments: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..44ea0d28de --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-fcm-provider.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_fcm_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + service_account_json: {} # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..a2e53190d7 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,23 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_mailgun_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + api_key: '<API_KEY>', # optional + domain: '<DOMAIN>', # optional + is_eu_region: false, # optional + enabled: false, # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: '<REPLY_TO_EMAIL>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..0e88382850 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_msg91_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + template_id: '<TEMPLATE_ID>', # optional + sender_id: '<SENDER_ID>', # optional + auth_key: '<AUTH_KEY>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-push.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-push.md new file mode 100644 index 0000000000..42a5104ccb --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-push.md @@ -0,0 +1,32 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_push( + message_id: '<MESSAGE_ID>', + topics: [], # optional + users: [], # optional + targets: [], # optional + title: '<TITLE>', # optional + body: '<BODY>', # optional + data: {}, # optional + action: '<ACTION>', # optional + image: '[ID1:ID2]', # optional + icon: '<ICON>', # optional + sound: '<SOUND>', # optional + color: '<COLOR>', # optional + tag: '<TAG>', # optional + badge: null, # optional + draft: false, # optional + scheduled_at: '', # optional + content_available: false, # optional + critical: false, # optional + priority: MessagePriority::NORMAL # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..99f1a9c7f1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_sendgrid_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + api_key: '<API_KEY>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: '<REPLY_TO_EMAIL>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-sms.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-sms.md new file mode 100644 index 0000000000..b31480c1a0 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-sms.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_sms( + message_id: '<MESSAGE_ID>', + topics: [], # optional + users: [], # optional + targets: [], # optional + content: '<CONTENT>', # optional + draft: false, # optional + scheduled_at: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..bbaebf3c32 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-smtp-provider.md @@ -0,0 +1,27 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_smtp_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + host: '<HOST>', # optional + port: 1, # optional + username: '<USERNAME>', # optional + password: '<PASSWORD>', # optional + encryption: SmtpEncryption::NONE, # optional + auto_tls: false, # optional + mailer: '<MAILER>', # optional + from_name: '<FROM_NAME>', # optional + from_email: 'email@example.com', # optional + reply_to_name: '<REPLY_TO_NAME>', # optional + reply_to_email: '<REPLY_TO_EMAIL>', # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..4f1bf6ff5b --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-telesign-provider.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_telesign_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + customer_id: '<CUSTOMER_ID>', # optional + api_key: '<API_KEY>', # optional + from: '<FROM>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..c8cd2f0daf --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_textmagic_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + username: '<USERNAME>', # optional + api_key: '<API_KEY>', # optional + from: '<FROM>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-topic.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-topic.md new file mode 100644 index 0000000000..d20d945385 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-topic.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_topic( + topic_id: '<TOPIC_ID>', + name: '<NAME>', # optional + subscribe: ["any"] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..0f6a6761e1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-twilio-provider.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_twilio_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + account_sid: '<ACCOUNT_SID>', # optional + auth_token: '<AUTH_TOKEN>', # optional + from: '<FROM>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-ruby/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..e75bfbd98e --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/messaging/update-vonage-provider.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_vonage_provider( + provider_id: '<PROVIDER_ID>', + name: '<NAME>', # optional + enabled: false, # optional + api_key: '<API_KEY>', # optional + api_secret: '<API_SECRET>', # optional + from: '<FROM>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/create-deployment.md b/docs/examples/1.8.x/server-ruby/examples/sites/create-deployment.md new file mode 100644 index 0000000000..b392b8679a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/create-deployment.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create_deployment( + site_id: '<SITE_ID>', + code: InputFile.from_path('dir/file.png'), + activate: false, + install_command: '<INSTALL_COMMAND>', # optional + build_command: '<BUILD_COMMAND>', # optional + output_directory: '<OUTPUT_DIRECTORY>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-ruby/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..f72b7a641b --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create_duplicate_deployment( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/server-ruby/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..7df9665590 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/create-template-deployment.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create_template_deployment( + site_id: '<SITE_ID>', + repository: '<REPOSITORY>', + owner: '<OWNER>', + root_directory: '<ROOT_DIRECTORY>', + version: '<VERSION>', + activate: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/create-variable.md b/docs/examples/1.8.x/server-ruby/examples/sites/create-variable.md new file mode 100644 index 0000000000..4d2031f8ea --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/create-variable.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create_variable( + site_id: '<SITE_ID>', + key: '<KEY>', + value: '<VALUE>', + secret: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-ruby/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..2e72b6e3f1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/create-vcs-deployment.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create_vcs_deployment( + site_id: '<SITE_ID>', + type: VCSDeploymentType::BRANCH, + reference: '<REFERENCE>', + activate: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/create.md b/docs/examples/1.8.x/server-ruby/examples/sites/create.md new file mode 100644 index 0000000000..2243185485 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/create.md @@ -0,0 +1,32 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.create( + site_id: '<SITE_ID>', + name: '<NAME>', + framework: ::ANALOG, + build_runtime: ::NODE_14_5, + enabled: false, # optional + logging: false, # optional + timeout: 1, # optional + install_command: '<INSTALL_COMMAND>', # optional + build_command: '<BUILD_COMMAND>', # optional + output_directory: '<OUTPUT_DIRECTORY>', # optional + adapter: ::STATIC, # optional + installation_id: '<INSTALLATION_ID>', # optional + fallback_file: '<FALLBACK_FILE>', # optional + provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch: '<PROVIDER_BRANCH>', # optional + provider_silent_mode: false, # optional + provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional + specification: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/delete-deployment.md b/docs/examples/1.8.x/server-ruby/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..6f96e05023 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/delete-deployment.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.delete_deployment( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/delete-log.md b/docs/examples/1.8.x/server-ruby/examples/sites/delete-log.md new file mode 100644 index 0000000000..556f3e2855 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/delete-log.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.delete_log( + site_id: '<SITE_ID>', + log_id: '<LOG_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/delete-variable.md b/docs/examples/1.8.x/server-ruby/examples/sites/delete-variable.md new file mode 100644 index 0000000000..ca5e51b2b9 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/delete-variable.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.delete_variable( + site_id: '<SITE_ID>', + variable_id: '<VARIABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/delete.md b/docs/examples/1.8.x/server-ruby/examples/sites/delete.md new file mode 100644 index 0000000000..e92d6428e1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/delete.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.delete( + site_id: '<SITE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/server-ruby/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..85162626ba --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/get-deployment-download.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.get_deployment_download( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>', + type: DeploymentDownloadType::SOURCE # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/get-deployment.md b/docs/examples/1.8.x/server-ruby/examples/sites/get-deployment.md new file mode 100644 index 0000000000..79f47e4aad --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/get-deployment.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.get_deployment( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/get-log.md b/docs/examples/1.8.x/server-ruby/examples/sites/get-log.md new file mode 100644 index 0000000000..2e5e8c2d4c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/get-log.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.get_log( + site_id: '<SITE_ID>', + log_id: '<LOG_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/get-variable.md b/docs/examples/1.8.x/server-ruby/examples/sites/get-variable.md new file mode 100644 index 0000000000..ac27efcd50 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/get-variable.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.get_variable( + site_id: '<SITE_ID>', + variable_id: '<VARIABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/get.md b/docs/examples/1.8.x/server-ruby/examples/sites/get.md new file mode 100644 index 0000000000..a8d3aac1b4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/get.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.get( + site_id: '<SITE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/list-deployments.md b/docs/examples/1.8.x/server-ruby/examples/sites/list-deployments.md new file mode 100644 index 0000000000..8571f8561a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/list-deployments.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list_deployments( + site_id: '<SITE_ID>', + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/list-frameworks.md b/docs/examples/1.8.x/server-ruby/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..61f18fbf6f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/list-frameworks.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list_frameworks() diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/list-logs.md b/docs/examples/1.8.x/server-ruby/examples/sites/list-logs.md new file mode 100644 index 0000000000..919be968c9 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/list-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list_logs( + site_id: '<SITE_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/list-specifications.md b/docs/examples/1.8.x/server-ruby/examples/sites/list-specifications.md new file mode 100644 index 0000000000..42f41157fb --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/list-specifications.md @@ -0,0 +1,12 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list_specifications() diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/list-variables.md b/docs/examples/1.8.x/server-ruby/examples/sites/list-variables.md new file mode 100644 index 0000000000..cf10fa4628 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/list-variables.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list_variables( + site_id: '<SITE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/list.md b/docs/examples/1.8.x/server-ruby/examples/sites/list.md new file mode 100644 index 0000000000..ba70205236 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/list.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.list( + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/server-ruby/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..859ad22b61 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/update-deployment-status.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.update_deployment_status( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/server-ruby/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..bc033e931e --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/update-site-deployment.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.update_site_deployment( + site_id: '<SITE_ID>', + deployment_id: '<DEPLOYMENT_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/update-variable.md b/docs/examples/1.8.x/server-ruby/examples/sites/update-variable.md new file mode 100644 index 0000000000..e61f129573 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/update-variable.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.update_variable( + site_id: '<SITE_ID>', + variable_id: '<VARIABLE_ID>', + key: '<KEY>', + value: '<VALUE>', # optional + secret: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/sites/update.md b/docs/examples/1.8.x/server-ruby/examples/sites/update.md new file mode 100644 index 0000000000..922255ab65 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/sites/update.md @@ -0,0 +1,32 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +sites = Sites.new(client) + +result = sites.update( + site_id: '<SITE_ID>', + name: '<NAME>', + framework: ::ANALOG, + enabled: false, # optional + logging: false, # optional + timeout: 1, # optional + install_command: '<INSTALL_COMMAND>', # optional + build_command: '<BUILD_COMMAND>', # optional + output_directory: '<OUTPUT_DIRECTORY>', # optional + build_runtime: ::NODE_14_5, # optional + adapter: ::STATIC, # optional + fallback_file: '<FALLBACK_FILE>', # optional + installation_id: '<INSTALLATION_ID>', # optional + provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional + provider_branch: '<PROVIDER_BRANCH>', # optional + provider_silent_mode: false, # optional + provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional + specification: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/create-bucket.md b/docs/examples/1.8.x/server-ruby/examples/storage/create-bucket.md new file mode 100644 index 0000000000..643431ed2c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/create-bucket.md @@ -0,0 +1,23 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage.new(client) + +result = storage.create_bucket( + bucket_id: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], # optional + file_security: false, # optional + enabled: false, # optional + maximum_file_size: 1, # optional + allowed_file_extensions: [], # optional + compression: ::NONE, # optional + encryption: false, # optional + antivirus: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/create-file.md b/docs/examples/1.8.x/server-ruby/examples/storage/create-file.md new file mode 100644 index 0000000000..99e07c33f4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/create-file.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.create_file( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + file: InputFile.from_path('dir/file.png'), + permissions: ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/delete-bucket.md b/docs/examples/1.8.x/server-ruby/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..dda3264e66 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/delete-bucket.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage.new(client) + +result = storage.delete_bucket( + bucket_id: '<BUCKET_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/delete-file.md b/docs/examples/1.8.x/server-ruby/examples/storage/delete-file.md new file mode 100644 index 0000000000..eef058857c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/delete-file.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.delete_file( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/get-bucket.md b/docs/examples/1.8.x/server-ruby/examples/storage/get-bucket.md new file mode 100644 index 0000000000..7c8580dcaf --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/get-bucket.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage.new(client) + +result = storage.get_bucket( + bucket_id: '<BUCKET_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/get-file-download.md b/docs/examples/1.8.x/server-ruby/examples/storage/get-file-download.md new file mode 100644 index 0000000000..7b7075184a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/get-file-download.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.get_file_download( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + token: '<TOKEN>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/get-file-preview.md b/docs/examples/1.8.x/server-ruby/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..23254615d3 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/get-file-preview.md @@ -0,0 +1,27 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.get_file_preview( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + width: 0, # optional + height: 0, # optional + gravity: ImageGravity::CENTER, # optional + quality: -1, # optional + border_width: 0, # optional + border_color: '', # optional + border_radius: 0, # optional + opacity: 0, # optional + rotation: -360, # optional + background: '', # optional + output: ImageFormat::JPG, # optional + token: '<TOKEN>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/get-file-view.md b/docs/examples/1.8.x/server-ruby/examples/storage/get-file-view.md new file mode 100644 index 0000000000..c9e9952f05 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/get-file-view.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.get_file_view( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + token: '<TOKEN>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/get-file.md b/docs/examples/1.8.x/server-ruby/examples/storage/get-file.md new file mode 100644 index 0000000000..b816bdba02 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/get-file.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.get_file( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/list-buckets.md b/docs/examples/1.8.x/server-ruby/examples/storage/list-buckets.md new file mode 100644 index 0000000000..dfee831b69 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/list-buckets.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage.new(client) + +result = storage.list_buckets( + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/list-files.md b/docs/examples/1.8.x/server-ruby/examples/storage/list-files.md new file mode 100644 index 0000000000..078ff55e41 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/list-files.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.list_files( + bucket_id: '<BUCKET_ID>', + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/update-bucket.md b/docs/examples/1.8.x/server-ruby/examples/storage/update-bucket.md new file mode 100644 index 0000000000..09b915eb5f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/update-bucket.md @@ -0,0 +1,23 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +storage = Storage.new(client) + +result = storage.update_bucket( + bucket_id: '<BUCKET_ID>', + name: '<NAME>', + permissions: ["read("any")"], # optional + file_security: false, # optional + enabled: false, # optional + maximum_file_size: 1, # optional + allowed_file_extensions: [], # optional + compression: ::NONE, # optional + encryption: false, # optional + antivirus: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/storage/update-file.md b/docs/examples/1.8.x/server-ruby/examples/storage/update-file.md new file mode 100644 index 0000000000..a454499d9d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/storage/update-file.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +storage = Storage.new(client) + +result = storage.update_file( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + name: '<NAME>', # optional + permissions: ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..99dfb41271 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_boolean_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: false, # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..f53b5ef3c6 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_datetime_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: '', # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..0a1ea924a6 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-email-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_email_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..0586dd8c58 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-enum-column.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_enum_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..88a0384ceb --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-float-column.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_float_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + min: null, # optional + max: null, # optional + default: null, # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-index.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..f7c2d0e4e1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-index.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_index( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + type: IndexType::KEY, + columns: [], + orders: [], # optional + lengths: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..4b9690eb96 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-integer-column.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_integer_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + min: null, # optional + max: null, # optional + default: null, # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..1e32122706 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-ip-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_ip_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: '', # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..ec2352e65a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-line-column.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_line_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..bfe77a54d0 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-point-column.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_point_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: [1, 2] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..40ac70e78c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_polygon_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..1c5a935e68 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,22 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_relationship_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + related_table_id: '<RELATED_TABLE_ID>', + type: RelationshipType::ONETOONE, + two_way: false, # optional + key: '', # optional + two_way_key: '', # optional + on_delete: RelationMutate::CASCADE # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-row.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..5e19136676 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-row.md @@ -0,0 +1,24 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.create_row( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + data: { + "username" => "walter.obrien", + "email" => "walter.obrien@example.com", + "fullName" => "Walter O'Brien", + "age" => 30, + "isAdmin" => false + }, + permissions: ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..f258d4d36f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-rows.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_rows( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + rows: [] +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..8167289d30 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-string-column.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_string_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + size: 1, + required: false, + default: '<DEFAULT>', # optional + array: false, # optional + encrypt: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-table.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..c8fcf477b3 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-table.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_table( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], # optional + row_security: false, # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..fc2159faf1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create-url-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_url_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', # optional + array: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/create.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create.md new file mode 100644 index 0000000000..76346f5833 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/create.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create( + database_id: '<DATABASE_ID>', + name: '<NAME>', + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..21439740ed --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.decrement_row_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + column: '', + value: null, # optional + min: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..d9d9c2f0e9 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-column.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.delete_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..5998633cc5 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-index.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.delete_index( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..704f52fc39 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-row.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.delete_row( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..5b15c1748a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-rows.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.delete_rows( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..2c955aed29 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete-table.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.delete_table( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete.md new file mode 100644 index 0000000000..3c4371c7fa --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/delete.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.delete( + database_id: '<DATABASE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..b231f2d91b --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-column.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.get_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-index.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..eb010e7111 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-index.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.get_index( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-row.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..621c2e12f6 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-row.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.get_row( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-table.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..35843569f8 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/get-table.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.get_table( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/get.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/get.md new file mode 100644 index 0000000000..e8067bc0e3 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/get.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.get( + database_id: '<DATABASE_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..bf9b6cc230 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/increment-row-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.increment_row_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + column: '', + value: null, # optional + max: null # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..f3f0165289 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-columns.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.list_columns( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..85e343fa22 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-indexes.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.list_indexes( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..af971fbe10 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-rows.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.list_rows( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..a2ec4cda68 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/list-tables.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.list_tables( + database_id: '<DATABASE_ID>', + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/list.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/list.md new file mode 100644 index 0000000000..ca0d4645e2 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/list.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.list( + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..d048d76410 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_boolean_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: false, + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..13bad26f00 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_datetime_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: '', + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..e5c97a5d10 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-email-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_email_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: 'email@example.com', + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..4ae45749c4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-enum-column.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_enum_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + elements: [], + required: false, + default: '<DEFAULT>', + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..5eb175fe6a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-float-column.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_float_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, # optional + max: null, # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..e32e1d4348 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-integer-column.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_integer_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: null, + min: null, # optional + max: null, # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..aae8ce9dc6 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-ip-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_ip_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: '', + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..5c1e24d16e --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-line-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_line_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: [[1, 2], [3, 4], [5, 6]], # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..f2130bda64 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-point-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_point_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: [1, 2], # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..6b878e3e18 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_polygon_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..3951cbc047 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_relationship_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + on_delete: RelationMutate::CASCADE, # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-row.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..7a48c5e3f6 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-row.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.update_row( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + data: {}, # optional + permissions: ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..7316241139 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-rows.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_rows( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + data: {}, # optional + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..331ce88ad9 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-string-column.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_string_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: '<DEFAULT>', + size: 1, # optional + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-table.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..cb8706d0b4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-table.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_table( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + name: '<NAME>', + permissions: ["read("any")"], # optional + row_security: false, # optional + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..03034e9c07 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update-url-column.md @@ -0,0 +1,19 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_url_column( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + key: '', + required: false, + default: 'https://example.com', + new_key: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/update.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update.md new file mode 100644 index 0000000000..787d5c11e8 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/update.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update( + database_id: '<DATABASE_ID>', + name: '<NAME>', + enabled: false # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..5eb4281002 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/upsert-row.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +tables_db = TablesDB.new(client) + +result = tables_db.upsert_row( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + row_id: '<ROW_ID>', + data: {}, # optional + permissions: ["read("any")"] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-ruby/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..c48211dcc0 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tablesdb/upsert-rows.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.upsert_rows( + database_id: '<DATABASE_ID>', + table_id: '<TABLE_ID>', + rows: [] +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/create-membership.md b/docs/examples/1.8.x/server-ruby/examples/teams/create-membership.md new file mode 100644 index 0000000000..6c0faba77d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/create-membership.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.create_membership( + team_id: '<TEAM_ID>', + roles: [], + email: 'email@example.com', # optional + user_id: '<USER_ID>', # optional + phone: '+12065550100', # optional + url: 'https://example.com', # optional + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/create.md b/docs/examples/1.8.x/server-ruby/examples/teams/create.md new file mode 100644 index 0000000000..ba71a1dfc4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/create.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.create( + team_id: '<TEAM_ID>', + name: '<NAME>', + roles: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/delete-membership.md b/docs/examples/1.8.x/server-ruby/examples/teams/delete-membership.md new file mode 100644 index 0000000000..5d815a8ca3 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/delete-membership.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.delete_membership( + team_id: '<TEAM_ID>', + membership_id: '<MEMBERSHIP_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/delete.md b/docs/examples/1.8.x/server-ruby/examples/teams/delete.md new file mode 100644 index 0000000000..c9f7c400e9 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/delete.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.delete( + team_id: '<TEAM_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/get-membership.md b/docs/examples/1.8.x/server-ruby/examples/teams/get-membership.md new file mode 100644 index 0000000000..41a2c7bfb4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/get-membership.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.get_membership( + team_id: '<TEAM_ID>', + membership_id: '<MEMBERSHIP_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/get-prefs.md b/docs/examples/1.8.x/server-ruby/examples/teams/get-prefs.md new file mode 100644 index 0000000000..e6b2cfadce --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/get-prefs.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.get_prefs( + team_id: '<TEAM_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/get.md b/docs/examples/1.8.x/server-ruby/examples/teams/get.md new file mode 100644 index 0000000000..af51193cd3 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/get.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.get( + team_id: '<TEAM_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/list-memberships.md b/docs/examples/1.8.x/server-ruby/examples/teams/list-memberships.md new file mode 100644 index 0000000000..db48f0cfc6 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/list-memberships.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.list_memberships( + team_id: '<TEAM_ID>', + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/list.md b/docs/examples/1.8.x/server-ruby/examples/teams/list.md new file mode 100644 index 0000000000..9e96391975 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/list.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.list( + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/update-membership-status.md b/docs/examples/1.8.x/server-ruby/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..40d82b86f1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/update-membership-status.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.update_membership_status( + team_id: '<TEAM_ID>', + membership_id: '<MEMBERSHIP_ID>', + user_id: '<USER_ID>', + secret: '<SECRET>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/update-membership.md b/docs/examples/1.8.x/server-ruby/examples/teams/update-membership.md new file mode 100644 index 0000000000..92b69b1773 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/update-membership.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.update_membership( + team_id: '<TEAM_ID>', + membership_id: '<MEMBERSHIP_ID>', + roles: [] +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/update-name.md b/docs/examples/1.8.x/server-ruby/examples/teams/update-name.md new file mode 100644 index 0000000000..74f785c4ca --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/update-name.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.update_name( + team_id: '<TEAM_ID>', + name: '<NAME>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/teams/update-prefs.md b/docs/examples/1.8.x/server-ruby/examples/teams/update-prefs.md new file mode 100644 index 0000000000..03426aa3b9 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/teams/update-prefs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_session('') # The user session to authenticate with + +teams = Teams.new(client) + +result = teams.update_prefs( + team_id: '<TEAM_ID>', + prefs: {} +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tokens/create-file-token.md b/docs/examples/1.8.x/server-ruby/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..8c432c5255 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tokens/create-file-token.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens.new(client) + +result = tokens.create_file_token( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + expire: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tokens/delete.md b/docs/examples/1.8.x/server-ruby/examples/tokens/delete.md new file mode 100644 index 0000000000..cb59147f42 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tokens/delete.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens.new(client) + +result = tokens.delete( + token_id: '<TOKEN_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tokens/get.md b/docs/examples/1.8.x/server-ruby/examples/tokens/get.md new file mode 100644 index 0000000000..ef87c74294 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tokens/get.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens.new(client) + +result = tokens.get( + token_id: '<TOKEN_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tokens/list.md b/docs/examples/1.8.x/server-ruby/examples/tokens/list.md new file mode 100644 index 0000000000..4932f04151 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tokens/list.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens.new(client) + +result = tokens.list( + bucket_id: '<BUCKET_ID>', + file_id: '<FILE_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/tokens/update.md b/docs/examples/1.8.x/server-ruby/examples/tokens/update.md new file mode 100644 index 0000000000..91713730fb --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/tokens/update.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +tokens = Tokens.new(client) + +result = tokens.update( + token_id: '<TOKEN_ID>', + expire: '' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/server-ruby/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..8da9e0b1ff --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-argon-2-user.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_argon2_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-ruby/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..7c2b852d69 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-bcrypt-user.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_bcrypt_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-jwt.md b/docs/examples/1.8.x/server-ruby/examples/users/create-jwt.md new file mode 100644 index 0000000000..57f7f1d32f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-jwt.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_jwt( + user_id: '<USER_ID>', + session_id: '<SESSION_ID>', # optional + duration: 0 # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-md-5-user.md b/docs/examples/1.8.x/server-ruby/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..63fb68742e --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-md-5-user.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_md5_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-ruby/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..0cdea46af3 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_mfa_recovery_codes( + user_id: '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-ruby/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..7cd898a6fc --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-ph-pass-user.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_ph_pass_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-ruby/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..d84c2eed48 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_scrypt_modified_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + password_salt: '<PASSWORD_SALT>', + password_salt_separator: '<PASSWORD_SALT_SEPARATOR>', + password_signer_key: '<PASSWORD_SIGNER_KEY>', + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/server-ruby/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..53aa253d2a --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-scrypt-user.md @@ -0,0 +1,22 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_scrypt_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + password_salt: '<PASSWORD_SALT>', + password_cpu: null, + password_memory: null, + password_parallel: null, + password_length: null, + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-session.md b/docs/examples/1.8.x/server-ruby/examples/users/create-session.md new file mode 100644 index 0000000000..32d2b5f2ad --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-session.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_session( + user_id: '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-sha-user.md b/docs/examples/1.8.x/server-ruby/examples/users/create-sha-user.md new file mode 100644 index 0000000000..f3951d9c80 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-sha-user.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_sha_user( + user_id: '<USER_ID>', + email: 'email@example.com', + password: 'password', + password_version: PasswordHash::SHA1, # optional + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-target.md b/docs/examples/1.8.x/server-ruby/examples/users/create-target.md new file mode 100644 index 0000000000..3e87868df6 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-target.md @@ -0,0 +1,20 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_target( + user_id: '<USER_ID>', + target_id: '<TARGET_ID>', + provider_type: MessagingProviderType::EMAIL, + identifier: '<IDENTIFIER>', + provider_id: '<PROVIDER_ID>', # optional + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create-token.md b/docs/examples/1.8.x/server-ruby/examples/users/create-token.md new file mode 100644 index 0000000000..85e5f448ca --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create-token.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create_token( + user_id: '<USER_ID>', + length: 4, # optional + expire: 60 # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/create.md b/docs/examples/1.8.x/server-ruby/examples/users/create.md new file mode 100644 index 0000000000..4f57adeb87 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/create.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.create( + user_id: '<USER_ID>', + email: 'email@example.com', # optional + phone: '+12065550100', # optional + password: '', # optional + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/delete-identity.md b/docs/examples/1.8.x/server-ruby/examples/users/delete-identity.md new file mode 100644 index 0000000000..d2482dfae1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/delete-identity.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete_identity( + identity_id: '<IDENTITY_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-ruby/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..50fcb0fa0d --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete_mfa_authenticator( + user_id: '<USER_ID>', + type: AuthenticatorType::TOTP +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/delete-session.md b/docs/examples/1.8.x/server-ruby/examples/users/delete-session.md new file mode 100644 index 0000000000..9b14cc4fa3 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/delete-session.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete_session( + user_id: '<USER_ID>', + session_id: '<SESSION_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/delete-sessions.md b/docs/examples/1.8.x/server-ruby/examples/users/delete-sessions.md new file mode 100644 index 0000000000..23fd505763 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/delete-sessions.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete_sessions( + user_id: '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/delete-target.md b/docs/examples/1.8.x/server-ruby/examples/users/delete-target.md new file mode 100644 index 0000000000..f1564024db --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/delete-target.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete_target( + user_id: '<USER_ID>', + target_id: '<TARGET_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/delete.md b/docs/examples/1.8.x/server-ruby/examples/users/delete.md new file mode 100644 index 0000000000..db7f2ee6f8 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/delete.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.delete( + user_id: '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-ruby/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..f984517d26 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.get_mfa_recovery_codes( + user_id: '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/get-prefs.md b/docs/examples/1.8.x/server-ruby/examples/users/get-prefs.md new file mode 100644 index 0000000000..0118b39897 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/get-prefs.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.get_prefs( + user_id: '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/get-target.md b/docs/examples/1.8.x/server-ruby/examples/users/get-target.md new file mode 100644 index 0000000000..10ce49b229 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/get-target.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.get_target( + user_id: '<USER_ID>', + target_id: '<TARGET_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/get.md b/docs/examples/1.8.x/server-ruby/examples/users/get.md new file mode 100644 index 0000000000..95865b7e6c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/get.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.get( + user_id: '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/list-identities.md b/docs/examples/1.8.x/server-ruby/examples/users/list-identities.md new file mode 100644 index 0000000000..78c8cf5098 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/list-identities.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list_identities( + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/list-logs.md b/docs/examples/1.8.x/server-ruby/examples/users/list-logs.md new file mode 100644 index 0000000000..686434869c --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/list-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list_logs( + user_id: '<USER_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/list-memberships.md b/docs/examples/1.8.x/server-ruby/examples/users/list-memberships.md new file mode 100644 index 0000000000..a4c3aa11d2 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/list-memberships.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list_memberships( + user_id: '<USER_ID>', + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/server-ruby/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..ca1e2b2b96 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/list-mfa-factors.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list_mfa_factors( + user_id: '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/list-sessions.md b/docs/examples/1.8.x/server-ruby/examples/users/list-sessions.md new file mode 100644 index 0000000000..311420531f --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/list-sessions.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list_sessions( + user_id: '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/list-targets.md b/docs/examples/1.8.x/server-ruby/examples/users/list-targets.md new file mode 100644 index 0000000000..aae9941794 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/list-targets.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list_targets( + user_id: '<USER_ID>', + queries: [] # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/list.md b/docs/examples/1.8.x/server-ruby/examples/users/list.md new file mode 100644 index 0000000000..b490b65099 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/list.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.list( + queries: [], # optional + search: '<SEARCH>' # optional +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-email-verification.md b/docs/examples/1.8.x/server-ruby/examples/users/update-email-verification.md new file mode 100644 index 0000000000..07f85f0318 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-email-verification.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_email_verification( + user_id: '<USER_ID>', + email_verification: false +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-email.md b/docs/examples/1.8.x/server-ruby/examples/users/update-email.md new file mode 100644 index 0000000000..b36aac59d1 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-email.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_email( + user_id: '<USER_ID>', + email: 'email@example.com' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-labels.md b/docs/examples/1.8.x/server-ruby/examples/users/update-labels.md new file mode 100644 index 0000000000..a62d34b2e2 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-labels.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_labels( + user_id: '<USER_ID>', + labels: [] +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-ruby/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..aaf5ba16c0 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,14 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_mfa_recovery_codes( + user_id: '<USER_ID>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-mfa.md b/docs/examples/1.8.x/server-ruby/examples/users/update-mfa.md new file mode 100644 index 0000000000..3ebfb96116 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-mfa.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_mfa( + user_id: '<USER_ID>', + mfa: false +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-name.md b/docs/examples/1.8.x/server-ruby/examples/users/update-name.md new file mode 100644 index 0000000000..e7ade96e32 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-name.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_name( + user_id: '<USER_ID>', + name: '<NAME>' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-password.md b/docs/examples/1.8.x/server-ruby/examples/users/update-password.md new file mode 100644 index 0000000000..47c1f1ef49 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-password.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_password( + user_id: '<USER_ID>', + password: '' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-phone-verification.md b/docs/examples/1.8.x/server-ruby/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..6af7fcb638 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-phone-verification.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_phone_verification( + user_id: '<USER_ID>', + phone_verification: false +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-phone.md b/docs/examples/1.8.x/server-ruby/examples/users/update-phone.md new file mode 100644 index 0000000000..bd26547daa --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-phone.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_phone( + user_id: '<USER_ID>', + number: '+12065550100' +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-prefs.md b/docs/examples/1.8.x/server-ruby/examples/users/update-prefs.md new file mode 100644 index 0000000000..fbdccd7d23 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-prefs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_prefs( + user_id: '<USER_ID>', + prefs: {} +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-status.md b/docs/examples/1.8.x/server-ruby/examples/users/update-status.md new file mode 100644 index 0000000000..d73982c149 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-status.md @@ -0,0 +1,15 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_status( + user_id: '<USER_ID>', + status: false +) diff --git a/docs/examples/1.8.x/server-ruby/examples/users/update-target.md b/docs/examples/1.8.x/server-ruby/examples/users/update-target.md new file mode 100644 index 0000000000..dbcd1bd2f4 --- /dev/null +++ b/docs/examples/1.8.x/server-ruby/examples/users/update-target.md @@ -0,0 +1,18 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('<YOUR_PROJECT_ID>') # Your project ID + .set_key('<YOUR_API_KEY>') # Your secret API key + +users = Users.new(client) + +result = users.update_target( + user_id: '<USER_ID>', + target_id: '<TARGET_ID>', + identifier: '<IDENTIFIER>', # optional + provider_id: '<PROVIDER_ID>', # optional + name: '<NAME>' # optional +) diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-anonymous-session.md b/docs/examples/1.8.x/server-swift/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..22020a16d9 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-anonymous-session.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.createAnonymousSession() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-email-password-session.md b/docs/examples/1.8.x/server-swift/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..5f541a8a15 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-email-password-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.createEmailPasswordSession( + email: "email@example.com", + password: "password" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-email-token.md b/docs/examples/1.8.x/server-swift/examples/account/create-email-token.md new file mode 100644 index 0000000000..cf82afde8f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-email-token.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.createEmailToken( + userId: "<USER_ID>", + email: "email@example.com", + phrase: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-jwt.md b/docs/examples/1.8.x/server-swift/examples/account/create-jwt.md new file mode 100644 index 0000000000..fbcd50401c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-jwt.md @@ -0,0 +1,10 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let jwt = try await account.createJWT() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-magic-url-token.md b/docs/examples/1.8.x/server-swift/examples/account/create-magic-url-token.md new file mode 100644 index 0000000000..27bbe4137e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-magic-url-token.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.createMagicURLToken( + userId: "<USER_ID>", + email: "email@example.com", + url: "https://example.com", // optional + phrase: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-mfa-authenticator.md b/docs/examples/1.8.x/server-swift/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..dd3a7d1201 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-mfa-authenticator.md @@ -0,0 +1,14 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let mfaType = try await account.createMFAAuthenticator( + type: .totp +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-mfa-challenge.md b/docs/examples/1.8.x/server-swift/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..27f1bc1784 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-mfa-challenge.md @@ -0,0 +1,13 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let mfaChallenge = try await account.createMFAChallenge( + factor: .email +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-swift/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..3595cdae31 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let mfaRecoveryCodes = try await account.createMFARecoveryCodes() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-o-auth-2-token.md b/docs/examples/1.8.x/server-swift/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000000..21b54e8c9a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-o-auth-2-token.md @@ -0,0 +1,16 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let success = try await account.createOAuth2Token( + provider: .amazon, + success: "https://example.com", // optional + failure: "https://example.com", // optional + scopes: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-phone-token.md b/docs/examples/1.8.x/server-swift/examples/account/create-phone-token.md new file mode 100644 index 0000000000..12b2d4b223 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-phone-token.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let token = try await account.createPhoneToken( + userId: "<USER_ID>", + phone: "+12065550100" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-phone-verification.md b/docs/examples/1.8.x/server-swift/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..cba0637648 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-phone-verification.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.createPhoneVerification() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-recovery.md b/docs/examples/1.8.x/server-swift/examples/account/create-recovery.md new file mode 100644 index 0000000000..d89f679e0c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-recovery.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.createRecovery( + email: "email@example.com", + url: "https://example.com" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-session.md b/docs/examples/1.8.x/server-swift/examples/account/create-session.md new file mode 100644 index 0000000000..2065692a16 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.createSession( + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create-verification.md b/docs/examples/1.8.x/server-swift/examples/account/create-verification.md new file mode 100644 index 0000000000..71e9bdd32b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create-verification.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.createVerification( + url: "https://example.com" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/create.md b/docs/examples/1.8.x/server-swift/examples/account/create.md new file mode 100644 index 0000000000..79b4db64ba --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/create.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let user = try await account.create( + userId: "<USER_ID>", + email: "email@example.com", + password: "", + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/delete-identity.md b/docs/examples/1.8.x/server-swift/examples/account/delete-identity.md new file mode 100644 index 0000000000..f0f14b37d2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/delete-identity.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let result = try await account.deleteIdentity( + identityId: "<IDENTITY_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-swift/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..5a85cdcad5 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,14 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let result = try await account.deleteMFAAuthenticator( + type: .totp +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/delete-session.md b/docs/examples/1.8.x/server-swift/examples/account/delete-session.md new file mode 100644 index 0000000000..2469620116 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/delete-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let result = try await account.deleteSession( + sessionId: "<SESSION_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/delete-sessions.md b/docs/examples/1.8.x/server-swift/examples/account/delete-sessions.md new file mode 100644 index 0000000000..da8ac6dfe8 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/delete-sessions.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let result = try await account.deleteSessions() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-swift/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..86c435d2cb --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let mfaRecoveryCodes = try await account.getMFARecoveryCodes() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/get-prefs.md b/docs/examples/1.8.x/server-swift/examples/account/get-prefs.md new file mode 100644 index 0000000000..6551df92e6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/get-prefs.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let preferences = try await account.getPrefs() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/get-session.md b/docs/examples/1.8.x/server-swift/examples/account/get-session.md new file mode 100644 index 0000000000..63efb3f098 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/get-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let session = try await account.getSession( + sessionId: "<SESSION_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/get.md b/docs/examples/1.8.x/server-swift/examples/account/get.md new file mode 100644 index 0000000000..833901b5b4 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/get.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.get() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/list-identities.md b/docs/examples/1.8.x/server-swift/examples/account/list-identities.md new file mode 100644 index 0000000000..c7ecff9962 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/list-identities.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let identityList = try await account.listIdentities( + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/list-logs.md b/docs/examples/1.8.x/server-swift/examples/account/list-logs.md new file mode 100644 index 0000000000..84c3327762 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/list-logs.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let logList = try await account.listLogs( + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/list-mfa-factors.md b/docs/examples/1.8.x/server-swift/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..be41b2b2ff --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/list-mfa-factors.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let mfaFactors = try await account.listMFAFactors() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/list-sessions.md b/docs/examples/1.8.x/server-swift/examples/account/list-sessions.md new file mode 100644 index 0000000000..49691b3a9e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/list-sessions.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let sessionList = try await account.listSessions() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-email.md b/docs/examples/1.8.x/server-swift/examples/account/update-email.md new file mode 100644 index 0000000000..48cce5055d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-email.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updateEmail( + email: "email@example.com", + password: "password" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-magic-url-session.md b/docs/examples/1.8.x/server-swift/examples/account/update-magic-url-session.md new file mode 100644 index 0000000000..507006b230 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-magic-url-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.updateMagicURLSession( + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-mfa-authenticator.md b/docs/examples/1.8.x/server-swift/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..79f408e1d4 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-mfa-authenticator.md @@ -0,0 +1,15 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updateMFAAuthenticator( + type: .totp, + otp: "<OTP>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-mfa-challenge.md b/docs/examples/1.8.x/server-swift/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..c595f1ebc0 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-mfa-challenge.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let session = try await account.updateMFAChallenge( + challengeId: "<CHALLENGE_ID>", + otp: "<OTP>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-swift/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..ee6f9acb39 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let mfaRecoveryCodes = try await account.updateMFARecoveryCodes() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-mfa.md b/docs/examples/1.8.x/server-swift/examples/account/update-mfa.md new file mode 100644 index 0000000000..ac486fceb6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-mfa.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updateMFA( + mfa: false +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-name.md b/docs/examples/1.8.x/server-swift/examples/account/update-name.md new file mode 100644 index 0000000000..2c676d8714 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-name.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updateName( + name: "<NAME>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-password.md b/docs/examples/1.8.x/server-swift/examples/account/update-password.md new file mode 100644 index 0000000000..62fe48e6e9 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-password.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updatePassword( + password: "", + oldPassword: "password" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-phone-session.md b/docs/examples/1.8.x/server-swift/examples/account/update-phone-session.md new file mode 100644 index 0000000000..f6776d1de1 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-phone-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + +let account = Account(client) + +let session = try await account.updatePhoneSession( + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-phone-verification.md b/docs/examples/1.8.x/server-swift/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..a983e79c3c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-phone-verification.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.updatePhoneVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-phone.md b/docs/examples/1.8.x/server-swift/examples/account/update-phone.md new file mode 100644 index 0000000000..6dd87a0ce5 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-phone.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updatePhone( + phone: "+12065550100", + password: "password" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-prefs.md b/docs/examples/1.8.x/server-swift/examples/account/update-prefs.md new file mode 100644 index 0000000000..cc7b5e6860 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-prefs.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updatePrefs( + prefs: [ + "language": "en", + "timezone": "UTC", + "darkTheme": true + ] +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-recovery.md b/docs/examples/1.8.x/server-swift/examples/account/update-recovery.md new file mode 100644 index 0000000000..d655edfe59 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-recovery.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.updateRecovery( + userId: "<USER_ID>", + secret: "<SECRET>", + password: "" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-session.md b/docs/examples/1.8.x/server-swift/examples/account/update-session.md new file mode 100644 index 0000000000..f2f4f7b737 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let session = try await account.updateSession( + sessionId: "<SESSION_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-status.md b/docs/examples/1.8.x/server-swift/examples/account/update-status.md new file mode 100644 index 0000000000..88e30cfb09 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-status.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let user = try await account.updateStatus() + diff --git a/docs/examples/1.8.x/server-swift/examples/account/update-verification.md b/docs/examples/1.8.x/server-swift/examples/account/update-verification.md new file mode 100644 index 0000000000..61bc18cc48 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/account/update-verification.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let account = Account(client) + +let token = try await account.updateVerification( + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/avatars/get-browser.md b/docs/examples/1.8.x/server-swift/examples/avatars/get-browser.md new file mode 100644 index 0000000000..1c105c280c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/avatars/get-browser.md @@ -0,0 +1,17 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getBrowser( + code: .avantBrowser, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/avatars/get-credit-card.md b/docs/examples/1.8.x/server-swift/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..af7c2800be --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/avatars/get-credit-card.md @@ -0,0 +1,17 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getCreditCard( + code: .americanExpress, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/avatars/get-favicon.md b/docs/examples/1.8.x/server-swift/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..73f54fe5d3 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/avatars/get-favicon.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getFavicon( + url: "https://example.com" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/avatars/get-flag.md b/docs/examples/1.8.x/server-swift/examples/avatars/get-flag.md new file mode 100644 index 0000000000..e33cbb0c7f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/avatars/get-flag.md @@ -0,0 +1,17 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getFlag( + code: .afghanistan, + width: 0, // optional + height: 0, // optional + quality: -1 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/avatars/get-image.md b/docs/examples/1.8.x/server-swift/examples/avatars/get-image.md new file mode 100644 index 0000000000..5455ad18f5 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/avatars/get-image.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getImage( + url: "https://example.com", + width: 0, // optional + height: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/avatars/get-initials.md b/docs/examples/1.8.x/server-swift/examples/avatars/get-initials.md new file mode 100644 index 0000000000..63dfa5e5ab --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/avatars/get-initials.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getInitials( + name: "<NAME>", // optional + width: 0, // optional + height: 0, // optional + background: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/avatars/get-qr.md b/docs/examples/1.8.x/server-swift/examples/avatars/get-qr.md new file mode 100644 index 0000000000..ae4cc910ab --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/avatars/get-qr.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let avatars = Avatars(client) + +let bytes = try await avatars.getQR( + text: "<TEXT>", + size: 1, // optional + margin: 0, // optional + download: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-boolean-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-boolean-attribute.md new file mode 100644 index 0000000000..4530c385ca --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-boolean-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeBoolean = try await databases.createBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: false, // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-collection.md b/docs/examples/1.8.x/server-swift/examples/databases/create-collection.md new file mode 100644 index 0000000000..c3335b48cb --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-collection.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let collection = try await databases.createCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-datetime-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-datetime-attribute.md new file mode 100644 index 0000000000..d14d0b5cab --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-datetime-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeDatetime = try await databases.createDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-document.md b/docs/examples/1.8.x/server-swift/examples/databases/create-document.md new file mode 100644 index 0000000000..cc25fd8df8 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-document.md @@ -0,0 +1,23 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.createDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-documents.md b/docs/examples/1.8.x/server-swift/examples/databases/create-documents.md new file mode 100644 index 0000000000..2e992d9e3a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-documents.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.createDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [] +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-email-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-email-attribute.md new file mode 100644 index 0000000000..9bd30b38c9 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-email-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeEmail = try await databases.createEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "email@example.com", // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-enum-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-enum-attribute.md new file mode 100644 index 0000000000..08023f652b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-enum-attribute.md @@ -0,0 +1,19 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeEnum = try await databases.createEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + elements: [], + required: false, + default: "<DEFAULT>", // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-float-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-float-attribute.md new file mode 100644 index 0000000000..b5126c6a50 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-float-attribute.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeFloat = try await databases.createFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + min: 0, // optional + max: 0, // optional + default: 0, // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-index.md b/docs/examples/1.8.x/server-swift/examples/databases/create-index.md new file mode 100644 index 0000000000..7e9a6205d7 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-index.md @@ -0,0 +1,20 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let index = try await databases.createIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + type: .key, + attributes: [], + orders: [], // optional + lengths: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-integer-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-integer-attribute.md new file mode 100644 index 0000000000..20c29cd569 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-integer-attribute.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeInteger = try await databases.createIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + min: 0, // optional + max: 0, // optional + default: 0, // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-ip-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-ip-attribute.md new file mode 100644 index 0000000000..09605ba522 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-ip-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeIp = try await databases.createIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-line-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-line-attribute.md new file mode 100644 index 0000000000..610da4dd71 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-line-attribute.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeLine = try await databases.createLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-point-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-point-attribute.md new file mode 100644 index 0000000000..e3392e871f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-point-attribute.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributePoint = try await databases.createPointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [1, 2] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-polygon-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..c68543e87b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-polygon-attribute.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributePolygon = try await databases.createPolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-relationship-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-relationship-attribute.md new file mode 100644 index 0000000000..8e6c3eb84b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-relationship-attribute.md @@ -0,0 +1,21 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeRelationship = try await databases.createRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + relatedCollectionId: "<RELATED_COLLECTION_ID>", + type: .oneToOne, + twoWay: false, // optional + key: "", // optional + twoWayKey: "", // optional + onDelete: .cascade // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-string-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-string-attribute.md new file mode 100644 index 0000000000..80c321ecdb --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-string-attribute.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeString = try await databases.createStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + size: 1, + required: false, + default: "<DEFAULT>", // optional + array: false, // optional + encrypt: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create-url-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/create-url-attribute.md new file mode 100644 index 0000000000..efd2acbc08 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create-url-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeUrl = try await databases.createUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "https://example.com", // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/create.md b/docs/examples/1.8.x/server-swift/examples/databases/create.md new file mode 100644 index 0000000000..b0362bb3e8 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/create.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let database = try await databases.create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/decrement-document-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..81516fa26a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/decrement-document-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.decrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, // optional + min: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/delete-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/delete-attribute.md new file mode 100644 index 0000000000..9948555981 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/delete-attribute.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let result = try await databases.deleteAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/delete-collection.md b/docs/examples/1.8.x/server-swift/examples/databases/delete-collection.md new file mode 100644 index 0000000000..d61f0e658d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/delete-collection.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let result = try await databases.deleteCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/delete-document.md b/docs/examples/1.8.x/server-swift/examples/databases/delete-document.md new file mode 100644 index 0000000000..1db59709ab --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/delete-document.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let result = try await databases.deleteDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/delete-documents.md b/docs/examples/1.8.x/server-swift/examples/databases/delete-documents.md new file mode 100644 index 0000000000..d5321f2b26 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/delete-documents.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.deleteDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/delete-index.md b/docs/examples/1.8.x/server-swift/examples/databases/delete-index.md new file mode 100644 index 0000000000..ecd09f7ce6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/delete-index.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let result = try await databases.deleteIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/delete.md b/docs/examples/1.8.x/server-swift/examples/databases/delete.md new file mode 100644 index 0000000000..40567e4288 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/delete.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let result = try await databases.delete( + databaseId: "<DATABASE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/get-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/get-attribute.md new file mode 100644 index 0000000000..30cd0c8832 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/get-attribute.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let result = try await databases.getAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/get-collection.md b/docs/examples/1.8.x/server-swift/examples/databases/get-collection.md new file mode 100644 index 0000000000..96c1fa0f94 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/get-collection.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let collection = try await databases.getCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/get-document.md b/docs/examples/1.8.x/server-swift/examples/databases/get-document.md new file mode 100644 index 0000000000..c92856a731 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/get-document.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.getDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/get-index.md b/docs/examples/1.8.x/server-swift/examples/databases/get-index.md new file mode 100644 index 0000000000..cd59074dc8 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/get-index.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let index = try await databases.getIndex( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/get.md b/docs/examples/1.8.x/server-swift/examples/databases/get.md new file mode 100644 index 0000000000..875929bed0 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/get.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let database = try await databases.get( + databaseId: "<DATABASE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/increment-document-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/increment-document-attribute.md new file mode 100644 index 0000000000..64ba46b413 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/increment-document-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.incrementDocumentAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + attribute: "", + value: 0, // optional + max: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/list-attributes.md b/docs/examples/1.8.x/server-swift/examples/databases/list-attributes.md new file mode 100644 index 0000000000..b375c8771b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/list-attributes.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeList = try await databases.listAttributes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/list-collections.md b/docs/examples/1.8.x/server-swift/examples/databases/list-collections.md new file mode 100644 index 0000000000..10481d985c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/list-collections.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let collectionList = try await databases.listCollections( + databaseId: "<DATABASE_ID>", + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/list-documents.md b/docs/examples/1.8.x/server-swift/examples/databases/list-documents.md new file mode 100644 index 0000000000..2cac9330b3 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/list-documents.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let documentList = try await databases.listDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/list-indexes.md b/docs/examples/1.8.x/server-swift/examples/databases/list-indexes.md new file mode 100644 index 0000000000..691f74b076 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/list-indexes.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let indexList = try await databases.listIndexes( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/list.md b/docs/examples/1.8.x/server-swift/examples/databases/list.md new file mode 100644 index 0000000000..f8a2313acc --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/list.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let databaseList = try await databases.list( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-boolean-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-boolean-attribute.md new file mode 100644 index 0000000000..0d925056c2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-boolean-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeBoolean = try await databases.updateBooleanAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: false, + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-collection.md b/docs/examples/1.8.x/server-swift/examples/databases/update-collection.md new file mode 100644 index 0000000000..9109990109 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-collection.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let collection = try await databases.updateCollection( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + documentSecurity: false, // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-datetime-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-datetime-attribute.md new file mode 100644 index 0000000000..906b374946 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-datetime-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeDatetime = try await databases.updateDatetimeAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-document.md b/docs/examples/1.8.x/server-swift/examples/databases/update-document.md new file mode 100644 index 0000000000..7d452db284 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-document.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.updateDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [:], // optional + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-documents.md b/docs/examples/1.8.x/server-swift/examples/databases/update-documents.md new file mode 100644 index 0000000000..0e934b1424 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-documents.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.updateDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + data: [:], // optional + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-email-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-email-attribute.md new file mode 100644 index 0000000000..b485712ada --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-email-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeEmail = try await databases.updateEmailAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "email@example.com", + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-enum-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-enum-attribute.md new file mode 100644 index 0000000000..997b940c1b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-enum-attribute.md @@ -0,0 +1,19 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeEnum = try await databases.updateEnumAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + elements: [], + required: false, + default: "<DEFAULT>", + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-float-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-float-attribute.md new file mode 100644 index 0000000000..5f3e8da4da --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-float-attribute.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeFloat = try await databases.updateFloatAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: 0, + min: 0, // optional + max: 0, // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-integer-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-integer-attribute.md new file mode 100644 index 0000000000..edc0a12c8c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-integer-attribute.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeInteger = try await databases.updateIntegerAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: 0, + min: 0, // optional + max: 0, // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-ip-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-ip-attribute.md new file mode 100644 index 0000000000..e08835747c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-ip-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeIp = try await databases.updateIpAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "", + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-line-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-line-attribute.md new file mode 100644 index 0000000000..a9c65367aa --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-line-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeLine = try await databases.updateLineAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-point-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-point-attribute.md new file mode 100644 index 0000000000..6fd00c5da6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-point-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributePoint = try await databases.updatePointAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [1, 2], // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-polygon-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..08bbaec88e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-polygon-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributePolygon = try await databases.updatePolygonAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-relationship-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-relationship-attribute.md new file mode 100644 index 0000000000..0fb06d7796 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-relationship-attribute.md @@ -0,0 +1,18 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeRelationship = try await databases.updateRelationshipAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + onDelete: .cascade, // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-string-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-string-attribute.md new file mode 100644 index 0000000000..1eb3315dca --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-string-attribute.md @@ -0,0 +1,19 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeString = try await databases.updateStringAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "<DEFAULT>", + size: 1, // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update-url-attribute.md b/docs/examples/1.8.x/server-swift/examples/databases/update-url-attribute.md new file mode 100644 index 0000000000..cd18f96368 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update-url-attribute.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let attributeUrl = try await databases.updateUrlAttribute( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + key: "", + required: false, + default: "https://example.com", + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/update.md b/docs/examples/1.8.x/server-swift/examples/databases/update.md new file mode 100644 index 0000000000..07f506257b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/update.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let database = try await databases.update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/upsert-document.md b/docs/examples/1.8.x/server-swift/examples/databases/upsert-document.md new file mode 100644 index 0000000000..e78bd458a0 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/upsert-document.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let document = try await databases.upsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [:], + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/databases/upsert-documents.md b/docs/examples/1.8.x/server-swift/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..544f02f9c0 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/databases/upsert-documents.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.upsertDocuments( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documents: [] +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/create-deployment.md b/docs/examples/1.8.x/server-swift/examples/functions/create-deployment.md new file mode 100644 index 0000000000..de3d14d242 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/create-deployment.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.createDeployment( + functionId: "<FUNCTION_ID>", + code: InputFile.fromPath("file.png"), + activate: false, + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/create-duplicate-deployment.md b/docs/examples/1.8.x/server-swift/examples/functions/create-duplicate-deployment.md new file mode 100644 index 0000000000..cadf67aa65 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/create-duplicate-deployment.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.createDuplicateDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>", + buildId: "<BUILD_ID>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/create-execution.md b/docs/examples/1.8.x/server-swift/examples/functions/create-execution.md new file mode 100644 index 0000000000..46c9d69087 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/create-execution.md @@ -0,0 +1,20 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let functions = Functions(client) + +let execution = try await functions.createExecution( + functionId: "<FUNCTION_ID>", + body: "<BODY>", // optional + async: false, // optional + path: "<PATH>", // optional + method: .gET, // optional + headers: [:], // optional + scheduledAt: "<SCHEDULED_AT>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/create-template-deployment.md b/docs/examples/1.8.x/server-swift/examples/functions/create-template-deployment.md new file mode 100644 index 0000000000..27c5311c7a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/create-template-deployment.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.createTemplateDeployment( + functionId: "<FUNCTION_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + version: "<VERSION>", + activate: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/create-variable.md b/docs/examples/1.8.x/server-swift/examples/functions/create-variable.md new file mode 100644 index 0000000000..d792c678e6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/create-variable.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let variable = try await functions.createVariable( + functionId: "<FUNCTION_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/create-vcs-deployment.md b/docs/examples/1.8.x/server-swift/examples/functions/create-vcs-deployment.md new file mode 100644 index 0000000000..5586722aab --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/create-vcs-deployment.md @@ -0,0 +1,17 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.createVcsDeployment( + functionId: "<FUNCTION_ID>", + type: .branch, + reference: "<REFERENCE>", + activate: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/create.md b/docs/examples/1.8.x/server-swift/examples/functions/create.md new file mode 100644 index 0000000000..6f17a65b93 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/create.md @@ -0,0 +1,31 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let function = try await functions.create( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: .node145, + execute: ["any"], // optional + events: [], // optional + schedule: "", // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>", // optional + scopes: [], // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + specification: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/delete-deployment.md b/docs/examples/1.8.x/server-swift/examples/functions/delete-deployment.md new file mode 100644 index 0000000000..dec7b1db8f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/delete-deployment.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let result = try await functions.deleteDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/delete-execution.md b/docs/examples/1.8.x/server-swift/examples/functions/delete-execution.md new file mode 100644 index 0000000000..e51b7dcd5c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/delete-execution.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let result = try await functions.deleteExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/delete-variable.md b/docs/examples/1.8.x/server-swift/examples/functions/delete-variable.md new file mode 100644 index 0000000000..ea0ebab079 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/delete-variable.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let result = try await functions.deleteVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/delete.md b/docs/examples/1.8.x/server-swift/examples/functions/delete.md new file mode 100644 index 0000000000..76bb48cddf --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/delete.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let result = try await functions.delete( + functionId: "<FUNCTION_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/get-deployment-download.md b/docs/examples/1.8.x/server-swift/examples/functions/get-deployment-download.md new file mode 100644 index 0000000000..1feab0f484 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/get-deployment-download.md @@ -0,0 +1,16 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let bytes = try await functions.getDeploymentDownload( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>", + type: .source // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/get-deployment.md b/docs/examples/1.8.x/server-swift/examples/functions/get-deployment.md new file mode 100644 index 0000000000..56ed2e8512 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/get-deployment.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.getDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/get-execution.md b/docs/examples/1.8.x/server-swift/examples/functions/get-execution.md new file mode 100644 index 0000000000..6d24ee9390 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/get-execution.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let functions = Functions(client) + +let execution = try await functions.getExecution( + functionId: "<FUNCTION_ID>", + executionId: "<EXECUTION_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/get-variable.md b/docs/examples/1.8.x/server-swift/examples/functions/get-variable.md new file mode 100644 index 0000000000..da20d68007 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/get-variable.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let variable = try await functions.getVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/get.md b/docs/examples/1.8.x/server-swift/examples/functions/get.md new file mode 100644 index 0000000000..98babdb04d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/get.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let function = try await functions.get( + functionId: "<FUNCTION_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/list-deployments.md b/docs/examples/1.8.x/server-swift/examples/functions/list-deployments.md new file mode 100644 index 0000000000..599f301ca8 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/list-deployments.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deploymentList = try await functions.listDeployments( + functionId: "<FUNCTION_ID>", + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/list-executions.md b/docs/examples/1.8.x/server-swift/examples/functions/list-executions.md new file mode 100644 index 0000000000..f0aa857f01 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/list-executions.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let functions = Functions(client) + +let executionList = try await functions.listExecutions( + functionId: "<FUNCTION_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/list-runtimes.md b/docs/examples/1.8.x/server-swift/examples/functions/list-runtimes.md new file mode 100644 index 0000000000..c4a3f31174 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/list-runtimes.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let runtimeList = try await functions.listRuntimes() + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/list-specifications.md b/docs/examples/1.8.x/server-swift/examples/functions/list-specifications.md new file mode 100644 index 0000000000..1f5914ba91 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/list-specifications.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let specificationList = try await functions.listSpecifications() + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/list-variables.md b/docs/examples/1.8.x/server-swift/examples/functions/list-variables.md new file mode 100644 index 0000000000..0343e54772 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/list-variables.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let variableList = try await functions.listVariables( + functionId: "<FUNCTION_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/list.md b/docs/examples/1.8.x/server-swift/examples/functions/list.md new file mode 100644 index 0000000000..370b6bddfd --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/list.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let functionList = try await functions.list( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/update-deployment-status.md b/docs/examples/1.8.x/server-swift/examples/functions/update-deployment-status.md new file mode 100644 index 0000000000..1883199655 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/update-deployment-status.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let deployment = try await functions.updateDeploymentStatus( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/update-function-deployment.md b/docs/examples/1.8.x/server-swift/examples/functions/update-function-deployment.md new file mode 100644 index 0000000000..5557d82f10 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/update-function-deployment.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let function = try await functions.updateFunctionDeployment( + functionId: "<FUNCTION_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/update-variable.md b/docs/examples/1.8.x/server-swift/examples/functions/update-variable.md new file mode 100644 index 0000000000..974b2ed0ff --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/update-variable.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let variable = try await functions.updateVariable( + functionId: "<FUNCTION_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", // optional + secret: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/functions/update.md b/docs/examples/1.8.x/server-swift/examples/functions/update.md new file mode 100644 index 0000000000..ebb2828bc8 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/functions/update.md @@ -0,0 +1,31 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let functions = Functions(client) + +let function = try await functions.update( + functionId: "<FUNCTION_ID>", + name: "<NAME>", + runtime: .node145, // optional + execute: ["any"], // optional + events: [], // optional + schedule: "", // optional + timeout: 1, // optional + enabled: false, // optional + logging: false, // optional + entrypoint: "<ENTRYPOINT>", // optional + commands: "<COMMANDS>", // optional + scopes: [], // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + specification: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/graphql/mutation.md b/docs/examples/1.8.x/server-swift/examples/graphql/mutation.md new file mode 100644 index 0000000000..ad33858894 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/graphql/mutation.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let graphql = Graphql(client) + +let any = try await graphql.mutation( + query: [:] +) + diff --git a/docs/examples/1.8.x/server-swift/examples/graphql/query.md b/docs/examples/1.8.x/server-swift/examples/graphql/query.md new file mode 100644 index 0000000000..f087c888a3 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/graphql/query.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let graphql = Graphql(client) + +let any = try await graphql.query( + query: [:] +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-antivirus.md b/docs/examples/1.8.x/server-swift/examples/health/get-antivirus.md new file mode 100644 index 0000000000..5fc335f8fc --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-antivirus.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthAntivirus = try await health.getAntivirus() + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-cache.md b/docs/examples/1.8.x/server-swift/examples/health/get-cache.md new file mode 100644 index 0000000000..a1c514b60e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-cache.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthStatus = try await health.getCache() + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-certificate.md b/docs/examples/1.8.x/server-swift/examples/health/get-certificate.md new file mode 100644 index 0000000000..6adf4d6052 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-certificate.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthCertificate = try await health.getCertificate( + domain: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-db.md b/docs/examples/1.8.x/server-swift/examples/health/get-db.md new file mode 100644 index 0000000000..a6aeb12e44 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-db.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthStatus = try await health.getDB() + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-failed-jobs.md b/docs/examples/1.8.x/server-swift/examples/health/get-failed-jobs.md new file mode 100644 index 0000000000..c508106bfa --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-failed-jobs.md @@ -0,0 +1,15 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getFailedJobs( + name: .v1Database, + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-pub-sub.md b/docs/examples/1.8.x/server-swift/examples/health/get-pub-sub.md new file mode 100644 index 0000000000..9a7766c94a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-pub-sub.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthStatus = try await health.getPubSub() + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-builds.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-builds.md new file mode 100644 index 0000000000..8db346ccbe --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-builds.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueBuilds( + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-certificates.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..4814f29d87 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-certificates.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueCertificates( + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-databases.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-databases.md new file mode 100644 index 0000000000..3acda3ddd7 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-databases.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueDatabases( + name: "<NAME>", // optional + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-deletes.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-deletes.md new file mode 100644 index 0000000000..8be397f53f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-deletes.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueDeletes( + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-functions.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..aa420409d2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-functions.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueFunctions( + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-logs.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..dc989a510f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-logs.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueLogs( + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-mails.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-mails.md new file mode 100644 index 0000000000..2106b2f233 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-mails.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueMails( + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-messaging.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-messaging.md new file mode 100644 index 0000000000..11cb16c5e3 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-messaging.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueMessaging( + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-migrations.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-migrations.md new file mode 100644 index 0000000000..a0a4588b54 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-migrations.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueMigrations( + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-stats-resources.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-stats-resources.md new file mode 100644 index 0000000000..4eb6ba7de3 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-stats-resources.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueStatsResources( + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-usage.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..bfaeab0b36 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-usage.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueUsage( + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-queue-webhooks.md b/docs/examples/1.8.x/server-swift/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..c315406627 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-queue-webhooks.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthQueue = try await health.getQueueWebhooks( + threshold: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-storage-local.md b/docs/examples/1.8.x/server-swift/examples/health/get-storage-local.md new file mode 100644 index 0000000000..9e23c09b6d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-storage-local.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthStatus = try await health.getStorageLocal() + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-storage.md b/docs/examples/1.8.x/server-swift/examples/health/get-storage.md new file mode 100644 index 0000000000..513ebac944 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-storage.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthStatus = try await health.getStorage() + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get-time.md b/docs/examples/1.8.x/server-swift/examples/health/get-time.md new file mode 100644 index 0000000000..6624b40b22 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get-time.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthTime = try await health.getTime() + diff --git a/docs/examples/1.8.x/server-swift/examples/health/get.md b/docs/examples/1.8.x/server-swift/examples/health/get.md new file mode 100644 index 0000000000..ef1ffaab6c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/health/get.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let health = Health(client) + +let healthStatus = try await health.get() + diff --git a/docs/examples/1.8.x/server-swift/examples/locale/get.md b/docs/examples/1.8.x/server-swift/examples/locale/get.md new file mode 100644 index 0000000000..e22f3157c7 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/locale/get.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let locale = try await locale.get() + diff --git a/docs/examples/1.8.x/server-swift/examples/locale/list-codes.md b/docs/examples/1.8.x/server-swift/examples/locale/list-codes.md new file mode 100644 index 0000000000..b31448a119 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/locale/list-codes.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let localeCodeList = try await locale.listCodes() + diff --git a/docs/examples/1.8.x/server-swift/examples/locale/list-continents.md b/docs/examples/1.8.x/server-swift/examples/locale/list-continents.md new file mode 100644 index 0000000000..c75abf8a4d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/locale/list-continents.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let continentList = try await locale.listContinents() + diff --git a/docs/examples/1.8.x/server-swift/examples/locale/list-countries-eu.md b/docs/examples/1.8.x/server-swift/examples/locale/list-countries-eu.md new file mode 100644 index 0000000000..e09f3db4f7 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/locale/list-countries-eu.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let countryList = try await locale.listCountriesEU() + diff --git a/docs/examples/1.8.x/server-swift/examples/locale/list-countries-phones.md b/docs/examples/1.8.x/server-swift/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..de360c4408 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/locale/list-countries-phones.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let phoneList = try await locale.listCountriesPhones() + diff --git a/docs/examples/1.8.x/server-swift/examples/locale/list-countries.md b/docs/examples/1.8.x/server-swift/examples/locale/list-countries.md new file mode 100644 index 0000000000..b214f9899b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/locale/list-countries.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let countryList = try await locale.listCountries() + diff --git a/docs/examples/1.8.x/server-swift/examples/locale/list-currencies.md b/docs/examples/1.8.x/server-swift/examples/locale/list-currencies.md new file mode 100644 index 0000000000..a47cae696b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/locale/list-currencies.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let currencyList = try await locale.listCurrencies() + diff --git a/docs/examples/1.8.x/server-swift/examples/locale/list-languages.md b/docs/examples/1.8.x/server-swift/examples/locale/list-languages.md new file mode 100644 index 0000000000..40db7e5fe6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/locale/list-languages.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let locale = Locale(client) + +let languageList = try await locale.listLanguages() + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-apns-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-apns-provider.md new file mode 100644 index 0000000000..772084dc44 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-apns-provider.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + authKey: "<AUTH_KEY>", // optional + authKeyId: "<AUTH_KEY_ID>", // optional + teamId: "<TEAM_ID>", // optional + bundleId: "<BUNDLE_ID>", // optional + sandbox: false, // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-email.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-email.md new file mode 100644 index 0000000000..a1b4774228 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-email.md @@ -0,0 +1,24 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.createEmail( + messageId: "<MESSAGE_ID>", + subject: "<SUBJECT>", + content: "<CONTENT>", + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + attachments: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-fcm-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-fcm-provider.md new file mode 100644 index 0000000000..2b004507b6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-fcm-provider.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + serviceAccountJSON: [:], // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-mailgun-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-mailgun-provider.md new file mode 100644 index 0000000000..aca295d1bd --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-mailgun-provider.md @@ -0,0 +1,22 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", // optional + domain: "<DOMAIN>", // optional + isEuRegion: false, // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-msg-91-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000000..01503c10cb --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + templateId: "<TEMPLATE_ID>", // optional + senderId: "<SENDER_ID>", // optional + authKey: "<AUTH_KEY>", // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-push.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-push.md new file mode 100644 index 0000000000..498eccb51a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-push.md @@ -0,0 +1,32 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.createPush( + messageId: "<MESSAGE_ID>", + title: "<TITLE>", // optional + body: "<BODY>", // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + data: [:], // optional + action: "<ACTION>", // optional + image: "[ID1:ID2]", // optional + icon: "<ICON>", // optional + sound: "<SOUND>", // optional + color: "<COLOR>", // optional + tag: "<TAG>", // optional + badge: 0, // optional + draft: false, // optional + scheduledAt: "", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: .normal // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-sendgrid-provider.md new file mode 100644 index 0000000000..5275f6cdb7 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-sendgrid-provider.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-sms.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-sms.md new file mode 100644 index 0000000000..28a6ba7a63 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-sms.md @@ -0,0 +1,19 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.createSMS( + messageId: "<MESSAGE_ID>", + content: "<CONTENT>", + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-smtp-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-smtp-provider.md new file mode 100644 index 0000000000..ec9b92c8e1 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-smtp-provider.md @@ -0,0 +1,27 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + host: "<HOST>", + port: 1, // optional + username: "<USERNAME>", // optional + password: "<PASSWORD>", // optional + encryption: .none, // optional + autoTLS: false, // optional + mailer: "<MAILER>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "email@example.com", // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-subscriber.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..cb23162484 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-subscriber.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>") // Your secret JSON Web Token + +let messaging = Messaging(client) + +let subscriber = try await messaging.createSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>", + targetId: "<TARGET_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-telesign-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-telesign-provider.md new file mode 100644 index 0000000000..a787134992 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-telesign-provider.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + customerId: "<CUSTOMER_ID>", // optional + apiKey: "<API_KEY>", // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-textmagic-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-textmagic-provider.md new file mode 100644 index 0000000000..9b12a7d8cb --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-textmagic-provider.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + username: "<USERNAME>", // optional + apiKey: "<API_KEY>", // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-topic.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-topic.md new file mode 100644 index 0000000000..9429c45554 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-topic.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let topic = try await messaging.createTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", + subscribe: ["any"] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-twilio-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-twilio-provider.md new file mode 100644 index 0000000000..7421290e05 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-twilio-provider.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + accountSid: "<ACCOUNT_SID>", // optional + authToken: "<AUTH_TOKEN>", // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/create-vonage-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/create-vonage-provider.md new file mode 100644 index 0000000000..b6a3014391 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/create-vonage-provider.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.createVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", + from: "+12065550100", // optional + apiKey: "<API_KEY>", // optional + apiSecret: "<API_SECRET>", // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/delete-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/delete-provider.md new file mode 100644 index 0000000000..94da565e1f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/delete-provider.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let result = try await messaging.deleteProvider( + providerId: "<PROVIDER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/delete-subscriber.md b/docs/examples/1.8.x/server-swift/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..b0aa96602f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/delete-subscriber.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setJWT("<YOUR_JWT>") // Your secret JSON Web Token + +let messaging = Messaging(client) + +let result = try await messaging.deleteSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/delete-topic.md b/docs/examples/1.8.x/server-swift/examples/messaging/delete-topic.md new file mode 100644 index 0000000000..6676adf94e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/delete-topic.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let result = try await messaging.deleteTopic( + topicId: "<TOPIC_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/delete.md b/docs/examples/1.8.x/server-swift/examples/messaging/delete.md new file mode 100644 index 0000000000..fca66c7f43 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/delete.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let result = try await messaging.delete( + messageId: "<MESSAGE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/get-message.md b/docs/examples/1.8.x/server-swift/examples/messaging/get-message.md new file mode 100644 index 0000000000..b1bbf9d5f0 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/get-message.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.getMessage( + messageId: "<MESSAGE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/get-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/get-provider.md new file mode 100644 index 0000000000..6ff8545bd0 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/get-provider.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.getProvider( + providerId: "<PROVIDER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/get-subscriber.md b/docs/examples/1.8.x/server-swift/examples/messaging/get-subscriber.md new file mode 100644 index 0000000000..55538e073d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/get-subscriber.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let subscriber = try await messaging.getSubscriber( + topicId: "<TOPIC_ID>", + subscriberId: "<SUBSCRIBER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/get-topic.md b/docs/examples/1.8.x/server-swift/examples/messaging/get-topic.md new file mode 100644 index 0000000000..0d2035bd9d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/get-topic.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let topic = try await messaging.getTopic( + topicId: "<TOPIC_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/list-message-logs.md b/docs/examples/1.8.x/server-swift/examples/messaging/list-message-logs.md new file mode 100644 index 0000000000..b7efe6fa9f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/list-message-logs.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let logList = try await messaging.listMessageLogs( + messageId: "<MESSAGE_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/list-messages.md b/docs/examples/1.8.x/server-swift/examples/messaging/list-messages.md new file mode 100644 index 0000000000..73832f7dae --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/list-messages.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let messageList = try await messaging.listMessages( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/list-provider-logs.md b/docs/examples/1.8.x/server-swift/examples/messaging/list-provider-logs.md new file mode 100644 index 0000000000..0633e15b62 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/list-provider-logs.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let logList = try await messaging.listProviderLogs( + providerId: "<PROVIDER_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/list-providers.md b/docs/examples/1.8.x/server-swift/examples/messaging/list-providers.md new file mode 100644 index 0000000000..c24af425a6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/list-providers.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let providerList = try await messaging.listProviders( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/list-subscriber-logs.md b/docs/examples/1.8.x/server-swift/examples/messaging/list-subscriber-logs.md new file mode 100644 index 0000000000..eab170d7cb --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/list-subscriber-logs.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let logList = try await messaging.listSubscriberLogs( + subscriberId: "<SUBSCRIBER_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/list-subscribers.md b/docs/examples/1.8.x/server-swift/examples/messaging/list-subscribers.md new file mode 100644 index 0000000000..a29bcefaf1 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/list-subscribers.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let subscriberList = try await messaging.listSubscribers( + topicId: "<TOPIC_ID>", + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/list-targets.md b/docs/examples/1.8.x/server-swift/examples/messaging/list-targets.md new file mode 100644 index 0000000000..974ae4f7b5 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/list-targets.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let targetList = try await messaging.listTargets( + messageId: "<MESSAGE_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/list-topic-logs.md b/docs/examples/1.8.x/server-swift/examples/messaging/list-topic-logs.md new file mode 100644 index 0000000000..e6f32ad232 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/list-topic-logs.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let logList = try await messaging.listTopicLogs( + topicId: "<TOPIC_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/list-topics.md b/docs/examples/1.8.x/server-swift/examples/messaging/list-topics.md new file mode 100644 index 0000000000..13106e940c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/list-topics.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let topicList = try await messaging.listTopics( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-apns-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-apns-provider.md new file mode 100644 index 0000000000..bed92ba11c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-apns-provider.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateAPNSProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + authKey: "<AUTH_KEY>", // optional + authKeyId: "<AUTH_KEY_ID>", // optional + teamId: "<TEAM_ID>", // optional + bundleId: "<BUNDLE_ID>", // optional + sandbox: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-email.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-email.md new file mode 100644 index 0000000000..1404fb8f77 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-email.md @@ -0,0 +1,24 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.updateEmail( + messageId: "<MESSAGE_ID>", + topics: [], // optional + users: [], // optional + targets: [], // optional + subject: "<SUBJECT>", // optional + content: "<CONTENT>", // optional + draft: false, // optional + html: false, // optional + cc: [], // optional + bcc: [], // optional + scheduledAt: "", // optional + attachments: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-fcm-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-fcm-provider.md new file mode 100644 index 0000000000..efd7e1fb9d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-fcm-provider.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateFCMProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + serviceAccountJSON: [:] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-mailgun-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-mailgun-provider.md new file mode 100644 index 0000000000..8ed28aa40e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-mailgun-provider.md @@ -0,0 +1,22 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateMailgunProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + apiKey: "<API_KEY>", // optional + domain: "<DOMAIN>", // optional + isEuRegion: false, // optional + enabled: false, // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-msg-91-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000000..e4a441c561 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateMsg91Provider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + templateId: "<TEMPLATE_ID>", // optional + senderId: "<SENDER_ID>", // optional + authKey: "<AUTH_KEY>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-push.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-push.md new file mode 100644 index 0000000000..e443161aa9 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-push.md @@ -0,0 +1,32 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.updatePush( + messageId: "<MESSAGE_ID>", + topics: [], // optional + users: [], // optional + targets: [], // optional + title: "<TITLE>", // optional + body: "<BODY>", // optional + data: [:], // optional + action: "<ACTION>", // optional + image: "[ID1:ID2]", // optional + icon: "<ICON>", // optional + sound: "<SOUND>", // optional + color: "<COLOR>", // optional + tag: "<TAG>", // optional + badge: 0, // optional + draft: false, // optional + scheduledAt: "", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: .normal // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-sendgrid-provider.md new file mode 100644 index 0000000000..d363342af8 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-sendgrid-provider.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateSendgridProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + apiKey: "<API_KEY>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-sms.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-sms.md new file mode 100644 index 0000000000..d6dc207b02 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-sms.md @@ -0,0 +1,19 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.updateSMS( + messageId: "<MESSAGE_ID>", + topics: [], // optional + users: [], // optional + targets: [], // optional + content: "<CONTENT>", // optional + draft: false, // optional + scheduledAt: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-smtp-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-smtp-provider.md new file mode 100644 index 0000000000..402c2675d2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-smtp-provider.md @@ -0,0 +1,27 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateSMTPProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + host: "<HOST>", // optional + port: 1, // optional + username: "<USERNAME>", // optional + password: "<PASSWORD>", // optional + encryption: .none, // optional + autoTLS: false, // optional + mailer: "<MAILER>", // optional + fromName: "<FROM_NAME>", // optional + fromEmail: "email@example.com", // optional + replyToName: "<REPLY_TO_NAME>", // optional + replyToEmail: "<REPLY_TO_EMAIL>", // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-telesign-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-telesign-provider.md new file mode 100644 index 0000000000..4475128b71 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-telesign-provider.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateTelesignProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + customerId: "<CUSTOMER_ID>", // optional + apiKey: "<API_KEY>", // optional + from: "<FROM>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-textmagic-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-textmagic-provider.md new file mode 100644 index 0000000000..e412faab65 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-textmagic-provider.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateTextmagicProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + username: "<USERNAME>", // optional + apiKey: "<API_KEY>", // optional + from: "<FROM>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-topic.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-topic.md new file mode 100644 index 0000000000..796f581f07 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-topic.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let topic = try await messaging.updateTopic( + topicId: "<TOPIC_ID>", + name: "<NAME>", // optional + subscribe: ["any"] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-twilio-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-twilio-provider.md new file mode 100644 index 0000000000..7b4592b048 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-twilio-provider.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateTwilioProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + accountSid: "<ACCOUNT_SID>", // optional + authToken: "<AUTH_TOKEN>", // optional + from: "<FROM>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/messaging/update-vonage-provider.md b/docs/examples/1.8.x/server-swift/examples/messaging/update-vonage-provider.md new file mode 100644 index 0000000000..ba10ce2309 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/messaging/update-vonage-provider.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let messaging = Messaging(client) + +let provider = try await messaging.updateVonageProvider( + providerId: "<PROVIDER_ID>", + name: "<NAME>", // optional + enabled: false, // optional + apiKey: "<API_KEY>", // optional + apiSecret: "<API_SECRET>", // optional + from: "<FROM>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/create-deployment.md b/docs/examples/1.8.x/server-swift/examples/sites/create-deployment.md new file mode 100644 index 0000000000..5730e8ef5c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/create-deployment.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createDeployment( + siteId: "<SITE_ID>", + code: InputFile.fromPath("file.png"), + activate: false, + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/create-duplicate-deployment.md b/docs/examples/1.8.x/server-swift/examples/sites/create-duplicate-deployment.md new file mode 100644 index 0000000000..0ec3804d7a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createDuplicateDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/create-template-deployment.md b/docs/examples/1.8.x/server-swift/examples/sites/create-template-deployment.md new file mode 100644 index 0000000000..1cb3e42030 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/create-template-deployment.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createTemplateDeployment( + siteId: "<SITE_ID>", + repository: "<REPOSITORY>", + owner: "<OWNER>", + rootDirectory: "<ROOT_DIRECTORY>", + version: "<VERSION>", + activate: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/create-variable.md b/docs/examples/1.8.x/server-swift/examples/sites/create-variable.md new file mode 100644 index 0000000000..305a683fcd --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/create-variable.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let variable = try await sites.createVariable( + siteId: "<SITE_ID>", + key: "<KEY>", + value: "<VALUE>", + secret: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/create-vcs-deployment.md b/docs/examples/1.8.x/server-swift/examples/sites/create-vcs-deployment.md new file mode 100644 index 0000000000..d72540e715 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/create-vcs-deployment.md @@ -0,0 +1,17 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.createVcsDeployment( + siteId: "<SITE_ID>", + type: .branch, + reference: "<REFERENCE>", + activate: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/create.md b/docs/examples/1.8.x/server-swift/examples/sites/create.md new file mode 100644 index 0000000000..1f961d0535 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/create.md @@ -0,0 +1,31 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.create( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: .analog, + buildRuntime: .node145, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>", // optional + adapter: .static, // optional + installationId: "<INSTALLATION_ID>", // optional + fallbackFile: "<FALLBACK_FILE>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + specification: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/delete-deployment.md b/docs/examples/1.8.x/server-swift/examples/sites/delete-deployment.md new file mode 100644 index 0000000000..c4f6971d7f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/delete-deployment.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.deleteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/delete-log.md b/docs/examples/1.8.x/server-swift/examples/sites/delete-log.md new file mode 100644 index 0000000000..1066551495 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/delete-log.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.deleteLog( + siteId: "<SITE_ID>", + logId: "<LOG_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/delete-variable.md b/docs/examples/1.8.x/server-swift/examples/sites/delete-variable.md new file mode 100644 index 0000000000..a33e1c549e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/delete-variable.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.deleteVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/delete.md b/docs/examples/1.8.x/server-swift/examples/sites/delete.md new file mode 100644 index 0000000000..8283f70de2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/delete.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let result = try await sites.delete( + siteId: "<SITE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/get-deployment-download.md b/docs/examples/1.8.x/server-swift/examples/sites/get-deployment-download.md new file mode 100644 index 0000000000..5ed409c53b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/get-deployment-download.md @@ -0,0 +1,16 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let bytes = try await sites.getDeploymentDownload( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>", + type: .source // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/get-deployment.md b/docs/examples/1.8.x/server-swift/examples/sites/get-deployment.md new file mode 100644 index 0000000000..b9f04f3dfc --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/get-deployment.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.getDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/get-log.md b/docs/examples/1.8.x/server-swift/examples/sites/get-log.md new file mode 100644 index 0000000000..1e5c8121a6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/get-log.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let execution = try await sites.getLog( + siteId: "<SITE_ID>", + logId: "<LOG_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/get-variable.md b/docs/examples/1.8.x/server-swift/examples/sites/get-variable.md new file mode 100644 index 0000000000..f9258fd5f6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/get-variable.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let variable = try await sites.getVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/get.md b/docs/examples/1.8.x/server-swift/examples/sites/get.md new file mode 100644 index 0000000000..a14a9b73e7 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/get.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.get( + siteId: "<SITE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/list-deployments.md b/docs/examples/1.8.x/server-swift/examples/sites/list-deployments.md new file mode 100644 index 0000000000..5516b74224 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/list-deployments.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deploymentList = try await sites.listDeployments( + siteId: "<SITE_ID>", + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/list-frameworks.md b/docs/examples/1.8.x/server-swift/examples/sites/list-frameworks.md new file mode 100644 index 0000000000..13fdf9bca2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/list-frameworks.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let frameworkList = try await sites.listFrameworks() + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/list-logs.md b/docs/examples/1.8.x/server-swift/examples/sites/list-logs.md new file mode 100644 index 0000000000..3eb2a8c096 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/list-logs.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let executionList = try await sites.listLogs( + siteId: "<SITE_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/list-specifications.md b/docs/examples/1.8.x/server-swift/examples/sites/list-specifications.md new file mode 100644 index 0000000000..302e9ea50e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/list-specifications.md @@ -0,0 +1,11 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let specificationList = try await sites.listSpecifications() + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/list-variables.md b/docs/examples/1.8.x/server-swift/examples/sites/list-variables.md new file mode 100644 index 0000000000..9818224988 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/list-variables.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let variableList = try await sites.listVariables( + siteId: "<SITE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/list.md b/docs/examples/1.8.x/server-swift/examples/sites/list.md new file mode 100644 index 0000000000..f330c721b9 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/list.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let siteList = try await sites.list( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/update-deployment-status.md b/docs/examples/1.8.x/server-swift/examples/sites/update-deployment-status.md new file mode 100644 index 0000000000..104058713d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/update-deployment-status.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let deployment = try await sites.updateDeploymentStatus( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/update-site-deployment.md b/docs/examples/1.8.x/server-swift/examples/sites/update-site-deployment.md new file mode 100644 index 0000000000..ce330e4985 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/update-site-deployment.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.updateSiteDeployment( + siteId: "<SITE_ID>", + deploymentId: "<DEPLOYMENT_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/update-variable.md b/docs/examples/1.8.x/server-swift/examples/sites/update-variable.md new file mode 100644 index 0000000000..8385c20e90 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/update-variable.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let variable = try await sites.updateVariable( + siteId: "<SITE_ID>", + variableId: "<VARIABLE_ID>", + key: "<KEY>", + value: "<VALUE>", // optional + secret: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/sites/update.md b/docs/examples/1.8.x/server-swift/examples/sites/update.md new file mode 100644 index 0000000000..e7de2fbd17 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/sites/update.md @@ -0,0 +1,31 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let sites = Sites(client) + +let site = try await sites.update( + siteId: "<SITE_ID>", + name: "<NAME>", + framework: .analog, + enabled: false, // optional + logging: false, // optional + timeout: 1, // optional + installCommand: "<INSTALL_COMMAND>", // optional + buildCommand: "<BUILD_COMMAND>", // optional + outputDirectory: "<OUTPUT_DIRECTORY>", // optional + buildRuntime: .node145, // optional + adapter: .static, // optional + fallbackFile: "<FALLBACK_FILE>", // optional + installationId: "<INSTALLATION_ID>", // optional + providerRepositoryId: "<PROVIDER_REPOSITORY_ID>", // optional + providerBranch: "<PROVIDER_BRANCH>", // optional + providerSilentMode: false, // optional + providerRootDirectory: "<PROVIDER_ROOT_DIRECTORY>", // optional + specification: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/create-bucket.md b/docs/examples/1.8.x/server-swift/examples/storage/create-bucket.md new file mode 100644 index 0000000000..a664e14f5f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/create-bucket.md @@ -0,0 +1,23 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let storage = Storage(client) + +let bucket = try await storage.createBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: .none, // optional + encryption: false, // optional + antivirus: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/create-file.md b/docs/examples/1.8.x/server-swift/examples/storage/create-file.md new file mode 100644 index 0000000000..540c869fab --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/create-file.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let file = try await storage.createFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + file: InputFile.fromPath("file.png"), + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/delete-bucket.md b/docs/examples/1.8.x/server-swift/examples/storage/delete-bucket.md new file mode 100644 index 0000000000..2f4916dba2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/delete-bucket.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let storage = Storage(client) + +let result = try await storage.deleteBucket( + bucketId: "<BUCKET_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/delete-file.md b/docs/examples/1.8.x/server-swift/examples/storage/delete-file.md new file mode 100644 index 0000000000..7ac1b194e6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/delete-file.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let result = try await storage.deleteFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/get-bucket.md b/docs/examples/1.8.x/server-swift/examples/storage/get-bucket.md new file mode 100644 index 0000000000..296a27bf85 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/get-bucket.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let storage = Storage(client) + +let bucket = try await storage.getBucket( + bucketId: "<BUCKET_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/get-file-download.md b/docs/examples/1.8.x/server-swift/examples/storage/get-file-download.md new file mode 100644 index 0000000000..b362b08cda --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/get-file-download.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let bytes = try await storage.getFileDownload( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/get-file-preview.md b/docs/examples/1.8.x/server-swift/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..d8c2380b7d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/get-file-preview.md @@ -0,0 +1,27 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let bytes = try await storage.getFilePreview( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + width: 0, // optional + height: 0, // optional + gravity: .center, // optional + quality: -1, // optional + borderWidth: 0, // optional + borderColor: "", // optional + borderRadius: 0, // optional + opacity: 0, // optional + rotation: -360, // optional + background: "", // optional + output: .jpg, // optional + token: "<TOKEN>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/get-file-view.md b/docs/examples/1.8.x/server-swift/examples/storage/get-file-view.md new file mode 100644 index 0000000000..a3b94eec45 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/get-file-view.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let bytes = try await storage.getFileView( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + token: "<TOKEN>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/get-file.md b/docs/examples/1.8.x/server-swift/examples/storage/get-file.md new file mode 100644 index 0000000000..033a643a83 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/get-file.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let file = try await storage.getFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/list-buckets.md b/docs/examples/1.8.x/server-swift/examples/storage/list-buckets.md new file mode 100644 index 0000000000..957d266e9a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/list-buckets.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let storage = Storage(client) + +let bucketList = try await storage.listBuckets( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/list-files.md b/docs/examples/1.8.x/server-swift/examples/storage/list-files.md new file mode 100644 index 0000000000..103d3c328c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/list-files.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let fileList = try await storage.listFiles( + bucketId: "<BUCKET_ID>", + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/update-bucket.md b/docs/examples/1.8.x/server-swift/examples/storage/update-bucket.md new file mode 100644 index 0000000000..de3b5bf0e5 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/update-bucket.md @@ -0,0 +1,23 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let storage = Storage(client) + +let bucket = try await storage.updateBucket( + bucketId: "<BUCKET_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + fileSecurity: false, // optional + enabled: false, // optional + maximumFileSize: 1, // optional + allowedFileExtensions: [], // optional + compression: .none, // optional + encryption: false, // optional + antivirus: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/storage/update-file.md b/docs/examples/1.8.x/server-swift/examples/storage/update-file.md new file mode 100644 index 0000000000..d4d7484bd3 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/storage/update-file.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let storage = Storage(client) + +let file = try await storage.updateFile( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + name: "<NAME>", // optional + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-boolean-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..af4b7bdf9d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnBoolean = try await tablesDB.createBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: false, // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-datetime-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..ee1945d563 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnDatetime = try await tablesDB.createDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-email-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000000..4ca0fe78aa --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-email-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnEmail = try await tablesDB.createEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "email@example.com", // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-enum-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..ccddf5297b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-enum-column.md @@ -0,0 +1,19 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnEnum = try await tablesDB.createEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + elements: [], + required: false, + default: "<DEFAULT>", // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-float-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000000..c1c685bc02 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-float-column.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnFloat = try await tablesDB.createFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + min: 0, // optional + max: 0, // optional + default: 0, // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-index.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-index.md new file mode 100644 index 0000000000..3620c625eb --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-index.md @@ -0,0 +1,20 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnIndex = try await tablesDB.createIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + type: .key, + columns: [], + orders: [], // optional + lengths: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-integer-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..52ad14a592 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-integer-column.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnInteger = try await tablesDB.createIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + min: 0, // optional + max: 0, // optional + default: 0, // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-ip-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..d8801c5a24 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-ip-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnIp = try await tablesDB.createIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-line-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-line-column.md new file mode 100644 index 0000000000..2737d91cb8 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-line-column.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnLine = try await tablesDB.createLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-point-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-point-column.md new file mode 100644 index 0000000000..2652ea0427 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-point-column.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnPoint = try await tablesDB.createPointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [1, 2] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-polygon-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..860a1eeab2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-polygon-column.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnPolygon = try await tablesDB.createPolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-relationship-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..4c464b5d70 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,21 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnRelationship = try await tablesDB.createRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + relatedTableId: "<RELATED_TABLE_ID>", + type: .oneToOne, + twoWay: false, // optional + key: "", // optional + twoWayKey: "", // optional + onDelete: .cascade // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-row.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-row.md new file mode 100644 index 0000000000..0c59a65755 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-row.md @@ -0,0 +1,23 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.createRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: [ + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + ], + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-rows.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-rows.md new file mode 100644 index 0000000000..25ea512590 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-rows.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.createRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: [] +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-string-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000000..e38dcb8014 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-string-column.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnString = try await tablesDB.createStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + size: 1, + required: false, + default: "<DEFAULT>", // optional + array: false, // optional + encrypt: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-table.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-table.md new file mode 100644 index 0000000000..11d14e1881 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-table.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let table = try await tablesDB.createTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create-url-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000000..083556f2a3 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create-url-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnUrl = try await tablesDB.createUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "https://example.com", // optional + array: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/create.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/create.md new file mode 100644 index 0000000000..be88b5950d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/create.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let database = try await tablesDB.create( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/decrement-row-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..196289e994 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.decrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "", + value: 0, // optional + min: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-column.md new file mode 100644 index 0000000000..f9f2c5cf60 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-column.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-index.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-index.md new file mode 100644 index 0000000000..0a413b6418 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-index.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-row.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-row.md new file mode 100644 index 0000000000..5449c74edb --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-row.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-rows.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000000..85d8957f78 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-rows.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.deleteRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-table.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-table.md new file mode 100644 index 0000000000..1986f3a19e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete-table.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.deleteTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/delete.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete.md new file mode 100644 index 0000000000..08e6ddc2d1 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/delete.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.delete( + databaseId: "<DATABASE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/get-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/get-column.md new file mode 100644 index 0000000000..2d88b03967 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/get-column.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let result = try await tablesDB.getColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/get-index.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/get-index.md new file mode 100644 index 0000000000..6f65fdba2b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/get-index.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnIndex = try await tablesDB.getIndex( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/get-row.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/get-row.md new file mode 100644 index 0000000000..17e6ccbb52 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/get-row.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.getRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/get-table.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/get-table.md new file mode 100644 index 0000000000..e9167d4d0a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/get-table.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let table = try await tablesDB.getTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/get.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/get.md new file mode 100644 index 0000000000..d670cf7a18 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/get.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let database = try await tablesDB.get( + databaseId: "<DATABASE_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/increment-row-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..38aa7581c6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/increment-row-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.incrementRowColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + column: "", + value: 0, // optional + max: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/list-columns.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/list-columns.md new file mode 100644 index 0000000000..271a6d4afd --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/list-columns.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnList = try await tablesDB.listColumns( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/list-indexes.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000000..a8e2770f8f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/list-indexes.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnIndexList = try await tablesDB.listIndexes( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/list-rows.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/list-rows.md new file mode 100644 index 0000000000..7320147685 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/list-rows.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.listRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/list-tables.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/list-tables.md new file mode 100644 index 0000000000..46fcdcf0a6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/list-tables.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let tableList = try await tablesDB.listTables( + databaseId: "<DATABASE_ID>", + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/list.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/list.md new file mode 100644 index 0000000000..6923d8ade3 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/list.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let databaseList = try await tablesDB.list( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-boolean-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..c8ca0fc499 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnBoolean = try await tablesDB.updateBooleanColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: false, + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-datetime-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..67e411bd35 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnDatetime = try await tablesDB.updateDatetimeColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-email-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000000..56a7d074de --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-email-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnEmail = try await tablesDB.updateEmailColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "email@example.com", + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-enum-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..a86d114c0c --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-enum-column.md @@ -0,0 +1,19 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnEnum = try await tablesDB.updateEnumColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + elements: [], + required: false, + default: "<DEFAULT>", + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-float-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000000..10806aae70 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-float-column.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnFloat = try await tablesDB.updateFloatColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: 0, + min: 0, // optional + max: 0, // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-integer-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..ba6bfa589a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-integer-column.md @@ -0,0 +1,20 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnInteger = try await tablesDB.updateIntegerColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: 0, + min: 0, // optional + max: 0, // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-ip-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..5686e71016 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-ip-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnIp = try await tablesDB.updateIpColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "", + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-line-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-line-column.md new file mode 100644 index 0000000000..d63e024849 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-line-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnLine = try await tablesDB.updateLineColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[1, 2], [3, 4], [5, 6]], // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-point-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-point-column.md new file mode 100644 index 0000000000..3427b17bdf --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-point-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnPoint = try await tablesDB.updatePointColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [1, 2], // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-polygon-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..140665a1be --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-polygon-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnPolygon = try await tablesDB.updatePolygonColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-relationship-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..0a021ff03e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,18 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnRelationship = try await tablesDB.updateRelationshipColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + onDelete: .cascade, // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-row.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-row.md new file mode 100644 index 0000000000..e06338b3d6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-row.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.updateRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: [:], // optional + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-rows.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-rows.md new file mode 100644 index 0000000000..58894f5b85 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-rows.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.updateRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + data: [:], // optional + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-string-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000000..55efca1c67 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-string-column.md @@ -0,0 +1,19 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnString = try await tablesDB.updateStringColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "<DEFAULT>", + size: 1, // optional + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-table.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-table.md new file mode 100644 index 0000000000..278d6e6b4e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-table.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let table = try await tablesDB.updateTable( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + name: "<NAME>", + permissions: ["read("any")"], // optional + rowSecurity: false, // optional + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update-url-column.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000000..693fe52796 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update-url-column.md @@ -0,0 +1,18 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let columnUrl = try await tablesDB.updateUrlColumn( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + key: "", + required: false, + default: "https://example.com", + newKey: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/update.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/update.md new file mode 100644 index 0000000000..4a7dcc8c53 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/update.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let database = try await tablesDB.update( + databaseId: "<DATABASE_ID>", + name: "<NAME>", + enabled: false // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/upsert-row.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000000..dc133f6cd1 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/upsert-row.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let tablesDB = TablesDB(client) + +let row = try await tablesDB.upsertRow( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rowId: "<ROW_ID>", + data: [:], // optional + permissions: ["read("any")"] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tablesdb/upsert-rows.md b/docs/examples/1.8.x/server-swift/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..fe35f0da91 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tablesdb/upsert-rows.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tablesDB = TablesDB(client) + +let rowList = try await tablesDB.upsertRows( + databaseId: "<DATABASE_ID>", + tableId: "<TABLE_ID>", + rows: [] +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/create-membership.md b/docs/examples/1.8.x/server-swift/examples/teams/create-membership.md new file mode 100644 index 0000000000..9010372175 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/create-membership.md @@ -0,0 +1,19 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let membership = try await teams.createMembership( + teamId: "<TEAM_ID>", + roles: [], + email: "email@example.com", // optional + userId: "<USER_ID>", // optional + phone: "+12065550100", // optional + url: "https://example.com", // optional + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/create.md b/docs/examples/1.8.x/server-swift/examples/teams/create.md new file mode 100644 index 0000000000..71f3d70874 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/create.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let team = try await teams.create( + teamId: "<TEAM_ID>", + name: "<NAME>", + roles: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/delete-membership.md b/docs/examples/1.8.x/server-swift/examples/teams/delete-membership.md new file mode 100644 index 0000000000..dbdbc96ff9 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/delete-membership.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let result = try await teams.deleteMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/delete.md b/docs/examples/1.8.x/server-swift/examples/teams/delete.md new file mode 100644 index 0000000000..ee9daaa55b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/delete.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let result = try await teams.delete( + teamId: "<TEAM_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/get-membership.md b/docs/examples/1.8.x/server-swift/examples/teams/get-membership.md new file mode 100644 index 0000000000..ab7b29eb3a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/get-membership.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let membership = try await teams.getMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/get-prefs.md b/docs/examples/1.8.x/server-swift/examples/teams/get-prefs.md new file mode 100644 index 0000000000..ae3e9f2875 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/get-prefs.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let preferences = try await teams.getPrefs( + teamId: "<TEAM_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/get.md b/docs/examples/1.8.x/server-swift/examples/teams/get.md new file mode 100644 index 0000000000..cd4b75567a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/get.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let team = try await teams.get( + teamId: "<TEAM_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/list-memberships.md b/docs/examples/1.8.x/server-swift/examples/teams/list-memberships.md new file mode 100644 index 0000000000..0670d91ab2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/list-memberships.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let membershipList = try await teams.listMemberships( + teamId: "<TEAM_ID>", + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/list.md b/docs/examples/1.8.x/server-swift/examples/teams/list.md new file mode 100644 index 0000000000..b5130cbf89 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/list.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let teamList = try await teams.list( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/update-membership-status.md b/docs/examples/1.8.x/server-swift/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..69fca1de74 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/update-membership-status.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let membership = try await teams.updateMembershipStatus( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + userId: "<USER_ID>", + secret: "<SECRET>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/update-membership.md b/docs/examples/1.8.x/server-swift/examples/teams/update-membership.md new file mode 100644 index 0000000000..47f28e74fd --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/update-membership.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let membership = try await teams.updateMembership( + teamId: "<TEAM_ID>", + membershipId: "<MEMBERSHIP_ID>", + roles: [] +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/update-name.md b/docs/examples/1.8.x/server-swift/examples/teams/update-name.md new file mode 100644 index 0000000000..56f5ab60db --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/update-name.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let team = try await teams.updateName( + teamId: "<TEAM_ID>", + name: "<NAME>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/teams/update-prefs.md b/docs/examples/1.8.x/server-swift/examples/teams/update-prefs.md new file mode 100644 index 0000000000..b8bb200b65 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/teams/update-prefs.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setSession("") // The user session to authenticate with + +let teams = Teams(client) + +let preferences = try await teams.updatePrefs( + teamId: "<TEAM_ID>", + prefs: [:] +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tokens/create-file-token.md b/docs/examples/1.8.x/server-swift/examples/tokens/create-file-token.md new file mode 100644 index 0000000000..2bdc123b61 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tokens/create-file-token.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tokens = Tokens(client) + +let resourceToken = try await tokens.createFileToken( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + expire: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tokens/delete.md b/docs/examples/1.8.x/server-swift/examples/tokens/delete.md new file mode 100644 index 0000000000..8b4db1435d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tokens/delete.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tokens = Tokens(client) + +let result = try await tokens.delete( + tokenId: "<TOKEN_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tokens/get.md b/docs/examples/1.8.x/server-swift/examples/tokens/get.md new file mode 100644 index 0000000000..d6eac81059 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tokens/get.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tokens = Tokens(client) + +let resourceToken = try await tokens.get( + tokenId: "<TOKEN_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tokens/list.md b/docs/examples/1.8.x/server-swift/examples/tokens/list.md new file mode 100644 index 0000000000..8438050754 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tokens/list.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tokens = Tokens(client) + +let resourceTokenList = try await tokens.list( + bucketId: "<BUCKET_ID>", + fileId: "<FILE_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/tokens/update.md b/docs/examples/1.8.x/server-swift/examples/tokens/update.md new file mode 100644 index 0000000000..14bcb30f78 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/tokens/update.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let tokens = Tokens(client) + +let resourceToken = try await tokens.update( + tokenId: "<TOKEN_ID>", + expire: "" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-argon-2-user.md b/docs/examples/1.8.x/server-swift/examples/users/create-argon-2-user.md new file mode 100644 index 0000000000..9b7477001d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-argon-2-user.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createArgon2User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-bcrypt-user.md b/docs/examples/1.8.x/server-swift/examples/users/create-bcrypt-user.md new file mode 100644 index 0000000000..ad5a81fe34 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-bcrypt-user.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createBcryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-jwt.md b/docs/examples/1.8.x/server-swift/examples/users/create-jwt.md new file mode 100644 index 0000000000..d61adfb9a7 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-jwt.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let jwt = try await users.createJWT( + userId: "<USER_ID>", + sessionId: "<SESSION_ID>", // optional + duration: 0 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-md-5-user.md b/docs/examples/1.8.x/server-swift/examples/users/create-md-5-user.md new file mode 100644 index 0000000000..ffe7180c5e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-md-5-user.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createMD5User( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.8.x/server-swift/examples/users/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..5f073d10e6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let mfaRecoveryCodes = try await users.createMFARecoveryCodes( + userId: "<USER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-ph-pass-user.md b/docs/examples/1.8.x/server-swift/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000000..e1d8d3f3ef --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-ph-pass-user.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createPHPassUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-scrypt-modified-user.md b/docs/examples/1.8.x/server-swift/examples/users/create-scrypt-modified-user.md new file mode 100644 index 0000000000..d6c67f6f3d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-scrypt-modified-user.md @@ -0,0 +1,19 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createScryptModifiedUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordSaltSeparator: "<PASSWORD_SALT_SEPARATOR>", + passwordSignerKey: "<PASSWORD_SIGNER_KEY>", + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-scrypt-user.md b/docs/examples/1.8.x/server-swift/examples/users/create-scrypt-user.md new file mode 100644 index 0000000000..16452c4606 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-scrypt-user.md @@ -0,0 +1,21 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createScryptUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordSalt: "<PASSWORD_SALT>", + passwordCpu: 0, + passwordMemory: 0, + passwordParallel: 0, + passwordLength: 0, + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-session.md b/docs/examples/1.8.x/server-swift/examples/users/create-session.md new file mode 100644 index 0000000000..cf6f67bd91 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-session.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let session = try await users.createSession( + userId: "<USER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-sha-user.md b/docs/examples/1.8.x/server-swift/examples/users/create-sha-user.md new file mode 100644 index 0000000000..ac42f2fe9d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-sha-user.md @@ -0,0 +1,18 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.createSHAUser( + userId: "<USER_ID>", + email: "email@example.com", + password: "password", + passwordVersion: .sha1, // optional + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-target.md b/docs/examples/1.8.x/server-swift/examples/users/create-target.md new file mode 100644 index 0000000000..e736afcf31 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-target.md @@ -0,0 +1,19 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let target = try await users.createTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + providerType: .email, + identifier: "<IDENTIFIER>", + providerId: "<PROVIDER_ID>", // optional + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create-token.md b/docs/examples/1.8.x/server-swift/examples/users/create-token.md new file mode 100644 index 0000000000..ca1767e178 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create-token.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let token = try await users.createToken( + userId: "<USER_ID>", + length: 4, // optional + expire: 60 // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/create.md b/docs/examples/1.8.x/server-swift/examples/users/create.md new file mode 100644 index 0000000000..98b886005b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/create.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.create( + userId: "<USER_ID>", + email: "email@example.com", // optional + phone: "+12065550100", // optional + password: "", // optional + name: "<NAME>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/delete-identity.md b/docs/examples/1.8.x/server-swift/examples/users/delete-identity.md new file mode 100644 index 0000000000..bb3d812457 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/delete-identity.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.deleteIdentity( + identityId: "<IDENTITY_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/delete-mfa-authenticator.md b/docs/examples/1.8.x/server-swift/examples/users/delete-mfa-authenticator.md new file mode 100644 index 0000000000..be9f39529e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/delete-mfa-authenticator.md @@ -0,0 +1,15 @@ +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.deleteMFAAuthenticator( + userId: "<USER_ID>", + type: .totp +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/delete-session.md b/docs/examples/1.8.x/server-swift/examples/users/delete-session.md new file mode 100644 index 0000000000..c664e4f2ba --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/delete-session.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.deleteSession( + userId: "<USER_ID>", + sessionId: "<SESSION_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/delete-sessions.md b/docs/examples/1.8.x/server-swift/examples/users/delete-sessions.md new file mode 100644 index 0000000000..92ab9d7748 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/delete-sessions.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.deleteSessions( + userId: "<USER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/delete-target.md b/docs/examples/1.8.x/server-swift/examples/users/delete-target.md new file mode 100644 index 0000000000..1cce56657a --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/delete-target.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.deleteTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/delete.md b/docs/examples/1.8.x/server-swift/examples/users/delete.md new file mode 100644 index 0000000000..8dfe648d6e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/delete.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let result = try await users.delete( + userId: "<USER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.8.x/server-swift/examples/users/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..874076c6ac --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/get-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let mfaRecoveryCodes = try await users.getMFARecoveryCodes( + userId: "<USER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/get-prefs.md b/docs/examples/1.8.x/server-swift/examples/users/get-prefs.md new file mode 100644 index 0000000000..c4ae61d9dd --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/get-prefs.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let preferences = try await users.getPrefs( + userId: "<USER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/get-target.md b/docs/examples/1.8.x/server-swift/examples/users/get-target.md new file mode 100644 index 0000000000..100c56398d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/get-target.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let target = try await users.getTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/get.md b/docs/examples/1.8.x/server-swift/examples/users/get.md new file mode 100644 index 0000000000..563042b8ef --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/get.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.get( + userId: "<USER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/list-identities.md b/docs/examples/1.8.x/server-swift/examples/users/list-identities.md new file mode 100644 index 0000000000..8cbe8a71f4 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/list-identities.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let identityList = try await users.listIdentities( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/list-logs.md b/docs/examples/1.8.x/server-swift/examples/users/list-logs.md new file mode 100644 index 0000000000..80d9199c3e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/list-logs.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let logList = try await users.listLogs( + userId: "<USER_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/list-memberships.md b/docs/examples/1.8.x/server-swift/examples/users/list-memberships.md new file mode 100644 index 0000000000..0ae34d4582 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/list-memberships.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let membershipList = try await users.listMemberships( + userId: "<USER_ID>", + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/list-mfa-factors.md b/docs/examples/1.8.x/server-swift/examples/users/list-mfa-factors.md new file mode 100644 index 0000000000..4a58a07147 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/list-mfa-factors.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let mfaFactors = try await users.listMFAFactors( + userId: "<USER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/list-sessions.md b/docs/examples/1.8.x/server-swift/examples/users/list-sessions.md new file mode 100644 index 0000000000..e0278279a4 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/list-sessions.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let sessionList = try await users.listSessions( + userId: "<USER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/list-targets.md b/docs/examples/1.8.x/server-swift/examples/users/list-targets.md new file mode 100644 index 0000000000..b069781f70 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/list-targets.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let targetList = try await users.listTargets( + userId: "<USER_ID>", + queries: [] // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/list.md b/docs/examples/1.8.x/server-swift/examples/users/list.md new file mode 100644 index 0000000000..45ccf23961 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/list.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let userList = try await users.list( + queries: [], // optional + search: "<SEARCH>" // optional +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-email-verification.md b/docs/examples/1.8.x/server-swift/examples/users/update-email-verification.md new file mode 100644 index 0000000000..e0de947fa2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-email-verification.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateEmailVerification( + userId: "<USER_ID>", + emailVerification: false +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-email.md b/docs/examples/1.8.x/server-swift/examples/users/update-email.md new file mode 100644 index 0000000000..4d3c1c2db2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-email.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateEmail( + userId: "<USER_ID>", + email: "email@example.com" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-labels.md b/docs/examples/1.8.x/server-swift/examples/users/update-labels.md new file mode 100644 index 0000000000..8916996b1f --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-labels.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateLabels( + userId: "<USER_ID>", + labels: [] +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.8.x/server-swift/examples/users/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..7ebb34efcb --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-mfa-recovery-codes.md @@ -0,0 +1,13 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let mfaRecoveryCodes = try await users.updateMFARecoveryCodes( + userId: "<USER_ID>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-mfa.md b/docs/examples/1.8.x/server-swift/examples/users/update-mfa.md new file mode 100644 index 0000000000..ca442b3a3b --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-mfa.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateMFA( + userId: "<USER_ID>", + mfa: false +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-name.md b/docs/examples/1.8.x/server-swift/examples/users/update-name.md new file mode 100644 index 0000000000..3735b706d8 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-name.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateName( + userId: "<USER_ID>", + name: "<NAME>" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-password.md b/docs/examples/1.8.x/server-swift/examples/users/update-password.md new file mode 100644 index 0000000000..3a5b804478 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-password.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updatePassword( + userId: "<USER_ID>", + password: "" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-phone-verification.md b/docs/examples/1.8.x/server-swift/examples/users/update-phone-verification.md new file mode 100644 index 0000000000..fffd768f5d --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-phone-verification.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updatePhoneVerification( + userId: "<USER_ID>", + phoneVerification: false +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-phone.md b/docs/examples/1.8.x/server-swift/examples/users/update-phone.md new file mode 100644 index 0000000000..8411ad22a2 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-phone.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updatePhone( + userId: "<USER_ID>", + number: "+12065550100" +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-prefs.md b/docs/examples/1.8.x/server-swift/examples/users/update-prefs.md new file mode 100644 index 0000000000..c71b712df3 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-prefs.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let preferences = try await users.updatePrefs( + userId: "<USER_ID>", + prefs: [:] +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-status.md b/docs/examples/1.8.x/server-swift/examples/users/update-status.md new file mode 100644 index 0000000000..43ecea44f6 --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-status.md @@ -0,0 +1,14 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let user = try await users.updateStatus( + userId: "<USER_ID>", + status: false +) + diff --git a/docs/examples/1.8.x/server-swift/examples/users/update-target.md b/docs/examples/1.8.x/server-swift/examples/users/update-target.md new file mode 100644 index 0000000000..579f0d282e --- /dev/null +++ b/docs/examples/1.8.x/server-swift/examples/users/update-target.md @@ -0,0 +1,17 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("<YOUR_PROJECT_ID>") // Your project ID + .setKey("<YOUR_API_KEY>") // Your secret API key + +let users = Users(client) + +let target = try await users.updateTarget( + userId: "<USER_ID>", + targetId: "<TARGET_ID>", + identifier: "<IDENTIFIER>", // optional + providerId: "<PROVIDER_ID>", // optional + name: "<NAME>" // optional +) + diff --git a/docs/references/account/create-token-email.md b/docs/references/account/create-token-email.md index 3e49899888..3ed175c7f9 100644 --- a/docs/references/account/create-token-email.md +++ b/docs/references/account/create-token-email.md @@ -1,3 +1,3 @@ -Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. +Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. -A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). \ No newline at end of file +A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). diff --git a/docs/references/databases/create-attribute-enum.md b/docs/references/databases/create-attribute-enum.md deleted file mode 100644 index 209c891d97..0000000000 --- a/docs/references/databases/create-attribute-enum.md +++ /dev/null @@ -1 +0,0 @@ -Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. diff --git a/docs/references/databases/create-enum-attribute.md b/docs/references/databases/create-enum-attribute.md index 02ed0a5d60..0e201cf7eb 100644 --- a/docs/references/databases/create-enum-attribute.md +++ b/docs/references/databases/create-enum-attribute.md @@ -1 +1 @@ -Create an enum attribute. +Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. diff --git a/docs/references/databases/create-line-attribute.md b/docs/references/databases/create-line-attribute.md new file mode 100644 index 0000000000..96f1509936 --- /dev/null +++ b/docs/references/databases/create-line-attribute.md @@ -0,0 +1 @@ +Create a geometric line attribute. \ No newline at end of file diff --git a/docs/references/databases/create-point-attribute.md b/docs/references/databases/create-point-attribute.md new file mode 100644 index 0000000000..dd92ffc98e --- /dev/null +++ b/docs/references/databases/create-point-attribute.md @@ -0,0 +1 @@ +Create a geometric point attribute. \ No newline at end of file diff --git a/docs/references/databases/create-polygon-attribute.md b/docs/references/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..7cb3985ff7 --- /dev/null +++ b/docs/references/databases/create-polygon-attribute.md @@ -0,0 +1 @@ +Create a geometric polygon attribute. \ No newline at end of file diff --git a/docs/references/databases/decrement-document-attribute.md b/docs/references/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..e0ed8140ea --- /dev/null +++ b/docs/references/databases/decrement-document-attribute.md @@ -0,0 +1 @@ +Decrement a specific attribute of a document by a given value. \ No newline at end of file diff --git a/docs/references/databases/get-usage.md b/docs/references/databases/get-usage.md deleted file mode 100644 index d41f8704c8..0000000000 --- a/docs/references/databases/get-usage.md +++ /dev/null @@ -1 +0,0 @@ -Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. \ No newline at end of file diff --git a/docs/references/databases/increment-document-attribute.md b/docs/references/databases/increment-document-attribute.md new file mode 100644 index 0000000000..13bd612eed --- /dev/null +++ b/docs/references/databases/increment-document-attribute.md @@ -0,0 +1 @@ +Increment a specific attribute of a document by a given value. \ No newline at end of file diff --git a/docs/references/databases/list-usage.md b/docs/references/databases/list-usage.md new file mode 100644 index 0000000000..a88e76680e --- /dev/null +++ b/docs/references/databases/list-usage.md @@ -0,0 +1 @@ +List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. \ No newline at end of file diff --git a/docs/references/databases/update-line-attribute.md b/docs/references/databases/update-line-attribute.md new file mode 100644 index 0000000000..b55d31c5f6 --- /dev/null +++ b/docs/references/databases/update-line-attribute.md @@ -0,0 +1 @@ +Update a line attribute. Changing the `default` value will not update already existing documents. \ No newline at end of file diff --git a/docs/references/databases/update-point-attribute.md b/docs/references/databases/update-point-attribute.md new file mode 100644 index 0000000000..f40d18c6e5 --- /dev/null +++ b/docs/references/databases/update-point-attribute.md @@ -0,0 +1 @@ +Update a point attribute. Changing the `default` value will not update already existing documents. \ No newline at end of file diff --git a/docs/references/databases/update-polygon-attribute.md b/docs/references/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..0d9718e41e --- /dev/null +++ b/docs/references/databases/update-polygon-attribute.md @@ -0,0 +1 @@ +Update a polygon attribute. Changing the `default` value will not update already existing documents. \ No newline at end of file diff --git a/docs/references/projects/list.md b/docs/references/projects/list.md deleted file mode 100644 index 576a4b79ae..0000000000 --- a/docs/references/projects/list.md +++ /dev/null @@ -1 +0,0 @@ -Get a list of all projects. You can use the query params to filter your results. \ No newline at end of file diff --git a/docs/references/projects/update-session-invalidation.md b/docs/references/projects/update-session-invalidation.md new file mode 100644 index 0000000000..cbaf378624 --- /dev/null +++ b/docs/references/projects/update-session-invalidation.md @@ -0,0 +1 @@ +Invalidate all existing sessions. An optional auth security setting for projects, and enabled by default for console project. \ No newline at end of file diff --git a/docs/references/proxy/delete-rule.md b/docs/references/proxy/delete-rule.md deleted file mode 100644 index 7a4823f86d..0000000000 --- a/docs/references/proxy/delete-rule.md +++ /dev/null @@ -1 +0,0 @@ -Delete a proxy rule by its unique ID. \ No newline at end of file diff --git a/docs/references/proxy/get-rule.md b/docs/references/proxy/get-rule.md deleted file mode 100644 index cfd040141e..0000000000 --- a/docs/references/proxy/get-rule.md +++ /dev/null @@ -1 +0,0 @@ -Get a proxy rule by its unique ID. \ No newline at end of file diff --git a/docs/references/proxy/list-rules.md b/docs/references/proxy/list-rules.md deleted file mode 100644 index 042d780f02..0000000000 --- a/docs/references/proxy/list-rules.md +++ /dev/null @@ -1 +0,0 @@ -Get a list of all the proxy rules. You can use the query params to filter your results. \ No newline at end of file diff --git a/docs/references/proxy/update-rule-verification.md b/docs/references/proxy/update-rule-verification.md deleted file mode 100644 index c06994bc59..0000000000 --- a/docs/references/proxy/update-rule-verification.md +++ /dev/null @@ -1 +0,0 @@ -Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain. \ No newline at end of file diff --git a/docs/references/tablesdb/create-boolean-column.md b/docs/references/tablesdb/create-boolean-column.md new file mode 100644 index 0000000000..c528ede1a2 --- /dev/null +++ b/docs/references/tablesdb/create-boolean-column.md @@ -0,0 +1 @@ +Create a boolean column. diff --git a/docs/references/tablesdb/create-datetime-column.md b/docs/references/tablesdb/create-datetime-column.md new file mode 100644 index 0000000000..ad92750639 --- /dev/null +++ b/docs/references/tablesdb/create-datetime-column.md @@ -0,0 +1 @@ +Create a date time column according to the ISO 8601 standard. \ No newline at end of file diff --git a/docs/references/tablesdb/create-email-column.md b/docs/references/tablesdb/create-email-column.md new file mode 100644 index 0000000000..91aa5c9326 --- /dev/null +++ b/docs/references/tablesdb/create-email-column.md @@ -0,0 +1 @@ +Create an email column. diff --git a/docs/references/tablesdb/create-enum-column.md b/docs/references/tablesdb/create-enum-column.md new file mode 100644 index 0000000000..b9e5a3ebe4 --- /dev/null +++ b/docs/references/tablesdb/create-enum-column.md @@ -0,0 +1 @@ +Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column. \ No newline at end of file diff --git a/docs/references/tablesdb/create-float-column.md b/docs/references/tablesdb/create-float-column.md new file mode 100644 index 0000000000..0b133eef28 --- /dev/null +++ b/docs/references/tablesdb/create-float-column.md @@ -0,0 +1 @@ +Create a float column. Optionally, minimum and maximum values can be provided. diff --git a/docs/references/tablesdb/create-index.md b/docs/references/tablesdb/create-index.md new file mode 100644 index 0000000000..b0920a74a5 --- /dev/null +++ b/docs/references/tablesdb/create-index.md @@ -0,0 +1,2 @@ +Creates an index on the columns listed. Your index should include all the columns you will query in a single request. +Type can be `key`, `fulltext`, or `unique`. \ No newline at end of file diff --git a/docs/references/tablesdb/create-integer-column.md b/docs/references/tablesdb/create-integer-column.md new file mode 100644 index 0000000000..5f51b3965a --- /dev/null +++ b/docs/references/tablesdb/create-integer-column.md @@ -0,0 +1 @@ +Create an integer column. Optionally, minimum and maximum values can be provided. diff --git a/docs/references/tablesdb/create-ip-column.md b/docs/references/tablesdb/create-ip-column.md new file mode 100644 index 0000000000..012431dbae --- /dev/null +++ b/docs/references/tablesdb/create-ip-column.md @@ -0,0 +1 @@ +Create IP address column. diff --git a/docs/references/tablesdb/create-line-column.md b/docs/references/tablesdb/create-line-column.md new file mode 100644 index 0000000000..bee229c132 --- /dev/null +++ b/docs/references/tablesdb/create-line-column.md @@ -0,0 +1 @@ +Create a geometric line column. \ No newline at end of file diff --git a/docs/references/tablesdb/create-point-column.md b/docs/references/tablesdb/create-point-column.md new file mode 100644 index 0000000000..36bb5b6c37 --- /dev/null +++ b/docs/references/tablesdb/create-point-column.md @@ -0,0 +1 @@ +Create a geometric point column. \ No newline at end of file diff --git a/docs/references/tablesdb/create-polygon-column.md b/docs/references/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..c334003cc6 --- /dev/null +++ b/docs/references/tablesdb/create-polygon-column.md @@ -0,0 +1 @@ +Create a geometric polygon column. \ No newline at end of file diff --git a/docs/references/tablesdb/create-relationship-column.md b/docs/references/tablesdb/create-relationship-column.md new file mode 100644 index 0000000000..d87d8bccf8 --- /dev/null +++ b/docs/references/tablesdb/create-relationship-column.md @@ -0,0 +1 @@ +Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). diff --git a/docs/references/tablesdb/create-row.md b/docs/references/tablesdb/create-row.md new file mode 100644 index 0000000000..9b25555eeb --- /dev/null +++ b/docs/references/tablesdb/create-row.md @@ -0,0 +1 @@ +Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. \ No newline at end of file diff --git a/docs/references/tablesdb/create-rows.md b/docs/references/tablesdb/create-rows.md new file mode 100644 index 0000000000..6a19d7bc9f --- /dev/null +++ b/docs/references/tablesdb/create-rows.md @@ -0,0 +1 @@ +Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. \ No newline at end of file diff --git a/docs/references/tablesdb/create-string-column.md b/docs/references/tablesdb/create-string-column.md new file mode 100644 index 0000000000..7395e26a11 --- /dev/null +++ b/docs/references/tablesdb/create-string-column.md @@ -0,0 +1 @@ +Create a string column. diff --git a/docs/references/tablesdb/create-table.md b/docs/references/tablesdb/create-table.md new file mode 100644 index 0000000000..006e8794df --- /dev/null +++ b/docs/references/tablesdb/create-table.md @@ -0,0 +1 @@ +Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. \ No newline at end of file diff --git a/docs/references/tablesdb/create-url-column.md b/docs/references/tablesdb/create-url-column.md new file mode 100644 index 0000000000..e731d758ce --- /dev/null +++ b/docs/references/tablesdb/create-url-column.md @@ -0,0 +1 @@ +Create a URL column. diff --git a/docs/references/tablesdb/create.md b/docs/references/tablesdb/create.md new file mode 100644 index 0000000000..b608485341 --- /dev/null +++ b/docs/references/tablesdb/create.md @@ -0,0 +1 @@ +Create a new Database. diff --git a/docs/references/tablesdb/decrement-row-column.md b/docs/references/tablesdb/decrement-row-column.md new file mode 100644 index 0000000000..b7b32d6148 --- /dev/null +++ b/docs/references/tablesdb/decrement-row-column.md @@ -0,0 +1 @@ +Decrement a specific column of a row by a given value. \ No newline at end of file diff --git a/docs/references/tablesdb/delete-column.md b/docs/references/tablesdb/delete-column.md new file mode 100644 index 0000000000..efba8b1d77 --- /dev/null +++ b/docs/references/tablesdb/delete-column.md @@ -0,0 +1 @@ +Deletes a column. \ No newline at end of file diff --git a/docs/references/tablesdb/delete-index.md b/docs/references/tablesdb/delete-index.md new file mode 100644 index 0000000000..c5b8f49e5f --- /dev/null +++ b/docs/references/tablesdb/delete-index.md @@ -0,0 +1 @@ +Delete an index. \ No newline at end of file diff --git a/docs/references/tablesdb/delete-row.md b/docs/references/tablesdb/delete-row.md new file mode 100644 index 0000000000..c0b9dfbdaf --- /dev/null +++ b/docs/references/tablesdb/delete-row.md @@ -0,0 +1 @@ +Delete a row by its unique ID. \ No newline at end of file diff --git a/docs/references/tablesdb/delete-rows.md b/docs/references/tablesdb/delete-rows.md new file mode 100644 index 0000000000..9d5189ce76 --- /dev/null +++ b/docs/references/tablesdb/delete-rows.md @@ -0,0 +1 @@ +Bulk delete rows using queries, if no queries are passed then all rows are deleted. \ No newline at end of file diff --git a/docs/references/tablesdb/delete-table.md b/docs/references/tablesdb/delete-table.md new file mode 100644 index 0000000000..ad74ca3233 --- /dev/null +++ b/docs/references/tablesdb/delete-table.md @@ -0,0 +1 @@ +Delete a table by its unique ID. Only users with write permissions have access to delete this resource. \ No newline at end of file diff --git a/docs/references/tablesdb/delete.md b/docs/references/tablesdb/delete.md new file mode 100644 index 0000000000..605fa290d3 --- /dev/null +++ b/docs/references/tablesdb/delete.md @@ -0,0 +1 @@ +Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. \ No newline at end of file diff --git a/docs/references/tablesdb/get-column.md b/docs/references/tablesdb/get-column.md new file mode 100644 index 0000000000..cd8b8797a9 --- /dev/null +++ b/docs/references/tablesdb/get-column.md @@ -0,0 +1 @@ +Get column by ID. \ No newline at end of file diff --git a/docs/references/tablesdb/get-database-usage.md b/docs/references/tablesdb/get-database-usage.md new file mode 100644 index 0000000000..d9298f4814 --- /dev/null +++ b/docs/references/tablesdb/get-database-usage.md @@ -0,0 +1 @@ +Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. \ No newline at end of file diff --git a/docs/references/tablesdb/get-database.md b/docs/references/tablesdb/get-database.md new file mode 100644 index 0000000000..24183f6f6b --- /dev/null +++ b/docs/references/tablesdb/get-database.md @@ -0,0 +1 @@ +Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. \ No newline at end of file diff --git a/docs/references/tablesdb/get-index.md b/docs/references/tablesdb/get-index.md new file mode 100644 index 0000000000..cdea5b4f27 --- /dev/null +++ b/docs/references/tablesdb/get-index.md @@ -0,0 +1 @@ +Get index by ID. \ No newline at end of file diff --git a/docs/references/tablesdb/get-logs.md b/docs/references/tablesdb/get-logs.md new file mode 100644 index 0000000000..8e49da4603 --- /dev/null +++ b/docs/references/tablesdb/get-logs.md @@ -0,0 +1 @@ +Get the database activity logs list by its unique ID. \ No newline at end of file diff --git a/docs/references/tablesdb/get-row-logs.md b/docs/references/tablesdb/get-row-logs.md new file mode 100644 index 0000000000..1d494ed53e --- /dev/null +++ b/docs/references/tablesdb/get-row-logs.md @@ -0,0 +1 @@ +Get the row activity logs list by its unique ID. \ No newline at end of file diff --git a/docs/references/tablesdb/get-row.md b/docs/references/tablesdb/get-row.md new file mode 100644 index 0000000000..6a30fa472c --- /dev/null +++ b/docs/references/tablesdb/get-row.md @@ -0,0 +1 @@ +Get a row by its unique ID. This endpoint response returns a JSON object with the row data. \ No newline at end of file diff --git a/docs/references/tablesdb/get-table-logs.md b/docs/references/tablesdb/get-table-logs.md new file mode 100644 index 0000000000..8b00c7f317 --- /dev/null +++ b/docs/references/tablesdb/get-table-logs.md @@ -0,0 +1 @@ +Get the table activity logs list by its unique ID. \ No newline at end of file diff --git a/docs/references/tablesdb/get-table-usage.md b/docs/references/tablesdb/get-table-usage.md new file mode 100644 index 0000000000..08e28af0a6 --- /dev/null +++ b/docs/references/tablesdb/get-table-usage.md @@ -0,0 +1 @@ +Get usage metrics and statistics for a table. Returning the total number of rows. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. \ No newline at end of file diff --git a/docs/references/tablesdb/get-table.md b/docs/references/tablesdb/get-table.md new file mode 100644 index 0000000000..67b8428431 --- /dev/null +++ b/docs/references/tablesdb/get-table.md @@ -0,0 +1 @@ +Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata. \ No newline at end of file diff --git a/docs/references/tablesdb/get.md b/docs/references/tablesdb/get.md new file mode 100644 index 0000000000..24183f6f6b --- /dev/null +++ b/docs/references/tablesdb/get.md @@ -0,0 +1 @@ +Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. \ No newline at end of file diff --git a/docs/references/tablesdb/increment-row-column.md b/docs/references/tablesdb/increment-row-column.md new file mode 100644 index 0000000000..7a19b3fbc7 --- /dev/null +++ b/docs/references/tablesdb/increment-row-column.md @@ -0,0 +1 @@ +Increment a specific column of a row by a given value. \ No newline at end of file diff --git a/docs/references/tablesdb/list-columns.md b/docs/references/tablesdb/list-columns.md new file mode 100644 index 0000000000..aacf373082 --- /dev/null +++ b/docs/references/tablesdb/list-columns.md @@ -0,0 +1 @@ +List columns in the table. \ No newline at end of file diff --git a/docs/references/tablesdb/list-indexes.md b/docs/references/tablesdb/list-indexes.md new file mode 100644 index 0000000000..598187558d --- /dev/null +++ b/docs/references/tablesdb/list-indexes.md @@ -0,0 +1 @@ +List indexes on the table. \ No newline at end of file diff --git a/docs/references/tablesdb/list-rows.md b/docs/references/tablesdb/list-rows.md new file mode 100644 index 0000000000..68185fc192 --- /dev/null +++ b/docs/references/tablesdb/list-rows.md @@ -0,0 +1 @@ +Get a list of all the user's rows in a given table. You can use the query params to filter your results. \ No newline at end of file diff --git a/docs/references/tablesdb/list-tables.md b/docs/references/tablesdb/list-tables.md new file mode 100644 index 0000000000..e14795eeac --- /dev/null +++ b/docs/references/tablesdb/list-tables.md @@ -0,0 +1 @@ +Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results. \ No newline at end of file diff --git a/docs/references/tablesdb/list-usage.md b/docs/references/tablesdb/list-usage.md new file mode 100644 index 0000000000..2bf5ed81e1 --- /dev/null +++ b/docs/references/tablesdb/list-usage.md @@ -0,0 +1 @@ +List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. \ No newline at end of file diff --git a/docs/references/tablesdb/list.md b/docs/references/tablesdb/list.md new file mode 100644 index 0000000000..d93fb9d7a8 --- /dev/null +++ b/docs/references/tablesdb/list.md @@ -0,0 +1 @@ +Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. \ No newline at end of file diff --git a/docs/references/tablesdb/update-boolean-column.md b/docs/references/tablesdb/update-boolean-column.md new file mode 100644 index 0000000000..f5167d97b6 --- /dev/null +++ b/docs/references/tablesdb/update-boolean-column.md @@ -0,0 +1 @@ +Update a boolean column. Changing the `default` value will not update already existing rows. \ No newline at end of file diff --git a/docs/references/tablesdb/update-datetime-column.md b/docs/references/tablesdb/update-datetime-column.md new file mode 100644 index 0000000000..e793b41921 --- /dev/null +++ b/docs/references/tablesdb/update-datetime-column.md @@ -0,0 +1 @@ +Update a date time column. Changing the `default` value will not update already existing rows. \ No newline at end of file diff --git a/docs/references/tablesdb/update-email-column.md b/docs/references/tablesdb/update-email-column.md new file mode 100644 index 0000000000..0db17e29bd --- /dev/null +++ b/docs/references/tablesdb/update-email-column.md @@ -0,0 +1 @@ +Update an email column. Changing the `default` value will not update already existing rows. diff --git a/docs/references/tablesdb/update-enum-column.md b/docs/references/tablesdb/update-enum-column.md new file mode 100644 index 0000000000..df172cbc38 --- /dev/null +++ b/docs/references/tablesdb/update-enum-column.md @@ -0,0 +1 @@ +Update an enum column. Changing the `default` value will not update already existing rows. diff --git a/docs/references/tablesdb/update-float-column.md b/docs/references/tablesdb/update-float-column.md new file mode 100644 index 0000000000..4e0eb9ddb2 --- /dev/null +++ b/docs/references/tablesdb/update-float-column.md @@ -0,0 +1 @@ +Update a float column. Changing the `default` value will not update already existing rows. diff --git a/docs/references/tablesdb/update-integer-column.md b/docs/references/tablesdb/update-integer-column.md new file mode 100644 index 0000000000..0f2a07ea6e --- /dev/null +++ b/docs/references/tablesdb/update-integer-column.md @@ -0,0 +1 @@ +Update an integer column. Changing the `default` value will not update already existing rows. diff --git a/docs/references/tablesdb/update-ip-column.md b/docs/references/tablesdb/update-ip-column.md new file mode 100644 index 0000000000..115c87a7e1 --- /dev/null +++ b/docs/references/tablesdb/update-ip-column.md @@ -0,0 +1 @@ +Update an ip column. Changing the `default` value will not update already existing rows. diff --git a/docs/references/tablesdb/update-line-column.md b/docs/references/tablesdb/update-line-column.md new file mode 100644 index 0000000000..2558d4ab3c --- /dev/null +++ b/docs/references/tablesdb/update-line-column.md @@ -0,0 +1 @@ +Update a line column. Changing the `default` value will not update already existing rows. \ No newline at end of file diff --git a/docs/references/tablesdb/update-point-column.md b/docs/references/tablesdb/update-point-column.md new file mode 100644 index 0000000000..9acf547538 --- /dev/null +++ b/docs/references/tablesdb/update-point-column.md @@ -0,0 +1 @@ +Update a point column. Changing the `default` value will not update already existing rows. \ No newline at end of file diff --git a/docs/references/tablesdb/update-polygon-column.md b/docs/references/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..40dbf8a095 --- /dev/null +++ b/docs/references/tablesdb/update-polygon-column.md @@ -0,0 +1 @@ +Update a polygon column. Changing the `default` value will not update already existing rows. \ No newline at end of file diff --git a/docs/references/tablesdb/update-relationship-column.md b/docs/references/tablesdb/update-relationship-column.md new file mode 100644 index 0000000000..dfdcd8ae5a --- /dev/null +++ b/docs/references/tablesdb/update-relationship-column.md @@ -0,0 +1 @@ +Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). diff --git a/docs/references/tablesdb/update-row.md b/docs/references/tablesdb/update-row.md new file mode 100644 index 0000000000..b532ea411d --- /dev/null +++ b/docs/references/tablesdb/update-row.md @@ -0,0 +1 @@ +Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated. \ No newline at end of file diff --git a/docs/references/tablesdb/update-rows.md b/docs/references/tablesdb/update-rows.md new file mode 100644 index 0000000000..334b91aec1 --- /dev/null +++ b/docs/references/tablesdb/update-rows.md @@ -0,0 +1 @@ +Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated. \ No newline at end of file diff --git a/docs/references/tablesdb/update-string-column.md b/docs/references/tablesdb/update-string-column.md new file mode 100644 index 0000000000..617214b4c9 --- /dev/null +++ b/docs/references/tablesdb/update-string-column.md @@ -0,0 +1 @@ +Update a string column. Changing the `default` value will not update already existing rows. diff --git a/docs/references/tablesdb/update-table.md b/docs/references/tablesdb/update-table.md new file mode 100644 index 0000000000..bbd676d3b8 --- /dev/null +++ b/docs/references/tablesdb/update-table.md @@ -0,0 +1 @@ +Update a table by its unique ID. \ No newline at end of file diff --git a/docs/references/tablesdb/update-url-column.md b/docs/references/tablesdb/update-url-column.md new file mode 100644 index 0000000000..6080d71509 --- /dev/null +++ b/docs/references/tablesdb/update-url-column.md @@ -0,0 +1 @@ +Update an url column. Changing the `default` value will not update already existing rows. diff --git a/docs/references/tablesdb/update.md b/docs/references/tablesdb/update.md new file mode 100644 index 0000000000..4e99bf2e07 --- /dev/null +++ b/docs/references/tablesdb/update.md @@ -0,0 +1 @@ +Update a database by its unique ID. \ No newline at end of file diff --git a/docs/references/tablesdb/upsert-row.md b/docs/references/tablesdb/upsert-row.md new file mode 100644 index 0000000000..26edd7ad04 --- /dev/null +++ b/docs/references/tablesdb/upsert-row.md @@ -0,0 +1 @@ +Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. \ No newline at end of file diff --git a/docs/references/tablesdb/upsert-rows.md b/docs/references/tablesdb/upsert-rows.md new file mode 100644 index 0000000000..f980d8c30d --- /dev/null +++ b/docs/references/tablesdb/upsert-rows.md @@ -0,0 +1 @@ +Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. diff --git a/docs/references/vcs/get-repository-contents.md b/docs/references/vcs/get-repository-contents.md index ab5ef7f8da..176b4203d3 100644 --- a/docs/references/vcs/get-repository-contents.md +++ b/docs/references/vcs/get-repository-contents.md @@ -1 +1 @@ -Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work. +Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work. \ No newline at end of file diff --git a/docs/sdks/android/CHANGELOG.md b/docs/sdks/android/CHANGELOG.md index 8406e637b0..38d0c4be2d 100644 --- a/docs/sdks/android/CHANGELOG.md +++ b/docs/sdks/android/CHANGELOG.md @@ -1,8 +1,23 @@ # Change Log +## 8.2.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `gif` support to `ImageFormat` enum +* Add `sequence` support to `Document` model + +## 8.1.0 + +* Add `devKeys` support to `Client` service +* Add `upsertDocument` support to `Databases` service + ## 8.0.0 * Add `token` param to `getFilePreview` and `getFileView` for File tokens usage * Update default `quality` for `getFilePreview` from 0 to -1 * Remove `Gif` from ImageFormat enum -* Remove `search` param from `listExecutions` method \ No newline at end of file +* Remove `search` param from `listExecutions` method + +## 7.0.1 + +* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests diff --git a/docs/sdks/android/GETTING_STARTED.md b/docs/sdks/android/GETTING_STARTED.md index de16f2cc57..724cfb4654 100644 --- a/docs/sdks/android/GETTING_STARTED.md +++ b/docs/sdks/android/GETTING_STARTED.md @@ -18,7 +18,7 @@ In order to capture the Appwrite OAuth callback url, the following activity need <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> - <data android:scheme="appwrite-callback-[PROJECT_ID]" /> + <data android:scheme="appwrite-callback-<PROJECT_ID>" /> </intent-filter> </activity> </application> @@ -34,8 +34,8 @@ import io.appwrite.Client import io.appwrite.services.Account val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setEndpoint("https://<HOSTNAME_OR_IP>/v1") // Your API Endpoint + .setProject("<PROJECT_ID>") // Your project ID .setSelfSigned(true) // Remove in production ``` @@ -66,8 +66,8 @@ import io.appwrite.services.Account import io.appwrite.ID val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID + .setEndpoint("https://<HOSTNAME_OR_IP>/v1") // Your API Endpoint + .setProject("<PROJECT_ID>") // Your project ID .setSelfSigned(true) // Remove in production val account = Account(client) @@ -79,7 +79,134 @@ val user = account.create( ) ``` +### Type Safety with Models + +The Appwrite Android SDK provides type safety when working with database documents through generic methods. Methods like `listDocuments`, `getDocument`, and others accept a `nestedType` parameter that allows you to specify your custom model type for full type safety. + +**Kotlin:** +```kotlin +data class Book( + val name: String, + val author: String, + val releaseYear: String? = null, + val category: String? = null, + val genre: List<String>? = null, + val isCheckedOut: Boolean +) + +val databases = Databases(client) + +try { + val documents = databases.listDocuments( + databaseId = "your-database-id", + collectionId = "your-collection-id", + nestedType = Book::class.java // Pass in your custom model type + ) + + for (book in documents.documents) { + Log.d("Appwrite", "Book: ${book.name} by ${book.author}") // Now you have full type safety + } +} catch (e: AppwriteException) { + Log.e("Appwrite", e.message ?: "Unknown error") +} +``` + +**Java:** +```java +public class Book { + private String name; + private String author; + private String releaseYear; + private String category; + private List<String> genre; + private boolean isCheckedOut; + + // Constructor + public Book(String name, String author, boolean isCheckedOut) { + this.name = name; + this.author = author; + this.isCheckedOut = isCheckedOut; + } + + // Getters and setters + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + public String getAuthor() { return author; } + public void setAuthor(String author) { this.author = author; } + + public String getReleaseYear() { return releaseYear; } + public void setReleaseYear(String releaseYear) { this.releaseYear = releaseYear; } + + public String getCategory() { return category; } + public void setCategory(String category) { this.category = category; } + + public List<String> getGenre() { return genre; } + public void setGenre(List<String> genre) { this.genre = genre; } + + public boolean isCheckedOut() { return isCheckedOut; } + public void setCheckedOut(boolean checkedOut) { isCheckedOut = checkedOut; } +} + +Databases databases = new Databases(client); + +try { + DocumentList<Book> documents = databases.listDocuments( + "your-database-id", + "your-collection-id", + Book.class // Pass in your custom model type + ); + + for (Book book : documents.getDocuments()) { + Log.d("Appwrite", "Book: " + book.getName() + " by " + book.getAuthor()); // Now you have full type safety + } +} catch (AppwriteException e) { + Log.e("Appwrite", e.getMessage() != null ? e.getMessage() : "Unknown error"); +} +``` + +**Tip**: You can use the `appwrite types` command to automatically generate model definitions based on your Appwrite database schema. Learn more about [type generation](https://appwrite.io/docs/products/databases/type-generation). + +### Working with Model Methods + +All Appwrite models come with built-in methods for data conversion and manipulation: + +**`toMap()`** - Converts a model instance to a Map format, useful for debugging or manual data manipulation: +```kotlin +val account = Account(client) +val user = account.get() +val userMap = user.toMap() +Log.d("Appwrite", userMap.toString()) // Prints all user properties as a Map +``` + +**`from(map:, nestedType:)`** - Creates a model instance from a Map, useful when working with raw data: +```kotlin +val userData: Map<String, Any> = mapOf( + "\$id" to "123", + "name" to "John", + "email" to "john@example.com" +) +val user = User.from(userData, User::class.java) +``` + +**JSON Serialization** - Models can be easily converted to/from JSON using Gson (which the SDK uses internally): +```kotlin +import com.google.gson.Gson + +val account = Account(client) +val user = account.get() + +// Convert to JSON +val gson = Gson() +val jsonString = gson.toJson(user) +Log.d("Appwrite", "User JSON: $jsonString") + +// Convert from JSON +val userFromJson = gson.fromJson(jsonString, User::class.java) +``` + ### Error Handling + The Appwrite Android SDK raises an `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example. ```kotlin diff --git a/docs/sdks/apple/CHANGELOG.md b/docs/sdks/apple/CHANGELOG.md index bc30d56a4b..f62eb708f1 100644 --- a/docs/sdks/apple/CHANGELOG.md +++ b/docs/sdks/apple/CHANGELOG.md @@ -1,8 +1,36 @@ # Change Log +## 10.2.0 + +* Update sdk to use swift-native doc comments instead of jsdoc styled comments as per [Swift Documentation Comments](https://github.com/swiftlang/swift/blob/main/docs/DocumentationComments.md) +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `gif` support to `ImageFormat` enum +* Remove `Content-Type`, `Content-Length` headers and body from websocket requests + +## 10.1.1 + +* Adds warnings to bulk operation methods +* Fix select Queries by updating internal attributes like id, createdAt, updatedAt etc. to be optional in Document model. +* Fix querying datetime values by properly encoding URLs + +## 10.1.0 + +* Add `devKeys` support to `Client` service +* Add `upsertDocument` support to `Databases` service + ## 10.0.0 * Add `<REGION>` to doc examples due to the new multi region endpoints * Add `token` param to `getFilePreview` and `getFileView` for File tokens usage * Remove `search` param from `listExecutions` method -* Remove `Gif` from ImageFormat enum \ No newline at end of file +* Remove `Gif` from ImageFormat enum + +## 9.0.1 + +* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests + +## 9.0.0 + +* Remove redundant titles from method descriptions. +* Add `codable` models +* Ensure response attribute in `AppwriteException` is always string diff --git a/docs/sdks/apple/GETTING_STARTED.md b/docs/sdks/apple/GETTING_STARTED.md index 6defbc5f00..63c216e08d 100644 --- a/docs/sdks/apple/GETTING_STARTED.md +++ b/docs/sdks/apple/GETTING_STARTED.md @@ -113,6 +113,63 @@ func main() { } ``` +### Type Safety with Models + +The Appwrite Apple SDK provides type safety when working with database documents through generic methods. Methods like `listDocuments`, `getDocument`, and others accept a `nestedType` parameter that allows you to specify your custom model type for full type safety. + +```swift +struct Book: Codable { + let name: String + let author: String + let releaseYear: String? + let category: String? + let genre: [String]? + let isCheckedOut: Bool +} + +let databases = Databases(client) + +do { + let documents = try await databases.listDocuments( + databaseId: "your-database-id", + collectionId: "your-collection-id", + nestedType: Book.self // Pass in your custom model type + ) + + for book in documents.documents { + print("Book: \(book.name) by \(book.author)") // Now you have full type safety + } +} catch { + print(error.localizedDescription) +} +``` + +**Tip**: You can use the `appwrite types` command to automatically generate model definitions based on your Appwrite database schema. Learn more about [type generation](https://appwrite.io/docs/products/databases/type-generation). + +### Working with Model Methods + +All Appwrite models come with built-in methods for data conversion and manipulation: + +**`toMap()`** - Converts a model instance to a dictionary format, useful for debugging or manual data manipulation: +```swift +let user = try await account.get() +let userMap = user.toMap() +print(userMap) // Prints all user properties as a dictionary +``` + +**`from(map:)`** - Creates a model instance from a dictionary, useful when working with raw data: +```swift +let userData: [String: Any] = ["$id": "123", "name": "John", "email": "john@example.com"] +let user = User.from(map: userData) +``` + +**`encode(to:)`** - Encodes the model to JSON format (part of Swift's Codable protocol), useful for serialization: +```swift +let user = try await account.get() +let jsonData = try JSONEncoder().encode(user) +let jsonString = String(data: jsonData, encoding: .utf8) +``` + ### Error Handling When an error occurs, the Appwrite Apple SDK throws an `AppwriteError` object with `message` and `code` properties. You can handle any errors in a catch block and present the `message` or `localizedDescription` to the user or handle it yourself based on the provided error information. Below is an example. diff --git a/docs/sdks/cli/CHANGELOG.md b/docs/sdks/cli/CHANGELOG.md index fa4d35e687..000a7e0938 100644 --- a/docs/sdks/cli/CHANGELOG.md +++ b/docs/sdks/cli/CHANGELOG.md @@ -1 +1,125 @@ -# Change Log \ No newline at end of file +# Change Log + +## 10.0.0 + +* **Breaking:** Removed Avatars CLI command and all related subcommands; corresponding examples deleted +* **Feat:** Geo defaults now accept coordinate arrays for Databases and Tables DB, with automatic normalization +* **Feat:** Pull command skips deprecated resources by default and shows clearer totals/messages +* **Feat:** Updated CLI descriptions: Databases marked legacy; added tables-db, projects, and project +* Fix TypeScript type generation now quotes invalid property names to produce valid typings +* Update documentation: Removed Avatars CLI examples and updated help text to reflect new geo defaults and terminology + +## 8.3.0 + +* **Feat:** Add support for `appwrite.config.json` file + * All new projects will be initialized with this configuration file + * Resolves bundler conflicts (e.g., Vite) that incorrectly interpret `.json` files as library imports +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Type generation fixes: + * Fix relationships using the relatedCollection's id instead of name + * Update auto generated comment to show relative path instead of absolute path + +> **Note:** The existing `appwrite.json` file remains fully supported for backward compatibility + +## 8.2.2 + +* Fix object comparison logic when pushing settings +* Type generation fixes: + * Dart: Fixed import casing to snake_case, removed `extends Document` and hardcoded attributes, removed unnecessary imports + * Java: Fixed indentation to 4 spaces, updated imports to `java.util.Objects`, fixed enum casing in strict mode as per [Oracle official docs](https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html) + * Javascript: Updated optional values formatting from `|null` to `| null` + * Kotlin: Fixed indentation to 4 spaces per [Kotlinlang official docs](https://kotlinlang.org/docs/coding-conventions.html#indentation) + * PHP: Fixed indentation to 4 spaces per [PHP Fig official docs](https://www.php-fig.org/psr/psr-2/) + * Swift: Fixed indentation to 4 spaces, improved `decodeIfPresent` usage for optionals, added missing `public` to `init` method + * Typescript: Fixed indentation to 4 spaces per [Typescript coding guidelines](https://github.com/microsoft/TypeScript/wiki/Coding-guidelines) + +## 8.2.1 + +* Added `--with-variables` option to the Sites command for adding/updating environment variables +* Fixed Functions environment variables not being pushed with `--with-variables` +* Removed `awaitPools` when wiping old variables + +> **Note:** Storing environment variables in the `vars` attribute of `appwrite.json` is now deprecated due to security risks. Variables are now synced directly from the `.env` file in the root directory of the function’s or site’s folder. + +## 8.2.0 + +* Add `encrypt` attribute support +* Add improved warnings on attribute recreation and deletion +* Fix `null` parsing error when using create attribute command +* Type generation fixes and improvements: + * Add `--strict` / `-s` flag to `appwrite types` command to generate types in strict mode. This automatically converts the casing of attributes to match the language's naming conventions + * Add automatic package import to `dart` language which uses package detection to import the correct package + * Add `Document` class extension to generated types in `dart` and `js` language to support internal attributes like `$id` and `$collectionId` etc. + * Add proper enum support to `js` language + * Fix indentation in `java`, `kotlin` and `swift` to use 2 spaces instead of 4 for consistency across all languages + * Fix doc comments to use correct syntax in various languages (for eg. `///` instead of `/*`) + * Update enums in `dart` to use lowerCamelCase in `strict` mode as per [constant_identifier_names](https://dart.dev/tools/diagnostics/constant_identifier_names?utm_source=dartdev&utm_medium=redir&utm_id=diagcode&utm_content=constant_identifier_names) + +## 8.1.1 + +* Fix circular dependency issue due to usage of `success` method in `utils.js` file from `parser.js` file +* Type generation fixes: + * Add ability to generate types directly to a specific file by passing a file path to `appwrite types output_path`, instead of just a directory + * Fix non-required attributes to not be null if default value is provided + * Fix `Models` import error + * Improve formatting and add auto-generated comments + +## 8.1.0 + +* Add multi-region support to `init` command +* Update `init` command to clear previous configuration in `appwrite.json` +* Update localConfig to store multi-region endpoint +* Fix throw error when creating unknown attribute instead of timing out +* Fix equal comparison of large numbers and BigNumber instances using proper equality checks +* Fix duplication of reasons when comparing localConfig with remoteConfig +* Fix `firstOrNull()` to `firstOrNull` in types generation for dart +* Refactor to use `isCloud()` method consistently + +## 8.0.2 + +* Add Type generation fixes: + * Properly handle enum attributes in dart, java and kotlin + * Fix initialisation of null attributes in dart's fromMap method + * Fix relationships and enums in swift + +## 8.0.1 + +* Add `resourceId` and `resourceType` attributes to `createRedirectRule` +* Add `providerReference` to vcs command for getting repository contents +* Add warning comment to `bulk updateDocuments` method +* Fix type generation for enums in Typescript and PHP language + +## 8.0.0 + +* Add `types` command to generate language specific typings for collections. Currently supports - `php`, `swift`, `dart`, `js`, `ts`, `kotlin` and `java` +* Update bulk operation docs to include experiment feature warnings +* Remove assistant service and commands + +## 7.0.0 + +* Add `sites` command +* Add `tokens` command +* Add `devKeys` support to `projects` command +* Add `init site`, `pull site` and `push site` commands +* Add bulk operation methods like `createDocuments`, `deleteDocuments` etc. +* Add new upsert methods: `upsertDocument` and `upsertDocuments` +* Update GET requests to not include content-type header + +## 6.2.3 + +* Fix hot swapping error in `python-ml` function + +## 6.2.2 + +* Fix GitHub builds by adding `qemu-system` package +* Fix attribute creation timed out + +## 6.2.1 + +* Add `listOrganizations` method to `organizations` service and fix init project command + +## 6.2.0 + +* Add specifications support to CLI +* Update package version +* Fix: Missed specifications param when updating a function \ No newline at end of file diff --git a/docs/sdks/dart/CHANGELOG.md b/docs/sdks/dart/CHANGELOG.md index 57a53e5f75..7e33794153 100644 --- a/docs/sdks/dart/CHANGELOG.md +++ b/docs/sdks/dart/CHANGELOG.md @@ -1,5 +1,53 @@ # Change Log +## 18.1.0 + +* Add `orderRandom` query support + +## 18.0.0 + +* Rename `CreditCard` enum value `unionChinaPay` to `unionPay` +* Add time between query support +* Add spatial attribute support +* Add spatial index support +* Add spatial query support + +## 17.0.0 + +* Support for Appwrite 1.8 +* Added TablesDB service +* Added new query types: + * `notContains` + * `notSearch` + * `notBetween` + * `notStartsWith` + * `notEndsWith` + * `createdBefore` + * `createdAfter` + * `updatedBefore` + * `updatedAfter` +* Deprecated `updateMagicURLSession` +* Deprecated `updatePhoneSession` +* Deprecated Databases service +> The TablesDB service is the new recommended way to work with databases. +> Existing databases/collections/attributes/documents can be managed using the TablesDB service. +> Existing Databases service will continue to work, but new features may only be added to the TablesDB service. + + +## 16.2.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `encrypt` support to string attribute model +* Add `sequence` support to `Document` model + +## 16.1.0 + +* Add `gif` support to `ImageFormat` enum +* Add support for `dart38` and `flutter332` runtimes +* Add `upsertDocument()` method to Databases service +* Fix `convertTo()` method in `Document` and `Preferences` models to correctly accept `Map<String, dynamic>` +* Fix `upsertDocuments()` method to have `documents` attribute as required parameter + ## 16.0.0 * Add `<REGION>` to doc examples due to the new multi region endpoints diff --git a/docs/sdks/dart/EXAMPLES.md b/docs/sdks/dart/EXAMPLES.md index fc2c6d0996..6de057486a 100644 --- a/docs/sdks/dart/EXAMPLES.md +++ b/docs/sdks/dart/EXAMPLES.md @@ -1,3 +1,4 @@ +@@ -1,62 +0,0 @@ # Examples Init your Appwrite client: @@ -6,10 +7,8 @@ Init your Appwrite client: Client client = Client(); client - .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint - .setProject('5e8cf4f46b5e8') // Your project ID - .setSelfSigned() // Remove in production -; + .setProject('<YOUR_PROJECT_ID>') + .setKey('<YOUR_API_KEY>'); ``` Create a new user: @@ -18,21 +17,21 @@ Create a new user: Users users = Users(client); User result = await users.create( - userId: ID.unique(), - email: "email@example.com", - phone: "+123456789", - password: "password", - name: "Walter O'Brien" + userId: ID.unique(), + email: "email@example.com", + phone: "+123456789", + password: "password", + name: "Walter O'Brien" ); ``` -Fetch user profile: +Get user: ```dart Users users = Users(client); -User profile = await users.get( - userId: '[USER_ID]', +User user = await users.get( + userId: '[USER_ID]', ); ``` @@ -41,22 +40,19 @@ Upload File: ```dart Storage storage = Storage(client); -InputFile file = InputFile(path: './path-to-file/image.jpg', filename: 'image.jpg'); +InputFile input = InputFile( + path: './path-to-file/image.jpg', + filename: 'image.jpg', +); -storage.createFile( - bucketId: '[BUCKET_ID]', - fileId: '[FILE_ID]', // use 'unique()' to automatically generate a unique ID - file: file, - permissions: [ - Permission.read(Role.any()), - ], -) -.then((response) { - print(response); // File uploaded! -}) -.catchError((error) { - print(error.response); -}); +File file = await storage.createFile( + bucketId: '<YOUR_BUCKET_ID>', + fileId: ID.unique(), + file: input, + permissions: [ + Permission.read(Role.any()), + ], +); ``` All examples and API features are available at the [official Appwrite docs](https://appwrite.io/docs) diff --git a/docs/sdks/dart/GETTING_STARTED.md b/docs/sdks/dart/GETTING_STARTED.md index a1dd4b5c4e..1df40dd2ff 100644 --- a/docs/sdks/dart/GETTING_STARTED.md +++ b/docs/sdks/dart/GETTING_STARTED.md @@ -4,38 +4,29 @@ Once you add the dependencies, its extremely easy to get started with the SDK; All you need to do is import the package in your code, set your Appwrite credentials, and start making API calls. Below is a simple example: ```dart -import 'package:dart_appwrite/dart_appwrite.dart'; +Client client = Client() + .setProject('<YOUR_PROJECT_ID>') + .setKey('<YOUR_API_KEY>'); -void main() async { - Client client = Client() - .setEndpoint('http://[HOSTNAME_OR_IP]/v1') // Make sure your endpoint is accessible - .setProject('5ff3379a01d25') // Your project ID - .setKey('cd868c7af8bdc893b4...93b7535db89') - .setSelfSigned(); // Use only on dev mode with a self-signed SSL cert +Users users = Users(client); - Users users = Users(client); - - try { - final user = await users.create(userId: ID.unique(), email: "email@example.com", phone: "+123456789", password: "password", name: "Walter O'Brien"); - print(user.toMap()); - } on AppwriteException catch(e) { - print(e.message); - } -} +User user = await users.create( + userId: ID.unique(), + email: 'email@example.com', + phone: '+123456789', + password: 'password', + name: 'Walter O'Brien' +); ``` ### Error handling The Appwrite Dart SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example. ```dart -Users users = Users(client); - try { - final user = await users.create(userId: ID.unique(), email: "email@example.com", phone: "+123456789", password: "password", name: "Walter O'Brien"); - print(user.toMap()); + User user = await users.create(...); } on AppwriteException catch(e) { - //show message to user or do other operation based on error as required - print(e.message); + // Handle the error } ``` diff --git a/docs/sdks/deno/CHANGELOG.md b/docs/sdks/deno/CHANGELOG.md index e46648db82..893f49d511 100644 --- a/docs/sdks/deno/CHANGELOG.md +++ b/docs/sdks/deno/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 15.1.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `gif` support to `ImageFormat` enum +* Add `dart38` and `flutter332` support to runtime models +* Add `encrypt` support to `StringAttribute` model +* Add `sequence` support to `Document` model +* Add `upsertDocument` support to `Databases` service + ## 15.0.0 * Add `<REGION>` to doc examples due to the new multi region endpoints @@ -10,4 +19,4 @@ * Updates enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 * Add `token` param to `getFilePreview` and `getFileView` for File tokens usage * Add `queries` and `search` params to `listMemberships` method -* Removes `search` param from `listExecutions` method \ No newline at end of file +* Removes `search` param from `listExecutions` method diff --git a/docs/sdks/deno/GETTING_STARTED.md b/docs/sdks/deno/GETTING_STARTED.md index 22ea80aa84..5046d61c74 100644 --- a/docs/sdks/deno/GETTING_STARTED.md +++ b/docs/sdks/deno/GETTING_STARTED.md @@ -1,6 +1,7 @@ ## Getting Started ### Init your SDK + Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key from project's API keys section. ```typescript @@ -26,6 +27,7 @@ console.log(user); ``` ### Full Example + ```typescript import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -44,6 +46,7 @@ console.log(user); ``` ### Error Handling + The Appwrite Deno SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example. ```typescript @@ -57,6 +60,7 @@ try { ``` ### Learn more + You can use the following resources to learn more and get help - 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) - 📜 [Appwrite Docs](https://appwrite.io/docs) diff --git a/docs/sdks/dotnet/CHANGELOG.md b/docs/sdks/dotnet/CHANGELOG.md index fa4d35e687..bbfee108a7 100644 --- a/docs/sdks/dotnet/CHANGELOG.md +++ b/docs/sdks/dotnet/CHANGELOG.md @@ -1 +1,70 @@ -# Change Log \ No newline at end of file +# Change Log + +## 0.15.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `encrypt` support to `StringAttribute` model +* Add `sequence` support to `Document` model +* Fix: pass enum value as string in API params + +## 0.14.0 + +* Refactor from Newtonsoft.Json to System.Text.Json for serialization/deserialization +* Update package dependencies in `Package.csproj.twig` +* Migrate all serialization/deserialization logic in `Client.cs.twig`, `Query.cs.twig`, and `Extensions.cs.twig` +* Update model attributes from `[JsonProperty]` to `[JsonPropertyName]` in `Model.cs.twig` +* Create new `ObjectToInferredTypesConverter.cs.twig` for proper object type handling +* Replace `JsonConverter` with `JsonConverter<object>` in `ValueClassConverter.cs.twig` +* Update error handling to use `JsonDocument` instead of `JObject` + +## 0.13.0 + +* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. +* Add doc examples, class and methods for new `Sites` service +* Add doc examples, class and methods for new `Tokens` service +* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 +* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage +* Add `queries` and `search` params to `listMemberships` method +* Remove `search` param from `listExecutions` method + +## 0.12.0 + +* fix: remove content-type from GET requests by @loks0n in https://github.com/appwrite/sdk-for-dotnet/pull/59 +* update: min and max are not optional in methods like `UpdateIntegerAttribute` etc. +* chore: regenerate sdk by @ChiragAgg5k in https://github.com/appwrite/sdk-for-dotnet/pull/60 +* chore: fix build error by @ChiragAgg5k in https://github.com/appwrite/sdk-for-dotnet/pull/61 + +## 0.11.0 + +* Add new push message parameters by @abnegate in https://github.com/appwrite/sdk-for-dotnet/pull/56 + +## 0.10.0 + +* fix: chunk upload by @byawitz in https://github.com/appwrite/sdk-for-dotnet/pull/52 + +## 0.9.0 + +* Support for Appwrite 1.6 +* Added `key` attribute to `Runtime` response model. +* Added `buildSize` attribute to `Deployments` response model. +* Added `scheduledAt` attribute to `Executions` response model. +* Added `scopes` attribute to `Functions` response model. +* Added `specifications` attribute to `Functions` response model. +* Added new response model for `Specifications`. +* Added new response model for `Builds`. +* Added `createJWT()` : Enables creating a JWT using the `userId`. +* Added `listSpecifications()`: Enables listing available runtime specifications. +* Added `deleteExecution()` : Enables deleting executions. +* Added `updateDeploymentBuild()`: Enables cancelling a deployment. +* Added `scheduledAt` parameter to `createExecution()`: Enables creating a delayed execution + +#### Breaking changes +You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`. +* Removed `otp` parameter from `deleteMFAAuthenticator`. +* Added `scopes` parameter for create/update function. +* Renamed `templateBranch` to `templateVersion` in `createFunction()`. +* Renamed `downloadDeployment()` to `getDeploymentDownload()` + +> **Please note: This version is compatible with Appwrite 1.6 and later only. If you do not update your Appwrite SDK, old SDKs will not break your app. Appwrite APIs are backwards compatible.** diff --git a/docs/sdks/flutter/CHANGELOG.md b/docs/sdks/flutter/CHANGELOG.md index f707c645e6..f704415675 100644 --- a/docs/sdks/flutter/CHANGELOG.md +++ b/docs/sdks/flutter/CHANGELOG.md @@ -1,9 +1,57 @@ # Change Log -## 16.1.1 +## 19.1.0 + +* Add `orderRandom` query support + +## 19.0.0 + +* Rename `CreditCard` enum value `unionChinaPay` to `unionPay` +* Add time between query support +* Add spatial query support + +## 18.0.0 + +* Support for Appwrite 1.8 +* Added TablesDB service +* Added new query types: + * `notContains` + * `notSearch` + * `notBetween` + * `notStartsWith` + * `notEndsWith` + * `createdBefore` + * `createdAfter` + * `updatedBefore` + * `updatedAfter` +* Deprecated `updateMagicURLSession` +* Deprecated `updatePhoneSession` +* Deprecated Databases service +> The TablesDB service is the new recommended way to work with databases. +> Existing databases/collections/attributes/documents can be managed using the TablesDB service. +> Existing Databases service will continue to work, but new features may only be added to the TablesDB service. + +## 17.1.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `gif` support to `ImageFormat` enum +* Add `sequence` support to `Document` model + +## 17.0.2 + +* Add `gif` support to `ImageFormat` enum +* Fix `convertTo()` method in `Document` and `Preferences` models to correctly accept `Map<String, dynamic>` + +## 17.0.1 + +* Fix `devKeys` support by conditionally including credentials during requests + +## 17.0.0 * Update `flutter_web_auth_2` dependency to version 4.1.0 * Update `auth.html` example in README.md to align with `flutter_web_auth_2` documentation +* Breaking changes: + * Minimum iOS version supported is now 17.4 due to the updated requirements of `flutter_web_auth_2` version 4.1.0 ## 16.1.0 diff --git a/docs/sdks/flutter/GETTING_STARTED.md b/docs/sdks/flutter/GETTING_STARTED.md index c3a1a8d33d..75cf9de1af 100644 --- a/docs/sdks/flutter/GETTING_STARTED.md +++ b/docs/sdks/flutter/GETTING_STARTED.md @@ -17,7 +17,7 @@ In order to capture the Appwrite OAuth callback url, the following activity need .... <application ...> .... - <!-- Add this inside the <application> tag, along side the existing <activity> tags --> + <!-- Add this inside the <application> tag, alongside the existing <activity> tags --> <activity android:exported="true" android:name="com.linusu.flutter_web_auth_2.CallbackActivity" > <intent-filter android:label="flutter_web_auth_2"> <action android:name="android.intent.action.VIEW" /> @@ -43,8 +43,8 @@ The Appwrite SDK uses ASWebAuthenticationSession on iOS 12+ and SFAuthentication ### Linux For **Linux** add your app <u>name</u> and <u>package name</u>, Your package name is generally the **name** in your <a href="https://github.com/appwrite/playground-for-flutter/blob/0fdbdff98384fff940ed0b1e08cf14cfe3a2be3e/pubspec.yaml#L1" target="_blank" rel="noopener">pubspec.yaml<a> 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. -### Mac OS -For **Mac OS** 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. +### macOS +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. @@ -88,77 +88,53 @@ For **Windows** add your app <u>name</u> and <u>package name</u>, Your package n ### Init your SDK -<p>Initialize your SDK with your Appwrite server API endpoint and project ID, which can be found in your project settings page. +<p>Initialize your SDK with your project ID, which can be found in your project settings page. ```dart -import 'package:appwrite/appwrite.dart'; - -void main() { - Client client = Client(); - - client - .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint - .setProject('5e8cf4f46b5e8') // Your project ID - .setSelfSigned() // Use only on dev mode with a self-signed SSL cert - ; -} +Client client = Client().setProject('<YOUR_PROJECT_ID>'); ``` -Before starting to send any API calls to your new Appwrite instance, make sure your Android or iOS emulators has network access to the Appwrite server hostname or IP address. - -When trying to connect to Appwrite from an emulator or a mobile device, localhost is the hostname for the device or emulator and not your local Appwrite instance. You should replace localhost with your private IP as the Appwrite endpoint's hostname. You can also use a service like [ngrok](https://ngrok.com/) to proxy the Appwrite API. +> If using a self-hosted instance, you will also need to set your Appwrite endpoint using the `setEndpoint` method. Before starting to send any API calls to your new Appwrite instance, make sure your Android or iOS emulators has network access to the Appwrite server hostname or IP address. +> When trying to connect to a local Appwrite instance from an emulator or a mobile device, localhost is the hostname for the device or emulator and not your machine. You should replace localhost with your machine's private IP as the Appwrite endpoint's hostname (e.g. 192.168.1.100). You can also use a service like [ngrok](https://ngrok.com/) to proxy the Appwrite API. ### Make Your First Request <p>Once your SDK object 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](https://appwrite.io/docs) section. ```dart -// Register User Account account = Account(client); -final user = await account - .create( - userId: ID.unique(), email: "email@example.com", password: "password", name: "Walter O'Brien" - ); + +User user = await account.create( + userId: ID.unique(), + email: 'email@example.com', + password: 'password', + name: 'Walter O'Brien', +); ``` ### Full Example ```dart -import 'package:appwrite/appwrite.dart'; +Client client = Client().setProject('<YOUR_PROJECT_ID>>'); -void main() { - Client client = Client(); +Account account = Account(client); - - client - .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint - .setProject('5e8cf4f46b5e8') // Your project ID - .setSelfSigned() // Use only on dev mode with a self-signed SSL cert - ; - - - // Register User - Account account = Account(client); - - final user = await account - .create( - userId: ID.unique(), email: "email@example.com", password: "password", name: "Walter O'Brien" - ); -} +User user = await account.create( + userId: ID.unique(), + email: 'email@example.com', + password: 'password', + name: 'Walter O'Brien' +); ``` ### Error Handling The Appwrite Flutter SDK raises `AppwriteException` object with `message`, `type`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example. ```dart -Account account = Account(client); - try { - final user = await account.create(userId: ID.unique(), email: "email@example.com", password: "password", name: "Walter O'Brien"); - print(user.toMap()); + User user = await account.create(...); } on AppwriteException catch(e) { - //show message to user or do other operation based on error as required - print(e.message); + // Handle the exception } ``` diff --git a/docs/sdks/go/CHANGELOG.md b/docs/sdks/go/CHANGELOG.md index fa4d35e687..418c7db5e5 100644 --- a/docs/sdks/go/CHANGELOG.md +++ b/docs/sdks/go/CHANGELOG.md @@ -1 +1,39 @@ -# Change Log \ No newline at end of file +# Change Log + +## 0.9.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `upsertDocument` support to `Databases` service +* Update doc examples to use correct syntax + +## 0.8.0 + +* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. +* Add doc examples, class and methods for new `Sites` service +* Add doc examples, class and methods for new `Tokens` service +* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 +* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage +* Add `queries` and `search` params to `listMemberships` method +* Remove `search` param from `listExecutions` method + +## 0.7.0 + +* Version skipped + +## 0.6.0 + +* Add bulk API methods: `createDocuments`, `deleteDocuments` etc. + +## 0.5.0 + +* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests + +## 0.4.0 + +* Fix pong response and chunked upload + +## 0.3.0 + +* Add new push message parameters diff --git a/docs/sdks/java/CHANGELOG.md b/docs/sdks/java/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/docs/sdks/java/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/docs/sdks/kotlin/CHANGELOG.md b/docs/sdks/kotlin/CHANGELOG.md index fa4d35e687..c7194d5391 100644 --- a/docs/sdks/kotlin/CHANGELOG.md +++ b/docs/sdks/kotlin/CHANGELOG.md @@ -1 +1,29 @@ -# Change Log \ No newline at end of file +# Change Log + +## 9.1.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `dart38` and `flutter332` support to runtime models +* Add `gif` support to `ImageFormat` enum +* Add `encrypt` support to `StringAttribute` model +* Add `sequence` support to `Document` model + +## 9.0.0 + +* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. +* Add doc examples, class and methods for new `Sites` service +* Add doc examples, class and methods for new `Tokens` service +* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 +* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage +* Add `queries` and `search` params to `listMemberships` method +* Remove `search` param from `listExecutions` method + +## 8.0.0 + +* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests + +## 7.0.0 + +* Fix pong response & chunked upload diff --git a/docs/sdks/kotlin/GETTING_STARTED.md b/docs/sdks/kotlin/GETTING_STARTED.md index 5b5ee5f050..2a36a9deb7 100644 --- a/docs/sdks/kotlin/GETTING_STARTED.md +++ b/docs/sdks/kotlin/GETTING_STARTED.md @@ -57,6 +57,132 @@ suspend fun main() { } ``` +### Type Safety with Models + +The Appwrite Kotlin SDK provides type safety when working with database documents through generic methods. Methods like `listDocuments`, `getDocument`, and others accept a `nestedType` parameter that allows you to specify your custom model type for full type safety. + +**Kotlin:** +```kotlin +data class Book( + val name: String, + val author: String, + val releaseYear: String? = null, + val category: String? = null, + val genre: List<String>? = null, + val isCheckedOut: Boolean +) + +val databases = Databases(client) + +try { + val documents = databases.listDocuments( + databaseId = "your-database-id", + collectionId = "your-collection-id", + nestedType = Book::class.java // Pass in your custom model type + ) + + for (book in documents.documents) { + Log.d("Appwrite", "Book: ${book.name} by ${book.author}") // Now you have full type safety + } +} catch (e: AppwriteException) { + Log.e("Appwrite", e.message ?: "Unknown error") +} +``` + +**Java:** +```java +public class Book { + private String name; + private String author; + private String releaseYear; + private String category; + private List<String> genre; + private boolean isCheckedOut; + + // Constructor + public Book(String name, String author, boolean isCheckedOut) { + this.name = name; + this.author = author; + this.isCheckedOut = isCheckedOut; + } + + // Getters and setters + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + public String getAuthor() { return author; } + public void setAuthor(String author) { this.author = author; } + + public String getReleaseYear() { return releaseYear; } + public void setReleaseYear(String releaseYear) { this.releaseYear = releaseYear; } + + public String getCategory() { return category; } + public void setCategory(String category) { this.category = category; } + + public List<String> getGenre() { return genre; } + public void setGenre(List<String> genre) { this.genre = genre; } + + public boolean isCheckedOut() { return isCheckedOut; } + public void setCheckedOut(boolean checkedOut) { isCheckedOut = checkedOut; } +} + +Databases databases = new Databases(client); + +try { + DocumentList<Book> documents = databases.listDocuments( + "your-database-id", + "your-collection-id", + Book.class // Pass in your custom model type + ); + + for (Book book : documents.getDocuments()) { + Log.d("Appwrite", "Book: " + book.getName() + " by " + book.getAuthor()); // Now you have full type safety + } +} catch (AppwriteException e) { + Log.e("Appwrite", e.getMessage() != null ? e.getMessage() : "Unknown error"); +} +``` + +**Tip**: You can use the `appwrite types` command to automatically generate model definitions based on your Appwrite database schema. Learn more about [type generation](https://appwrite.io/docs/products/databases/type-generation). + +### Working with Model Methods + +All Appwrite models come with built-in methods for data conversion and manipulation: + +**`toMap()`** - Converts a model instance to a Map format, useful for debugging or manual data manipulation: +```kotlin +val account = Account(client) +val user = account.get() +val userMap = user.toMap() +Log.d("Appwrite", userMap.toString()) // Prints all user properties as a Map +``` + +**`from(map:, nestedType:)`** - Creates a model instance from a Map, useful when working with raw data: +```kotlin +val userData: Map<String, Any> = mapOf( + "\$id" to "123", + "name" to "John", + "email" to "john@example.com" +) +val user = User.from(userData, User::class.java) +``` + +**JSON Serialization** - Models can be easily converted to/from JSON using Gson (which the SDK uses internally): +```kotlin +import com.google.gson.Gson + +val account = Account(client) +val user = account.get() + +// Convert to JSON +val gson = Gson() +val jsonString = gson.toJson(user) +Log.d("Appwrite", "User JSON: $jsonString") + +// Convert from JSON +val userFromJson = gson.fromJson(jsonString, User::class.java) +``` + ### Error Handling The Appwrite Kotlin SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example. diff --git a/docs/sdks/nodejs/CHANGELOG.md b/docs/sdks/nodejs/CHANGELOG.md index c8a8a16c8e..7d6926dd1d 100644 --- a/docs/sdks/nodejs/CHANGELOG.md +++ b/docs/sdks/nodejs/CHANGELOG.md @@ -1,13 +1,73 @@ # Change Log +## 17.2.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Fix autocompletion not working for `Document` model even when generic is passed + +## 17.1.0 + +* Add `upsertDocument` method +* Add `dart-3.8` and `flutter-3.32` runtimes +* Add `gif` image format +* Update bulk operation methods to reflect warning message +* Fix file parameter handling in chunked upload method + ## 17.0.0 -* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add `REGION` to doc examples due to the new multi region endpoints * Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. * Add doc examples, class and methods for new `Sites` service * Add doc examples, class and methods for new `Tokens` service -* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Add enums for `BuildRuntime`, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` * Updates enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 * Add `token` param to `getFilePreview` and `getFileView` for File tokens usage * Add `queries` and `search` params to `listMemberships` method -* Removes `search` param from `listExecutions` method \ No newline at end of file +* Removes `search` param from `listExecutions` method + +## 16.0.0 + +* Fix: remove content-type from GET requests +* Update (breaking): min and max params are now optional in `updateFloatAttribute` and `updateIntegerAttribute` methods (changes their positioning in method definition) + +## 15.0.1 + +* Remove titles from all function descriptions +* Fix typing for collection "attribute" key +* Remove unnecessary awaits and asyncs +* Ensure `AppwriteException` response is always string + +## 15.0.0 + +* Fix: pong response & chunked upload + +## 14.2.0 + +* Add new push message parameters + +## 14.1.0 + +* Support updating attribute name and size + +## 14.0.0 + +* Support for Appwrite 1.6 +* Add `key` attribute to `Runtime` response model. +* Add `buildSize` attribute to `Deployments` response model +* Add `scheduledAt` attribute to `Executions` response model +* Add `scopes` attribute to `Functions` response model +* Add `specifications` attribute to `Functions` response model +* Add new response model for `Specifications` +* Add new response model for `Builds` +* Add `createJWT()` : Enables creating a JWT using the `userId` +* Add `listSpecifications()`: Enables listing available runtime specifications +* Add `deleteExecution()` : Enables deleting executions +* Add `updateDeploymentBuild()`: Enables cancelling a deployment +* Add `scheduledAt` parameter to `createExecution()`: Enables creating a delayed execution +* Breaking changes + * Remove `otp` parameter from `deleteMFAAuthenticator`. + * Add `scopes` parameter for create/update function. + * Rename `templateBranch` to `templateVersion` in `createFunction()`. + * Rename `downloadDeployment()` to `getDeploymentDownload()` + +> You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`. \ No newline at end of file diff --git a/docs/sdks/nodejs/GETTING_STARTED.md b/docs/sdks/nodejs/GETTING_STARTED.md index e98400f846..b54f85c51d 100644 --- a/docs/sdks/nodejs/GETTING_STARTED.md +++ b/docs/sdks/nodejs/GETTING_STARTED.md @@ -1,6 +1,7 @@ ## Getting Started ### Init your SDK + Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key project API keys section. ```js @@ -17,6 +18,7 @@ client ``` ### Make Your First Request + Once your SDK object 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](https://appwrite.io/docs) section. ```js @@ -54,7 +56,70 @@ promise.then(function (response) { }); ``` +### Type Safety with Models + +The Appwrite Node SDK provides type safety when working with database documents through generic methods. Methods like `listDocuments`, `getDocument`, and others accept a generic type parameter that allows you to specify your custom model type for full type safety. + +**TypeScript:** +```typescript +interface Book { + name: string; + author: string; + releaseYear?: string; + category?: string; + genre?: string[]; + isCheckedOut: boolean; +} + +const databases = new Databases(client); + +try { + const documents = await databases.listDocuments<Book>( + 'your-database-id', + 'your-collection-id' + ); + + documents.documents.forEach(book => { + console.log(`Book: ${book.name} by ${book.author}`); // Now you have full type safety + }); +} catch (error) { + console.error('Appwrite error:', error); +} +``` + +**JavaScript (with JSDoc for type hints):** +```javascript +/** + * @typedef {Object} Book + * @property {string} name + * @property {string} author + * @property {string} [releaseYear] + * @property {string} [category] + * @property {string[]} [genre] + * @property {boolean} isCheckedOut + */ + +const databases = new Databases(client); + +try { + /** @type {Models.DocumentList<Book>} */ + const documents = await databases.listDocuments( + 'your-database-id', + 'your-collection-id' + ); + + documents.documents.forEach(book => { + console.log(`Book: ${book.name} by ${book.author}`); // Type hints available in IDE + }); +} catch (error) { + console.error('Appwrite error:', error); +} +``` + +**Tip**: You can use the `appwrite types` command to automatically generate TypeScript interfaces based on your Appwrite database schema. Learn more about [type generation](https://appwrite.io/docs/products/databases/type-generation). + ### Error Handling + The Appwrite Node SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example. ```js diff --git a/docs/sdks/php/CHANGELOG.md b/docs/sdks/php/CHANGELOG.md index fa4d35e687..d5a323c4cb 100644 --- a/docs/sdks/php/CHANGELOG.md +++ b/docs/sdks/php/CHANGELOG.md @@ -1 +1,9 @@ -# Change Log \ No newline at end of file +# Change Log + +## 15.1.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `dart38` and `flutter332` support to runtime models +* Add `gif` support to `ImageFormat` enum +* Add `upsertDocument` support to `Databases` service +* Add `sequence` support to `Document` model diff --git a/docs/sdks/python/CHANGELOG.md b/docs/sdks/python/CHANGELOG.md index fa4d35e687..ff63134a20 100644 --- a/docs/sdks/python/CHANGELOG.md +++ b/docs/sdks/python/CHANGELOG.md @@ -1 +1,28 @@ -# Change Log \ No newline at end of file +# Change Log + +## 11.1.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `dart38` and `flutter332` support to runtime models +* Add `gif` support to `ImageFormat` enum +* Add `upsertDocument` support to `Databases` service + +## 11.0.0 + +* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. +* Add doc examples, class and methods for new `Sites` service +* Add doc examples, class and methods for new `Tokens` service +* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 +* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage +* Add `queries` and `search` params to `listMemberships` method +* Remove `search` param from `listExecutions` method + +## 10.0.0 + +* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests + +## 9.0.3 + +* Update sdk to use Numpy-style docstrings diff --git a/docs/sdks/react-native/CHANGELOG.md b/docs/sdks/react-native/CHANGELOG.md index 1bc7d89373..eda0bca26e 100644 --- a/docs/sdks/react-native/CHANGELOG.md +++ b/docs/sdks/react-native/CHANGELOG.md @@ -1,5 +1,29 @@ # Change log +## 0.11.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `sequence` support to `Document` model +* Fix autocompletion not working for `Document` model even when generic is passed + +## 0.10.1 + +* Fix URL based methods like `getFileViewURL`, `getFilePreviewURL` etc. by adding the missing `projectId` to searchParams +* Add `gif` to ImageFormat enum + +## 0.10.0 + +* Add generate file URL methods like`getFilePreviewURL`, `getFileViewURL` etc. +* Update (breaking) existing methods like `getFilePreview` to download the image instead of returning URLs + +## 0.9.2 + +* Fix `devKeys` by removing credentials from requests when the key is set + +## 0.9.1 + +* Add `setDevkey` and `upsertDocument` methods + ## 0.9.0 * Add `token` param to `getFilePreview` and `getFileView` for File tokens usage @@ -10,4 +34,4 @@ ## 0.7.4 * Upgrade dependencies to resolve PlatformConstants error with Expo 53 -* Update doc examples to use new multi-region endpoint \ No newline at end of file +* Update doc examples to use new multi-region endpoint diff --git a/docs/sdks/react-native/GETTING_STARTED.md b/docs/sdks/react-native/GETTING_STARTED.md index 9d07eec54a..a5c6f57c46 100644 --- a/docs/sdks/react-native/GETTING_STARTED.md +++ b/docs/sdks/react-native/GETTING_STARTED.md @@ -1,12 +1,13 @@ - ## Getting Started ### Add your Platform + If this is your first time using Appwrite, create an account and create your first project. Then, under **Add a platform**, add a **Android app** or a **Apple app**. You can skip optional steps. #### iOS steps + 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. For Expo projects you can set or find it on **app.json** file at your project's root directory. #### Android steps @@ -24,6 +25,7 @@ import 'react-native-url-polyfill/auto' > `cd ios && pod install && cd ..` ### Init your SDK + Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page. ```js @@ -39,6 +41,7 @@ client ``` ### Make Your First Request + Once your SDK object 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](https://appwrite.io/docs) section. ```js @@ -55,6 +58,7 @@ account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe') ``` ### Full Example + ```js import { Client, Account } from 'react-native-appwrite'; // Init your React Native SDK @@ -77,9 +81,85 @@ account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe') }); ``` +### Type Safety with Models + +The Appwrite React Native SDK provides type safety when working with database documents through generic methods. Methods like `listDocuments`, `getDocument`, and others accept a generic type parameter that allows you to specify your custom model type for full type safety. + +**TypeScript:** +```typescript +interface Book { + name: string; + author: string; + releaseYear?: string; + category?: string; + genre?: string[]; + isCheckedOut: boolean; +} + +const databases = new Databases(client); + +try { + const documents = await databases.listDocuments<Book>( + 'your-database-id', + 'your-collection-id' + ); + + documents.documents.forEach(book => { + console.log(`Book: ${book.name} by ${book.author}`); // Now you have full type safety + }); +} catch (error) { + console.error('Appwrite error:', error); +} +``` + +**JavaScript (with JSDoc for type hints):** +```javascript +/** + * @typedef {Object} Book + * @property {string} name + * @property {string} author + * @property {string} [releaseYear] + * @property {string} [category] + * @property {string[]} [genre] + * @property {boolean} isCheckedOut + */ + +const databases = new Databases(client); + +try { + /** @type {Models.DocumentList<Book>} */ + const documents = await databases.listDocuments( + 'your-database-id', + 'your-collection-id' + ); + + documents.documents.forEach(book => { + console.log(`Book: ${book.name} by ${book.author}`); // Type hints available in IDE + }); +} catch (error) { + console.error('Appwrite error:', error); +} +``` + +**Tip**: You can use the `appwrite types` command to automatically generate TypeScript interfaces based on your Appwrite database schema. Learn more about [type generation](https://appwrite.io/docs/products/databases/type-generation). + +### Error Handling + +The Appwrite React Native SDK raises an `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching the exception and present the `message` to the user or handle it yourself based on the provided error information. Below is an example. + +```javascript +try { + const user = await account.create(ID.unique(), "email@example.com", "password", "Walter O'Brien"); + console.log('User created:', user); +} catch (error) { + console.error('Appwrite error:', error.message); +} +``` + ### Learn more + You can use the following resources to learn more and get help - 🚀 [Getting Started Tutorial](https://appwrite.io/docs/quick-starts/react-native) - 📜 [Appwrite Docs](https://appwrite.io/docs) - 💬 [Discord Community](https://appwrite.io/discord) -- 🚂 [Appwrite React Native Playground](https://github.com/appwrite/playground-for-react-native) \ No newline at end of file +- 🚂 [Appwrite React Native Playground](https://github.com/appwrite/playground-for-react-native) diff --git a/docs/sdks/ruby/CHANGELOG.md b/docs/sdks/ruby/CHANGELOG.md index fa4d35e687..1f2e10beea 100644 --- a/docs/sdks/ruby/CHANGELOG.md +++ b/docs/sdks/ruby/CHANGELOG.md @@ -1 +1,30 @@ -# Change Log \ No newline at end of file +# Change Log + +## 16.1.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `dart38` and `flutter332` support to runtime models +* Add `gif` support to `ImageFormat` enum +* Add `encrypt` support to `StringAttribute` model +* Add `sequence` support to `Document` model +* Add `upsertDocument` support to `Databases` service + +## 16.0.0 + +* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. +* Add doc examples, class and methods for new `Sites` service +* Add doc examples, class and methods for new `Tokens` service +* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 +* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage +* Add `queries` and `search` params to `listMemberships` method +* Remove `search` param from `listExecutions` method + +## 15.0.0 + +* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests + +## 14.0.0 + +* Fix pong response & chunked upload diff --git a/docs/sdks/swift/CHANGELOG.md b/docs/sdks/swift/CHANGELOG.md index fa4d35e687..6cb1cca595 100644 --- a/docs/sdks/swift/CHANGELOG.md +++ b/docs/sdks/swift/CHANGELOG.md @@ -1 +1,45 @@ -# Change Log \ No newline at end of file +# Change Log + +## 10.2.0 + +* Update sdk to use swift-native doc comments instead of jsdoc styled comments as per [Swift Documentation Comments](https://github.com/swiftlang/swift/blob/main/docs/DocumentationComments.md) +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `gif` support to `ImageFormat` enum +* Add `sequence` support to `Document` model +* Add `dart38` and `flutter332` support to runtime models + +## 10.1.0 + +* Adds `upsertDocument` method +* Adds warnings to bulk operation methods +* Adds the new `encrypt` attribute +* Adds runtimes: `flutter332` and `dart38` +* Fix `select` Queries by updating internal attributes like `id`, `createdAt`, `updatedAt` etc. to be optional in `Document` model. +* Fix `listCollection` errors by updating `attributes` typing +* Fix querying datetime values by properly encoding URLs + +## 10.0.0 + +* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. +* Add doc examples, class and methods for new `Sites` service +* Add doc examples, class and methods for new `Tokens` service +* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 +* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage +* Add `queries` and `search` params to `listMemberships` method +* Remove `search` param from `listExecutions` method + +## 9.0.0 + +* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests + +## 8.0.0 + +* Remove redundant titles from method descriptions. +* Add `codable` models +* Ensure response attribute in `AppwriteException` is always string + +## 7.0.0 + +* Fix pong response & chunked upload diff --git a/docs/sdks/swift/GETTING_STARTED.md b/docs/sdks/swift/GETTING_STARTED.md index 49aa51e9b2..251ea371d2 100644 --- a/docs/sdks/swift/GETTING_STARTED.md +++ b/docs/sdks/swift/GETTING_STARTED.md @@ -66,6 +66,63 @@ func main() { } ``` +### Type Safety with Models + +The Appwrite Swift SDK provides type safety when working with database documents through generic methods. Methods like `listDocuments`, `getDocument`, and others accept a `nestedType` parameter that allows you to specify your custom model type for full type safety. + +```swift +struct Book: Codable { + let name: String + let author: String + let releaseYear: String? + let category: String? + let genre: [String]? + let isCheckedOut: Bool +} + +let databases = Databases(client) + +do { + let documents = try await databases.listDocuments( + databaseId: "your-database-id", + collectionId: "your-collection-id", + nestedType: Book.self // Pass in your custom model type + ) + + for book in documents.documents { + print("Book: \(book.name) by \(book.author)") // Now you have full type safety + } +} catch { + print(error.localizedDescription) +} +``` + +**Tip**: You can use the `appwrite types` command to automatically generate model definitions based on your Appwrite database schema. Learn more about [type generation](https://appwrite.io/docs/products/databases/type-generation). + +### Working with Model Methods + +All Appwrite models come with built-in methods for data conversion and manipulation: + +**`toMap()`** - Converts a model instance to a dictionary format, useful for debugging or manual data manipulation: +```swift +let user = try await account.get() +let userMap = user.toMap() +print(userMap) // Prints all user properties as a dictionary +``` + +**`from(map:)`** - Creates a model instance from a dictionary, useful when working with raw data: +```swift +let userData: [String: Any] = ["$id": "123", "name": "John", "email": "john@example.com"] +let user = User.from(map: userData) +``` + +**`encode(to:)`** - Encodes the model to JSON format (part of Swift's Codable protocol), useful for serialization: +```swift +let user = try await account.get() +let jsonData = try JSONEncoder().encode(user) +let jsonString = String(data: jsonData, encoding: .utf8) +``` + ### Error Handling When an error occurs, the Appwrite Swift SDK throws an `AppwriteError` object with `message` and `code` properties. You can handle any errors in a catch block and present the `message` or `localizedDescription` to the user or handle it yourself based on the provided error information. Below is an example. diff --git a/docs/sdks/typescript/CHANGELOG.md b/docs/sdks/typescript/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/docs/sdks/typescript/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/docs/sdks/web/CHANGELOG.md b/docs/sdks/web/CHANGELOG.md index 5923160f8f..328ef1d5a8 100644 --- a/docs/sdks/web/CHANGELOG.md +++ b/docs/sdks/web/CHANGELOG.md @@ -1,9 +1,41 @@ # Change Log +## 18.2.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `gif` support to `ImageFormat` enum +* Fix undefined `fileParam` error in `chunkedUpload` method +* Fix autocompletion not working for `Document` model even when generic is passed + +## 18.1.1 + +* Fix using `devKeys` resulting in an error by conditionally removing credentials + +## 18.1.0 + +* Add `devKeys` support to `Client` service +* Add `upsertDocument` support to `Databases` service + ## 18.0.0 * Add `<REGION>` to doc examples due to the new multi region endpoints * Remove `Gif` from ImageFormat enum * Remove `search` param from `listExecutions` method * Add `token` param to `getFilePreview` and `getFileView` for File tokens usage -* Improve CORS error catching in `client.call` method \ No newline at end of file +* Improve CORS error catching in `client.call` method + +## 17.0.2 + +* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests + +## 17.0.1 + +* Remove unnecessary titles from method descriptions +* Fix duplicate adding of payload params +* Remove unnecessary awaits and asyncs +* Ensure `AppwriteException` response is always string + +## 17.0.0 + +* Fix pong response & chunked upload +* Add `ping` support to `Realtime` service diff --git a/docs/sdks/web/GETTING_STARTED.md b/docs/sdks/web/GETTING_STARTED.md index 26aa9470bd..cc75a3d3e5 100644 --- a/docs/sdks/web/GETTING_STARTED.md +++ b/docs/sdks/web/GETTING_STARTED.md @@ -1,11 +1,13 @@ ## Getting Started ### Add your Web Platform + For you 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. ### Init your SDK + Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page. ```js @@ -19,6 +21,7 @@ client ``` ### Make Your First Request + Once your SDK object 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](https://appwrite.io/docs) section. ```js @@ -35,6 +38,7 @@ account.create(ID.unique(), "email@example.com", "password", "Walter O'Brien") ``` ### Full Example + ```js // Init your Web SDK const client = new Client(); @@ -55,7 +59,83 @@ account.create(ID.unique(), "email@example.com", "password", "Walter O'Brien") }); ``` +### Type Safety with Models + +The Appwrite Web SDK provides type safety when working with database documents through generic methods. Methods like `listDocuments`, `getDocument`, and others accept a generic type parameter that allows you to specify your custom model type for full type safety. + +**TypeScript:** +```typescript +interface Book { + name: string; + author: string; + releaseYear?: string; + category?: string; + genre?: string[]; + isCheckedOut: boolean; +} + +const databases = new Databases(client); + +try { + const documents = await databases.listDocuments<Book>( + 'your-database-id', + 'your-collection-id' + ); + + documents.documents.forEach(book => { + console.log(`Book: ${book.name} by ${book.author}`); // Now you have full type safety + }); +} catch (error) { + console.error('Appwrite error:', error); +} +``` + +**JavaScript (with JSDoc for type hints):** +```javascript +/** + * @typedef {Object} Book + * @property {string} name + * @property {string} author + * @property {string} [releaseYear] + * @property {string} [category] + * @property {string[]} [genre] + * @property {boolean} isCheckedOut + */ + +const databases = new Databases(client); + +try { + /** @type {Models.DocumentList<Book>} */ + const documents = await databases.listDocuments( + 'your-database-id', + 'your-collection-id' + ); + + documents.documents.forEach(book => { + console.log(`Book: ${book.name} by ${book.author}`); // Type hints available in IDE + }); +} catch (error) { + console.error('Appwrite error:', error); +} +``` + +**Tip**: You can use the `appwrite types` command to automatically generate TypeScript interfaces based on your Appwrite database schema. Learn more about [type generation](https://appwrite.io/docs/products/databases/type-generation). + +### Error Handling + +The Appwrite Web SDK raises an `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching the exception and present the `message` to the user or handle it yourself based on the provided error information. Below is an example. + +```javascript +try { + const user = await account.create(ID.unique(), "email@example.com", "password", "Walter O'Brien"); + console.log('User created:', user); +} catch (error) { + console.error('Appwrite error:', error.message); +} +``` + ### Learn more + You can use the following resources to learn more and get help - 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-web) - 📜 [Appwrite Docs](https://appwrite.io/docs) diff --git a/docs/sdks/web/README.md b/docs/sdks/web/README.md deleted file mode 100644 index d1becb4c31..0000000000 --- a/docs/sdks/web/README.md +++ /dev/null @@ -1,15 +0,0 @@ -## Getting Started - -Initialise the Appwrite SDK in your code, and setup your API credentials: - -```js - -// Init your Web SDK -var appwrite = new Appwrite(); - -appwrite - .setEndpoint('http://localhost/v1') // Set only when using self-hosted solution - .setProject('455x34dfkj') // Your Appwrite Project UID -; - -``` diff --git a/docs/services/databases.md b/docs/services/databases.md index 9c1eef19a5..d92bb7f72e 100644 --- a/docs/services/databases.md +++ b/docs/services/databases.md @@ -1,6 +1,6 @@ The Databases service allows you to create structured collections of documents, query and filter lists of documents, and manage an advanced set of read and write access permissions. -All data returned by the Databases service are represented as structured JSON documents. +All data returned by the Databases service are represented as structured JSON objects. The Databases service can contain multiple databases, each database can contain multiple collections. A collection is a group of similarly structured documents. The accepted structure of documents is defined by [collection attributes](https://appwrite.io/docs/databases#attributes). The collection attributes help you ensure all your user-submitted data is validated and stored according to the collection structure. diff --git a/docs/services/tablesdb.md b/docs/services/tablesdb.md new file mode 100644 index 0000000000..b64fb92e34 --- /dev/null +++ b/docs/services/tablesdb.md @@ -0,0 +1,7 @@ +The TablesDB service allows you to create structured tables of rows, query and filter lists of rows, and manage an advanced set of read and write access permissions. + +All data returned by the TablesDB service are represented as structured JSON objects. + +The TablesDB service can contain multiple databases, each database can contain multiple tables. A table is a group of similarly structured rows. The accepted structure of rows is defined by [table columns](https://appwrite.io/docs/databases#columns). The table columns help you ensure all your user-submitted data is validated and stored according to the table structure. + +Using Appwrite permissions architecture, you can assign read or write access to each table or row in your project for either a specific user, team, user role, or even grant it with public access (`any`). You can learn more about [how Appwrite handles permissions and access control](https://appwrite.io/docs/permissions). \ No newline at end of file diff --git a/package.json b/package.json index 6e32c7d515..1e2b1be430 100644 --- a/package.json +++ b/package.json @@ -4,5 +4,9 @@ "repository": { "type": "git", "url": "git+https://github.com/appwrite/appwrite.git" - } -} \ No newline at end of file + }, + "files": [ + "docs/examples", + "app/config/specs" + ] +} diff --git a/phpstan.neon b/phpstan.neon index b18f3d6d58..153b3be21c 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,4 +5,5 @@ parameters: scanDirectories: - vendor/swoole/ide-helper excludePaths: - - tests/resources \ No newline at end of file + - tests/resources + - app/sdks \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index 598b730908..4c4e55ea4e 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="true" + stopOnFailure="false" > <extensions> <extension class="Appwrite\Tests\TestHook" /> diff --git a/src/Appwrite/Event/Certificate.php b/src/Appwrite/Event/Certificate.php index 827472ae37..00875c7a4a 100644 --- a/src/Appwrite/Event/Certificate.php +++ b/src/Appwrite/Event/Certificate.php @@ -9,6 +9,7 @@ class Certificate extends Event { protected bool $skipRenewCheck = false; protected ?Document $domain = null; + protected ?string $validationDomain = null; public function __construct(protected Publisher $publisher) { @@ -55,6 +56,30 @@ class Certificate extends Event return $this; } + + /** + * Set override for main domain used for validation + * + * @param string|null $validationDomain + * @return self + */ + public function setValidationDomain(?string $validationDomain): self + { + $this->validationDomain = $validationDomain; + + return $this; + } + + /** + * Get validation domain + * + * @return string|null + */ + public function getValidationDomain(): ?string + { + return $this->validationDomain; + } + /** * Return if the certificate needs be validated. * @@ -65,6 +90,7 @@ class Certificate extends Event return $this->skipRenewCheck; } + /** * Prepare the payload for the event * @@ -75,7 +101,8 @@ class Certificate extends Event return [ 'project' => $this->project, 'domain' => $this->domain, - 'skipRenewCheck' => $this->skipRenewCheck + 'skipRenewCheck' => $this->skipRenewCheck, + 'validationDomain' => $this->validationDomain ]; } } diff --git a/src/Appwrite/Event/Database.php b/src/Appwrite/Event/Database.php index d2f70dddf2..8e7f6b7625 100644 --- a/src/Appwrite/Event/Database.php +++ b/src/Appwrite/Event/Database.php @@ -10,8 +10,15 @@ class Database extends Event { protected string $type = ''; protected ?Document $database = null; - protected ?Document $collection = null; + + // tables api + protected ?Document $row = null; + protected ?Document $table = null; + + // collections api protected ?Document $document = null; + protected ?Document $collection = null; + public function __construct(protected Publisher $publisher) { @@ -54,6 +61,61 @@ class Database extends Event return $this; } + /** + * Returns set database for this event. + * + * @return null|Document + */ + public function getDatabase(): ?Document + { + return $this->database; + } + + /** + * Set the table for this database event. + * + * @param Document $table + * @return self + */ + public function setTable(Document $table): self + { + $this->table = $table; + + return $this; + } + + /** + * Returns set table for this event. + * + * @return null|Document + */ + public function getTable(): ?Document + { + return $this->table; + } + + /** + * Set the row for this database event. + * + * @param Document $row + * @return self + */ + public function setRow(Document $row): self + { + $this->row = $row; + + return $this; + } + + /** + * Returns set row for this database event. + * @return null|Document + */ + public function getRow(): ?Document + { + return $this->row; + } + /** * Set the collection for this database event. * @@ -99,17 +161,20 @@ class Database extends Event return $this->document; } - public function getQueue(): string + public function setProject(Document $project): self { - try { - $dsn = new DSN($this->getProject()->getAttribute('database')); - } catch (\InvalidArgumentException) { - // TODO: Temporary until all projects are using shared tables - $dsn = new DSN('mysql://' . $this->getProject()->getAttribute('database')); + $database = $project->getAttribute('database'); + if (!empty($database)) { + try { + $dsn = new DSN($database); + } catch (\InvalidArgumentException) { + // TODO: Temporary until all projects are using shared tables + $dsn = new DSN("mysql://$database"); + } + $this->queue = $dsn->getHost(); } - $this->queue = $dsn->getHost(); - return $this->queue; + return parent::setProject($project); } /** @@ -123,6 +188,8 @@ class Database extends Event 'project' => $this->project, 'user' => $this->user, 'type' => $this->type, + 'table' => $this->table, + 'row' => $this->row, 'collection' => $this->collection, 'document' => $this->document, 'database' => $this->database, diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index 934647f7c3..e9f3ccc2a2 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -383,6 +383,8 @@ class Event { $this->params = []; $this->sensitive = []; + $this->event = ''; + $this->payload = []; return $this; } @@ -569,7 +571,12 @@ class Event /** * Force a non-assoc array. */ - return \array_values($events); + $eventValues = \array_values($events); + + /** + * Return a combined list of table, collection events. + */ + return Event::mirrorCollectionEvents($pattern, $eventValues[0], $eventValues); } /** @@ -590,4 +597,57 @@ class Event $this->context = $event->context; return $this; } + + /** + * Adds `table` events for `collection` events. + * + * Example: + * + * `databases.*.collections.*.documents.*.update` →\ + * `[databases.*.collections.*.documents.*.update, databases.*.tables.*.rows.*.update]` + */ + private static function mirrorCollectionEvents(string $pattern, string $firstEvent, array $events): array + { + $tableEventMap = [ + 'documents' => 'rows', + 'collections' => 'tables', + 'attributes' => 'columns', + ]; + + if ( + str_contains($pattern, 'databases.') && + str_contains($firstEvent, 'collections') + ) { + $pairedEvents = []; + + foreach ($events as $event) { + $pairedEvents[] = $event; + + if (str_contains($event, 'collections')) { + $tableSideEvent = str_replace( + array_keys($tableEventMap), + array_values($tableEventMap), + $event + ); + $pairedEvents[] = $tableSideEvent; + } + } + + $events = $pairedEvents; + } + + return $events; + } + + /** + * Returns the size of the queue. + * + * @param bool $failed Whether to include failed events in the count. + * @return int The size of the queue. + */ + public function getSize(bool $failed = false): int + { + $queue = new Queue($this->getQueue()); + return $this->publisher->getQueueSize($queue, $failed); + } } diff --git a/src/Appwrite/Event/Mail.php b/src/Appwrite/Event/Mail.php index 87312182ea..aaaa148fde 100644 --- a/src/Appwrite/Event/Mail.php +++ b/src/Appwrite/Event/Mail.php @@ -10,6 +10,7 @@ class Mail extends Event protected string $name = ''; protected string $subject = ''; protected string $body = ''; + protected string $preview = ''; protected array $smtp = []; protected array $variables = []; protected string $bodyTemplate = ''; @@ -93,6 +94,28 @@ class Mail extends Event return $this->body; } + /** + * Sets preview for the mail event. + * + * @return string + */ + public function setPreview(string $preview): self + { + $this->preview = $preview; + + return $this; + } + + /** + * Returns preview for the mail event. + * + * @return string + */ + public function getPreview(string $preview): string + { + return $this->preview; + } + /** * Sets name for the mail event. * @@ -122,7 +145,7 @@ class Mail extends Event * @param string $bodyTemplate * @return self */ - public function setbodyTemplate(string $bodyTemplate): self + public function setBodyTemplate(string $bodyTemplate): self { $this->bodyTemplate = $bodyTemplate; @@ -134,7 +157,7 @@ class Mail extends Event * * @return string */ - public function getbodyTemplate(): string + public function getBodyTemplate(): string { return $this->bodyTemplate; } @@ -409,6 +432,7 @@ class Mail extends Event 'subject' => $this->subject, 'bodyTemplate' => $this->bodyTemplate, 'body' => $this->body, + 'preview' => $this->preview, 'smtp' => $this->smtp, 'variables' => $this->variables, 'attachment' => $this->attachment, diff --git a/src/Appwrite/Event/Realtime.php b/src/Appwrite/Event/Realtime.php index 4d8c9a321b..6cb51ffa14 100644 --- a/src/Appwrite/Event/Realtime.php +++ b/src/Appwrite/Event/Realtime.php @@ -73,19 +73,21 @@ class Realtime extends Event } $allEvents = Event::generateEvents($this->getEvent(), $this->getParams()); + $payload = new Document($this->getPayload()); $db = $this->getContext('database'); - $collection = $this->getContext('collection'); $bucket = $this->getContext('bucket'); + // Can be Tables API or Collections API; generated channels include both! + $tableOrCollection = $this->getContext('table') ?? $this->getContext('collection'); + $target = RealtimeAdapter::fromPayload( - // Pass first, most verbose event pattern event: $allEvents[0], payload: $payload, project: $this->getProject(), database: $db, - collection: $collection, + collection: $tableOrCollection, bucket: $bucket, ); diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index 296434ed57..52282ad7af 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -48,7 +48,8 @@ class Exception extends \Exception public const GENERAL_SMTP_DISABLED = 'general_smtp_disabled'; public const GENERAL_PHONE_DISABLED = 'general_phone_disabled'; public const GENERAL_ARGUMENT_INVALID = 'general_argument_invalid'; - public const GENERAL_QUERY_LIMIT_EXCEEDED = 'general_query_limit_exceeded'; + public const GENERAL_COLUMN_QUERY_LIMIT_EXCEEDED = 'general_column_query_limit_exceeded'; + public const GENERAL_ATTRIBUTE_QUERY_LIMIT_EXCEEDED = 'general_attribute_query_limit_exceeded'; public const GENERAL_QUERY_INVALID = 'general_query_invalid'; public const GENERAL_ROUTE_NOT_FOUND = 'general_route_not_found'; public const GENERAL_CURSOR_NOT_FOUND = 'general_cursor_not_found'; @@ -124,6 +125,8 @@ class Exception extends \Exception /** Membership */ public const MEMBERSHIP_NOT_FOUND = 'membership_not_found'; public const MEMBERSHIP_ALREADY_CONFIRMED = 'membership_already_confirmed'; + public const MEMBERSHIP_DELETION_PROHIBITED = 'membership_deletion_prohibited'; + public const MEMBERSHIP_DOWNGRADE_PROHIBITED = 'membership_downgrade_prohibited'; /** Avatars */ public const AVATAR_SET_NOT_FOUND = 'avatar_set_not_found'; @@ -131,6 +134,7 @@ class Exception extends \Exception public const AVATAR_IMAGE_NOT_FOUND = 'avatar_image_not_found'; public const AVATAR_REMOTE_URL_FAILED = 'avatar_remote_url_failed'; public const AVATAR_ICON_NOT_FOUND = 'avatar_icon_not_found'; + public const AVATAR_SVG_SANITIZATION_FAILED = 'avatar_svg_sanitization_failed'; /** Storage */ public const STORAGE_FILE_ALREADY_EXISTS = 'storage_file_already_exists'; @@ -196,6 +200,11 @@ class Exception extends \Exception public const COLLECTION_ALREADY_EXISTS = 'collection_already_exists'; public const COLLECTION_LIMIT_EXCEEDED = 'collection_limit_exceeded'; + /** Tables */ + public const TABLE_NOT_FOUND = 'table_not_found'; + public const TABLE_ALREADY_EXISTS = 'table_already_exists'; + public const TABLE_LIMIT_EXCEEDED = 'table_limit_exceeded'; + /** Documents */ public const DOCUMENT_NOT_FOUND = 'document_not_found'; public const DOCUMENT_INVALID_STRUCTURE = 'document_invalid_structure'; @@ -205,7 +214,16 @@ class Exception extends \Exception public const DOCUMENT_UPDATE_CONFLICT = 'document_update_conflict'; public const DOCUMENT_DELETE_RESTRICTED = 'document_delete_restricted'; - /** Attribute */ + /** Rows */ + public const ROW_NOT_FOUND = 'row_not_found'; + public const ROW_INVALID_STRUCTURE = 'row_invalid_structure'; + public const ROW_MISSING_DATA = 'row_missing_data'; + public const ROW_MISSING_PAYLOAD = 'row_missing_payload'; + public const ROW_ALREADY_EXISTS = 'row_already_exists'; + public const ROW_UPDATE_CONFLICT = 'row_update_conflict'; + public const ROW_DELETE_RESTRICTED = 'row_delete_restricted'; + + /** Attributes */ public const ATTRIBUTE_NOT_FOUND = 'attribute_not_found'; public const ATTRIBUTE_UNKNOWN = 'attribute_unknown'; public const ATTRIBUTE_NOT_AVAILABLE = 'attribute_not_available'; @@ -217,6 +235,22 @@ class Exception extends \Exception public const ATTRIBUTE_TYPE_INVALID = 'attribute_type_invalid'; public const ATTRIBUTE_INVALID_RESIZE = 'attribute_invalid_resize'; + public const ATTRIBUTE_TYPE_NOT_SUPPORTED = 'ATTRIBUTE_TYPE_NOT_SUPPORTED'; + + /** Columns */ + public const COLUMN_NOT_FOUND = 'column_not_found'; + public const COLUMN_UNKNOWN = 'column_unknown'; + public const COLUMN_NOT_AVAILABLE = 'column_not_available'; + public const COLUMN_FORMAT_UNSUPPORTED = 'column_format_unsupported'; + public const COLUMN_DEFAULT_UNSUPPORTED = 'column_default_unsupported'; + public const COLUMN_ALREADY_EXISTS = 'column_already_exists'; + public const COLUMN_LIMIT_EXCEEDED = 'column_limit_exceeded'; + public const COLUMN_VALUE_INVALID = 'column_value_invalid'; + public const COLUMN_TYPE_INVALID = 'column_type_invalid'; + public const COLUMN_INVALID_RESIZE = 'column_invalid_resize'; + + public const COLUMN_TYPE_NOT_SUPPORTED = 'COLUMN_TYPE_NOT_SUPPORTED'; + /** Relationship */ public const RELATIONSHIP_VALUE_INVALID = 'relationship_value_invalid'; @@ -227,6 +261,13 @@ class Exception extends \Exception public const INDEX_INVALID = 'index_invalid'; public const INDEX_DEPENDENCY = 'index_dependency'; + /** Column Indexes */ + public const COLUMN_INDEX_NOT_FOUND = 'column_index_not_found'; + public const COLUMN_INDEX_LIMIT_EXCEEDED = 'column_index_limit_exceeded'; + public const COLUMN_INDEX_ALREADY_EXISTS = 'column_index_already_exists'; + public const COLUMN_INDEX_INVALID = 'column_index_invalid'; + public const COLUMN_INDEX_DEPENDENCY = 'column_index_dependency'; + /** Projects */ public const PROJECT_NOT_FOUND = 'project_not_found'; public const PROJECT_PROVIDER_DISABLED = 'project_provider_disabled'; @@ -314,7 +355,7 @@ class Exception extends \Exception public const MESSAGE_MISSING_SCHEDULE = 'message_missing_schedule'; /** Targets */ - public const TARGET_PROVIDER_INVALID_TYPE = 'target_provider_invalid_type'; + public const TARGET_PROVIDER_INVALID_TYPE = 'target_provider_invalid_type'; /** Schedules */ public const SCHEDULE_NOT_FOUND = 'schedule_not_found'; diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 3c7915bc96..b74e2a7549 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -58,6 +58,8 @@ class Mapper 'json' => Types::json(), 'none' => Types::json(), 'any' => Types::json(), + 'array' => Types::json(), + 'enum' => Type::string() ]; foreach ($defaults as $type => $default) { @@ -226,7 +228,7 @@ class Mapper ]; if (!$rule['required']) { - $fields[$escapedKey]['defaultValue'] = $rule['default']; + $fields[$escapedKey]['defaultValue'] = $rule['default'] ?? null; } } @@ -267,48 +269,53 @@ class Mapper } switch ((!empty($validator)) ? $validator::class : '') { - case 'Appwrite\Network\Validator\CNAME': - case 'Appwrite\Task\Validator\Cron': - case 'Appwrite\Utopia\Database\Validator\CustomId': - case 'Utopia\Validator\Domain': - case 'Appwrite\Network\Validator\Email': + case 'Appwrite\Auth\Validator\Password': case 'Appwrite\Event\Validator\Event': case 'Appwrite\Event\Validator\FunctionEvent': + case 'Appwrite\Network\Validator\CNAME': + case 'Appwrite\Network\Validator\Email': + case 'Appwrite\Network\Validator\Redirect': + case 'Appwrite\Network\Validator\DNS': + case 'Appwrite\Network\Validator\Origin': + case 'Appwrite\Task\Validator\Cron': + case 'Appwrite\Utopia\Database\Validator\CustomId': + case 'Utopia\Database\Validator\Key': + case 'Utopia\Database\Validator\UID': + case 'Utopia\Validator\Domain': case 'Utopia\Validator\HexColor': case 'Utopia\Validator\Host': case 'Utopia\Validator\IP': - case 'Utopia\Database\Validator\Key': case 'Utopia\Validator\Origin': - case 'Appwrite\Auth\Validator\Password': case 'Utopia\Validator\Text': - case 'Utopia\Database\Validator\UID': case 'Utopia\Validator\URL': case 'Utopia\Validator\WhiteList': default: $type = Type::string(); break; - case 'Utopia\Database\Validator\Authorization': + case 'Appwrite\Utopia\Database\Validator\Queries\Attributes': case 'Appwrite\Utopia\Database\Validator\Queries\Base': case 'Appwrite\Utopia\Database\Validator\Queries\Buckets': + case 'Appwrite\Utopia\Database\Validator\Queries\Tables': case 'Appwrite\Utopia\Database\Validator\Queries\Collections': - case 'Appwrite\Utopia\Database\Validator\Queries\Attributes': - case 'Appwrite\Utopia\Database\Validator\Queries\Indexes': + case 'Appwrite\Utopia\Database\Validator\Queries\Columns': case 'Appwrite\Utopia\Database\Validator\Queries\Databases': case 'Appwrite\Utopia\Database\Validator\Queries\Deployments': - case 'Appwrite\Utopia\Database\Validator\Queries\Installations': - case 'Utopia\Database\Validator\Queries\Documents': case 'Appwrite\Utopia\Database\Validator\Queries\Executions': case 'Appwrite\Utopia\Database\Validator\Queries\Files': case 'Appwrite\Utopia\Database\Validator\Queries\Functions': - case 'Appwrite\Utopia\Database\Validator\Queries\Rules': + case 'Appwrite\Utopia\Database\Validator\Queries\Indexes': + case 'Appwrite\Utopia\Database\Validator\Queries\Installations': case 'Appwrite\Utopia\Database\Validator\Queries\Memberships': - case 'Utopia\Database\Validator\Permissions': case 'Appwrite\Utopia\Database\Validator\Queries\Projects': - case 'Utopia\Database\Validator\Queries': - case 'Utopia\Database\Validator\Roles': + case 'Appwrite\Utopia\Database\Validator\Queries\Rules': case 'Appwrite\Utopia\Database\Validator\Queries\Teams': case 'Appwrite\Utopia\Database\Validator\Queries\Users': case 'Appwrite\Utopia\Database\Validator\Queries\Variables': + case 'Utopia\Database\Validator\Authorization': + case 'Utopia\Database\Validator\Permissions': + case 'Utopia\Database\Validator\Queries': + case 'Utopia\Database\Validator\Queries\Documents': + case 'Utopia\Database\Validator\Roles': $type = Type::listOf(Type::string()); break; case 'Utopia\Validator\Boolean': @@ -425,7 +432,9 @@ class Mapper switch ($name) { case 'Attributes': - return static::getAttributeImplementation($object); + return static::getColumnImplementation($object); + case 'Columns': + return static::getColumnImplementation($object, true); case 'HashOptions': return static::getHashOptionsImplementation($object); } @@ -433,29 +442,28 @@ class Mapper throw new Exception('Unknown union type: ' . $name); } - private static function getAttributeImplementation(array $object): Type + private static function getColumnImplementation(array $object, bool $isColumns = false): Type { - switch ($object['type']) { - case 'string': - return match ($object['format'] ?? '') { - 'email' => static::model('AttributeEmail'), - 'url' => static::model('AttributeUrl'), - 'ip' => static::model('AttributeIp'), - default => static::model('AttributeString'), - }; - case 'integer': - return static::model('AttributeInteger'); - case 'double': - return static::model('AttributeFloat'); - case 'boolean': - return static::model('AttributeBoolean'); - case 'datetime': - return static::model('AttributeDatetime'); - case 'relationship': - return static::model('AttributeRelationship'); - } + $prefix = $isColumns ? 'Column' : 'Attribute'; - throw new Exception('Unknown attribute implementation'); + return match ($object['type']) { + 'string' => match ($object['format'] ?? '') { + 'email' => static::model("{$prefix}Email"), + 'url' => static::model("{$prefix}Url"), + 'ip' => static::model("{$prefix}Ip"), + default => static::model("{$prefix}String"), + }, + 'enum' => static::model("{$prefix}String"), // TODO: Add enum type (breaking change if added) + 'integer' => static::model("{$prefix}Integer"), + 'double' => static::model("{$prefix}Float"), + 'boolean' => static::model("{$prefix}Boolean"), + 'datetime' => static::model("{$prefix}Datetime"), + 'relationship' => static::model("{$prefix}Relationship"), + 'point' => static::model("{$prefix}Point"), + 'linestring' => static::model("{$prefix}Line"), + 'polygon' => static::model("{$prefix}Polygon"), + default => throw new Exception('Unknown ' . strtolower($prefix) . ' implementation'), + }; } private static function getHashOptionsImplementation(array $object): Type diff --git a/src/Appwrite/Messaging/Adapter/Realtime.php b/src/Appwrite/Messaging/Adapter/Realtime.php index d122841d68..8b5e121dcd 100644 --- a/src/Appwrite/Messaging/Adapter/Realtime.php +++ b/src/Appwrite/Messaging/Adapter/Realtime.php @@ -230,7 +230,7 @@ class Realtime extends MessagingAdapter foreach ($channels as $key => $value) { switch (true) { - case \str_starts_with($key, 'account.'): + case str_starts_with($key, 'account.'): unset($channels[$key]); break; @@ -273,6 +273,7 @@ class Realtime extends MessagingAdapter $roles = [Role::user(ID::custom($parts[1]))->toString()]; break; case 'rules': + case 'migrations': $channels[] = 'console'; $channels[] = 'projects.' . $project->getId(); $projectId = 'console'; @@ -297,19 +298,24 @@ class Realtime extends MessagingAdapter $roles = [Role::team(ID::custom($parts[1]))->toString()]; break; case 'databases': - if (in_array($parts[4] ?? [], ['attributes', 'indexes'])) { + $resource = $parts[4] ?? ''; + if (in_array($resource, ['columns', 'attributes', 'indexes'])) { $channels[] = 'console'; $channels[] = 'projects.' . $project->getId(); $projectId = 'console'; $roles = [Role::team($project->getAttribute('teamId'))->toString()]; - } elseif (($parts[4] ?? '') === 'documents') { + } elseif (in_array($resource, ['rows', 'documents'])) { if ($database->isEmpty()) { - throw new \Exception('Database needs to be passed to Realtime for Document events in the Database.'); + throw new \Exception('Database needs to be passed to Realtime for Document/Row events in the Database.'); } if ($collection->isEmpty()) { - throw new \Exception('Collection needs to be passed to Realtime for Document events in the Database.'); + throw new \Exception('Collection or the Table needs to be passed to Realtime for Document/Row events in the Database.'); } + $channels[] = 'rows'; + $channels[] = 'databases.' . $database->getId() . '.tables.' . $payload->getAttribute('$tableId') . '.rows'; + $channels[] = 'databases.' . $database->getId() . '.tables.' . $payload->getAttribute('$tableId') . '.rows.' . $payload->getId(); + $channels[] = 'documents'; $channels[] = 'databases.' . $database->getId() . '.collections.' . $payload->getAttribute('$collectionId') . '.documents'; $channels[] = 'databases.' . $database->getId() . '.collections.' . $payload->getAttribute('$collectionId') . '.documents.' . $payload->getId(); @@ -334,7 +340,6 @@ class Realtime extends MessagingAdapter } break; - case 'functions': if ($parts[2] === 'executions') { if (!empty($payload->getRead())) { @@ -361,12 +366,6 @@ class Realtime extends MessagingAdapter $roles = [Role::team($project->getAttribute('teamId'))->toString()]; } break; - case 'migrations': - $channels[] = 'console'; - $channels[] = 'projects.' . $project->getId(); - $projectId = 'console'; - $roles = [Role::team($project->getAttribute('teamId'))->toString()]; - break; } return [ diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index 73d16394c0..2d82b9c486 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -87,6 +87,9 @@ abstract class Migration '1.7.0' => 'V22', '1.7.1' => 'V22', '1.7.2' => 'V22', + '1.7.3' => 'V22', + '1.7.4' => 'V22', + '1.8.0' => 'V23' ]; /** @@ -118,6 +121,7 @@ abstract class Migration * @param Document $project * @param Database $dbForProject * @param Database $dbForPlatform + * @param callable|null $getProjectDB * @return self */ public function setProject( diff --git a/src/Appwrite/Migration/Version/V19.php b/src/Appwrite/Migration/Version/V19.php index d4dda02d75..f5cf84c95e 100644 --- a/src/Appwrite/Migration/Version/V19.php +++ b/src/Appwrite/Migration/Version/V19.php @@ -730,8 +730,8 @@ class V19 extends Migration if (empty($document->getAttribute('scheduleId', null))) { $schedule = $this->dbForPlatform->createDocument('schedules', new Document([ - 'region' => $project->getAttribute('region'), - 'resourceType' => 'function', + 'region' => $this->project->getAttribute('region'), + 'resourceType' => SCHEDULE_RESOURCE_TYPE_FUNCTION, 'resourceId' => $document->getId(), 'resourceInternalId' => $document->getSequence(), 'resourceUpdatedAt' => DateTime::now(), diff --git a/src/Appwrite/Migration/Version/V22.php b/src/Appwrite/Migration/Version/V22.php index a99e07de59..ba9c9dc126 100644 --- a/src/Appwrite/Migration/Version/V22.php +++ b/src/Appwrite/Migration/Version/V22.php @@ -12,6 +12,7 @@ use Utopia\Database\Exception\Conflict; use Utopia\Database\Exception\Structure; use Utopia\Database\Exception\Timeout; use Utopia\Database\Query; +use Utopia\System\System; class V22 extends Migration { @@ -149,9 +150,9 @@ class V22 extends Migration ]; foreach ($indexes as $index) { try { - $this->createIndexFromCollection($this->dbForProject, $id, $index); + $this->dbForProject->deleteIndex($id, $index); } catch (Throwable $th) { - Console::warning("Failed to create index \"$index\" from {$id}: {$th->getMessage()}"); + Console::warning("Failed to delete index \"$index\" from {$id}: {$th->getMessage()}"); } } $this->dbForProject->purgeCachedCollection($id); @@ -324,7 +325,9 @@ class V22 extends Migration 4. Fill "trigger" with "manual" 5. Fill "deploymentResourceType". If "resourceType" is "function", set "deploymentResourceType" to "function" 6. Fill "search" with "{$id} {domain}" - 7. Fill "deploymentId" and "deploymentInternalId". If "deploymentResourceType" is "function", get project DB, and find function with ID "resourceId". Then fill rule's "deploymentId" with function's "deployment", and "deploymentId" as backup + 7. Set "region" to project region + 8. Fill "owner" with "Appwrite" if "domain" ends with "functions" or "sites" + 9. Fill "deploymentId" and "deploymentInternalId". If "deploymentResourceType" is "function", get project DB, and find function with ID "resourceId". Then fill rule's "deploymentId" with function's "deployment", and "deploymentId" as backup */ $deploymentResourceType = null; @@ -346,14 +349,29 @@ class V22 extends Migration ->setAttribute('deploymentResourceType', $document->getAttribute('deploymentResourceType', $deploymentResourceType)) ->setAttribute('search', \implode(' ', [$document->getId(), $document->getAttribute('domain', '')])); + $project = $this->dbForProject->getDocument('projects', $document->getAttribute('projectId')); + + if ($project->isEmpty()) { + Console::warning("Project \"{$document->getAttribute('projectId')}\" not found for rule \"{$document->getId()}\""); + $document->setAttribute('region', System::getEnv('_APP_REGION', 'default')); + break; + } + + $document->setAttribute('region', $project->getAttribute('region', System::getEnv('_APP_REGION', 'default'))); + + $domain = $document->getAttribute('domain', ''); + $functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); + $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); + $owner = $document->getAttribute('owner', ''); + if ( + empty($owner) && + (!empty($functionsDomain) && \str_ends_with($domain, $functionsDomain)) || + (!empty($sitesDomain) && \str_ends_with($domain, $sitesDomain)) + ) { + $document->setAttribute('owner', 'Appwrite'); + } + if ($deploymentResourceType === 'function') { - $project = $this->dbForProject->getDocument('projects', $document->getAttribute('projectId')); - - if ($project->isEmpty()) { - Console::warning("Project \"{$document->getAttribute('projectId')}\" not found for rule \"{$document->getId()}\""); - break; - } - $dbForOwnerProject = ($this->getProjectDB)($project); $function = $dbForOwnerProject->getDocument('functions', $resourceId); diff --git a/src/Appwrite/Migration/Version/V23.php b/src/Appwrite/Migration/Version/V23.php new file mode 100644 index 0000000000..d5caf2ab3c --- /dev/null +++ b/src/Appwrite/Migration/Version/V23.php @@ -0,0 +1,52 @@ +<?php + +namespace Appwrite\Migration\Version; + +use Appwrite\Migration\Migration; +use Exception; +use Throwable; +use Utopia\CLI\Console; +use Utopia\Database\Database; +use Utopia\Database\Document; + +class V23 extends Migration +{ + /** + * @throws Throwable + */ + public function execute(): void + { + /** + * Disable SubQueries for Performance. + */ + foreach (['subQueryIndexes', 'subQueryPlatforms', 'subQueryDomains', 'subQueryKeys', 'subQueryDevKeys', 'subQueryWebhooks', 'subQuerySessions', 'subQueryTokens', 'subQueryMemberships', 'subQueryVariables', 'subQueryChallenges', 'subQueryProjectVariables', 'subQueryTargets', 'subQueryTopicTargets'] as $name) { + Database::addFilter( + $name, + fn () => null, + fn () => [] + ); + } + + Console::info('Migrating databases'); + $this->migrateDatabases(); + } + + /** + * Migrate Databases. + * + * @return void + * @throws Exception|Throwable + */ + private function migrateDatabases(): void + { + if ($this->project->getId() === 'console') { + return; + } + + // since required + default can't be used together + // so first creating the attribute then bulk updating the attribute + $this->createAttributeFromCollection($this->dbForProject, 'databases', 'type'); + $this->dbForProject->updateDocuments('databases', new Document(['type' => 'legacy'])); + } + +} diff --git a/src/Appwrite/Network/Platform.php b/src/Appwrite/Network/Platform.php new file mode 100644 index 0000000000..ea64ff98c1 --- /dev/null +++ b/src/Appwrite/Network/Platform.php @@ -0,0 +1,159 @@ +<?php + +namespace Appwrite\Network; + +class Platform +{ + public const TYPE_UNKNOWN = 'unknown'; + public const TYPE_WEB = 'web'; + public const TYPE_FLUTTER_IOS = 'flutter-ios'; + public const TYPE_FLUTTER_ANDROID = 'flutter-android'; + public const TYPE_FLUTTER_MACOS = 'flutter-macos'; + public const TYPE_FLUTTER_WINDOWS = 'flutter-windows'; + public const TYPE_FLUTTER_LINUX = 'flutter-linux'; + public const TYPE_FLUTTER_WEB = 'flutter-web'; + public const TYPE_APPLE_IOS = 'apple-ios'; + public const TYPE_APPLE_MACOS = 'apple-macos'; + public const TYPE_APPLE_WATCHOS = 'apple-watchos'; + public const TYPE_APPLE_TVOS = 'apple-tvos'; + public const TYPE_ANDROID = 'android'; + public const TYPE_UNITY = 'unity'; + public const TYPE_REACT_NATIVE_IOS = 'react-native-ios'; + public const TYPE_REACT_NATIVE_ANDROID = 'react-native-android'; + public const TYPE_SCHEME = 'scheme'; + + public const SCHEME_HTTP = 'http'; + public const SCHEME_HTTPS = 'https'; + public const SCHEME_CHROME_EXTENSION = 'chrome-extension'; + public const SCHEME_FIREFOX_EXTENSION = 'moz-extension'; + public const SCHEME_SAFARI_EXTENSION = 'safari-web-extension'; + public const SCHEME_EDGE_EXTENSION = 'ms-browser-extension'; + public const SCHEME_IOS = 'appwrite-ios'; + public const SCHEME_MACOS = 'appwrite-macos'; + public const SCHEME_WATCHOS = 'appwrite-watchos'; + public const SCHEME_TVOS = 'appwrite-tvos'; + public const SCHEME_ANDROID = 'appwrite-android'; + public const SCHEME_WINDOWS = 'appwrite-windows'; + public const SCHEME_LINUX = 'appwrite-linux'; + + /** + * @var array<string, string> Map scheme types to user-friendly platform names. + */ + private static array $names = [ + self::SCHEME_HTTP => 'Web', + self::SCHEME_HTTPS => 'Web', + self::SCHEME_IOS => 'iOS', + self::SCHEME_MACOS => 'macOS', + self::SCHEME_WATCHOS => 'watchOS', + self::SCHEME_TVOS => 'tvOS', + self::SCHEME_ANDROID => 'Android', + self::SCHEME_WINDOWS => 'Windows', + self::SCHEME_LINUX => 'Linux', + self::SCHEME_CHROME_EXTENSION => 'Web (Chrome Extension)', + self::SCHEME_FIREFOX_EXTENSION => 'Web (Firefox Extension)', + self::SCHEME_SAFARI_EXTENSION => 'Web (Safari Extension)', + self::SCHEME_EDGE_EXTENSION => 'Web (Edge Extension)', + ]; + + /** + * Get user-friendly platform name from a scheme. + * + * @param string|null $scheme + * @return string Empty string if scheme is not found. + */ + public static function getNameByScheme(?string $scheme): string + { + return self::$names[$scheme] ?? ''; + } + + public static function getHostnames(array $platforms): array + { + $hostnames = []; + foreach ($platforms as $platform) { + $type = strtolower($platform['type'] ?? self::TYPE_UNKNOWN); + $hostname = strtolower($platform['hostname'] ?? ''); + $key = strtolower($platform['key'] ?? ''); + + switch ($type) { + case self::TYPE_WEB: + case self::TYPE_FLUTTER_WEB: + if (!empty($hostname)) { + $hostnames[] = $hostname; + } + break; + case self::TYPE_FLUTTER_IOS: + case self::TYPE_FLUTTER_ANDROID: + case self::TYPE_FLUTTER_MACOS: + case self::TYPE_FLUTTER_WINDOWS: + case self::TYPE_FLUTTER_LINUX: + case self::TYPE_ANDROID: + case self::TYPE_APPLE_IOS: + case self::TYPE_APPLE_MACOS: + case self::TYPE_APPLE_WATCHOS: + case self::TYPE_APPLE_TVOS: + case self::TYPE_REACT_NATIVE_IOS: + case self::TYPE_REACT_NATIVE_ANDROID: + case self::TYPE_UNITY: + if (!empty($key)) { + $hostnames[] = $key; + } + break; + default: + break; + } + } + return array_unique($hostnames); + } + + public static function getSchemes(array $platforms): array + { + $schemes = []; + foreach ($platforms as $platform) { + $type = strtolower($platform['type'] ?? self::TYPE_UNKNOWN); + $scheme = strtolower($platform['key'] ?? ''); + + switch ($type) { + case self::TYPE_SCHEME: + if (!empty($scheme) && preg_match('/^[a-z][a-z0-9+.-]*$/', $scheme)) { + $schemes[] = $scheme; + } + break; + case self::TYPE_WEB: + case self::TYPE_FLUTTER_WEB: + $schemes[] = self::SCHEME_HTTP; + $schemes[] = self::SCHEME_HTTPS; + break; + case self::TYPE_FLUTTER_IOS: + case self::TYPE_APPLE_IOS: + case self::TYPE_REACT_NATIVE_IOS: + $schemes[] = self::SCHEME_IOS; + break; + case self::TYPE_FLUTTER_ANDROID: + case self::TYPE_ANDROID: + case self::TYPE_REACT_NATIVE_ANDROID: + $schemes[] = self::SCHEME_ANDROID; + break; + case self::TYPE_FLUTTER_MACOS: + case self::TYPE_APPLE_MACOS: + $schemes[] = self::SCHEME_MACOS; + break; + case self::TYPE_FLUTTER_WINDOWS: + case self::TYPE_UNITY: + $schemes[] = self::SCHEME_WINDOWS; + break; + case self::TYPE_FLUTTER_LINUX: + $schemes[] = self::SCHEME_LINUX; + break; + case self::TYPE_APPLE_WATCHOS: + $schemes[] = self::SCHEME_WATCHOS; + break; + case self::TYPE_APPLE_TVOS: + $schemes[] = self::SCHEME_TVOS; + break; + default: + break; + } + } + return array_unique($schemes); + } +} diff --git a/src/Appwrite/Network/Validator/DNS.php b/src/Appwrite/Network/Validator/DNS.php index 73494ddc3e..f09bb42b02 100644 --- a/src/Appwrite/Network/Validator/DNS.php +++ b/src/Appwrite/Network/Validator/DNS.php @@ -2,24 +2,38 @@ namespace Appwrite\Network\Validator; +use Utopia\DNS\Client; +use Utopia\Domains\Domain; +use Utopia\System\System; use Utopia\Validator; class DNS extends Validator { - public const RECORD_A = 'a'; - public const RECORD_AAAA = 'aaaa'; - public const RECORD_CNAME = 'cname'; + public const RECORD_A = 'A'; + public const RECORD_AAAA = 'AAAA'; + public const RECORD_CNAME = 'CNAME'; + public const RECORD_CAA = 'CAA'; // You can provide domain only (as $target) for CAA validation /** * @var mixed */ protected mixed $logs; + /** + * @var string + */ + protected string $dnsServer; + /** * @param string $target */ - public function __construct(protected string $target, protected string $type = self::RECORD_CNAME) + public function __construct(protected string $target, protected string $type = self::RECORD_CNAME, string $dnsServer = '') { + if (empty($dnsServer)) { + $dnsServer = System::getEnv('_APP_DNS', '8.8.8.8'); + } + + $this->dnsServer = $dnsServer; } /** @@ -42,42 +56,65 @@ class DNS extends Validator * Check if DNS record value matches specific value * * @param mixed $domain - * * @return bool */ public function isValid($value): bool { - $typeNative = match ($this->type) { - self::RECORD_A => DNS_A, - self::RECORD_AAAA => DNS_AAAA, - self::RECORD_CNAME => DNS_CNAME, - default => throw new \Exception('Record type not supported.') - }; - - $dnsKey = match ($this->type) { - self::RECORD_A => 'ip', - self::RECORD_AAAA => 'ipv6', - self::RECORD_CNAME => 'target', - default => throw new \Exception('Record type not supported.') - }; - if (!is_string($value)) { return false; } + $dns = new Client($this->dnsServer); + try { - $records = \dns_get_record($value, $typeNative); - $this->logs = $records; - } catch (\Throwable $th) { + $rawQuery = $dns->query($value, $this->type); + + // Some DNS servers return all records, not only type that's asked for + // Likely occurs when no records of specific type are found + $query = array_filter($rawQuery, function ($record) { + return $record->getTypeName() === $this->type; + }); + + $this->logs = $query; + } catch (\Exception $e) { + $this->logs = ['error' => $e->getMessage()]; return false; } - if (!$records) { + if (empty($query)) { + // CAA records inherit from parent (custom CAA behaviour) + if ($this->type === self::RECORD_CAA) { + $domain = new Domain($value); + if ($domain->get() === $domain->getApex()) { + return true; // No CAA on apex domain means anyone can issue certificate + } + + // Recursive validation by parent domain + $parts = \explode('.', $value); + \array_shift($parts); + $parentDomain = \implode('.', $parts); + $validator = new DNS($this->target, DNS::RECORD_CAA, $this->dnsServer); + return $validator->isValid($parentDomain); + } + return false; } - foreach ($records as $record) { - if (isset($record[$dnsKey]) && $record[$dnsKey] === $this->target) { + foreach ($query as $record) { + // CAA validation only needs to ensure domain + if ($this->type === self::RECORD_CAA) { + // Extract domain; comments showcase extraction steps in most complex scenario + $rdata = $record->getRdata(); // 255 issuewild "certainly.com;validationmethods=tls-alpn-01;retrytimeout=3600" + $rdata = \explode(' ', $rdata, 3)[2] ?? ''; // "certainly.com;validationmethods=tls-alpn-01;retrytimeout=3600" + $rdata = \trim($rdata, '"'); // certainly.com;validationmethods=tls-alpn-01;retrytimeout=3600 + $rdata = \explode(';', $rdata, 2)[0] ?? ''; // certainly.com + + if ($rdata === $this->target) { + return true; + } + } + + if ($record->getRdata() === $this->target) { return true; } } diff --git a/src/Appwrite/Network/Validator/Origin.php b/src/Appwrite/Network/Validator/Origin.php index d41e9af2ad..7843a17f1c 100644 --- a/src/Appwrite/Network/Validator/Origin.php +++ b/src/Appwrite/Network/Validator/Origin.php @@ -2,150 +2,91 @@ namespace Appwrite\Network\Validator; +use Appwrite\Network\Platform; use Utopia\Validator; use Utopia\Validator\Hostname; class Origin extends Validator { - public const CLIENT_TYPE_UNKNOWN = 'unknown'; - public const CLIENT_TYPE_WEB = 'web'; - public const CLIENT_TYPE_FLUTTER_IOS = 'flutter-ios'; - public const CLIENT_TYPE_FLUTTER_ANDROID = 'flutter-android'; - public const CLIENT_TYPE_FLUTTER_MACOS = 'flutter-macos'; - public const CLIENT_TYPE_FLUTTER_WINDOWS = 'flutter-windows'; - public const CLIENT_TYPE_FLUTTER_LINUX = 'flutter-linux'; - public const CLIENT_TYPE_FLUTTER_WEB = 'flutter-web'; - public const CLIENT_TYPE_APPLE_IOS = 'apple-ios'; - public const CLIENT_TYPE_APPLE_MACOS = 'apple-macos'; - public const CLIENT_TYPE_APPLE_WATCHOS = 'apple-watchos'; - public const CLIENT_TYPE_APPLE_TVOS = 'apple-tvos'; - public const CLIENT_TYPE_ANDROID = 'android'; - public const CLIENT_TYPE_UNITY = 'unity'; - public const CLIENT_TYPE_REACT_NATIVE_IOS = 'react-native-ios'; - public const CLIENT_TYPE_REACT_NATIVE_ANDROID = 'react-native-android'; - - - public const SCHEME_TYPE_HTTP = 'http'; - public const SCHEME_TYPE_HTTPS = 'https'; - public const SCHEME_TYPE_IOS = 'appwrite-ios'; - public const SCHEME_TYPE_MACOS = 'appwrite-macos'; - public const SCHEME_TYPE_WATCHOS = 'appwrite-watchos'; - public const SCHEME_TYPE_TVOS = 'appwrite-tvos'; - public const SCHEME_TYPE_ANDROID = 'appwrite-android'; - public const SCHEME_TYPE_WINDOWS = 'appwrite-windows'; - public const SCHEME_TYPE_LINUX = 'appwrite-linux'; + protected array $hostnames = []; + protected array $schemes = []; + protected ?string $scheme = null; + protected ?string $host = null; + protected string $origin = ''; /** - * @var array + * Constructor + * + * @param array<\Utopia\Database\Document> $platforms */ - protected $platforms = [ - self::SCHEME_TYPE_HTTP => 'Web', - self::SCHEME_TYPE_HTTPS => 'Web', - self::SCHEME_TYPE_IOS => 'iOS', - self::SCHEME_TYPE_MACOS => 'macOS', - self::SCHEME_TYPE_WATCHOS => 'watchOS', - self::SCHEME_TYPE_TVOS => 'tvOS', - self::SCHEME_TYPE_ANDROID => 'Android', - self::SCHEME_TYPE_WINDOWS => 'Windows', - self::SCHEME_TYPE_LINUX => 'Linux', - ]; - - /** - * @var array - */ - protected $clients = [ - ]; - - /** - * @var string - */ - protected $client = self::CLIENT_TYPE_UNKNOWN; - - /** - * @var string - */ - protected $host = ''; - - /** - * @param string $target - */ - public function __construct($platforms) + public function __construct(array $platforms) { - foreach ($platforms as $platform) { - $type = (isset($platform['type'])) ? $platform['type'] : ''; - - switch ($type) { - case self::CLIENT_TYPE_WEB: - case self::CLIENT_TYPE_FLUTTER_WEB: - $this->clients[] = (isset($platform['hostname'])) ? $platform['hostname'] : ''; - break; - - case self::CLIENT_TYPE_FLUTTER_IOS: - case self::CLIENT_TYPE_FLUTTER_ANDROID: - case self::CLIENT_TYPE_FLUTTER_MACOS: - case self::CLIENT_TYPE_FLUTTER_WINDOWS: - case self::CLIENT_TYPE_FLUTTER_LINUX: - case self::CLIENT_TYPE_ANDROID: - case self::CLIENT_TYPE_APPLE_IOS: - case self::CLIENT_TYPE_APPLE_MACOS: - case self::CLIENT_TYPE_APPLE_WATCHOS: - case self::CLIENT_TYPE_APPLE_TVOS: - case self::CLIENT_TYPE_REACT_NATIVE_IOS: - case self::CLIENT_TYPE_REACT_NATIVE_ANDROID: - $this->clients[] = (isset($platform['key'])) ? $platform['key'] : ''; - break; - - default: - # code... - break; - } - } + $this->hostnames = Platform::getHostnames($platforms); + $this->schemes = Platform::getSchemes($platforms); } - public function getDescription(): string - { - if (!\array_key_exists($this->client, $this->platforms)) { - return 'Unsupported platform'; - } - - return 'Invalid Origin. Register your new client (' . $this->host . ') as a new ' - . $this->platforms[$this->client] . ' platform on your project console dashboard'; - } /** - * Check if Origin has been allowed - * for access to the API - * - * @param mixed $origin - * + * Check if Origin is valid. + * @param mixed $origin The Origin URI. * @return bool */ public function isValid($origin): bool { - if (!is_string($origin)) { + $this->origin = $origin; + $this->scheme = null; + $this->host = null; + + if (!is_string($origin) || empty($origin)) { return false; } - $scheme = \parse_url($origin, PHP_URL_SCHEME); - $host = \parse_url($origin, PHP_URL_HOST); + $this->scheme = $this->parseScheme($origin); + $this->host = strtolower(parse_url($origin, PHP_URL_HOST) ?? ''); - $this->host = $host; - $this->client = $scheme; + $webPlatforms = [ + Platform::SCHEME_HTTP, + Platform::SCHEME_HTTPS, + Platform::SCHEME_CHROME_EXTENSION, + Platform::SCHEME_FIREFOX_EXTENSION, + Platform::SCHEME_SAFARI_EXTENSION, + Platform::SCHEME_EDGE_EXTENSION, + ]; + if (in_array($this->scheme, $webPlatforms, true)) { + $validator = new Hostname($this->hostnames); + return $validator->isValid($this->host); + } - if (empty($host)) { + if (!empty($this->scheme) && in_array($this->scheme, $this->schemes, true)) { return true; } - $validator = new Hostname($this->clients); + return false; + } - return $validator->isValid($host); + /** + * Get Description + * @return string + */ + public function getDescription(): string + { + $platform = $this->scheme ? Platform::getNameByScheme($this->scheme) : ''; + $host = $this->host ? '(' . $this->host . ')' : ''; + + if (empty($this->host) && empty($this->scheme)) { + return 'Invalid Origin.'; + } + + if (empty($platform)) { + return 'Invalid Scheme. The scheme used (' . $this->scheme . ') in the Origin (' . $this->origin . ') is not supported. If you are using a custom scheme, please change it to `appwrite-callback-<PROJECT_ID>`'; + } + + return 'Invalid Origin. Register your new client ' . $host . ' as a new ' + . $platform . ' platform on your project console dashboard'; } /** * Is array - * - * Function will return true if object is array. - * * @return bool */ public function isArray(): bool @@ -155,13 +96,35 @@ class Origin extends Validator /** * Get Type - * - * Returns validator type. - * * @return string */ public function getType(): string { return self::TYPE_STRING; } + + /** + * Parses the scheme from a URI string. + * + * @param string $uri The URI string to parse. + * @return string|null The extracted scheme string (e.g., "http", "exp", "mailto") + */ + public function parseScheme(string $uri): ?string + { + $uri = trim($uri); + if ($uri === '') { + return null; // No scheme in empty string + } + + $scheme = parse_url($uri, PHP_URL_SCHEME); + if ($scheme === false) { + if (preg_match('/^([a-z][a-z0-9+.-]*):/i', $uri, $matches)) { + return $matches[1]; + } else { + return null; + } + } else { + return $scheme; + } + } } diff --git a/src/Appwrite/Network/Validator/Redirect.php b/src/Appwrite/Network/Validator/Redirect.php new file mode 100644 index 0000000000..162f4c7eb9 --- /dev/null +++ b/src/Appwrite/Network/Validator/Redirect.php @@ -0,0 +1,25 @@ +<?php + +namespace Appwrite\Network\Validator; + +use Appwrite\Network\Platform; + +class Redirect extends Origin +{ + /** + * Get Description + * @return string + */ + public function getDescription(): string + { + $platform = Platform::getNameByScheme($this->scheme); + $host = $this->host ? '(' . $this->host . ')' : ''; + + if (empty($this->host) && empty($this->scheme)) { + return 'Invalid URI.'; + } + + return 'Invalid URI. Register your new client ' . $host . ' as a new ' + . $platform . ' platform on your project console dashboard'; + } +} diff --git a/src/Appwrite/Platform/Action.php b/src/Appwrite/Platform/Action.php index 72c41582ea..5699a67ff2 100644 --- a/src/Appwrite/Platform/Action.php +++ b/src/Appwrite/Platform/Action.php @@ -2,8 +2,13 @@ namespace Appwrite\Platform; +use Appwrite\Utopia\Request; +use Appwrite\Utopia\Response; use Swoole\Coroutine as Co; +use Utopia\CLI\Console; use Utopia\Database\Database; +use Utopia\Database\DateTime; +use Utopia\Database\Document; use Utopia\Database\Query; use Utopia\Platform\Action as UtopiaAction; @@ -16,6 +21,20 @@ class Action extends UtopiaAction */ protected mixed $logError; + protected array $filters = [ + 'subQueryKeys', 'subQueryWebhooks', 'subQueryPlatforms', 'subQueryProjectVariables', 'subQueryBlocks', 'subQueryDevKeys', // Project + 'subQueryAuthenticators', 'subQuerySessions', 'subQueryTokens', 'subQueryChallenges', 'subQueryMemberships', 'subQueryTargets', 'subQueryTopicTargets',// Users + 'subQueryVariables', // Sites + ]; + + /** + * Attributes to remove from relationship path documents per API + * Default is empty - APIs should set their specific attributes + * + * @var array + */ + protected array $removableAttributes = []; + /** * Foreach Document * Call provided callback for each document in the collection @@ -87,4 +106,98 @@ class Action extends UtopiaAction $latestDocument = $results[array_key_last($results)]; } } + + public function disableSubqueries() + { + $filters = $this->filters; + + foreach ($filters as $filter) { + Database::addFilter( + $filter, + function (mixed $value) { + return; + }, + function (mixed $value, Document $document, Database $database) { + return []; + } + ); + } + } + + /** + * Dump Log Message + * + * Logs messages to console with timestamp, method context, and project details. + * Supports multiple log types: success, error, log, warning, and info (default). + * + * @param string $method The calling method name + * @param string $log The log message + * @param string $type The log type (success, error, log, warning, info) + * @param Document|null $project The project document for context + * @param string $collectionId The collection identifier + * @return void + */ + public function dump(string $method, string $log, string $type = 'info', ?Document $project = null, string $collectionId = ''): void + { + if (empty($project)) { + $project = new Document([]); + } + switch ($type) { + case 'success': + Console::success("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log); + break; + case 'error': + Console::error("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log); + break; + case 'log': + Console::log("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log); + break; + case 'warning': + Console::warning("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log); + break; + default: + Console::info("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log); + } + } + + + /** + * Helper to apply (request) select queries to response model. + * + * This prevents default values of rules to be presnet for not-selected attributes + * + * @param Request $request + * @param Document $document + * @return void + */ + public function applySelectQueries(Request $request, Response $response, string $model): void + { + $queries = $request->getParam('queries', []); + + $queries = Query::parseQueries($queries); + $selectQueries = Query::groupByType($queries)['selections'] ?? []; + + // No select queries means no filtering out + if (empty($selectQueries)) { + return; + } + + $attributes = []; + foreach ($selectQueries as $query) { + foreach ($query->getValues() as $attribute) { + $attributes[] = $attribute; + } + } + + $responseModel = $response->getModel($model); + foreach ($responseModel->getRules() as $ruleName => $rule) { + if (\str_starts_with($ruleName, '$')) { + continue; + } + + if (!\in_array($ruleName, $attributes)) { + $responseModel->removeRule($ruleName); + } + } + } } diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index 5752432257..a77f894be7 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -4,6 +4,7 @@ namespace Appwrite\Platform; use Appwrite\Platform\Modules\Console; use Appwrite\Platform\Modules\Core; +use Appwrite\Platform\Modules\Databases; use Appwrite\Platform\Modules\Functions; use Appwrite\Platform\Modules\Projects; use Appwrite\Platform\Modules\Proxy; @@ -16,6 +17,7 @@ class Appwrite extends Platform public function __construct() { parent::__construct(new Core()); + $this->addModule(new Databases\Module()); $this->addModule(new Projects\Module()); $this->addModule(new Functions\Module()); $this->addModule(new Sites\Module()); diff --git a/src/Appwrite/Platform/Modules/Compute/Base.php b/src/Appwrite/Platform/Modules/Compute/Base.php index 71c436b0a0..92805fbaf8 100644 --- a/src/Appwrite/Platform/Modules/Compute/Base.php +++ b/src/Appwrite/Platform/Modules/Compute/Base.php @@ -4,14 +4,14 @@ namespace Appwrite\Platform\Modules\Compute; use Appwrite\Event\Build; use Appwrite\Extend\Exception; -use Appwrite\Query; +use Appwrite\Platform\Action; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Exception\Duplicate; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; -use Utopia\Platform\Action; use Utopia\Swoole\Request; use Utopia\System\System; use Utopia\VCS\Adapter\Git\GitHub; @@ -227,6 +227,73 @@ class Base extends Action ])) ); + if (!empty($commitDetails['commitHash'])) { + $domain = "commit-" . substr($commitDetails['commitHash'], 0, 16) . ".{$sitesDomain}"; + $ruleId = md5($domain); + try { + Authorization::skip( + fn () => $dbForPlatform->createDocument('rules', new Document([ + '$id' => $ruleId, + 'projectId' => $project->getId(), + 'projectInternalId' => $project->getSequence(), + 'domain' => $domain, + 'type' => 'deployment', + 'trigger' => 'deployment', + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + 'deploymentResourceType' => 'site', + 'deploymentResourceId' => $site->getId(), + 'deploymentResourceInternalId' => $site->getSequence(), + 'deploymentVcsProviderBranch' => $providerBranch, + 'status' => 'verified', + 'certificateId' => '', + 'search' => implode(' ', [$ruleId, $domain]), + 'owner' => 'Appwrite', + 'region' => $project->getAttribute('region') + ])) + ); + } catch (Duplicate $err) { + // Ignore, rule already exists; will be updated by builds worker + } + } + + // VCS branch preview + if (!empty($providerBranch)) { + $branchPrefix = substr($providerBranch, 0, 16); + if (strlen($providerBranch) > 16) { + $remainingChars = substr($providerBranch, 16); + $branchPrefix .= '-' . substr(hash('sha256', $remainingChars), 0, 7); + } + $resourceProjectHash = substr(hash('sha256', $site->getId() . $project->getId()), 0, 7); + $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; + $ruleId = md5($domain); + try { + Authorization::skip( + fn () => $dbForPlatform->createDocument('rules', new Document([ + '$id' => $ruleId, + 'projectId' => $project->getId(), + 'projectInternalId' => $project->getSequence(), + 'domain' => $domain, + 'type' => 'deployment', + 'trigger' => 'deployment', + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + 'deploymentResourceType' => 'site', + 'deploymentResourceId' => $site->getId(), + 'deploymentResourceInternalId' => $site->getSequence(), + 'deploymentVcsProviderBranch' => $providerBranch, + 'status' => 'verified', + 'certificateId' => '', + 'search' => implode(' ', [$ruleId, $domain]), + 'owner' => 'Appwrite', + 'region' => $project->getAttribute('region') + ])) + ); + } catch (Duplicate $err) { + // Ignore, rule already exists; will be updated by builds worker + } + } + $queueForBuilds ->setType(BUILD_TYPE_DEPLOYMENT) ->setResource($site) @@ -235,38 +302,4 @@ class Base extends Action return $deployment; } - - protected function listRules(Document $project, array $queries, Database $database, callable $callback): void - { - $limit = 100; - $cursor = null; - - do { - $queries = \array_merge([ - Query::limit($limit), - Query::equal("projectInternalId", [$project->getSequence()]) - ], $queries); - - if ($cursor !== null) { - $queries[] = Query::cursorAfter($cursor); - } - - $results = $database->find('rules', $queries); - - $total = \count($results); - if ($total > 0) { - $cursor = $results[$total - 1]; - } - - if ($total < $limit) { - $cursor = null; - } - - foreach ($results as $document) { - if (is_callable($callback)) { - $callback($document); - } - } - } while (!\is_null($cursor)); - } } diff --git a/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php b/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php index 16a94dc00c..b67a42adb1 100644 --- a/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php +++ b/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php @@ -11,9 +11,11 @@ use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; +use Utopia\Domains\Domain as Domain; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -use Utopia\Validator\Domain; +use Utopia\System\System; +use Utopia\Validator\Domain as DomainValidator; use Utopia\Validator\Text; use Utopia\Validator\WhiteList; @@ -57,7 +59,7 @@ class Get extends Action ->param('type', '', new WhiteList(['rules']), 'Resource type.') ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -67,10 +69,59 @@ class Get extends Action Database $dbForPlatform ) { if ($type === 'rules') { - $validator = new Domain($value); + $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); + $functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); + + $restrictions = []; + if (!empty($sitesDomain)) { + // Ensure site domains are exactly 1 subdomain, and dont start with reserved prefix + $domainLevel = \count(\explode('.', $sitesDomain)); + $restrictions[] = DomainValidator::createRestriction($sitesDomain, $domainLevel + 1, ['commit-', 'branch-']); + } + if (!empty($functionsDomain)) { + // Ensure function domains are exactly 1 subdomain + $domainLevel = \count(\explode('.', $functionsDomain)); + $restrictions[] = DomainValidator::createRestriction($functionsDomain, $domainLevel + 1); + } + $validator = new DomainValidator($restrictions); if (!$validator->isValid($value)) { - throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, $validator->getDescription()); + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); + } + + $deniedDomains = [ + 'localhost', + APP_HOSTNAME_INTERNAL + ]; + + $mainDomain = System::getEnv('_APP_DOMAIN', ''); + $deniedDomains[] = $mainDomain; + + if (!empty($sitesDomain)) { + $deniedDomains[] = $sitesDomain; + } + + if (!empty($functionsDomain)) { + $deniedDomains[] = $functionsDomain; + } + + $denyListDomains = System::getEnv('_APP_CUSTOM_DOMAIN_DENY_LIST', ''); + $denyListDomains = \array_map('trim', explode(',', $denyListDomains)); + foreach ($denyListDomains as $denyListDomain) { + if (empty($denyListDomain)) { + continue; + } + $deniedDomains[] = $denyListDomain; + } + + if (\in_array($value, $deniedDomains)) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); + } + + try { + $domain = new Domain($value); + } catch (\Throwable) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Domain may not start with http:// or https://.'); } $document = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [ diff --git a/src/Appwrite/Platform/Modules/Databases/Constants.php b/src/Appwrite/Platform/Modules/Databases/Constants.php new file mode 100644 index 0000000000..cfc297c3f4 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Constants.php @@ -0,0 +1,24 @@ +<?php + +/** + * Constants for identifying database resource types. + * + * - Tables vs. Collections, + * - Rows vs. Documents, and + * - Columns vs. Attributes + * + * are functionally equivalent and share the same underlying API structure. + * + * These constants help distinguish the context of an action, + * enabling accurate error messages, realtime event triggers, and other context-aware behaviors. + */ + +const ROWS = 'row'; +const TABLES = 'table'; +const COLUMNS = 'column'; +const COLUMN_INDEX = 'columnIndex'; + +const INDEX = 'index'; +const DOCUMENTS = 'document'; +const ATTRIBUTES = 'attribute'; +const COLLECTIONS = 'collection'; diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Action.php new file mode 100644 index 0000000000..884b9c5589 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Action.php @@ -0,0 +1,23 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases; + +use Utopia\Platform\Action as UtopiaAction; + +class Action extends UtopiaAction +{ + private string $context = 'legacy'; + + public function getDatabaseType(): string + { + return $this->context; + } + + public function setHttpPath(string $path): UtopiaAction + { + if (\str_contains($path, '/tablesdb')) { + $this->context = 'tablesdb'; + } + return parent::setHttpPath($path); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Action.php new file mode 100644 index 0000000000..0939376c49 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Action.php @@ -0,0 +1,108 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections; + +use Appwrite\Extend\Exception; +use Utopia\Platform\Action as UtopiaAction; +use Utopia\Platform\Scope\HTTP; + +abstract class Action extends UtopiaAction +{ + /** + * The current API context (either 'table' or 'collection'). + */ + private ?string $context = COLLECTIONS; + + /** + * Get the response model used in the SDK and HTTP responses. + */ + abstract protected function getResponseModel(): string; + + public function setHttpPath(string $path): UtopiaAction + { + if (\str_contains($path, '/tablesdb')) { + $this->context = TABLES; + } + return parent::setHttpPath($path); + } + + /** + * Get the current API context. + */ + protected function getContext(): string + { + return $this->context; + } + + /** + * Get the key used in event parameters (e.g., 'collectionId' or 'tableId'). + */ + protected function getEventsParamKey(): string + { + return $this->getContext() . 'Id'; + } + + /** + * Determine if the current action is for the Collections API. + */ + protected function isCollectionsAPI(): bool + { + return $this->getContext() === COLLECTIONS; + } + + /** + * Get the SDK group name for the current action. + */ + protected function getSdkGroup(): string + { + return $this->isCollectionsAPI() ? 'collections' : 'tables'; + } + + /** + * Get the SDK namespace for the current action. + */ + protected function getSdkNamespace(): string + { + return $this->isCollectionsAPI() ? 'databases' : 'tablesDB'; + } + + /** + * Get the exception to throw when the resource already exists. + */ + protected function getDuplicateException(): string + { + return $this->isCollectionsAPI() + ? Exception::COLLECTION_ALREADY_EXISTS + : Exception::TABLE_ALREADY_EXISTS; + } + + /** + * Get the appropriate index invalid exception. + */ + protected function getInvalidIndexException(): string + { + return $this->isCollectionsAPI() + ? Exception::INDEX_INVALID + : Exception::COLUMN_INDEX_INVALID; + } + + /** + * Get the exception to throw when the resource is not found. + */ + protected function getNotFoundException(): string + { + return $this->isCollectionsAPI() + ? Exception::COLLECTION_NOT_FOUND + : Exception::TABLE_NOT_FOUND; + } + + /** + * Get the exception to throw when the resource limit is exceeded. + */ + protected function getLimitException(): string + { + return $this->isCollectionsAPI() + ? Exception::COLLECTION_LIMIT_EXCEEDED + : Exception::TABLE_LIMIT_EXCEEDED; + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php new file mode 100644 index 0000000000..22a90d2653 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php @@ -0,0 +1,683 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\Utopia\Response; +use Appwrite\Utopia\Response as UtopiaResponse; +use Throwable; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Duplicate as DuplicateException; +use Utopia\Database\Exception\Index as IndexException; +use Utopia\Database\Exception\Limit as LimitException; +use Utopia\Database\Exception\Relationship as RelationshipException; +use Utopia\Database\Exception\Structure as StructureException; +use Utopia\Database\Exception\Truncate as TruncateException; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Structure; +use Utopia\Platform\Action as UtopiaAction; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Range; + +abstract class Action extends UtopiaAction +{ + /** + * @var string|null The current context (either 'column' or 'attribute') + */ + private ?string $context = ATTRIBUTES; + + /** + * Get the correct response model. + */ + abstract protected function getResponseModel(): string|array; + + public function setHttpPath(string $path): UtopiaAction + { + if (\str_contains($path, '/tablesdb')) { + $this->context = COLUMNS; + } + return parent::setHttpPath($path); + } + + /** + * Get the current context. + */ + protected function getContext(): string + { + return $this->context; + } + + /** + * Returns true if current context is Collections API. + */ + protected function isCollectionsAPI(): bool + { + // columns in tables context + // attributes in collections context + return $this->getContext() === ATTRIBUTES; + } + + /** + * Get the SDK group name for the current action. + * + * Can be used for XList operations as well! + */ + protected function getSdkGroup(): string + { + return $this->isCollectionsAPI() ? 'attributes' : 'columns'; + } + + /** + * Get the SDK namespace for the current action. + */ + protected function getSdkNamespace(): string + { + return $this->isCollectionsAPI() ? 'databases' : 'tablesDB'; + } + + /** + * Get the appropriate parent level not found exception. + */ + protected function getParentNotFoundException(): string + { + return $this->isCollectionsAPI() + ? Exception::COLLECTION_NOT_FOUND + : Exception::TABLE_NOT_FOUND; + } + + /** + * Get the appropriate not found exception. + */ + protected function getNotFoundException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_NOT_FOUND + : Exception::COLUMN_NOT_FOUND; + } + + /** + * Get the appropriate not found exception. + */ + protected function getIndexDependencyException(): string + { + return $this->isCollectionsAPI() + ? Exception::INDEX_DEPENDENCY + : Exception::COLUMN_INDEX_DEPENDENCY; + } + + /** + * Get the appropriate already exists exception. + */ + protected function getDuplicateException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_ALREADY_EXISTS + : Exception::COLUMN_ALREADY_EXISTS; + } + + /** + * Get the correct invalid structure message. + */ + protected function getStructureException(): string + { + return $this->isCollectionsAPI() + ? Exception::DOCUMENT_INVALID_STRUCTURE + : Exception::ROW_INVALID_STRUCTURE; + } + + /** + * Get the appropriate limit exceeded exception. + */ + protected function getLimitException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_LIMIT_EXCEEDED + : Exception::COLUMN_LIMIT_EXCEEDED; + } + + /** + * Get the appropriate index invalid exception. + */ + protected function getInvalidIndexException(): string + { + return $this->isCollectionsAPI() + ? Exception::INDEX_INVALID + : Exception::COLUMN_INDEX_INVALID; + } + + /** + * Get the correct default unsupported message. + */ + protected function getDefaultUnsupportedException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED + : Exception::COLUMN_DEFAULT_UNSUPPORTED; + } + + /** + * Get the correct format unsupported message. + */ + protected function getFormatUnsupportedException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_FORMAT_UNSUPPORTED + : Exception::COLUMN_FORMAT_UNSUPPORTED; + } + + /** + * Get the exception for invalid type or format mismatch. + */ + protected function getTypeInvalidException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_TYPE_INVALID + : Exception::COLUMN_TYPE_INVALID; + } + + /** + * Get the exception for resizing invalid attributes/columns. + */ + protected function getInvalidResizeException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_INVALID_RESIZE + : Exception::COLUMN_INVALID_RESIZE; + } + + /** + * Get the exception for invalid attributes/columns value. + */ + protected function getInvalidValueException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_VALUE_INVALID + : Exception::COLUMN_VALUE_INVALID; + } + + /** + * Get the exception for non-available column/attribute. + */ + protected function getNotAvailableException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_NOT_AVAILABLE + : Exception::COLUMN_NOT_AVAILABLE; + } + + /** + * Get the exception for spatial type attribute not supported by the database adapter + */ + protected function getSpatialTypeNotSupportedException(): string + { + return $this->isCollectionsAPI() ? Exception::ATTRIBUTE_TYPE_NOT_SUPPORTED : Exception::COLUMN_TYPE_NOT_SUPPORTED; + } + + /** + * Get the correct collections context for Events queue. + */ + protected function getCollectionsEventsContext(): string + { + return $this->isCollectionsAPI() ? 'collection' : 'table'; + } + + /** + * Get the proper column/attribute type based on set context. + */ + protected function getModel(string $type, string $format): string + { + $isCollections = $this->isCollectionsAPI(); + + return match ($type) { + Database::VAR_BOOLEAN => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_BOOLEAN + : UtopiaResponse::MODEL_COLUMN_BOOLEAN, + + Database::VAR_INTEGER => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_INTEGER + : UtopiaResponse::MODEL_COLUMN_INTEGER, + + Database::VAR_FLOAT => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_FLOAT + : UtopiaResponse::MODEL_COLUMN_FLOAT, + + Database::VAR_DATETIME => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_DATETIME + : UtopiaResponse::MODEL_COLUMN_DATETIME, + + Database::VAR_RELATIONSHIP => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_RELATIONSHIP + : UtopiaResponse::MODEL_COLUMN_RELATIONSHIP, + + Database::VAR_POINT => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_POINT + : UtopiaResponse::MODEL_COLUMN_POINT, + + Database::VAR_LINESTRING => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_LINE + : UtopiaResponse::MODEL_COLUMN_LINE, + + Database::VAR_POLYGON => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_POLYGON + : UtopiaResponse::MODEL_COLUMN_POLYGON, + + Database::VAR_STRING => match ($format) { + APP_DATABASE_ATTRIBUTE_EMAIL => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_EMAIL + : UtopiaResponse::MODEL_COLUMN_EMAIL, + + APP_DATABASE_ATTRIBUTE_ENUM => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_ENUM + : UtopiaResponse::MODEL_COLUMN_ENUM, + + APP_DATABASE_ATTRIBUTE_IP => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_IP + : UtopiaResponse::MODEL_COLUMN_IP, + + APP_DATABASE_ATTRIBUTE_URL => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_URL + : UtopiaResponse::MODEL_COLUMN_URL, + + default => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_STRING + : UtopiaResponse::MODEL_COLUMN_STRING, + }, + default => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE + : UtopiaResponse::MODEL_COLUMN, + }; + } + + protected function createAttribute(string $databaseId, string $collectionId, Document $attribute, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): Document + { + $key = $attribute->getAttribute('key'); + $type = $attribute->getAttribute('type', ''); + $size = $attribute->getAttribute('size', 0); + $required = $attribute->getAttribute('required', true); + $signed = $attribute->getAttribute('signed', true); // integers are signed by default + $array = $attribute->getAttribute('array', false); + $format = $attribute->getAttribute('format', ''); + $formatOptions = $attribute->getAttribute('formatOptions', []); + $filters = $attribute->getAttribute('filters', []); // filters are hidden from the endpoint + $default = $attribute->getAttribute('default'); + $options = $attribute->getAttribute('options', []); + + if (in_array($type, Database::SPATIAL_TYPES) && !$dbForProject->getAdapter()->getSupportForSpatialAttributes()) { + throw new Exception($this->getSpatialTypeNotSupportedException()); + } + + $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + if ($db->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $db->getSequence(), $collectionId); + + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + if (!empty($format)) { + if (!Structure::hasFormat($format, $type)) { + throw new Exception($this->getFormatUnsupportedException(), "Format $format not available for $type columns."); + } + } + + // Must throw here since dbForProject->createAttribute is performed by db worker + if ($required && isset($default)) { + throw new Exception($this->getDefaultUnsupportedException(), 'Cannot set default value for required ' . $this->getContext()); + } + + if ($array && isset($default)) { + throw new Exception($this->getDefaultUnsupportedException(), 'Cannot set default value for array ' . $this->getContext() . 's'); + } + + if ($type === Database::VAR_RELATIONSHIP) { + $options['side'] = Database::RELATION_SIDE_PARENT; + $relatedCollection = $dbForProject->getDocument('database_' . $db->getSequence(), $options['relatedCollection'] ?? ''); + if ($relatedCollection->isEmpty()) { + $parent = $this->isCollectionsAPI() ? 'collection' : 'table'; + throw new Exception($this->getParentNotFoundException(), "The related $parent was not found."); + } + } + + try { + $attribute = new Document([ + '$id' => ID::custom($db->getSequence() . '_' . $collection->getSequence() . '_' . $key), + 'key' => $key, + 'databaseInternalId' => $db->getSequence(), + 'databaseId' => $db->getId(), + 'collectionInternalId' => $collection->getSequence(), + 'collectionId' => $collectionId, + 'type' => $type, + 'status' => 'processing', // processing, available, failed, deleting, stuck + 'size' => $size, + 'required' => $required, + 'signed' => $signed, + 'default' => $default, + 'array' => $array, + 'format' => $format, + 'formatOptions' => $formatOptions, + 'filters' => $filters, + 'options' => $options, + ]); + if ( + !$dbForProject->getAdapter()->getSupportForSpatialIndexNull() && + \in_array($attribute->getAttribute('type'), Database::SPATIAL_TYPES) && + $attribute->getAttribute('required') + ) { + $hasData = !Authorization::skip(fn () => $dbForProject + ->findOne('database_' . $db->getSequence() . '_collection_' . $collection->getSequence())) + ->isEmpty(); + + if ($hasData) { + throw new StructureException('Failed to add required spatial column: existing rows present. Make the column optional.'); + } + } + $dbForProject->checkAttribute($collection, $attribute); + $attribute = $dbForProject->createDocument('attributes', $attribute); + } catch (DuplicateException) { + throw new Exception($this->getDuplicateException()); + } catch (LimitException) { + throw new Exception($this->getLimitException()); + } catch (StructureException $e) { + throw new Exception($this->getStructureException(), $e->getMessage()); + } catch (Throwable $e) { + $dbForProject->purgeCachedDocument('database_' . $db->getSequence(), $collectionId); + $dbForProject->purgeCachedCollection('database_' . $db->getSequence() . '_collection_' . $collection->getSequence()); + throw $e; + } + + $dbForProject->purgeCachedDocument('database_' . $db->getSequence(), $collectionId); + $dbForProject->purgeCachedCollection('database_' . $db->getSequence() . '_collection_' . $collection->getSequence()); + + if ($type === Database::VAR_RELATIONSHIP && $options['twoWay']) { + $twoWayKey = $options['twoWayKey']; + $options['relatedCollection'] = $collection->getId(); + $options['twoWayKey'] = $key; + $options['side'] = Database::RELATION_SIDE_CHILD; + + try { + $twoWayAttribute = new Document([ + '$id' => ID::custom($db->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $twoWayKey), + 'key' => $twoWayKey, + 'databaseInternalId' => $db->getSequence(), + 'databaseId' => $db->getId(), + 'collectionInternalId' => $relatedCollection->getSequence(), + 'collectionId' => $relatedCollection->getId(), + 'type' => $type, + 'status' => 'processing', // processing, available, failed, deleting, stuck + 'size' => $size, + 'required' => $required, + 'signed' => $signed, + 'default' => $default, + 'array' => $array, + 'format' => $format, + 'formatOptions' => $formatOptions, + 'filters' => $filters, + 'options' => $options, + ]); + + $dbForProject->checkAttribute($relatedCollection, $twoWayAttribute); + $dbForProject->createDocument('attributes', $twoWayAttribute); + } catch (DuplicateException) { + throw new Exception($this->getDuplicateException()); + } catch (LimitException) { + throw new Exception($this->getLimitException()); + } catch (StructureException) { + throw new Exception($this->getStructureException()); + } catch (Throwable $e) { + $dbForProject->deleteDocument('attributes', $attribute->getId()); + throw $e; + } finally { + $dbForProject->purgeCachedDocument('database_' . $db->getSequence(), $collectionId); + $dbForProject->purgeCachedCollection('database_' . $db->getSequence() . '_collection_' . $collection->getSequence()); + } + + // If operation succeeded, purge the cache for the related collection too + $dbForProject->purgeCachedDocument('database_' . $db->getSequence(), $relatedCollection->getId()); + $dbForProject->purgeCachedCollection('database_' . $db->getSequence() . '_collection_' . $relatedCollection->getSequence()); + } + + $queueForDatabase + ->setType(DATABASE_TYPE_CREATE_ATTRIBUTE) + ->setDatabase($db); + + if ($this->isCollectionsAPI()) { + $queueForDatabase + ->setDocument($attribute) + ->setCollection($collection); + } else { + $queueForDatabase + ->setRow($attribute) + ->setTable($collection); + } + + $queueForEvents + ->setContext('database', $db) + ->setParam('databaseId', $databaseId) + ->setParam('collectionId', $collection->getId()) + ->setParam('tableId', $collection->getId()) + ->setParam('attributeId', $attribute->getId()) + ->setParam('columnId', $attribute->getId()) + ->setContext($this->getCollectionsEventsContext(), $collection); + + $response->setStatusCode(SwooleResponse::STATUS_CODE_CREATED); + + return $attribute; + } + + protected function updateAttribute(string $databaseId, string $collectionId, string $key, Database $dbForProject, Event $queueForEvents, string $type, int $size = null, string $filter = null, string|bool|int|float|array $default = null, bool $required = null, int|float|null $min = null, int|float|null $max = null, array $elements = null, array $options = [], string $newKey = null): Document + { + $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + if ($db->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $db->getSequence(), $collectionId); + + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + $attribute = $dbForProject->getDocument('attributes', $db->getSequence() . '_' . $collection->getSequence() . '_' . $key); + + if ($attribute->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + if ($attribute->getAttribute('status') !== 'available') { + throw new Exception($this->getNotAvailableException()); + } + + if ($attribute->getAttribute(('type') !== $type)) { + throw new Exception($this->getTypeInvalidException()); + } + + if ($attribute->getAttribute('type') === Database::VAR_STRING && $attribute->getAttribute(('filter') !== $filter)) { + throw new Exception($this->getTypeInvalidException()); + } + + if ($required && isset($default)) { + throw new Exception($this->getDefaultUnsupportedException(), 'Cannot set default value for required ' . $this->getContext()); + } + + if ($attribute->getAttribute('array', false) && isset($default)) { + throw new Exception($this->getDefaultUnsupportedException(), 'Cannot set default value for array ' . $this->getContext() . 's'); + } + + $collectionId = 'database_' . $db->getSequence() . '_collection_' . $collection->getSequence(); + + $attribute + ->setAttribute('default', $default) + ->setAttribute('required', $required); + + if (!empty($size)) { + $attribute->setAttribute('size', $size); + } + + switch ($attribute->getAttribute('format')) { + case APP_DATABASE_ATTRIBUTE_INT_RANGE: + case APP_DATABASE_ATTRIBUTE_FLOAT_RANGE: + $min ??= $attribute->getAttribute('formatOptions')['min']; + $max ??= $attribute->getAttribute('formatOptions')['max']; + + if ($min > $max) { + throw new Exception($this->getInvalidValueException(), 'Minimum value must be lesser than maximum value'); + } + + if ($attribute->getAttribute('format') === APP_DATABASE_ATTRIBUTE_INT_RANGE) { + $validator = new Range($min, $max, Database::VAR_INTEGER); + } else { + $validator = new Range($min, $max, Database::VAR_FLOAT); + + if (!is_null($default)) { + $default = \floatval($default); + } + } + + if (!is_null($default) && !$validator->isValid($default)) { + throw new Exception($this->getInvalidValueException(), $validator->getDescription()); + } + + $options = [ + 'min' => $min, + 'max' => $max + ]; + $attribute->setAttribute('formatOptions', $options); + + break; + case APP_DATABASE_ATTRIBUTE_ENUM: + if (empty($elements)) { + throw new Exception($this->getInvalidValueException(), 'Enum elements must not be empty'); + } + + foreach ($elements as $element) { + if (\strlen($element) === 0) { + throw new Exception($this->getInvalidValueException(), 'Each enum element must not be empty'); + } + } + + if (!is_null($default) && !in_array($default, $elements)) { + throw new Exception($this->getInvalidValueException(), 'Default value not found in elements'); + } + + $options = [ + 'elements' => $elements + ]; + + $attribute->setAttribute('formatOptions', $options); + + break; + } + + if ($type === Database::VAR_RELATIONSHIP) { + $primaryDocumentOptions = \array_merge($attribute->getAttribute('options', []), $options); + $attribute->setAttribute('options', $primaryDocumentOptions); + try { + $dbForProject->updateRelationship( + collection: $collectionId, + id: $key, + newKey: $newKey, + onDelete: $primaryDocumentOptions['onDelete'], + ); + } catch (IndexException) { + throw new Exception(Exception::INDEX_INVALID); + } catch (LimitException) { + throw new Exception($this->getLimitException()); + } catch (RelationshipException $e) { + throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); + } catch (StructureException $e) { + throw new Exception($this->getStructureException(), $e->getMessage()); + } + + if ($primaryDocumentOptions['twoWay']) { + $relatedCollection = $dbForProject->getDocument('database_' . $db->getSequence(), $primaryDocumentOptions['relatedCollection']); + + $relatedAttribute = $dbForProject->getDocument('attributes', $db->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $primaryDocumentOptions['twoWayKey']); + + if (!empty($newKey) && $newKey !== $key) { + $options['twoWayKey'] = $newKey; + } + + $relatedOptions = \array_merge($relatedAttribute->getAttribute('options'), $options); + $relatedAttribute->setAttribute('options', $relatedOptions); + $dbForProject->updateDocument('attributes', $db->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $primaryDocumentOptions['twoWayKey'], $relatedAttribute); + + $dbForProject->purgeCachedDocument('database_' . $db->getSequence(), $relatedCollection->getId()); + } + } else { + try { + $dbForProject->updateAttribute( + collection: $collectionId, + id: $key, + size: $size, + required: $required, + default: $default, + formatOptions: $options, + newKey: $newKey ?? null + ); + } catch (DuplicateException) { + throw new Exception($this->getDuplicateException()); + } catch (IndexException $e) { + throw new Exception($this->getInvalidIndexException(), $e->getMessage()); + } catch (LimitException) { + throw new Exception($this->getLimitException()); + } catch (TruncateException) { + throw new Exception($this->getInvalidResizeException()); + } + } + + if (!empty($newKey) && $key !== $newKey) { + $originalUid = $attribute->getId(); + + $attribute + ->setAttribute('$id', ID::custom($db->getSequence() . '_' . $collection->getSequence() . '_' . $newKey)) + ->setAttribute('key', $newKey); + + try { + $dbForProject->updateDocument('attributes', $originalUid, $attribute); + } catch (DuplicateException) { + throw new Exception($this->getDuplicateException()); + } + + /** + * @var Document $index + */ + foreach ($collection->getAttribute('indexes') as $index) { + /** + * @var array<string> $attributes + */ + $attributes = $index->getAttribute('attributes', []); + $found = \array_search($key, $attributes); + + if ($found !== false) { + $attributes[$found] = $newKey; + $index->setAttribute('attributes', $attributes); + $dbForProject->updateDocument('indexes', $index->getId(), $index); + } + } + } else { + $attribute = $dbForProject->updateDocument('attributes', $db->getSequence() . '_' . $collection->getSequence() . '_' . $key, $attribute); + } + + $dbForProject->purgeCachedDocument('database_' . $db->getSequence(), $collection->getId()); + + $queueForEvents + ->setContext('database', $db) + ->setParam('databaseId', $databaseId) + ->setParam('collectionId', $collection->getId()) + ->setParam('tableId', $collection->getId()) + ->setParam('attributeId', $attribute->getId()) + ->setParam('columnId', $attribute->getId()) + ->setContext($this->getCollectionsEventsContext(), $collection); + + return $attribute; + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Create.php new file mode 100644 index 0000000000..6c4be252a0 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Create.php @@ -0,0 +1,89 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Boolean; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; + +class Create extends Action +{ + public static function getName(): string + { + return 'createBooleanAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_BOOLEAN; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/boolean') + ->desc('Create boolean attribute') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-boolean-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createBooleanColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Boolean(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?bool $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ + 'key' => $key, + 'type' => Database::VAR_BOOLEAN, + 'size' => 0, + 'required' => $required, + 'default' => $default, + 'array' => $array, + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php new file mode 100644 index 0000000000..752e8c6c59 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php @@ -0,0 +1,92 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Boolean; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateBooleanAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_BOOLEAN; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/boolean/:key') + ->desc('Update boolean attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-boolean-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateBooleanColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Boolean()), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('newKey', null, new Key(), 'New attribute key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?bool $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_BOOLEAN, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Create.php new file mode 100644 index 0000000000..5d5b8fe4bf --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Create.php @@ -0,0 +1,99 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Datetime; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Datetime as DatetimeValidator; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; + +class Create extends Action +{ + public static function getName(): string + { + return 'createDatetimeAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_DATETIME; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/datetime') + ->desc('Create datetime attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-datetime-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel() + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createDatetimeColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, fn (Database $dbForProject) => new DatetimeValidator($dbForProject->getAdapter()->getMinDateTime(), $dbForProject->getAdapter()->getMaxDateTime()), 'Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.', true, ['dbForProject']) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $attribute = $this->createAttribute( + $databaseId, + $collectionId, + new Document([ + 'key' => $key, + 'type' => Database::VAR_DATETIME, + 'size' => 0, + 'required' => $required, + 'default' => $default, + 'array' => $array, + 'filters' => ['datetime'], + ]), + $response, + $dbForProject, + $queueForDatabase, + $queueForEvents + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php new file mode 100644 index 0000000000..e1d1d40f75 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php @@ -0,0 +1,93 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Datetime; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Datetime as DatetimeValidator; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateDatetimeAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_DATETIME; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/datetime/:key') + ->desc('Update datetime attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-datetime-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel() + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateDatetimeColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, fn (Database $dbForProject) => new Nullable(new DatetimeValidator($dbForProject->getAdapter()->getMinDateTime(), $dbForProject->getAdapter()->getMaxDateTime())), 'Default value for attribute when not provided. Cannot be set when attribute is required.', injections: ['dbForProject']) + ->param('newKey', null, new Key(), 'New attribute key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_DATETIME, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php new file mode 100644 index 0000000000..8dec7530bf --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php @@ -0,0 +1,159 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\IndexDependency as IndexDependencyValidator; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Delete extends Action +{ + public static function getName(): string + { + return 'deleteAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_NONE; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') + ->desc('Delete attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.delete') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/delete-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_NOCONTENT, + model: UtopiaResponse::MODEL_NONE, + ) + ], + contentType: ContentType::NONE, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.deleteColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($db->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $db->getSequence(), $collectionId); + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + $attribute = $dbForProject->getDocument('attributes', $db->getSequence() . '_' . $collection->getSequence() . '_' . $key); + if ($attribute->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + $validator = new IndexDependencyValidator( + $collection->getAttribute('indexes'), + $dbForProject->getAdapter()->getSupportForCastIndexArray(), + ); + + if (!$validator->isValid($attribute)) { + throw new Exception($this->getIndexDependencyException()); + } + + if ($attribute->getAttribute('status') === 'available') { + $attribute = $dbForProject->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'deleting')); + } + + $dbForProject->purgeCachedDocument('database_' . $db->getSequence(), $collectionId); + $dbForProject->purgeCachedCollection('database_' . $db->getSequence() . '_collection_' . $collection->getSequence()); + + if ($attribute->getAttribute('type') === Database::VAR_RELATIONSHIP) { + $options = $attribute->getAttribute('options'); + if ($options['twoWay']) { + $relatedCollection = $dbForProject->getDocument('database_' . $db->getSequence(), $options['relatedCollection']); + if ($relatedCollection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + $relatedAttribute = $dbForProject->getDocument('attributes', $db->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $options['twoWayKey']); + if ($relatedAttribute->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + if ($relatedAttribute->getAttribute('status') === 'available') { + $dbForProject->updateDocument('attributes', $relatedAttribute->getId(), $relatedAttribute->setAttribute('status', 'deleting')); + } + + $dbForProject->purgeCachedDocument('database_' . $db->getSequence(), $options['relatedCollection']); + $dbForProject->purgeCachedCollection('database_' . $db->getSequence() . '_collection_' . $relatedCollection->getSequence()); + } + } + + $queueForDatabase + ->setDatabase($db) + ->setType(DATABASE_TYPE_DELETE_ATTRIBUTE); + + if ($this->isCollectionsAPI()) { + $queueForDatabase + ->setRow($attribute) + ->setTable($collection); + } else { + $queueForDatabase + ->setDocument($attribute) + ->setCollection($collection); + } + + $type = $attribute->getAttribute('type'); + $format = $attribute->getAttribute('format'); + + $model = $this->getModel($type, $format); + + $queueForEvents + ->setContext('database', $db) + ->setParam('databaseId', $databaseId) + ->setParam('collectionId', $collection->getId()) + ->setParam('tableId', $collection->getId()) + ->setParam('attributeId', $attribute->getId()) + ->setParam('columnId', $attribute->getId()) + ->setPayload($response->output($attribute, $model)) + ->setContext($this->getCollectionsEventsContext(), $collection); + + $response->noContent(); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Create.php new file mode 100644 index 0000000000..bc58ca10af --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Create.php @@ -0,0 +1,99 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Email; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Network\Validator\Email; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; + +class Create extends Action +{ + public static function getName(): string + { + return 'createEmailAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_EMAIL; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/email') + ->desc('Create email attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-email-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createEmailColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Email(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $attribute = $this->createAttribute( + $databaseId, + $collectionId, + new Document([ + 'key' => $key, + 'type' => Database::VAR_STRING, + 'size' => 254, + 'required' => $required, + 'default' => $default, + 'array' => $array, + 'format' => APP_DATABASE_ATTRIBUTE_EMAIL, + ]), + $response, + $dbForProject, + $queueForDatabase, + $queueForEvents + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php new file mode 100644 index 0000000000..53300725d7 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php @@ -0,0 +1,94 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Email; + +use Appwrite\Event\Event; +use Appwrite\Network\Validator\Email; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateEmailAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_EMAIL; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/email/:key') + ->desc('Update email attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-email-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateEmailColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Email()), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('newKey', null, new Key(), 'New Attribute Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_STRING, + filter: APP_DATABASE_ATTRIBUTE_EMAIL, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Create.php new file mode 100644 index 0000000000..cd22e87d1c --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Create.php @@ -0,0 +1,107 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Enum; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Boolean; +use Utopia\Validator\Text; + +class Create extends Action +{ + public static function getName(): string + { + return 'createEnumAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_ENUM; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/enum') + ->desc('Create enum attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-enum-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createEnumColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('elements', [], new ArrayList(new Text(Database::LENGTH_KEY), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of enum values.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Text(0), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, array $elements, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + if (!is_null($default) && !\in_array($default, $elements, true)) { + throw new Exception($this->getInvalidValueException(), 'Default value not found in elements'); + } + + $attribute = $this->createAttribute( + $databaseId, + $collectionId, + new Document([ + 'key' => $key, + 'type' => Database::VAR_STRING, + 'size' => Database::LENGTH_KEY, + 'required' => $required, + 'default' => $default, + 'array' => $array, + 'format' => APP_DATABASE_ATTRIBUTE_ENUM, + 'formatOptions' => ['elements' => $elements], + ]), + $response, + $dbForProject, + $queueForDatabase, + $queueForEvents + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php new file mode 100644 index 0000000000..951e43effe --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php @@ -0,0 +1,97 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Enum; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; +use Utopia\Validator\Text; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateEnumAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_ENUM; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/:key') + ->desc('Update enum attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-enum-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateEnumColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('elements', null, new ArrayList(new Text(Database::LENGTH_KEY), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Updated list of enum values.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Text(0)), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('newKey', null, new Key(), 'New Attribute Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?array $elements, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_STRING, + filter: APP_DATABASE_ATTRIBUTE_ENUM, + default: $default, + required: $required, + elements: $elements, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php new file mode 100644 index 0000000000..2a8253c22c --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php @@ -0,0 +1,114 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Float; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\FloatValidator; +use Utopia\Validator\Range; + +class Create extends Action +{ + public static function getName(): string + { + return 'createFloatAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_FLOAT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/float') + ->desc('Create float attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-float-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createFloatColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('min', null, new FloatValidator(), 'Minimum value.', true) + ->param('max', null, new FloatValidator(), 'Maximum value.', true) + ->param('default', null, new FloatValidator(), 'Default value. Cannot be set when required.', true) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?float $min, ?float $max, ?float $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $min ??= -PHP_FLOAT_MAX; + $max ??= PHP_FLOAT_MAX; + + if ($min > $max) { + throw new Exception($this->getInvalidValueException(), 'Minimum value must be lesser than maximum value'); + } + + $validator = new Range($min, $max, Database::VAR_FLOAT); + if (!\is_null($default) && !$validator->isValid($default)) { + throw new Exception($this->getInvalidValueException(), $validator->getDescription()); + } + + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ + 'key' => $key, + 'type' => Database::VAR_FLOAT, + 'size' => 0, + 'required' => $required, + 'default' => $default, + 'array' => $array, + 'format' => APP_DATABASE_ATTRIBUTE_FLOAT_RANGE, + 'formatOptions' => ['min' => $min, 'max' => $max], + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + + $formatOptions = $attribute->getAttribute('formatOptions', []); + if (!empty($formatOptions)) { + $attribute->setAttribute('min', \floatval($formatOptions['min'])); + $attribute->setAttribute('max', \floatval($formatOptions['max'])); + } + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php new file mode 100644 index 0000000000..327a766cee --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php @@ -0,0 +1,103 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Float; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\FloatValidator; +use Utopia\Validator\Nullable; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateFloatAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_FLOAT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/float/:key') + ->desc('Update float attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-float-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateFloatColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('min', null, new FloatValidator(), 'Minimum value.', true) + ->param('max', null, new FloatValidator(), 'Maximum value.', true) + ->param('default', null, new Nullable(new FloatValidator()), 'Default value. Cannot be set when required.') + ->param('newKey', null, new Key(), 'New Attribute Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?float $min, ?float $max, ?float $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_FLOAT, + default: $default, + required: $required, + min: $min, + max: $max, + newKey: $newKey + ); + + $formatOptions = $attribute->getAttribute('formatOptions', []); + if (!empty($formatOptions)) { + $attribute->setAttribute('min', \floatval($formatOptions['min'])); + $attribute->setAttribute('max', \floatval($formatOptions['max'])); + } + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Get.php new file mode 100644 index 0000000000..28ee584778 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Get.php @@ -0,0 +1,105 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Get extends Action +{ + public static function getName(): string + { + return 'getAttribute'; + } + + protected function getResponseModel(): string|array + { + return [ + UtopiaResponse::MODEL_ATTRIBUTE_BOOLEAN, + UtopiaResponse::MODEL_ATTRIBUTE_INTEGER, + UtopiaResponse::MODEL_ATTRIBUTE_FLOAT, + UtopiaResponse::MODEL_ATTRIBUTE_EMAIL, + UtopiaResponse::MODEL_ATTRIBUTE_ENUM, + UtopiaResponse::MODEL_ATTRIBUTE_URL, + UtopiaResponse::MODEL_ATTRIBUTE_IP, + UtopiaResponse::MODEL_ATTRIBUTE_DATETIME, + UtopiaResponse::MODEL_ATTRIBUTE_RELATIONSHIP, + UtopiaResponse::MODEL_ATTRIBUTE_STRING, + ]; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') + ->desc('Get attribute') + ->groups(['api', 'database']) + ->label('scope', 'collections.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/get-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel() + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.getColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + $attribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $collection->getSequence() . '_' . $key); + if ($attribute->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + $type = $attribute->getAttribute('type'); + $format = $attribute->getAttribute('format'); + $options = $attribute->getAttribute('options', []); + $filters = $attribute->getAttribute('filters', []); + foreach ($options as $key => $option) { + $attribute->setAttribute($key, $option); + } + + $model = $this->getModel($type, $format); + + $attribute->setAttribute('encrypt', in_array('encrypt', $filters)); + + $response->dynamic($attribute, $model); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Create.php new file mode 100644 index 0000000000..aa699b4a49 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Create.php @@ -0,0 +1,99 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\IP; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\IP; + +class Create extends Action +{ + public static function getName(): string + { + return 'createIpAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_IP; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/ip') + ->desc('Create IP address attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-ip-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createIpColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new IP(), 'Default value. Cannot be set when attribute is required.', true) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $attribute = $this->createAttribute( + $databaseId, + $collectionId, + new Document([ + 'key' => $key, + 'type' => Database::VAR_STRING, + 'size' => 39, + 'required' => $required, + 'default' => $default, + 'array' => $array, + 'format' => APP_DATABASE_ATTRIBUTE_IP, + ]), + $response, + $dbForProject, + $queueForDatabase, + $queueForEvents + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php new file mode 100644 index 0000000000..f61cf21732 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php @@ -0,0 +1,94 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\IP; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\IP; +use Utopia\Validator\Nullable; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateIpAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_IP; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:key') + ->desc('Update IP address attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-ip-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateIpColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new IP()), 'Default value. Cannot be set when attribute is required.') + ->param('newKey', null, new Key(), 'New Attribute Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_STRING, + filter: APP_DATABASE_ATTRIBUTE_IP, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Create.php new file mode 100644 index 0000000000..81a11b0471 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Create.php @@ -0,0 +1,116 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Integer; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Integer; +use Utopia\Validator\Range; + +class Create extends Action +{ + public static function getName(): string + { + return 'createIntegerAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_INTEGER; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/integer') + ->desc('Create integer attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-integer-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createIntegerColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('min', null, new Integer(), 'Minimum value', true) + ->param('max', null, new Integer(), 'Maximum value', true) + ->param('default', null, new Integer(), 'Default value. Cannot be set when attribute is required.', true) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?int $min, ?int $max, ?int $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $min ??= \PHP_INT_MIN; + $max ??= \PHP_INT_MAX; + + if ($min > $max) { + throw new Exception($this->getInvalidValueException(), 'Minimum value must be lesser than maximum value'); + } + + $validator = new Range($min, $max, Database::VAR_INTEGER); + if (!\is_null($default) && !$validator->isValid($default)) { + throw new Exception($this->getInvalidValueException(), $validator->getDescription()); + } + + $size = $max > 2147483647 ? 8 : 4; + + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ + 'key' => $key, + 'type' => Database::VAR_INTEGER, + 'size' => $size, + 'required' => $required, + 'default' => $default, + 'array' => $array, + 'format' => APP_DATABASE_ATTRIBUTE_INT_RANGE, + 'formatOptions' => ['min' => $min, 'max' => $max], + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + + $formatOptions = $attribute->getAttribute('formatOptions', []); + if (!empty($formatOptions)) { + $attribute->setAttribute('min', \intval($formatOptions['min'])); + $attribute->setAttribute('max', \intval($formatOptions['max'])); + } + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php new file mode 100644 index 0000000000..11cfb24943 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php @@ -0,0 +1,103 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Integer; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Integer; +use Utopia\Validator\Nullable; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateIntegerAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_INTEGER; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/integer/:key') + ->desc('Update integer attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-integer-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateIntegerColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('min', null, new Integer(), 'Minimum value', true) + ->param('max', null, new Integer(), 'Maximum value', true) + ->param('default', null, new Nullable(new Integer()), 'Default value. Cannot be set when attribute is required.') + ->param('newKey', null, new Key(), 'New Attribute Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?int $min, ?int $max, ?int $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_INTEGER, + default: $default, + required: $required, + min: $min, + max: $max, + newKey: $newKey + ); + + $formatOptions = $attribute->getAttribute('formatOptions', []); + if (!empty($formatOptions)) { + $attribute->setAttribute('min', \intval($formatOptions['min'])); + $attribute->setAttribute('max', \intval($formatOptions['max'])); + } + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php new file mode 100644 index 0000000000..4eb3345823 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php @@ -0,0 +1,88 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Line; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Create extends Action +{ + public static function getName(): string + { + return 'createLineAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_LINE; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/line') + ->desc('Create line attribute') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-line-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createLineColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ + 'key' => $key, + 'type' => Database::VAR_LINESTRING, + 'required' => $required, + 'default' => $default + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php new file mode 100644 index 0000000000..8fcb867923 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php @@ -0,0 +1,93 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Line; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateLineAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_LINE; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/line/:key') + ->desc('Update line attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-line-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateLineColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.', true) + ->param('newKey', null, new Key(), 'New attribute key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_LINESTRING, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php new file mode 100644 index 0000000000..47c88497ba --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php @@ -0,0 +1,88 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Point; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Create extends Action +{ + public static function getName(): string + { + return 'createPointAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_POINT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/point') + ->desc('Create point attribute') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-point-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createPointColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ + 'key' => $key, + 'type' => Database::VAR_POINT, + 'required' => $required, + 'default' => $default, + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php new file mode 100644 index 0000000000..bffe802927 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php @@ -0,0 +1,93 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Point; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends Action +{ + public static function getName(): string + { + return 'updatePointAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_POINT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/point/:key') + ->desc('Update point attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-point-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updatePointColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.', true) + ->param('newKey', null, new Key(), 'New attribute key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_POINT, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php new file mode 100644 index 0000000000..6cc74254ae --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php @@ -0,0 +1,88 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Polygon; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Create extends Action +{ + public static function getName(): string + { + return 'createPolygonAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_POLYGON; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/polygon') + ->desc('Create polygon attribute') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-polygon-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createPolygonColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ + 'key' => $key, + 'type' => Database::VAR_POLYGON, + 'required' => $required, + 'default' => $default, + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php new file mode 100644 index 0000000000..d78bfa8ef0 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php @@ -0,0 +1,93 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Polygon; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends Action +{ + public static function getName(): string + { + return 'updatePolygonAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_POLYGON; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/polygon/:key') + ->desc('Update polygon attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-polygon-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updatePolygonColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.', true) + ->param('newKey', null, new Key(), 'New attribute key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_POLYGON, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php new file mode 100644 index 0000000000..a062816329 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php @@ -0,0 +1,162 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Relationship; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\WhiteList; + +class Create extends Action +{ + public static function getName(): string + { + return 'createRelationshipAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_RELATIONSHIP; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/relationship') + ->desc('Create relationship attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-relationship-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel() + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createRelationshipColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('relatedCollectionId', '', new UID(), 'Related Collection ID.') + ->param('type', '', new WhiteList([ + Database::RELATION_ONE_TO_ONE, + Database::RELATION_MANY_TO_ONE, + Database::RELATION_MANY_TO_MANY, + Database::RELATION_ONE_TO_MANY + ], true), 'Relation type') + ->param('twoWay', false, new Boolean(), 'Is Two Way?', true) + ->param('key', null, new Key(), 'Attribute Key.', true) + ->param('twoWayKey', null, new Key(), 'Two Way Attribute Key.', true) + ->param('onDelete', Database::RELATION_MUTATE_RESTRICT, new WhiteList([ + Database::RELATION_MUTATE_CASCADE, + Database::RELATION_MUTATE_RESTRICT, + Database::RELATION_MUTATE_SET_NULL + ], true), 'Constraints option', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $relatedCollectionId, string $type, bool $twoWay, ?string $key, ?string $twoWayKey, string $onDelete, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $key ??= $relatedCollectionId; + $twoWayKey ??= $collectionId; + + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + $collection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + $relatedCollectionDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId); + $relatedCollection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $relatedCollectionDocument->getSequence()); + if ($relatedCollection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + $attributes = $collection->getAttribute('attributes', []); + foreach ($attributes as $attribute) { + if ($attribute->getAttribute('type') !== Database::VAR_RELATIONSHIP) { + continue; + } + + if (\strtolower($attribute->getId()) === \strtolower($key)) { + throw new Exception($this->getDuplicateException()); + } + + if ( + \strtolower($attribute->getAttribute('options')['twoWayKey']) === \strtolower($twoWayKey) && + $attribute->getAttribute('options')['relatedCollection'] === $relatedCollection->getId() + ) { + throw new Exception($this->getDuplicateException(), 'Attribute with the requested key already exists. Attribute keys must be unique, try again with a different key.'); + } + + if ( + $type === Database::RELATION_MANY_TO_MANY && + $attribute->getAttribute('options')['relationType'] === Database::RELATION_MANY_TO_MANY && + $attribute->getAttribute('options')['relatedCollection'] === $relatedCollection->getId() + ) { + $parentType = $this->isCollectionsAPI() ? 'collection' : 'table'; + throw new Exception($this->getDuplicateException(), "Creating more than one \"manyToMany\" relationship on the same $parentType is currently not permitted."); + } + } + + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ + 'key' => $key, + 'type' => Database::VAR_RELATIONSHIP, + 'size' => 0, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + 'options' => [ + 'relatedCollection' => $relatedCollectionId, + 'relationType' => $type, + 'twoWay' => $twoWay, + 'twoWayKey' => $twoWayKey, + 'onDelete' => $onDelete, + ] + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + + foreach ($attribute->getAttribute('options', []) as $k => $option) { + $attribute->setAttribute($k, $option); + } + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php new file mode 100644 index 0000000000..c19c4ff046 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php @@ -0,0 +1,108 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Relationship; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\WhiteList; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateRelationshipAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_RELATIONSHIP; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/relationship') + ->desc('Update relationship attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-relationship-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel() + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateRelationshipColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('onDelete', null, new WhiteList([ + Database::RELATION_MUTATE_CASCADE, + Database::RELATION_MUTATE_RESTRICT, + Database::RELATION_MUTATE_SET_NULL + ], true), 'Constraints option', true) + ->param('newKey', null, new Key(), 'New Attribute Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action( + string $databaseId, + string $collectionId, + string $key, + ?string $onDelete, + ?string $newKey, + UtopiaResponse $response, + Database $dbForProject, + Event $queueForEvents + ): void { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_RELATIONSHIP, + required: false, + options: [ + 'onDelete' => $onDelete + ], + newKey: $newKey + ); + + foreach ($attribute->getAttribute('options', []) as $k => $option) { + $attribute->setAttribute($k, $option); + } + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Create.php new file mode 100644 index 0000000000..592aa8ee93 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Create.php @@ -0,0 +1,143 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\String; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\App; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator; +use Utopia\Validator\Boolean; +use Utopia\Validator\Range; +use Utopia\Validator\Text; + +class Create extends Action +{ + public static function getName(): string + { + return 'createStringAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_STRING; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/string') + ->desc('Create string attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-string-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel() + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createStringColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('size', null, new Range(1, APP_DATABASE_ATTRIBUTE_STRING_MAX_LENGTH, Validator::TYPE_INTEGER), 'Attribute size for text attributes, in number of characters.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Text(0, 0), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->param('encrypt', false, new Boolean(), 'Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->inject('plan') + ->callback($this->action(...)); + } + + public function action( + string $databaseId, + string $collectionId, + string $key, + ?int $size, + ?bool $required, + ?string $default, + bool $array, + bool $encrypt, + UtopiaResponse $response, + Database $dbForProject, + EventDatabase $queueForDatabase, + Event $queueForEvents, + array $plan + ): void { + if (!App::isDevelopment() && $encrypt && !empty($plan) && !($plan['databasesAllowEncrypt'] ?? false)) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Encrypted string ' . $this->getSdkGroup() . ' are not available on your plan. Please upgrade to create encrypted string ' . $this->getSdkGroup() . '.'); + } + + if ($encrypt && $size < APP_DATABASE_ENCRYPT_SIZE_MIN) { + throw new Exception( + Exception::GENERAL_BAD_REQUEST, + "Size too small. Encrypted strings require a minimum size of " . APP_DATABASE_ENCRYPT_SIZE_MIN . " characters." + ); + } + + // Ensure default fits in the given size + $validator = new Text($size, 0); + if (!is_null($default) && !$validator->isValid($default)) { + throw new Exception($this->getInvalidValueException(), $validator->getDescription()); + } + + $filters = []; + if ($encrypt) { + $filters[] = 'encrypt'; + } + + $attribute = $this->createAttribute( + $databaseId, + $collectionId, + new Document([ + 'key' => $key, + 'type' => Database::VAR_STRING, + 'size' => $size, + 'required' => $required, + 'default' => $default, + 'array' => $array, + 'filters' => $filters, + ]), + $response, + $dbForProject, + $queueForDatabase, + $queueForEvents + ); + + $attribute->setAttribute('encrypt', $encrypt); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php new file mode 100644 index 0000000000..03efac1430 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php @@ -0,0 +1,107 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\String; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; +use Utopia\Validator\Range; +use Utopia\Validator\Text; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateStringAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_STRING; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/string/:key') + ->desc('Update string attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-string-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateStringColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Text(0, 0)), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('size', null, new Range(1, APP_DATABASE_ATTRIBUTE_STRING_MAX_LENGTH, Validator::TYPE_INTEGER), 'Maximum size of the string attribute.', true) + ->param('newKey', null, new Key(), 'New Attribute Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action( + string $databaseId, + string $collectionId, + string $key, + ?bool $required, + ?string $default, + ?int $size, + ?string $newKey, + UtopiaResponse $response, + Database $dbForProject, + Event $queueForEvents + ): void { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_STRING, + size: $size, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Create.php new file mode 100644 index 0000000000..39153b3cb8 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Create.php @@ -0,0 +1,101 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\URL; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\URL; + +class Create extends Action +{ + public static function getName(): string + { + return 'createUrlAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_URL; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/url') + ->desc('Create URL attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-url-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createUrlColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new URL(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action( + string $databaseId, + string $collectionId, + string $key, + ?bool $required, + ?string $default, + bool $array, + UtopiaResponse $response, + Database $dbForProject, + EventDatabase $queueForDatabase, + Event $queueForEvents + ): void { + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ + 'key' => $key, + 'type' => Database::VAR_STRING, + 'size' => 2000, + 'required' => $required, + 'default' => $default, + 'array' => $array, + 'format' => APP_DATABASE_ATTRIBUTE_URL, + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php new file mode 100644 index 0000000000..7ace4d0683 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php @@ -0,0 +1,103 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\URL; + +use Appwrite\Event\Event; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; +use Utopia\Validator\URL; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateUrlAttribute'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_URL; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/url/:key') + ->desc('Update URL attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-url-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateUrlColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new URL()), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('newKey', null, new Key(), 'New Attribute Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action( + string $databaseId, + string $collectionId, + string $key, + ?bool $required, + ?string $default, + ?string $newKey, + UtopiaResponse $response, + Database $dbForProject, + Event $queueForEvents + ): void { + $attribute = $this->updateAttribute( + $databaseId, + $collectionId, + $key, + $dbForProject, + $queueForEvents, + type: Database::VAR_STRING, + filter: APP_DATABASE_ATTRIBUTE_URL, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/XList.php new file mode 100644 index 0000000000..1852290f76 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/XList.php @@ -0,0 +1,147 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Queries\Attributes; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Order as OrderException; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Query\Cursor; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class XList extends Action +{ + public static function getName(): string + { + return 'listAttributes'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_ATTRIBUTE_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes') + ->desc('List attributes') + ->groups(['api', 'database']) + ->label('scope', 'collections.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/list-attributes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel() + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.listColumns', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('queries', [], new Attributes(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Attributes::ALLOWED_ATTRIBUTES), true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, array $queries, UtopiaResponse $response, Database $dbForProject): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + \array_push( + $queries, + Query::equal('databaseInternalId', [$database->getSequence()]), + Query::equal('collectionInternalId', [$collection->getSequence()]) + ); + + $cursor = \array_filter( + $queries, + fn ($query) => \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]) + ); + $cursor = \reset($cursor); + + if ($cursor) { + $validator = new Cursor(); + if (!$validator->isValid($cursor)) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); + } + + $attributeId = $cursor->getValue(); + try { + $cursorDocument = $dbForProject->findOne('attributes', [ + Query::equal('databaseInternalId', [$database->getSequence()]), + Query::equal('collectionInternalId', [$collection->getSequence()]), + Query::equal('key', [$attributeId]), + ]); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + if ($cursorDocument->isEmpty()) { + $type = ucfirst($this->getContext()); + throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "$type '$attributeId' for the 'cursor' value not found."); + } + + $cursor->setValue($cursorDocument); + } + + try { + $attributes = $dbForProject->find('attributes', $queries); + $total = $dbForProject->count('attributes', $queries, APP_LIMIT_COUNT); + } catch (OrderException $e) { + $documents = $this->isCollectionsAPI() ? 'documents' : 'rows'; + $attribute = $this->isCollectionsAPI() ? 'attribute' : 'column'; + $message = "The order $attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all $documents order $attribute values are non-null."; + throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, $message); + } catch (QueryException) { + throw new Exception(Exception::GENERAL_QUERY_INVALID); + } + + foreach ($attributes as $attribute) { + if ($attribute->getAttribute('type') === Database::VAR_STRING) { + $filters = $attribute->getAttribute('filters', []); + $attribute->setAttribute('encrypt', in_array('encrypt', $filters)); + } + } + + $response->dynamic(new Document([ + 'total' => $total, + $this->getSdkGroup() => $attributes, + ]), $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php new file mode 100644 index 0000000000..e06dae89bb --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php @@ -0,0 +1,138 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections; + +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\CustomId; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Duplicate as DuplicateException; +use Utopia\Database\Exception\Index as IndexException; +use Utopia\Database\Exception\Limit as LimitException; +use Utopia\Database\Exception\NotFound as NotFoundException; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Permissions; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Text; + +class Create extends Action +{ + public static function getName(): string + { + return 'createCollection'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_COLLECTION; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections') + ->desc('Create collections') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].collections.[collectionId].create') + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'collection.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{response.$id}') + ->label('sdk', new Method( + namespace: 'databases', + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-collection.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createTable', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') + ->param('name', '', new Text(128), 'Collection name. Max length: 128 chars.') + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('documentSecurity', false, new Boolean(true), 'Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('enabled', true, new Boolean(), 'Is collection enabled? When set to \'disabled\', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $name, ?array $permissions, bool $documentSecurity, bool $enabled, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collectionId = $collectionId === 'unique()' ? ID::unique() : $collectionId; + + // Map aggregate permissions into the multiple permissions they represent. + $permissions = Permission::aggregate($permissions) ?? []; + + try { + $collection = $dbForProject->createDocument('database_' . $database->getSequence(), new Document([ + '$id' => $collectionId, + 'databaseInternalId' => $database->getSequence(), + 'databaseId' => $databaseId, + '$permissions' => $permissions, + 'documentSecurity' => $documentSecurity, + 'enabled' => $enabled, + 'name' => $name, + 'search' => \implode(' ', [$collectionId, $name]), + ])); + } catch (DuplicateException) { + throw new Exception($this->getDuplicateException()); + } catch (LimitException) { + throw new Exception($this->getLimitException()); + } catch (NotFoundException) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + try { + $dbForProject->createCollection( + id: 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + permissions: $permissions, + documentSecurity: $documentSecurity + ); + } catch (DuplicateException) { + throw new Exception($this->getDuplicateException()); + } catch (IndexException) { + throw new Exception($this->getInvalidIndexException()); + } catch (LimitException) { + throw new Exception($this->getLimitException()); + } + + $queueForEvents + ->setContext('database', $database) + ->setParam('databaseId', $databaseId) + ->setParam($this->getEventsParamKey(), $collection->getId()); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_CREATED) + ->dynamic($collection, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Delete.php new file mode 100644 index 0000000000..d20570fb43 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Delete.php @@ -0,0 +1,107 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Delete extends Action +{ + public static function getName(): string + { + return 'deleteCollection'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_COLLECTION; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId') + ->desc('Delete collection') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].delete') + ->label('audits.event', 'collection.delete') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: 'databases', + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/delete-collection.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_NOCONTENT, + model: UtopiaResponse::MODEL_NONE, + ) + ], + contentType: ContentType::NONE, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.deleteTable', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + if ($collection->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + if (!$dbForProject->deleteDocument('database_' . $database->getSequence(), $collectionId)) { + $type = $this->getContext(); + throw new Exception(Exception::GENERAL_SERVER_ERROR, "Failed to remove $type from DB"); + } + + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); + + $queueForDatabase + ->setType(DATABASE_TYPE_DELETE_COLLECTION) + ->setDatabase($database); + + if ($this->isCollectionsAPI()) { + $queueForDatabase->setCollection($collection); + } else { + $queueForDatabase->setTable($collection); + } + + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setContext('database', $database) + ->setParam($this->getEventsParamKey(), $collection->getId()) + ->setPayload($response->output($collection, $this->getResponseModel())); + + $response->noContent(); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php new file mode 100644 index 0000000000..e05e588201 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php @@ -0,0 +1,370 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents; + +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Action as AppwriteAction; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; + +abstract class Action extends AppwriteAction +{ + /** + * @var string|null The current context (either 'row' or 'document') + */ + private ?string $context = DOCUMENTS; + + /** + * Get the response model used in the SDK and HTTP responses. + */ + abstract protected function getResponseModel(): string; + + public function setHttpPath(string $path): AppwriteAction + { + if (str_contains($path, '/tablesdb/')) { + $this->context = ROWS; + } + + $contextId = '$' . $this->getCollectionsEventsContext() . 'Id'; + $this->removableAttributes = [ + '*' => [ + '$sequence', + '$databaseId', + $contextId, + ], + 'privileged' => [ + '$createdAt', + '$updatedAt', + ], + ]; + + return parent::setHttpPath($path); + } + + /** + * Get the plural of the given name. + * + * Used for endpoints with multiple sdk methods. + */ + protected function getBulkActionName(string $name): string + { + return "{$name}s"; + } + + /** + * Get the current context. + */ + protected function getContext(): string + { + return $this->context; + } + + /** + * Returns true if current context is Collections API. + */ + protected function isCollectionsAPI(): bool + { + // rows in tables api context + // documents in collections api context + return $this->getContext() === DOCUMENTS; + } + + /** + * Get the SDK group name for the current action. + * + * Can be used for XList operations as well! + */ + protected function getSdkGroup(): string + { + return $this->isCollectionsAPI() ? 'documents' : 'rows'; + } + + /** + * Get the SDK namespace for the current action. + */ + protected function getSdkNamespace(): string + { + return $this->isCollectionsAPI() ? 'databases' : 'tablesDB'; + } + + /** + * Get the correct attribute/column structure context for errors. + */ + protected function getStructureContext(): string + { + return $this->isCollectionsAPI() ? 'attributes' : 'columns'; + } + + /** + * Get the appropriate parent level not found exception. + */ + protected function getParentNotFoundException(): string + { + return $this->isCollectionsAPI() + ? Exception::COLLECTION_NOT_FOUND + : Exception::TABLE_NOT_FOUND; + } + + /** + * Get the appropriate attribute/column not found exception. + */ + protected function getStructureNotFoundException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_NOT_FOUND + : Exception::COLUMN_NOT_FOUND; + } + + /** + * Get the appropriate not found exception. + */ + protected function getNotFoundException(): string + { + return $this->isCollectionsAPI() + ? Exception::DOCUMENT_NOT_FOUND + : Exception::ROW_NOT_FOUND; + } + + /** + * Get the appropriate already exists exception. + */ + protected function getDuplicateException(): string + { + return $this->isCollectionsAPI() + ? Exception::DOCUMENT_ALREADY_EXISTS + : Exception::ROW_ALREADY_EXISTS; + } + + /** + * Get the appropriate conflict exception. + */ + protected function getConflictException(): string + { + return $this->isCollectionsAPI() + ? Exception::DOCUMENT_UPDATE_CONFLICT + : Exception::ROW_UPDATE_CONFLICT; + } + + /** + * Get the appropriate delete restricted exception. + */ + protected function getRestrictedException(): string + { + return $this->isCollectionsAPI() + ? Exception::DOCUMENT_DELETE_RESTRICTED + : Exception::ROW_DELETE_RESTRICTED; + } + + /** + * Get the correct invalid structure message. + */ + protected function getStructureException(): string + { + return $this->isCollectionsAPI() + ? Exception::DOCUMENT_INVALID_STRUCTURE + : Exception::ROW_INVALID_STRUCTURE; + } + + /** + * Get the appropriate missing data exception. + */ + protected function getMissingDataException(): string + { + return $this->isCollectionsAPI() + ? Exception::DOCUMENT_MISSING_DATA + : Exception::ROW_MISSING_DATA; + } + + /** + * Get the exception to throw when the resource limit is exceeded. + */ + protected function getLimitException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_LIMIT_EXCEEDED + : Exception::COLUMN_LIMIT_EXCEEDED; + } + + /** + * Get the appropriate missing payload exception. + */ + protected function getMissingPayloadException(): string + { + return $this->isCollectionsAPI() + ? Exception::DOCUMENT_MISSING_PAYLOAD + : Exception::ROW_MISSING_PAYLOAD; + } + + /** + * Get the correct collections context for Events queue. + */ + protected function getCollectionsEventsContext(): string + { + return $this->isCollectionsAPI() ? 'collection' : 'table'; + } + + /** + * Remove configured removable attributes from a document. + * Used for relationship path handling to remove API-specific attributes. + */ + protected function removeReadonlyAttributes( + Document|array $document, + bool $privileged = false, + ): Document|array { + foreach ($this->removableAttributes['*'] as $attribute) { + unset($document[$attribute]); + } + if (!$privileged) { + foreach ($this->removableAttributes['privileged'] ?? [] as $attribute) { + unset($document[$attribute]); + } + } + return $document; + } + + /** + * Resolves relationships in a document and attaches metadata. + */ + protected function processDocument( + /* database */ + Document $database, + Document $collection, + Document $document, + Database $dbForProject, + + /* options */ + array &$collectionsCache, + ?int &$operations = null, + ): bool { + + if ($operations !== null && $document->isEmpty()) { + return false; + } + + if ($operations !== null) { + $operations++; + } + + $collectionId = $collection->getId(); + $document->removeAttribute('$collection'); + $document->setAttribute('$databaseId', $database->getId()); + $document->setAttribute('$' . $this->getCollectionsEventsContext() . 'Id', $collectionId); + + $relationships = $collectionsCache[$collectionId] ??= \array_filter( + $collection->getAttribute('attributes', []), + fn ($attr) => $attr->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + foreach ($relationships as $relationship) { + $key = $relationship->getAttribute('key'); + $related = $document->getAttribute($key); + + if (empty($related)) { + if (\in_array(\gettype($related), ['array', 'object']) && $operations !== null) { + $operations++; + } + continue; + } + + $relations = \is_array($related) ? $related : [$related]; + $relatedCollectionId = $relationship->getAttribute('relatedCollection'); + + if (!isset($collectionsCache[$relatedCollectionId])) { + $relatedCollectionDoc = Authorization::skip( + fn () => $dbForProject->getDocument( + 'database_' . $database->getSequence(), + $relatedCollectionId + ) + ); + + $collectionsCache[$relatedCollectionId] = \array_filter( + $relatedCollectionDoc->getAttribute('attributes', []), + fn ($attr) => $attr->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + } + + foreach ($relations as $relation) { + if ($relation instanceof Document) { + $relatedCollection = new Document([ + '$id' => $relatedCollectionId, + 'attributes' => $collectionsCache[$relatedCollectionId], + ]); + + $this->processDocument( + database: $database, + collection: $relatedCollection, + document: $relation, + dbForProject: $dbForProject, + collectionsCache: $collectionsCache, + operations: $operations + ); + } + } + + if (\is_array($related)) { + $document->setAttribute($relationship->getAttribute('key'), \array_values($relations)); + } elseif (empty($relations)) { + $document->setAttribute($relationship->getAttribute('key'), null); + } + } + + return true; + } + + /** + * For triggering different queues for each document for a bulk documents + * @param string $event + * @param Document $database + * @param Document $collection + * @param Document[] $documents + * @param Event $queueForEvents + * @param Event $queueForRealtime + * @param Event $queueForFunctions + * @param Event $queueForWebhooks + * @return void + */ + protected function triggerBulk( + string $event, + Document $database, + Document $collection, + array $documents, + Event $queueForEvents, + Event $queueForRealtime, + Event $queueForFunctions, + Event $queueForWebhooks + ): void { + $queueForEvents + ->setEvent($event) + ->setParam('databaseId', $database->getId()) + ->setContext('database', $database) + ->setParam('collectionId', $collection->getId()) + ->setParam('tableId', $collection->getId()) + ->setContext($this->getCollectionsEventsContext(), $collection); + + foreach ($documents as $document) { + $queueForEvents + ->setParam('documentId', $document->getId()) + ->setParam('rowId', $document->getId()) + ->setPayload($document->getArrayCopy()); + + $queueForRealtime + ->from($queueForEvents) + ->trigger(); + + $queueForFunctions + ->from($queueForEvents) + ->trigger(); + + $queueForWebhooks + ->from($queueForEvents) + ->trigger(); + } + + $queueForEvents->reset(); + $queueForRealtime->reset(); + $queueForFunctions->reset(); + $queueForWebhooks->reset(); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php new file mode 100644 index 0000000000..289dee5a8d --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php @@ -0,0 +1,141 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Attribute; + +use Appwrite\Event\Event; +use Appwrite\Event\StatsUsage; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use InvalidArgumentException; +use Utopia\Database\Database; +use Utopia\Database\Exception\Conflict as ConflictException; +use Utopia\Database\Exception\Limit as LimitException; +use Utopia\Database\Exception\NotFound as NotFoundException; +use Utopia\Database\Exception\Type as TypeException; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Numeric; + +class Decrement extends Action +{ + public static function getName(): string + { + return 'decrementDocumentAttribute'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId/:attribute/decrement') + ->desc('Decrement document attribute') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].update') + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'documents.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/decrement-document-attribute.md', + auth: [AuthType::SESSION, AuthType::JWT, AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.decrementRowColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('documentId', '', new UID(), 'Document ID.') + ->param('attribute', '', new Key(), 'Attribute key.') + ->param('value', 1, new Numeric(), 'Value to increment the attribute by. The value must be a number.', true) + ->param('min', null, new Numeric(), 'Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $documentId, string $attribute, int|float $value, int|float|null $min, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + try { + $document = $dbForProject->decreaseDocumentAttribute( + collection: 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + id: $documentId, + attribute: $attribute, + value: $value, + min: $min + ); + } catch (ConflictException) { + throw new Exception($this->getConflictException()); + } catch (NotFoundException) { + throw new Exception($this->getStructureNotFoundException()); + } catch (LimitException) { + throw new Exception($this->getLimitException(), $this->getSdkNamespace() . ' "' . $attribute . '" has reached the minimum value of ' . $min); + } catch (TypeException) { + throw new Exception(Exception::ATTRIBUTE_TYPE_INVALID, $this->getSdkNamespace() . ' "' . $attribute . '" is not a number'); + } catch (InvalidArgumentException $e) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, $e->getMessage()); + } + + $relationships = \array_map( + fn ($document) => $document->getAttribute('key'), + \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ) + ); + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, 1) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), 1); + + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setParam('collectionId', $collectionId) + ->setParam('tableId', $collectionId) + ->setParam('documentId', $documentId) + ->setParam('rowId', $documentId) + ->setContext('database', $database) + ->setContext($this->getCollectionsEventsContext(), $collection) + ->setPayload($response->getPayload(), sensitive: $relationships); + + $response->dynamic($document, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php new file mode 100644 index 0000000000..fe8bd2d225 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php @@ -0,0 +1,141 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Attribute; + +use Appwrite\Event\Event; +use Appwrite\Event\StatsUsage; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use InvalidArgumentException; +use Utopia\Database\Database; +use Utopia\Database\Exception\Conflict as ConflictException; +use Utopia\Database\Exception\Limit as LimitException; +use Utopia\Database\Exception\NotFound as NotFoundException; +use Utopia\Database\Exception\Type as TypeException; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Numeric; + +class Increment extends Action +{ + public static function getName(): string + { + return 'incrementDocumentAttribute'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId/:attribute/increment') + ->desc('Increment document attribute') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].update') + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'documents.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/increment-document-attribute.md', + auth: [AuthType::SESSION, AuthType::JWT, AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.incrementRowColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('documentId', '', new UID(), 'Document ID.') + ->param('attribute', '', new Key(), 'Attribute key.') + ->param('value', 1, new Numeric(), 'Value to increment the attribute by. The value must be a number.', true) + ->param('max', null, new Numeric(), 'Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $documentId, string $attribute, int|float $value, int|float|null $max, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + try { + $document = $dbForProject->increaseDocumentAttribute( + collection: 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + id: $documentId, + attribute: $attribute, + value: $value, + max: $max + ); + } catch (ConflictException) { + throw new Exception($this->getConflictException()); + } catch (NotFoundException) { + throw new Exception($this->getStructureNotFoundException()); + } catch (LimitException) { + throw new Exception($this->getLimitException(), $this->getSdkNamespace() . ' "' . $attribute . '" has reached the maximum value of ' . $max); + } catch (TypeException) { + throw new Exception(Exception::ATTRIBUTE_TYPE_INVALID, $this->getSdkNamespace() . ' "' . $attribute . '" is not a number'); + } catch (InvalidArgumentException $e) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, $e->getMessage()); + } + + $relationships = \array_map( + fn ($document) => $document->getAttribute('key'), + \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ) + ); + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, 1) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), 1); + + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setParam('collectionId', $collectionId) + ->setParam('tableId', $collectionId) + ->setParam('documentId', $documentId) + ->setParam('rowId', $documentId) + ->setContext('database', $database) + ->setContext($this->getCollectionsEventsContext(), $collection) + ->setPayload($response->getPayload(), sensitive: $relationships); + + $response->dynamic($document, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Delete.php new file mode 100644 index 0000000000..3467a9d11c --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Delete.php @@ -0,0 +1,156 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk; + +use Appwrite\Event\Event; +use Appwrite\Event\StatsUsage; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Conflict as ConflictException; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Exception\Restricted as RestrictedException; +use Utopia\Database\Query; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Text; + +class Delete extends Action +{ + public static function getName(): string + { + return 'deleteDocuments'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents') + ->desc('Delete documents') + ->groups(['api', 'database']) + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'documents.delete') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/delete-documents.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.deleteRows', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForStatsUsage') + ->inject('queueForEvents') + ->inject('queueForRealtime') + ->inject('queueForFunctions') + ->inject('queueForWebhooks') + ->inject('plan') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, array $queries, UtopiaResponse $response, Database $dbForProject, StatsUsage $queueForStatsUsage, Event $queueForEvents, Event $queueForRealtime, Event $queueForFunctions, Event $queueForWebhooks, array $plan): void + { + $database = $dbForProject->getDocument('databases', $databaseId); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + $hasRelationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + if ($hasRelationships) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk delete is not supported for ' . $this->getSdkNamespace() . ' with relationship attributes'); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + $documents = []; + + try { + $modified = $dbForProject->deleteDocuments( + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + $queries, + onNext: function (Document $document) use ($plan, &$documents) { + if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { + $documents[] = $document; + } + }, + ); + } catch (ConflictException) { + throw new Exception($this->getConflictException()); + } catch (RestrictedException) { + throw new Exception($this->getRestrictedException()); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + foreach ($documents as $document) { + $document->setAttribute('$databaseId', $database->getId()); + $document->setAttribute('$'.$this->getCollectionsEventsContext().'Id', $collection->getId()); + } + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); + + $response->dynamic(new Document([ + 'total' => $modified, + $this->getSdkGroup() => $documents, + ]), $this->getResponseModel()); + + $this->triggerBulk( + 'databases.[databaseId].collections.[collectionId].documents.[documentId].delete', + $database, + $collection, + $documents, + $queueForEvents, + $queueForRealtime, + $queueForFunctions, + $queueForWebhooks + ); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Update.php new file mode 100644 index 0000000000..65bd255d32 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Update.php @@ -0,0 +1,182 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk; + +use Appwrite\Event\Event; +use Appwrite\Event\StatsUsage; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Conflict as ConflictException; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Exception\Relationship as RelationshipException; +use Utopia\Database\Exception\Structure as StructureException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Permissions; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\JSON; +use Utopia\Validator\Text; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateDocuments'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents') + ->desc('Update documents') + ->groups(['api', 'database']) + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'documents.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-documents.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateRows', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('data', [], new JSON(), 'Document data as JSON object. Include only attribute and value pairs to be updated.', true) + ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForStatsUsage') + ->inject('queueForEvents') + ->inject('queueForRealtime') + ->inject('queueForFunctions') + ->inject('queueForWebhooks') + ->inject('plan') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string|array $data, array $queries, UtopiaResponse $response, Database $dbForProject, StatsUsage $queueForStatsUsage, Event $queueForEvents, Event $queueForRealtime, Event $queueForFunctions, Event $queueForWebhooks, array $plan): void + { + $data = \is_string($data) + ? \json_decode($data, true) + : $data; + + if (empty($data)) { + throw new Exception($this->getMissingPayloadException()); + } + + $database = $dbForProject->getDocument('databases', $databaseId); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + $hasRelationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + if ($hasRelationships) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk update is not supported for ' . $this->getSdkNamespace() . ' with relationship attributes'); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + if ($data['$permissions']) { + $validator = new Permissions(); + if (!$validator->isValid($data['$permissions'])) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, $validator->getDescription()); + } + } + + $data = $this->removeReadonlyAttributes($data, privileged: true); + + $documents = []; + + try { + $modified = $dbForProject->withPreserveDates(function () use ($plan, &$documents, $dbForProject, $database, $collection, $data, $queries) { + return $dbForProject->updateDocuments( + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + new Document($data), + $queries, + onNext: function (Document $document) use ($plan, &$documents) { + if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { + $documents[] = $document; + } + }, + ); + }); + } catch (ConflictException) { + throw new Exception($this->getConflictException()); + } catch (RelationshipException $e) { + throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); + } catch (StructureException $e) { + throw new Exception($this->getStructureException(), $e->getMessage()); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + foreach ($documents as $document) { + $document->setAttribute('$databaseId', $database->getId()); + $document->setAttribute('$'.$this->getCollectionsEventsContext().'Id', $collection->getId()); + } + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); + + $response->dynamic(new Document([ + 'total' => $modified, + $this->getSdkGroup() => $documents + ]), $this->getResponseModel()); + + $this->triggerBulk( + 'databases.[databaseId].collections.[collectionId].documents.[documentId].update', + $database, + $collection, + $documents, + $queueForEvents, + $queueForRealtime, + $queueForFunctions, + $queueForWebhooks + ); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php new file mode 100644 index 0000000000..4ce3990a38 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php @@ -0,0 +1,161 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk; + +use Appwrite\Event\Event; +use Appwrite\Event\StatsUsage; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Conflict as ConflictException; +use Utopia\Database\Exception\Duplicate as DuplicateException; +use Utopia\Database\Exception\Relationship as RelationshipException; +use Utopia\Database\Exception\Structure as StructureException; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\JSON; + +class Upsert extends Action +{ + public static function getName(): string + { + return 'upsertDocuments'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents') + ->desc('Upsert documents') + ->groups(['api', 'database']) + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'document.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', [ + new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/upsert-documents.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.upsertRows', + ), + ) + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('documents', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of document data as JSON objects. May contain partial documents.', false, ['plan']) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForStatsUsage') + ->inject('queueForEvents') + ->inject('queueForRealtime') + ->inject('queueForFunctions') + ->inject('queueForWebhooks') + ->inject('plan') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, array $documents, UtopiaResponse $response, Database $dbForProject, StatsUsage $queueForStatsUsage, Event $queueForEvents, Event $queueForRealtime, Event $queueForFunctions, Event $queueForWebhooks, array $plan): void + { + $database = $dbForProject->getDocument('databases', $databaseId); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + $hasRelationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + if ($hasRelationships) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk upsert is not supported for ' . $this->getSdkNamespace() . ' with relationship attributes'); + } + + foreach ($documents as $key => $document) { + $document = $this->removeReadonlyAttributes($document, privileged: true); + $documents[$key] = new Document($document); + } + + $upserted = []; + + try { + $modified = $dbForProject->withPreserveDates(function () use ($dbForProject, $database, $collection, $documents, $plan, &$upserted) { + return $dbForProject->createOrUpdateDocuments( + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + $documents, + onNext: function (Document $document) use ($plan, &$upserted) { + if (\count($upserted) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { + $upserted[] = $document; + } + }, + ); + }); + } catch (ConflictException) { + throw new Exception($this->getConflictException()); + } catch (DuplicateException) { + throw new Exception($this->getDuplicateException()); + } catch (RelationshipException $e) { + throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); + } catch (StructureException $e) { + throw new Exception($this->getStructureException(), $e->getMessage()); + } + + foreach ($upserted as $document) { + $document->setAttribute('$databaseId', $database->getId()); + $document->setAttribute('$'.$this->getCollectionsEventsContext().'Id', $collection->getId()); + } + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); + + $response->dynamic(new Document([ + 'total' => $modified, + $this->getSdkGroup() => $upserted + ]), $this->getResponseModel()); + + $this->triggerBulk( + 'databases.[databaseId].collections.[collectionId].documents.[documentId].upsert', + $database, + $collection, + $upserted, + $queueForEvents, + $queueForRealtime, + $queueForFunctions, + $queueForWebhooks + ); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php new file mode 100644 index 0000000000..a8af1eda86 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php @@ -0,0 +1,434 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents; + +use Appwrite\Auth\Auth; +use Appwrite\Event\Event; +use Appwrite\Event\StatsUsage; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Parameter; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\CustomId; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Duplicate as DuplicateException; +use Utopia\Database\Exception\NotFound as NotFoundException; +use Utopia\Database\Exception\Relationship as RelationshipException; +use Utopia\Database\Exception\Structure as StructureException; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Permissions; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\JSON; + +class Create extends Action +{ + public static function getName(): string + { + return 'createDocument'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT; + } + + protected function getBulkResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents') + ->desc('Create document') + ->groups(['api', 'database']) + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'document.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', [ + new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + desc: 'Create document', + description: '/docs/references/databases/create-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + parameters: [ + new Parameter('databaseId', optional: false), + new Parameter('collectionId', optional: false), + new Parameter('documentId', optional: false), + new Parameter('data', optional: false), + new Parameter('permissions', optional: true), + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createRow', + ), + ), + new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: $this->getBulkActionName(self::getName()), + desc: 'Create documents', + description: '/docs/references/databases/create-documents.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: $this->getBulkResponseModel(), + ) + ], + contentType: ContentType::JSON, + parameters: [ + new Parameter('databaseId', optional: false), + new Parameter('collectionId', optional: false), + new Parameter('documents', optional: false), + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createRows', + ), + ) + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') + ->param('data', [], new JSON(), 'Document data as JSON object.', true, example: '{"username":"walter.obrien","email":"walter.obrien@example.com","fullName":"Walter O\'Brien","age":30,"isAdmin":false}') + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('documents', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of documents data as JSON objects.', true, ['plan']) + ->inject('response') + ->inject('dbForProject') + ->inject('user') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->inject('queueForRealtime') + ->inject('queueForFunctions') + ->inject('queueForWebhooks') + ->callback($this->action(...)); + } + public function action(string $databaseId, string $documentId, string $collectionId, string|array $data, ?array $permissions, ?array $documents, UtopiaResponse $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, Event $queueForRealtime, Event $queueForFunctions, Event $queueForWebhooks): void + { + $data = \is_string($data) + ? \json_decode($data, true) + : $data; + + /** + * Determine which internal path to call, single or bulk + */ + if (empty($data) && empty($documents)) { + // No single or bulk documents provided + throw new Exception($this->getMissingDataException()); + } + if (!empty($data) && !empty($documents)) { + // Both single and bulk documents provided + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'You can only send one of the following parameters: data, ' . $this->getSdkGroup()); + } + if (!empty($data) && empty($documentId)) { + // Single document provided without document ID + $document = $this->isCollectionsAPI() ? 'Document' : 'Row'; + $message = "$document ID is required when creating a single " . strtolower($document) . '.'; + throw new Exception($this->getMissingDataException(), $message); + } + if (!empty($documents) && !empty($documentId)) { + // Bulk documents provided with document ID + $documentId = $this->isCollectionsAPI() ? 'documentId' : 'rowId'; + throw new Exception( + Exception::GENERAL_BAD_REQUEST, + "Param \"$documentId\" is not allowed when creating multiple " . $this->getSdkGroup() . ', set "$id" on each instead.' + ); + } + if (!empty($documents) && !empty($permissions)) { + // Bulk documents provided with permissions + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "permissions" is disallowed when creating multiple ' . $this->getSdkGroup() . ', set "$permissions" on each instead'); + } + + $isBulk = true; + if (!empty($data)) { + // Single document provided, convert to single item array + // But remember that it was single to respond with a single document + $isBulk = false; + $documents = [$data]; + } + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); + + if ($isBulk && !$isAPIKey && !$isPrivilegedUser) { + throw new Exception(Exception::GENERAL_UNAUTHORIZED_SCOPE); + } + + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception($this->getParentNotFoundException()); + } + + $hasRelationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + if ($isBulk && $hasRelationships) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is not supported for ' . $this->getSdkNamespace() .' with relationship ' . $this->getStructureContext()); + } + + $setPermissions = function (Document $document, ?array $permissions) use ($user, $isAPIKey, $isPrivilegedUser, $isBulk) { + $allowedPermissions = [ + Database::PERMISSION_READ, + Database::PERMISSION_UPDATE, + Database::PERMISSION_DELETE, + ]; + + // If bulk, we need to validate permissions explicitly per document + if ($isBulk) { + $permissions = $document['$permissions'] ?? null; + if (!empty($permissions)) { + $validator = new Permissions(); + if (!$validator->isValid($permissions)) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, $validator->getDescription()); + } + } + } + + $permissions = Permission::aggregate($permissions, $allowedPermissions); + + // Add permissions for current the user if none were provided. + if (\is_null($permissions)) { + $permissions = []; + if (!empty($user->getId())) { + foreach ($allowedPermissions as $permission) { + $permissions[] = (new Permission($permission, 'user', $user->getId()))->toString(); + } + } + } + + // Users can only manage their own roles, API keys and Admin users can manage any + if (!$isAPIKey && !$isPrivilegedUser) { + foreach (Database::PERMISSIONS as $type) { + foreach ($permissions as $permission) { + $permission = Permission::parse($permission); + if ($permission->getPermission() != $type) { + continue; + } + $role = (new Role( + $permission->getRole(), + $permission->getIdentifier(), + $permission->getDimension() + ))->toString(); + if (!Authorization::isRole($role)) { + throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', Authorization::getRoles()) . ')'); + } + } + } + } + + $document->setAttribute('$permissions', $permissions); + }; + + $operations = 0; + + $checkPermissions = function (Document $collection, Document $document, string $permission) use ($isAPIKey, $isPrivilegedUser, &$checkPermissions, $dbForProject, $database, &$operations) { + $operations++; + + $documentSecurity = $collection->getAttribute('documentSecurity', false); + $validator = new Authorization($permission); + + $valid = $validator->isValid($collection->getPermissionsByType($permission)); + if (($permission === Database::PERMISSION_UPDATE && !$documentSecurity) || !$valid) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + + if ($permission === Database::PERMISSION_UPDATE) { + $valid = $valid || $validator->isValid($document->getUpdate()); + if ($documentSecurity && !$valid) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + } + + $relationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + foreach ($relationships as $relationship) { + $related = $document->getAttribute($relationship->getAttribute('key')); + + if (empty($related)) { + continue; + } + + $isList = \is_array($related) && \array_values($related) === $related; + + if ($isList) { + $relations = $related; + } else { + $relations = [$related]; + } + + $relatedCollectionId = $relationship->getAttribute('relatedCollection'); + $relatedCollection = Authorization::skip( + fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) + ); + + foreach ($relations as &$relation) { + if ( + \is_array($relation) + && \array_values($relation) !== $relation + && !isset($relation['$id']) + ) { + $relation['$id'] = ID::unique(); + $relation = new Document($relation); + } + if ($relation instanceof Document) { + $relation = $this->removeReadonlyAttributes($relation, $isAPIKey || $isPrivilegedUser); + + $current = Authorization::skip( + fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), $relation->getId()) + ); + + if ($current->isEmpty()) { + $type = Database::PERMISSION_CREATE; + + if (isset($relation['$id']) && $relation['$id'] === 'unique()') { + $relation['$id'] = ID::unique(); + } + } else { + $relation->setAttribute('$collection', $relatedCollection->getId()); + $type = Database::PERMISSION_UPDATE; + } + + $checkPermissions($relatedCollection, $relation, $type); + } + } + + if ($isList) { + $document->setAttribute($relationship->getAttribute('key'), \array_values($relations)); + } else { + $document->setAttribute($relationship->getAttribute('key'), \reset($relations)); + } + } + }; + + $documents = \array_map(function ($document) use ($collection, $permissions, $checkPermissions, $isBulk, $documentId, $setPermissions, $isAPIKey, $isPrivilegedUser) { + $document['$collection'] = $collection->getId(); + + // Determine the source ID depending on whether it's a bulk operation. + $sourceId = $isBulk + ? ($document['$id'] ?? ID::unique()) + : $documentId; + + // If bulk, we need to validate ID explicitly + if ($isBulk) { + $validator = new CustomId(); + if (!$validator->isValid($sourceId)) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, $validator->getDescription()); + } + } + + // Assign a unique ID if needed, otherwise use the provided ID. + $document['$id'] = $sourceId === 'unique()' ? ID::unique() : $sourceId; + $document = $this->removeReadonlyAttributes($document, $isAPIKey || $isPrivilegedUser); + $document = new Document($document); + $setPermissions($document, $permissions); + $checkPermissions($collection, $document, Database::PERMISSION_CREATE); + return $document; + }, $documents); + + try { + $dbForProject->withPreserveDates( + fn () => $dbForProject->createDocuments( + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + $documents, + ) + ); + } catch (DuplicateException) { + throw new Exception($this->getDuplicateException()); + } catch (NotFoundException) { + throw new Exception($this->getParentNotFoundException()); + } catch (RelationshipException $e) { + throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); + } catch (StructureException $e) { + throw new Exception($this->getStructureException(), $e->getMessage()); + } + + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setContext('database', $database) + ->setParam('collectionId', $collection->getId()) + ->setParam('tableId', $collection->getId()) + ->setContext($this->getCollectionsEventsContext(), $collection); + + $collectionsCache = []; + foreach ($documents as $document) { + $this->processDocument( + database: $database, + collection: $collection, + document: $document, + dbForProject: $dbForProject, + collectionsCache: $collectionsCache, + ); + } + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); // per collection + + $response->setStatusCode(SwooleResponse::STATUS_CODE_CREATED); + + if ($isBulk) { + $response->dynamic(new Document([ + 'total' => count($documents), + $this->getSdkGroup() => $documents + ]), $this->getBulkResponseModel()); + + $this->triggerBulk( + 'databases.[databaseId].collections.[collectionId].documents.[documentId].create', + $database, + $collection, + $documents, + $queueForEvents, + $queueForRealtime, + $queueForFunctions, + $queueForWebhooks + ); + return; + } + + $queueForEvents + ->setParam('documentId', $documents[0]->getId()) + ->setParam('rowId', $documents[0]->getId()) + ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].create'); + + $response->dynamic( + $documents[0], + $this->getResponseModel() + ); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php new file mode 100644 index 0000000000..f34b4630c2 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php @@ -0,0 +1,155 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents; + +use Appwrite\Auth\Auth; +use Appwrite\Event\Event; +use Appwrite\Event\StatsUsage; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Exception\Conflict as ConflictException; +use Utopia\Database\Exception\Restricted as RestrictedException; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Delete extends Action +{ + public static function getName(): string + { + return 'deleteDocument'; + } + + /** + * 1. `SDKResponse` uses `UtopiaResponse::MODEL_NONE`. + * 2. But we later need the actual return type for events queue below! + */ + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') + ->desc('Delete document') + ->groups(['api', 'database']) + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].delete') + ->label('audits.event', 'document.delete') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}/document/{request.documentId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/delete-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_NOCONTENT, + model: UtopiaResponse::MODEL_NONE, + ) + ], + contentType: ContentType::NONE, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.deleteRow', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('documentId', '', new UID(), 'Document ID.') + ->inject('requestTimestamp') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $documentId, ?\DateTime $requestTimestamp, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); + + if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + + if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception($this->getParentNotFoundException()); + } + + // Read permission should not be required for delete + $document = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); + + if ($document->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + try { + $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $documentId) { + $dbForProject->deleteDocument( + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + $documentId + ); + }); + } catch (ConflictException) { + throw new Exception($this->getConflictException()); + } catch (RestrictedException) { + throw new Exception($this->getRestrictedException()); + } + + $collectionsCache = []; + + $this->processDocument( + database: $database, + collection: $collection, + document: $document, + dbForProject: $dbForProject, + collectionsCache: $collectionsCache, + ); + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, 1) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), 1); // per collection + + $response->addHeader('X-Debug-Operations', 1); + + $relationships = \array_map( + fn ($document) => $document->getAttribute('key'), + \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ) + ); + + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setContext('database', $database) + ->setParam('collectionId', $collection->getId()) + ->setParam('tableId', $collection->getId()) + ->setParam('documentId', $document->getId()) + ->setParam('rowId', $document->getId()) + ->setContext($this->getCollectionsEventsContext(), $collection) + ->setPayload($response->output($document, $this->getResponseModel()), sensitive: $relationships); + + $response->noContent(); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php new file mode 100644 index 0000000000..7f621fb33a --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php @@ -0,0 +1,131 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents; + +use Appwrite\Auth\Auth; +use Appwrite\Event\StatsUsage; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Text; + +class Get extends Action +{ + public static function getName(): string + { + return 'getDocument'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') + ->desc('Get document') + ->groups(['api', 'database']) + ->label('scope', 'documents.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/get-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.getRow', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('documentId', '', new UID(), 'Document ID.') + ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $documentId, array $queries, UtopiaResponse $response, Database $dbForProject, StatsUsage $queueForStatsUsage): void + { + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); + + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + + if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception($this->getParentNotFoundException()); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + try { + $selects = Query::groupByType($queries)['selections'] ?? []; + + if (! empty($selects)) { + // has selects, allow relationship on documents! + $document = $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId, $queries); + } else { + // has no selects, disable relationship looping on documents! + $document = $dbForProject->skipRelationships(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId, $queries)); + } + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + if ($document->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + $operations = 0; + $collectionsCache = []; + $this->processDocument( + database: $database, + collection: $collection, + document: $document, + dbForProject: $dbForProject, + collectionsCache: $collectionsCache, + operations: $operations + ); + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_READS, max($operations, 1)) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations); + + $response->addHeader('X-Debug-Operations', $operations); + + $response->dynamic($document, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php new file mode 100644 index 0000000000..93c8639520 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php @@ -0,0 +1,168 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Logs; + +use Appwrite\Detector\Detector; +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use MaxMind\Db\Reader; +use Utopia\Audit\Audit; +use Utopia\Database\Database; +use Utopia\Database\DateTime; +use Utopia\Database\Document; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Queries; +use Utopia\Database\Validator\Query\Limit; +use Utopia\Database\Validator\Query\Offset; +use Utopia\Database\Validator\UID; +use Utopia\Locale\Locale; +use Utopia\Swoole\Response as SwooleResponse; + +class XList extends Action +{ + public static function getName(): string + { + return 'listDocumentLogs'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_LOG_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId/logs') + ->desc('List document logs') + ->groups(['api', 'database']) + ->label('scope', 'documents.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: 'logs', + name: self::getName(), + description: '/docs/references/databases/get-document-logs.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.listRowLogs', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('documentId', '', new UID(), 'Document ID.') + ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) + ->inject('response') + ->inject('dbForProject') + ->inject('locale') + ->inject('geodb') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $documentId, array $queries, UtopiaResponse $response, Database $dbForProject, Locale $locale, Reader $geodb): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + if ($collection->isEmpty()) { + throw new Exception($this->getParentNotFoundException()); + } + + $document = $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId); + if ($document->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + // Temp fix for logs + $queries[] = Query::or([ + Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))), + Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))), + ]); + + $audit = new Audit($dbForProject); + $type = $this->getCollectionsEventsContext(); + $context = $this->getContext(); + $resource = match ($context) { + ROWS => "database/$databaseId/grid/$type/$collectionId/$context/{$document->getId()}", + default => "database/$databaseId/$type/$collectionId/$context/{$document->getId()}", + }; + + $logs = $audit->getLogsByResource($resource, $queries); + + $output = []; + + foreach ($logs as $i => &$log) { + $log['userAgent'] = (!empty($log['userAgent'])) ? $log['userAgent'] : 'UNKNOWN'; + + $detector = new Detector($log['userAgent']); + $detector->skipBotDetection(); // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) + + $os = $detector->getOS(); + $client = $detector->getClient(); + $device = $detector->getDevice(); + + $output[$i] = new Document([ + 'event' => $log['event'], + 'userId' => $log['data']['userId'], + 'userEmail' => $log['data']['userEmail'] ?? null, + 'userName' => $log['data']['userName'] ?? null, + 'mode' => $log['data']['mode'] ?? null, + 'ip' => $log['ip'], + 'time' => $log['time'], + 'osCode' => $os['osCode'], + 'osName' => $os['osName'], + 'osVersion' => $os['osVersion'], + 'clientType' => $client['clientType'], + 'clientCode' => $client['clientCode'], + 'clientName' => $client['clientName'], + 'clientVersion' => $client['clientVersion'], + 'clientEngine' => $client['clientEngine'], + 'clientEngineVersion' => $client['clientEngineVersion'], + 'deviceName' => $device['deviceName'], + 'deviceBrand' => $device['deviceBrand'], + 'deviceModel' => $device['deviceModel'] + ]); + + $record = $geodb->get($log['ip']); + + if ($record) { + $output[$i]['countryCode'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), false) ? \strtolower($record['country']['iso_code']) : '--'; + $output[$i]['countryName'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), $locale->getText('locale.country.unknown')); + } else { + $output[$i]['countryCode'] = '--'; + $output[$i]['countryName'] = $locale->getText('locale.country.unknown'); + } + } + + $response->dynamic(new Document([ + 'logs' => $output, + 'total' => $audit->countLogsByResource($resource, $queries), + ]), $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php new file mode 100644 index 0000000000..e510aeb089 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php @@ -0,0 +1,282 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents; + +use Appwrite\Auth\Auth; +use Appwrite\Event\Event; +use Appwrite\Event\StatsUsage; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Conflict as ConflictException; +use Utopia\Database\Exception\Duplicate as DuplicateException; +use Utopia\Database\Exception\Relationship as RelationshipException; +use Utopia\Database\Exception\Structure as StructureException; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Permissions; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\JSON; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateDocument'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') + ->desc('Update document') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].update') + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'document.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}/document/{response.$id}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateRow', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('documentId', '', new UID(), 'Document ID.') + ->param('data', [], new JSON(), 'Document data as JSON object. Include only attribute and value pairs to be updated.', true) + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->inject('requestTimestamp') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $documentId, string|array $data, ?array $permissions, ?\DateTime $requestTimestamp, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage): void + { + + $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array + + if (empty($data) && \is_null($permissions)) { + throw new Exception($this->getMissingPayloadException()); + } + + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); + + if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + + if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception($this->getParentNotFoundException()); + } + + // Read permission should not be required for update + /** @var Document $document */ + $document = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); + + if ($document->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + // Map aggregate permissions into the multiple permissions they represent. + $permissions = Permission::aggregate($permissions, [ + Database::PERMISSION_READ, + Database::PERMISSION_UPDATE, + Database::PERMISSION_DELETE, + ]); + + // Users can only manage their own roles, API keys and Admin users can manage any + $roles = Authorization::getRoles(); + if (!$isAPIKey && !$isPrivilegedUser && !\is_null($permissions)) { + foreach (Database::PERMISSIONS as $type) { + foreach ($permissions as $permission) { + $permission = Permission::parse($permission); + if ($permission->getPermission() != $type) { + continue; + } + $role = (new Role( + $permission->getRole(), + $permission->getIdentifier(), + $permission->getDimension() + ))->toString(); + if (!Authorization::isRole($role)) { + throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); + } + } + } + } + + if (\is_null($permissions)) { + $permissions = $document->getPermissions() ?? []; + } + + $data['$id'] = $documentId; + $data['$permissions'] = $permissions; + $data = $this->removeReadonlyAttributes($data, $isAPIKey || $isPrivilegedUser); + $newDocument = new Document($data); + + $operations = 0; + + $setCollection = (function (Document $collection, Document $document) use ($isAPIKey, $isPrivilegedUser, &$setCollection, $dbForProject, $database, &$operations) { + $operations++; + + $relationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + foreach ($relationships as $relationship) { + $related = $document->getAttribute($relationship->getAttribute('key')); + + if (empty($related)) { + continue; + } + + $isList = \is_array($related) && \array_values($related) === $related; + + if ($isList) { + $relations = $related; + } else { + $relations = [$related]; + } + + $relatedCollectionId = $relationship->getAttribute('relatedCollection'); + $relatedCollection = Authorization::skip( + fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) + ); + + foreach ($relations as &$relation) { + // If the relation is an array it can be either update or create a child document. + if ( + \is_array($relation) + && \array_values($relation) !== $relation + && !isset($relation['$id']) + ) { + $relation['$id'] = ID::unique(); + $relation = new Document($relation); + } + if ($relation instanceof Document) { + $relation = $this->removeReadonlyAttributes($relation, $isAPIKey || $isPrivilegedUser); + + $oldDocument = Authorization::skip(fn () => $dbForProject->getDocument( + 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), + $relation->getId() + )); + + // Attribute $collection is required for Utopia. + $relation->setAttribute( + '$collection', + 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence() + ); + + if ($oldDocument->isEmpty()) { + if (isset($relation['$id']) && $relation['$id'] === 'unique()') { + $relation['$id'] = ID::unique(); + } + } + $setCollection($relatedCollection, $relation); + } + } + + if ($isList) { + $document->setAttribute($relationship->getAttribute('key'), \array_values($relations)); + } else { + $document->setAttribute($relationship->getAttribute('key'), \reset($relations)); + } + } + }); + + $setCollection($collection, $newDocument); + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1)) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); + + try { + $document = $dbForProject->withRequestTimestamp( + $requestTimestamp, + fn () => $dbForProject->withPreserveDates(fn () => $dbForProject->updateDocument( + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + $document->getId(), + $newDocument + )) + ); + } catch (ConflictException) { + throw new Exception($this->getConflictException()); + } catch (DuplicateException) { + throw new Exception($this->getDuplicateException()); + } catch (RelationshipException $e) { + throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); + } catch (StructureException $e) { + throw new Exception($this->getStructureException(), $e->getMessage()); + } + + $collectionsCache = []; + $this->processDocument( + database: $database, + collection: $collection, + document: $document, + dbForProject: $dbForProject, + collectionsCache: $collectionsCache, + ); + + $response->dynamic($document, $this->getResponseModel()); + + $relationships = \array_map( + fn ($document) => $document->getAttribute('key'), + \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ) + ); + + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setParam('collectionId', $collection->getId()) + ->setParam('tableId', $collection->getId()) + ->setParam('documentId', $document->getId()) + ->setParam('rowId', $document->getId()) + ->setContext('database', $database) + ->setContext($this->getCollectionsEventsContext(), $collection) + ->setPayload($response->getPayload(), sensitive: $relationships); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php new file mode 100644 index 0000000000..3ac5e704e3 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php @@ -0,0 +1,303 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents; + +use Appwrite\Auth\Auth; +use Appwrite\Event\Event; +use Appwrite\Event\StatsUsage; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\CustomId; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Conflict as ConflictException; +use Utopia\Database\Exception\Duplicate as DuplicateException; +use Utopia\Database\Exception\Relationship as RelationshipException; +use Utopia\Database\Exception\Structure as StructureException; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Permissions; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\JSON; + +class Upsert extends Action +{ + public static function getName(): string + { + return 'upsertDocument'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') + ->desc('Upsert a document') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].upsert') + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'document.upsert') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}/document/{response.$id}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', [ + new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/upsert-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.upsertRow', + ), + ), + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('documentId', '', new CustomId(), 'Document ID.') + ->param('data', [], new JSON(), 'Document data as JSON object. Include all required attributes of the document to be created or updated.') + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->inject('requestTimestamp') + ->inject('response') + ->inject('user') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $documentId, string|array $data, ?array $permissions, ?\DateTime $requestTimestamp, UtopiaResponse $response, Document $user, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage): void + { + $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array + + if (empty($data) && \is_null($permissions)) { + throw new Exception($this->getMissingPayloadException()); + } + + if (\array_is_list($data) && \count($data) > 1) { // Allow 1 associated array + throw new Exception($this->getMissingPayloadException()); + } + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); + + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception($this->getParentNotFoundException()); + } + + $allowedPermissions = [ + Database::PERMISSION_READ, + Database::PERMISSION_UPDATE, + Database::PERMISSION_DELETE, + ]; + + $permissions = Permission::aggregate($permissions, $allowedPermissions); + + // If no permission, upsert permission from the old document if present (update scenario) else add default permission (create scenario) + if (\is_null($permissions)) { + $oldDocument = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); + if ($oldDocument->isEmpty()) { + if (!empty($user->getId())) { + $defaultPermissions = []; + foreach ($allowedPermissions as $permission) { + $defaultPermissions[] = (new Permission($permission, 'user', $user->getId()))->toString(); + } + $permissions = $defaultPermissions; + } + } else { + $permissions = $oldDocument->getPermissions(); + } + } + + // Users can only manage their own roles, API keys and Admin users can manage any + $roles = Authorization::getRoles(); + if (!$isAPIKey && !$isPrivilegedUser && !\is_null($permissions)) { + foreach (Database::PERMISSIONS as $type) { + foreach ($permissions as $permission) { + $permission = Permission::parse($permission); + if ($permission->getPermission() != $type) { + continue; + } + $role = (new Role( + $permission->getRole(), + $permission->getIdentifier(), + $permission->getDimension() + ))->toString(); + if (!Authorization::isRole($role)) { + throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); + } + } + } + } + + $data['$id'] = $documentId; + $data['$permissions'] = $permissions ?? []; + $data = $this->removeReadonlyAttributes($data, $isAPIKey || $isPrivilegedUser); + $newDocument = new Document($data); + $operations = 0; + + $setCollection = (function (Document $collection, Document $document) use ($isAPIKey, $isPrivilegedUser, &$setCollection, $dbForProject, $database, &$operations) { + $operations++; + + $relationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + foreach ($relationships as $relationship) { + $related = $document->getAttribute($relationship->getAttribute('key')); + + if (empty($related)) { + continue; + } + + $isList = \is_array($related) && \array_values($related) === $related; + + if ($isList) { + $relations = $related; + } else { + $relations = [$related]; + } + + $relatedCollectionId = $relationship->getAttribute('relatedCollection'); + $relatedCollection = Authorization::skip( + fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) + ); + + foreach ($relations as &$relation) { + // If the relation is an array it can be either update or create a child document. + if ( + \is_array($relation) + && \array_values($relation) !== $relation + && !isset($relation['$id']) + ) { + $relation['$id'] = ID::unique(); + $relation = new Document($relation); + } + if ($relation instanceof Document) { + $relation = $this->removeReadonlyAttributes($relation, $isAPIKey || $isPrivilegedUser); + + $oldDocument = Authorization::skip(fn () => $dbForProject->getDocument( + 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), + $relation->getId() + )); + + // Attribute $collection is required for Utopia. + $relation->setAttribute( + '$collection', + 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence() + ); + + if ($oldDocument->isEmpty()) { + if (isset($relation['$id']) && $relation['$id'] === 'unique()') { + $relation['$id'] = ID::unique(); + } + } + $setCollection($relatedCollection, $relation); + } + } + + if ($isList) { + $document->setAttribute($relationship->getAttribute('key'), \array_values($relations)); + } else { + $document->setAttribute($relationship->getAttribute('key'), \reset($relations)); + } + } + }); + + $setCollection($collection, $newDocument); + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); + + $upserted = []; + try { + $dbForProject->withPreserveDates(function () use (&$upserted, $dbForProject, $database, $collection, $newDocument) { + return $dbForProject->createOrUpdateDocuments( + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + [$newDocument], + onNext: function (Document $document) use (&$upserted) { + $upserted[] = $document; + }, + ); + }); + } catch (ConflictException) { + throw new Exception($this->getConflictException()); + } catch (DuplicateException) { + throw new Exception($this->getDuplicateException()); + } catch (RelationshipException $e) { + throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage()); + } catch (StructureException $e) { + throw new Exception($this->getStructureException(), $e->getMessage()); + } + + $collectionsCache = []; + + if (empty($upserted[0])) { + $upserted[0] = $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId); + } + + $document = $upserted[0]; + + $this->processDocument( + database: $database, + collection: $collection, + document: $document, + dbForProject: $dbForProject, + collectionsCache: $collectionsCache, + ); + + $relationships = \array_map( + fn ($document) => $document->getAttribute('key'), + \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ) + ); + + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setContext('database', $database) + ->setParam('collectionId', $collection->getId()) + ->setParam('tableId', $collection->getId()) + ->setParam('documentId', $document->getId()) + ->setParam('rowId', $document->getId()) + ->setContext($this->getCollectionsEventsContext(), $collection) + ->setPayload($response->getPayload(), sensitive: $relationships); + + $response->dynamic( + $document, + $this->getResponseModel() + ); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php new file mode 100644 index 0000000000..546cbeddd4 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php @@ -0,0 +1,167 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents; + +use Appwrite\Auth\Auth; +use Appwrite\Event\StatsUsage; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Order as OrderException; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Query\Cursor; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Text; + +class XList extends Action +{ + public static function getName(): string + { + return 'listDocuments'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_DOCUMENT_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents') + ->desc('List documents') + ->groups(['api', 'database']) + ->label('scope', 'documents.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/list-documents.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.listRows', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, array $queries, UtopiaResponse $response, Database $dbForProject, StatsUsage $queueForStatsUsage): void + { + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); + + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception($this->getParentNotFoundException()); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + /** + * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries + */ + $cursor = \array_filter($queries, function ($query) { + return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); + }); + + $cursor = \reset($cursor); + + if ($cursor) { + $validator = new Cursor(); + if (!$validator->isValid($cursor)) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); + } + + $documentId = $cursor->getValue(); + + $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); + + if ($cursorDocument->isEmpty()) { + $type = ucfirst($this->getContext()); + throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "$type '{$documentId}' for the 'cursor' value not found."); + } + + $cursor->setValue($cursorDocument); + } + + try { + $selectQueries = Query::groupByType($queries)['selections'] ?? []; + + if (! empty($selectQueries)) { + // has selects, allow relationship on documents + $documents = $dbForProject->find('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $queries); + } else { + // has no selects, disable relationship loading on documents + /* @type Document[] $documents */ + $documents = $dbForProject->skipRelationships(fn () => $dbForProject->find('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $queries)); + } + + $total = $dbForProject->count('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $queries, APP_LIMIT_COUNT); + } catch (OrderException $e) { + $documents = $this->isCollectionsAPI() ? 'documents' : 'rows'; + $attribute = $this->isCollectionsAPI() ? 'attribute' : 'column'; + $message = "The order $attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all $documents order $attribute values are non-null."; + throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, $message); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + $operations = 0; + $collectionsCache = []; + foreach ($documents as $document) { + $this->processDocument( + database: $database, + collection: $collection, + document: $document, + dbForProject: $dbForProject, + collectionsCache: $collectionsCache, + operations: $operations, + ); + } + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_READS, max($operations, 1)) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations); + + $response->dynamic(new Document([ + 'total' => $total, + // rows or documents + $this->getSdkGroup() => $documents, + ]), $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Get.php new file mode 100644 index 0000000000..af4b6bf733 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Get.php @@ -0,0 +1,79 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Get extends Action +{ + public static function getName(): string + { + return 'getCollection'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_COLLECTION; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId') + ->desc('Get collection') + ->groups(['api', 'database']) + ->label('scope', 'collections.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/get-collection.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.getTable', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, UtopiaResponse $response, Database $dbForProject): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + + if ($collection->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + $response->dynamic($collection, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Action.php new file mode 100644 index 0000000000..f136fdd29b --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Action.php @@ -0,0 +1,155 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes; + +use Appwrite\Extend\Exception; +use Utopia\Platform\Action as UtopiaAction; + +abstract class Action extends UtopiaAction +{ + /** + * The current API context (either 'columnIndex' or 'index'). + */ + private ?string $context = INDEX; + + /** + * Get the response model used in the SDK and HTTP responses. + */ + abstract protected function getResponseModel(): string; + + public function setHttpPath(string $path): UtopiaAction + { + if (\str_contains($path, '/tablesdb')) { + $this->context = COLUMN_INDEX; + } + return parent::setHttpPath($path); + } + + /** + * Get the current API's parent context. + */ + final protected function getParentContext(): string + { + return $this->getContext() === INDEX ? ATTRIBUTES : COLUMNS; + } + + /** + * Get the current API context. + */ + final protected function getContext(): string + { + return $this->context; + } + + /** + * Determine if the current action is for the Collections API. + */ + final protected function isCollectionsAPI(): bool + { + return $this->getParentContext() === ATTRIBUTES; + } + + /** + * Get the SDK group name for the current action. + */ + final protected function getSdkGroup(): string + { + return 'indexes'; + } + + /** + * Get the SDK namespace for the current action. + */ + final protected function getSdkNamespace(): string + { + return $this->isCollectionsAPI() ? 'databases' : 'tablesDB'; + } + + /** + * Get the exception to throw when the parent is unknown. + */ + final protected function getParentUnknownException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_UNKNOWN + : Exception::COLUMN_UNKNOWN; + } + + /** + * Get the appropriate grandparent level not found exception. + */ + final protected function getGrandParentNotFoundException(): string + { + return $this->isCollectionsAPI() + ? Exception::COLLECTION_NOT_FOUND + : Exception::TABLE_NOT_FOUND; + } + + /** + * Get the appropriate not found exception. + */ + final protected function getNotFoundException(): string + { + return $this->isCollectionsAPI() + ? Exception::INDEX_NOT_FOUND + : Exception::COLUMN_INDEX_NOT_FOUND; + } + + /** + * Get the exception to throw when the parent type is invalid. + */ + final protected function getParentInvalidTypeException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_TYPE_INVALID + : Exception::COLUMN_TYPE_INVALID; + } + + /** + * Get the exception to throw when the index type is invalid. + */ + final protected function getInvalidTypeException(): string + { + return $this->isCollectionsAPI() + ? Exception::INDEX_INVALID + : Exception::COLUMN_INDEX_INVALID; + } + + /** + * Get the exception to throw when the resource already exists. + */ + final protected function getDuplicateException(): string + { + return $this->isCollectionsAPI() + ? Exception::INDEX_ALREADY_EXISTS + : Exception::COLUMN_INDEX_ALREADY_EXISTS; + } + + /** + * Get the exception to throw when the resource limit is exceeded. + */ + final protected function getLimitException(): string + { + return $this->isCollectionsAPI() + ? Exception::INDEX_LIMIT_EXCEEDED + : Exception::COLUMN_INDEX_LIMIT_EXCEEDED; + } + + /** + * Get the exception to throw when the parent attribute/column is not in `available` state. + */ + final protected function getParentNotAvailableException(): string + { + return $this->isCollectionsAPI() + ? Exception::ATTRIBUTE_NOT_AVAILABLE + : Exception::COLUMN_NOT_AVAILABLE; + } + + /** + * Get the correct collections context for Events queue. + */ + final protected function getCollectionsEventsContext(): string + { + return $this->isCollectionsAPI() ? 'collection' : 'table'; + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php new file mode 100644 index 0000000000..733259f091 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php @@ -0,0 +1,248 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Duplicate as DuplicateException; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Index as IndexValidator; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Integer; +use Utopia\Validator\Nullable; +use Utopia\Validator\WhiteList; + +class Create extends Action +{ + public static function getName(): string + { + return 'createIndex'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_INDEX; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/indexes') + ->desc('Create index') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].create') + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'index.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-index.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createIndex', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', null, new Key(), 'Index Key.') + ->param('type', null, new WhiteList([Database::INDEX_KEY, Database::INDEX_FULLTEXT, Database::INDEX_UNIQUE, Database::INDEX_SPATIAL]), 'Index type.') + ->param('attributes', null, new ArrayList(new Key(true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of attributes to index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' attributes are allowed, each 32 characters long.') + ->param('orders', [], new ArrayList(new WhiteList(['ASC', 'DESC'], false, Database::VAR_STRING), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of index orders. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' orders are allowed.', true) + ->param('lengths', [], new ArrayList(new Nullable(new Integer()), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Length of index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE, optional: true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, string $type, array $attributes, array $orders, array $lengths, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + if ($db->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $db->getSequence(), $collectionId); + + if ($collection->isEmpty()) { + // table or collection. + throw new Exception($this->getGrandParentNotFoundException()); + } + + $count = $dbForProject->count('indexes', [ + Query::equal('collectionInternalId', [$collection->getSequence()]), + Query::equal('databaseInternalId', [$db->getSequence()]) + ], 61); + + $limit = $dbForProject->getLimitForIndexes(); + + if ($count >= $limit) { + throw new Exception($this->getLimitException(), 'Index limit exceeded'); + } + + // Convert Document array to array of attribute metadata + $oldAttributes = \array_map(fn ($a) => $a->getArrayCopy(), $collection->getAttribute('attributes')); + + $oldAttributes[] = [ + 'key' => '$id', + 'type' => Database::VAR_STRING, + 'status' => 'available', + 'required' => true, + 'array' => false, + 'default' => null, + 'size' => Database::LENGTH_KEY + ]; + + $oldAttributes[] = [ + 'key' => '$createdAt', + 'type' => Database::VAR_DATETIME, + 'status' => 'available', + 'signed' => false, + 'required' => false, + 'array' => false, + 'default' => null, + 'size' => 0 + ]; + + $oldAttributes[] = [ + 'key' => '$updatedAt', + 'type' => Database::VAR_DATETIME, + 'status' => 'available', + 'signed' => false, + 'required' => false, + 'array' => false, + 'default' => null, + 'size' => 0 + ]; + + $contextType = $this->getParentContext(); + foreach ($attributes as $i => $attribute) { + // find attribute metadata in collection document + $attributeIndex = \array_search($attribute, array_column($oldAttributes, 'key')); + + if ($attributeIndex === false) { + throw new Exception($this->getParentUnknownException(), "Unknown $contextType: " . $attribute . ". Verify the $contextType name or create the $contextType."); + } + + $attributeStatus = $oldAttributes[$attributeIndex]['status']; + $attributeType = $oldAttributes[$attributeIndex]['type']; + $attributeArray = $oldAttributes[$attributeIndex]['array'] ?? false; + + if ($attributeType === Database::VAR_RELATIONSHIP) { + throw new Exception($this->getParentInvalidTypeException(), "Cannot create an index for a relationship $contextType: " . $oldAttributes[$attributeIndex]['key']); + } + + // ensure attribute is available + if ($attributeStatus !== 'available') { + $contextType = ucfirst($contextType); + throw new Exception($this->getParentNotAvailableException(), "$contextType not available: " . $oldAttributes[$attributeIndex]['key']); + } + + if (empty($lengths[$i])) { + $lengths[$i] = null; + } + + if ($attributeArray === true) { + $lengths[$i] = Database::ARRAY_INDEX_LENGTH; + $orders[$i] = null; + } + } + + $index = new Document([ + '$id' => ID::custom($db->getSequence() . '_' . $collection->getSequence() . '_' . $key), + 'key' => $key, + 'status' => 'processing', // processing, available, failed, deleting, stuck + 'databaseInternalId' => $db->getSequence(), + 'databaseId' => $databaseId, + 'collectionInternalId' => $collection->getSequence(), + 'collectionId' => $collectionId, + 'type' => $type, + 'attributes' => $attributes, + 'lengths' => $lengths, + 'orders' => $orders, + ]); + + $maxIndexLength = $dbForProject->getAdapter()->getMaxIndexLength(); + $internalIndexesKeys = $dbForProject->getAdapter()->getInternalIndexesKeys(); + $supportForIndexArray = $dbForProject->getAdapter()->getSupportForIndexArray(); + $supportForSpatialAttributes = $dbForProject->getAdapter()->getSupportForSpatialAttributes(); + $supportForSpatialIndexNull = $dbForProject->getAdapter()->getSupportForSpatialIndexNull(); + $supportForSpatialIndexOrder = $dbForProject->getAdapter()->getSupportForSpatialIndexOrder(); + + $validator = new IndexValidator( + $collection->getAttribute('attributes'), + $maxIndexLength, + $internalIndexesKeys, + $supportForIndexArray, + $supportForSpatialAttributes, + $supportForSpatialIndexNull, + $supportForSpatialIndexOrder + ); + + if (!$validator->isValid($index)) { + throw new Exception($this->getInvalidTypeException(), $validator->getDescription()); + } + + try { + $index = $dbForProject->createDocument('indexes', $index); + } catch (DuplicateException) { + throw new Exception($this->getDuplicateException()); + } + + $dbForProject->purgeCachedDocument('database_' . $db->getSequence(), $collectionId); + + $queueForDatabase + ->setType(DATABASE_TYPE_CREATE_INDEX) + ->setDatabase($db); + + if ($this->isCollectionsAPI()) { + $queueForDatabase + ->setCollection($collection) + ->setDocument($index); + } else { + $queueForDatabase + ->setTable($collection) + ->setRow($index); + } + + $queueForEvents + ->setContext('database', $db) + ->setParam('databaseId', $databaseId) + ->setParam('indexId', $index->getId()) + ->setParam('collectionId', $collection->getId()) + ->setParam('tableId', $collection->getId()) + ->setContext($this->getCollectionsEventsContext(), $collection); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($index, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Delete.php new file mode 100644 index 0000000000..9ba4c98046 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Delete.php @@ -0,0 +1,128 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Delete extends Action +{ + public static function getName(): string + { + return 'deleteIndex'; + } + + /** + * 1. `SDKResponse` uses `UtopiaResponse::MODEL_NONE`. + * 2. But we later need the actual return type for events queue below! + */ + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_INDEX; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') + ->desc('Delete index') + ->groups(['api', 'database']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].update') + ->label('audits.event', 'index.delete') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/delete-index.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_NOCONTENT, + model: UtopiaResponse::MODEL_NONE, + ) + ], + contentType: ContentType::NONE, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.deleteIndex', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', '', new Key(), 'Index Key.') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + if ($db->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + $collection = $dbForProject->getDocument('database_' . $db->getSequence(), $collectionId); + + if ($collection->isEmpty()) { + // table or collection. + throw new Exception($this->getGrandParentNotFoundException()); + } + + $index = $dbForProject->getDocument('indexes', $db->getSequence() . '_' . $collection->getSequence() . '_' . $key); + + if (empty($index->getId())) { + throw new Exception($this->getNotFoundException()); + } + + // Only update status if removing available index + if ($index->getAttribute('status') === 'available') { + $index = $dbForProject->updateDocument('indexes', $index->getId(), $index->setAttribute('status', 'deleting')); + } + + $dbForProject->purgeCachedDocument('database_' . $db->getSequence(), $collectionId); + + $queueForDatabase + ->setType(DATABASE_TYPE_DELETE_INDEX) + ->setDatabase($db); + + if ($this->isCollectionsAPI()) { + $queueForDatabase + ->setCollection($collection) + ->setDocument($index); + } else { + $queueForDatabase + ->setTable($collection) + ->setRow($index); + } + + $queueForEvents + ->setContext('database', $db) + ->setParam('databaseId', $databaseId) + ->setParam('indexId', $index->getId()) + ->setParam('tableId', $collection->getId()) + ->setParam('collectionId', $collection->getId()) + ->setContext($this->getCollectionsEventsContext(), $collection) + ->setPayload($response->output($index, $this->getResponseModel())); + + $response->noContent(); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Get.php new file mode 100644 index 0000000000..9e05cc79c7 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Get.php @@ -0,0 +1,86 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Get extends Action +{ + public static function getName(): string + { + return 'getIndex'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_INDEX; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') + ->desc('Get index') + ->groups(['api', 'database']) + ->label('scope', 'collections.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/get-index.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.getIndex', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', null, new Key(), 'Index Key.') + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + + if ($collection->isEmpty()) { + // table or collection. + throw new Exception($this->getGrandParentNotFoundException()); + } + + $index = $collection->find('key', $key, 'indexes'); + if (empty($index)) { + throw new Exception($this->getNotFoundException()); + } + + $response->dynamic($index, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/XList.php new file mode 100644 index 0000000000..c0aa9457e7 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/XList.php @@ -0,0 +1,144 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Queries\Indexes; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Order as OrderException; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Query\Cursor; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class XList extends Action +{ + public static function getName(): string + { + return 'listIndexes'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_INDEX_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/indexes') + ->desc('List indexes') + ->groups(['api', 'database']) + ->label('scope', 'collections.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/list-indexes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.listIndexes', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('queries', [], new Indexes(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Indexes::ALLOWED_ATTRIBUTES), true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, array $queries, UtopiaResponse $response, Database $dbForProject): void + { + /** @var Document $database */ + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + + if ($collection->isEmpty()) { + // table or collection. + throw new Exception($this->getGrandParentNotFoundException()); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + \array_push( + $queries, + Query::equal('databaseId', [$databaseId]), + Query::equal('collectionId', [$collectionId]), + ); + + /** + * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries + */ + $cursor = \array_filter($queries, function ($query) { + return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); + }); + $cursor = reset($cursor); + + if ($cursor) { + $validator = new Cursor(); + if (!$validator->isValid($cursor)) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); + } + + $indexId = $cursor->getValue(); + $cursorDocument = Authorization::skip(fn () => $dbForProject->find('indexes', [ + Query::equal('collectionInternalId', [$collection->getSequence()]), + Query::equal('databaseInternalId', [$database->getSequence()]), + Query::equal('key', [$indexId]), + Query::limit(1) + ])); + + if (empty($cursorDocument) || $cursorDocument[0]->isEmpty()) { + throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Index '{$indexId}' for the 'cursor' value not found."); + } + + $cursor->setValue($cursorDocument[0]); + } + + try { + $total = $dbForProject->count('indexes', $queries, APP_LIMIT_COUNT); + $indexes = $dbForProject->find('indexes', $queries); + } catch (OrderException $e) { + $documents = $this->isCollectionsAPI() ? 'documents' : 'rows'; + $attribute = $this->isCollectionsAPI() ? 'attribute' : 'column'; + $message = "The order $attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all $documents order $attribute values are non-null."; + throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, $message); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + $response->dynamic(new Document([ + 'total' => $total, + 'indexes' => $indexes, + ]), $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php new file mode 100644 index 0000000000..1309793234 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php @@ -0,0 +1,164 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Logs; + +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use DeviceDetector\DeviceDetector as Detector; +use MaxMind\Db\Reader; +use Utopia\Audit\Audit; +use Utopia\Database\Database; +use Utopia\Database\DateTime; +use Utopia\Database\Document; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Queries; +use Utopia\Database\Validator\Query\Limit; +use Utopia\Database\Validator\Query\Offset; +use Utopia\Database\Validator\UID; +use Utopia\Locale\Locale; +use Utopia\Swoole\Response as SwooleResponse; + +class XList extends Action +{ + public static function getName(): string + { + return 'listCollectionLogs'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_LOG_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/logs') + ->desc('List collection logs') + ->groups(['api', 'database']) + ->label('scope', 'collections.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/get-collection-logs.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.listTableLogs', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) + ->inject('response') + ->inject('dbForProject') + ->inject('locale') + ->inject('geodb') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, array $queries, UtopiaResponse $response, Database $dbForProject, Locale $locale, Reader $geodb): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collectionDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + $collection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $collectionDocument->getSequence()); + + if ($collection->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + // Temp fix for logs + $queries[] = Query::or([ + Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))), + Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))), + ]); + + $audit = new Audit($dbForProject); + $context = $this->getContext(); + $resource = match ($context) { + TABLES => "database/$databaseId/grid/$context/$collectionId", + default => "database/$databaseId/$context/$collectionId", + }; + + $logs = $audit->getLogsByResource($resource, $queries); + + $output = []; + + foreach ($logs as $i => &$log) { + $log['userAgent'] = (!empty($log['userAgent'])) ? $log['userAgent'] : 'UNKNOWN'; + + $detector = new Detector($log['userAgent']); + $detector->skipBotDetection(); // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) + + $os = $detector->getOS(); + $client = $detector->getClient(); + $device = $detector->getDevice(); + + $output[$i] = new Document([ + 'event' => $log['event'], + 'userId' => $log['data']['userId'], + 'userEmail' => $log['data']['userEmail'] ?? null, + 'userName' => $log['data']['userName'] ?? null, + 'mode' => $log['data']['mode'] ?? null, + 'ip' => $log['ip'], + 'time' => $log['time'], + 'osCode' => $os['osCode'], + 'osName' => $os['osName'], + 'osVersion' => $os['osVersion'], + 'clientType' => $client['clientType'], + 'clientCode' => $client['clientCode'], + 'clientName' => $client['clientName'], + 'clientVersion' => $client['clientVersion'], + 'clientEngine' => $client['clientEngine'], + 'clientEngineVersion' => $client['clientEngineVersion'], + 'deviceName' => $device['deviceName'], + 'deviceBrand' => $device['deviceBrand'], + 'deviceModel' => $device['deviceModel'] + ]); + + $record = $geodb->get($log['ip']); + + if ($record) { + $output[$i]['countryCode'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), false) ? \strtolower($record['country']['iso_code']) : '--'; + $output[$i]['countryName'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), $locale->getText('locale.country.unknown')); + } else { + $output[$i]['countryCode'] = '--'; + $output[$i]['countryName'] = $locale->getText('locale.country.unknown'); + } + } + + $response->dynamic(new Document([ + 'logs' => $output, + 'total' => $audit->countLogsByResource($resource, $queries), + ]), $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php new file mode 100644 index 0000000000..5bf740d7d1 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php @@ -0,0 +1,115 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections; + +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Permissions; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Text; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateCollection'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_COLLECTION; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId') + ->desc('Update collection') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].update') + ->label('audits.event', 'collection.update') + ->label('audits.resource', 'database/{request.databaseId}/collections/{request.collectionId}') + ->label('sdk', new Method( + namespace: 'databases', + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-collection.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateTable', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('name', null, new Text(128), 'Collection name. Max length: 128 chars.') + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('documentSecurity', false, new Boolean(true), 'Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('enabled', true, new Boolean(), 'Is collection enabled? When set to \'disabled\', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $name, ?array $permissions, bool $documentSecurity, bool $enabled, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + if ($collection->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + $permissions ??= $collection->getPermissions(); + + // Map aggregate permissions into the multiple permissions they represent. + $permissions = Permission::aggregate($permissions); + + $enabled ??= $collection->getAttribute('enabled', true); + + $collection = $dbForProject->updateDocument( + 'database_' . $database->getSequence(), + $collectionId, + $collection + ->setAttribute('name', $name) + ->setAttribute('$permissions', $permissions) + ->setAttribute('documentSecurity', $documentSecurity) + ->setAttribute('enabled', $enabled) + ->setAttribute('search', \implode(' ', [$collectionId, $name])) + ); + + $dbForProject->updateCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $permissions, $documentSecurity); + + $queueForEvents + ->setContext('database', $database) + ->setParam('databaseId', $databaseId) + ->setParam($this->getEventsParamKey(), $collection->getId()); + + $response->dynamic($collection, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Usage/Get.php new file mode 100644 index 0000000000..9cf7b85267 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Usage/Get.php @@ -0,0 +1,141 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Usage; + +use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Action; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Config\Config; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\WhiteList; + +class Get extends Action +{ + public static function getName(): string + { + return 'getCollectionUsage'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_USAGE_COLLECTION; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/usage') + ->desc('Get collection usage stats') + ->groups(['api', 'database', 'usage']) + ->label('scope', 'collections.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + group: null, + name: self::getName(), + description: '/docs/references/databases/get-collection-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel() + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.getTableUsage', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) + ->param('collectionId', '', new UID(), 'Collection ID.') + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $range, string $collectionId, UtopiaResponse $response, Database $dbForProject): void + { + $database = $dbForProject->getDocument('databases', $databaseId); + $collectionDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + $collection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $collectionDocument->getSequence()); + + if ($collection->isEmpty()) { + throw new Exception($this->getNotFoundException()); + } + + $periods = Config::getParam('usage', []); + $stats = $usage = []; + $days = $periods[$range]; + $metrics = [ + str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getSequence(), $collectionDocument->getSequence()], METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS), + ]; + + Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + foreach ($metrics as $metric) { + $result = $dbForProject->findOne('stats', [ + Query::equal('metric', [$metric]), + Query::equal('period', ['inf']) + ]); + + $stats[$metric]['total'] = $result['value'] ?? 0; + $limit = $days['limit']; + $period = $days['period']; + $results = $dbForProject->find('stats', [ + Query::equal('metric', [$metric]), + Query::equal('period', [$period]), + Query::limit($limit), + Query::orderDesc('time'), + ]); + $stats[$metric]['data'] = []; + foreach ($results as $result) { + $stats[$metric]['data'][$result->getAttribute('time')] = [ + 'value' => $result->getAttribute('value'), + ]; + } + } + }); + + $format = match ($days['period']) { + '1h' => 'Y-m-d\TH:00:00.000P', + '1d' => 'Y-m-d\T00:00:00.000P', + }; + + foreach ($metrics as $metric) { + $usage[$metric]['total'] = $stats[$metric]['total']; + $usage[$metric]['data'] = []; + $leap = time() - ($days['limit'] * $days['factor']); + while ($leap < time()) { + $leap += $days['factor']; + $formatDate = date($format, $leap); + $usage[$metric]['data'][] = [ + 'value' => $stats[$metric]['data'][$formatDate]['value'] ?? 0, + 'date' => $formatDate, + ]; + } + } + + $prefix = $this->isCollectionsAPI() ? 'documents' : 'rows'; + + // prefix, prefixTotal + $usageDocument = new Document([ + 'range' => $range, + $prefix => $usage[$metrics[0]]['data'], + $prefix . 'Total' => $usage[$metrics[0]]['total'], + ]); + + $response->dynamic($usageDocument, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/XList.php new file mode 100644 index 0000000000..f2f7a2233a --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/XList.php @@ -0,0 +1,127 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Queries\Collections; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Order as OrderException; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Query\Cursor; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Text; + +class XList extends Action +{ + public static function getName(): string + { + return 'listCollections'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_COLLECTION_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/collections') + ->desc('List collections') + ->groups(['api', 'database']) + ->label('scope', 'collections.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/list-collections.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.listTables', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('queries', [], new Collections(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Collections::ALLOWED_ATTRIBUTES), true) + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } + + public function action(string $databaseId, array $queries, string $search, UtopiaResponse $response, Database $dbForProject): void + { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + if (!empty($search)) { + $queries[] = Query::search('search', $search); + } + + /** + * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries + */ + $cursor = \array_filter($queries, function ($query) { + return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); + }); + $cursor = reset($cursor); + + if ($cursor) { + $validator = new Cursor(); + if (!$validator->isValid($cursor)) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); + } + + $collectionIdId = $cursor->getValue(); + $cursorDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionIdId); + + if ($cursorDocument->isEmpty()) { + throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, ucfirst($this->getContext()) . " '$collectionIdId' for the 'cursor' value not found."); + } + + $cursor->setValue($cursorDocument); + } + + try { + $collections = $dbForProject->find('database_' . $database->getSequence(), $queries); + $total = $dbForProject->count('database_' . $database->getSequence(), $queries, APP_LIMIT_COUNT); + } catch (OrderException) { + throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL); + } catch (QueryException) { + throw new Exception(Exception::GENERAL_QUERY_INVALID); + } + + $response->dynamic(new Document([ + 'total' => $total, + $this->getSdkGroup() => $collections, + ]), $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Create.php new file mode 100644 index 0000000000..110ec99a9d --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Create.php @@ -0,0 +1,127 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases; + +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\CustomId; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Config\Config; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Duplicate as DuplicateException; +use Utopia\Database\Exception\Index as IndexException; +use Utopia\Database\Exception\Limit as LimitException; +use Utopia\Database\Exception\Structure as StructureException; +use Utopia\Database\Helpers\ID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Text; + +class Create extends Action +{ + public static function getName(): string + { + return 'createDatabase'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases') + ->desc('Create database') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].create') + ->label('scope', 'databases.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'database.create') + ->label('audits.resource', 'database/{response.$id}') + ->label('sdk', [ + new Method( + namespace: 'databases', + group: 'databases', + name: 'create', + description: '/docs/references/databases/create.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: UtopiaResponse::MODEL_DATABASE, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.create', + ) + ) + ]) + ->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') + ->param('name', '', new Text(128), 'Database name. Max length: 128 chars.') + ->param('enabled', true, new Boolean(), 'Is the database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $name, bool $enabled, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $databaseId = $databaseId == 'unique()' ? ID::unique() : $databaseId; + + try { + $dbForProject->createDocument('databases', new Document([ + '$id' => $databaseId, + 'name' => $name, + 'enabled' => $enabled, + 'search' => implode(' ', [$databaseId, $name]), + 'type' => $this->getDatabaseType(), + ])); + } catch (DuplicateException) { + throw new Exception(Exception::DATABASE_ALREADY_EXISTS); + } catch (StructureException $e) { + throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); + } + + $database = $dbForProject->getDocument('databases', $databaseId); + + $collections = (Config::getParam('collections', [])['databases'] ?? [])['collections'] ?? []; + if (empty($collections)) { + throw new Exception(Exception::GENERAL_SERVER_ERROR, 'The "collections" collection is not configured.'); + } + + $attributes = []; + foreach ($collections['attributes'] as $attribute) { + $attributes[] = new Document($attribute); + } + + $indexes = []; + foreach ($collections['indexes'] as $index) { + $indexes[] = new Document($index); + } + + try { + $dbForProject->createCollection('database_' . $database->getSequence(), $attributes, $indexes); + } catch (DuplicateException) { + throw new Exception(Exception::DATABASE_ALREADY_EXISTS); + } catch (IndexException) { + throw new Exception(Exception::INDEX_INVALID); + } catch (LimitException) { + // TODO: @Jake, how do we handle this collection/table? + // there's no context awareness at this level on what the api is. + throw new Exception(Exception::COLLECTION_LIMIT_EXCEEDED); + } + + $queueForEvents->setParam('databaseId', $database->getId()); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_CREATED) + ->dynamic($database, UtopiaResponse::MODEL_DATABASE); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Delete.php new file mode 100644 index 0000000000..7be96fa883 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Delete.php @@ -0,0 +1,92 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases; + +use Appwrite\Event\Database as EventDatabase; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\UID; +use Utopia\Platform\Action; +use Utopia\Swoole\Response as SwooleResponse; + +class Delete extends Action +{ + public static function getName(): string + { + return 'deleteDatabase'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/databases/:databaseId') + ->desc('Delete database') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'databases.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].delete') + ->label('audits.event', 'database.delete') + ->label('audits.resource', 'database/{request.databaseId}') + ->label('sdk', [ + new Method( + namespace: 'databases', + group: 'databases', + name: 'delete', + description: '/docs/references/databases/delete.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_NOCONTENT, + model: UtopiaResponse::MODEL_NONE, + ) + ], + contentType: ContentType::NONE, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.delete', + ) + ), + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } + + public function action(string $databaseId, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $database = $dbForProject->getDocument('databases', $databaseId); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + if (!$dbForProject->deleteDocument('databases', $databaseId)) { + throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove collection from DB'); + } + + $dbForProject->purgeCachedDocument('databases', $database->getId()); + $dbForProject->purgeCachedCollection('databases_' . $database->getSequence()); + + $queueForDatabase + ->setType(DATABASE_TYPE_DELETE_DATABASE) + ->setDatabase($database); + + $queueForEvents + ->setParam('databaseId', $database->getId()) + ->setPayload($response->output($database, UtopiaResponse::MODEL_DATABASE)); + + $response->noContent(); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Get.php new file mode 100644 index 0000000000..c4626c804c --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Get.php @@ -0,0 +1,69 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\UID; +use Utopia\Platform\Action; +use Utopia\Swoole\Response as SwooleResponse; + +class Get extends Action +{ + public static function getName(): string + { + return 'getDatabase'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId') + ->desc('Get database') + ->groups(['api', 'database']) + ->label('scope', 'databases.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', [ + new Method( + namespace: 'databases', + group: 'databases', + name: 'get', + description: '/docs/references/databases/get.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_DATABASE, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.get', + ) + ), + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } + + public function action(string $databaseId, UtopiaResponse $response, Database $dbForProject): void + { + $database = $dbForProject->getDocument('databases', $databaseId); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $response->dynamic($database, UtopiaResponse::MODEL_DATABASE); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Logs/XList.php new file mode 100644 index 0000000000..fd6ae05335 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Logs/XList.php @@ -0,0 +1,147 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Logs; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use DeviceDetector\DeviceDetector as Detector; +use MaxMind\Db\Reader; +use Utopia\Audit\Audit; +use Utopia\Database\Database; +use Utopia\Database\DateTime; +use Utopia\Database\Document; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Query; +use Utopia\Database\Validator\Queries; +use Utopia\Database\Validator\Query\Limit; +use Utopia\Database\Validator\Query\Offset; +use Utopia\Database\Validator\UID; +use Utopia\Locale\Locale; +use Utopia\Platform\Action; +use Utopia\Swoole\Response as SwooleResponse; + +class XList extends Action +{ + public static function getName(): string + { + return 'listDatabaseLogs'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/logs') + ->desc('List database logs') + ->groups(['api', 'database']) + ->label('scope', 'databases.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', [ + new Method( + namespace: 'databases', + group: 'logs', + name: 'listLogs', + description: '/docs/references/databases/get-logs.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_LOG_LIST, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.listDatabaseLogs', + ) + ), + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) + ->inject('response') + ->inject('dbForProject') + ->inject('locale') + ->inject('geodb') + ->callback($this->action(...)); + } + + public function action(string $databaseId, array $queries, UtopiaResponse $response, Database $dbForProject, Locale $locale, Reader $geodb): void + { + $database = $dbForProject->getDocument('databases', $databaseId); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + // Temp fix for logs + $queries[] = Query::or([ + Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))), + Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))), + ]); + + $audit = new Audit($dbForProject); + $resource = 'database/' . $databaseId; + $logs = $audit->getLogsByResource($resource, $queries); + + $output = []; + + foreach ($logs as $i => &$log) { + $log['userAgent'] = $log['userAgent'] ?: 'UNKNOWN'; + $detector = new Detector($log['userAgent']); + $detector->skipBotDetection(); + + $os = $detector->getOS(); + $client = $detector->getClient(); + $device = $detector->getDevice(); + + $output[$i] = new Document([ + 'event' => $log['event'], + 'userId' => ID::custom($log['data']['userId']), + 'userEmail' => $log['data']['userEmail'] ?? null, + 'userName' => $log['data']['userName'] ?? null, + 'mode' => $log['data']['mode'] ?? null, + 'ip' => $log['ip'], + 'time' => $log['time'], + 'osCode' => $os['osCode'], + 'osName' => $os['osName'], + 'osVersion' => $os['osVersion'], + 'clientType' => $client['clientType'], + 'clientCode' => $client['clientCode'], + 'clientName' => $client['clientName'], + 'clientVersion' => $client['clientVersion'], + 'clientEngine' => $client['clientEngine'], + 'clientEngineVersion' => $client['clientEngineVersion'], + 'deviceName' => $device['deviceName'], + 'deviceBrand' => $device['deviceBrand'], + 'deviceModel' => $device['deviceModel'], + ]); + + $record = $geodb->get($log['ip']); + if ($record) { + $countryCode = strtolower($record['country']['iso_code']); + $output[$i]['countryCode'] = $locale->getText("countries.{$countryCode}", false) ? $countryCode : '--'; + $output[$i]['countryName'] = $locale->getText("countries.{$countryCode}", $locale->getText('locale.country.unknown')); + } else { + $output[$i]['countryCode'] = '--'; + $output[$i]['countryName'] = $locale->getText('locale.country.unknown'); + } + } + + $response->dynamic(new Document([ + 'total' => $audit->countLogsByResource($resource, $queries), + 'logs' => $output, + ]), UtopiaResponse::MODEL_LOG_LIST); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Update.php new file mode 100644 index 0000000000..d3057c1ca5 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Update.php @@ -0,0 +1,85 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases; + +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\UID; +use Utopia\Platform\Action; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Text; + +class Update extends Action +{ + public static function getName(): string + { + return 'updateDatabase'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) + ->setHttpPath('/v1/databases/:databaseId') + ->desc('Update database') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'databases.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].update') + ->label('audits.event', 'database.update') + ->label('audits.resource', 'database/{response.$id}') + ->label('sdk', [ + new Method( + namespace: 'databases', + group: 'databases', + name: 'update', + description: '/docs/references/databases/update.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_DATABASE, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.update', + ) + ), + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('name', null, new Text(128), 'Database name. Max length: 128 chars.') + ->param('enabled', true, new Boolean(), 'Is database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $name, bool $enabled, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $database = $dbForProject->getDocument('databases', $databaseId); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $database = $dbForProject->updateDocument('databases', $databaseId, $database + ->setAttribute('name', $name) + ->setAttribute('enabled', $enabled) + ->setAttribute('search', implode(' ', [$databaseId, $name]))); + + $queueForEvents->setParam('databaseId', $database->getId()); + + $response->dynamic($database, UtopiaResponse::MODEL_DATABASE); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php new file mode 100644 index 0000000000..c9de9d5217 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php @@ -0,0 +1,146 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Usage; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Config\Config; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\UID; +use Utopia\Platform\Action; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\WhiteList; + +class Get extends Action +{ + public static function getName(): string + { + return 'getDatabaseUsage'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/:databaseId/usage') + ->desc('Get database usage stats') + ->groups(['api', 'database', 'usage']) + ->label('scope', 'collections.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', [ + new Method( + namespace: 'databases', + group: null, + name: 'getUsage', + description: '/docs/references/databases/get-database-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_USAGE_DATABASE, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.getUsage' + ) + ) + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $range, UtopiaResponse $response, Database $dbForProject): void + { + $database = $dbForProject->getDocument('databases', $databaseId); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $periods = Config::getParam('usage', []); + $stats = $usage = []; + $days = $periods[$range]; + $metrics = [ + str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_COLLECTIONS), + str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_DOCUMENTS), + str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_STORAGE), + str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_READS), + str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES) + ]; + + Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + foreach ($metrics as $metric) { + $result = $dbForProject->findOne('stats', [ + Query::equal('metric', [$metric]), + Query::equal('period', ['inf']) + ]); + + $stats[$metric]['total'] = $result['value'] ?? 0; + $limit = $days['limit']; + $period = $days['period']; + $results = $dbForProject->find('stats', [ + Query::equal('metric', [$metric]), + Query::equal('period', [$period]), + Query::limit($limit), + Query::orderDesc('time'), + ]); + $stats[$metric]['data'] = []; + foreach ($results as $result) { + $stats[$metric]['data'][$result->getAttribute('time')] = [ + 'value' => $result->getAttribute('value'), + ]; + } + } + }); + + $format = match ($days['period']) { + '1h' => 'Y-m-d\TH:00:00.000P', + '1d' => 'Y-m-d\T00:00:00.000P', + }; + + foreach ($metrics as $metric) { + $usage[$metric]['total'] = $stats[$metric]['total']; + $usage[$metric]['data'] = []; + $leap = time() - ($days['limit'] * $days['factor']); + while ($leap < time()) { + $leap += $days['factor']; + $formatDate = date($format, $leap); + $usage[$metric]['data'][] = [ + 'value' => $stats[$metric]['data'][$formatDate]['value'] ?? 0, + 'date' => $formatDate, + ]; + } + } + + $response->dynamic(new Document([ + 'range' => $range, + 'collectionsTotal' => $usage[$metrics[0]]['total'], + 'tablesTotal' => $usage[$metrics[0]]['total'], + 'documentsTotal' => $usage[$metrics[1]]['total'], + 'rowsTotal' => $usage[$metrics[1]]['total'], + 'storageTotal' => $usage[$metrics[2]]['total'], + 'databaseReadsTotal' => $usage[$metrics[3]]['total'], + 'databaseWritesTotal' => $usage[$metrics[4]]['total'], + 'collections' => $usage[$metrics[0]]['data'], + 'tables' => $usage[$metrics[0]]['data'], + 'documents' => $usage[$metrics[1]]['data'], + 'rows' => $usage[$metrics[1]]['data'], + 'storage' => $usage[$metrics[2]]['data'], + 'databaseReads' => $usage[$metrics[3]]['data'], + 'databaseWrites' => $usage[$metrics[4]]['data'], + ]), UtopiaResponse::MODEL_USAGE_DATABASE); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php new file mode 100644 index 0000000000..c13149cfc7 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php @@ -0,0 +1,140 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases\Usage; + +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Config\Config; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; +use Utopia\Platform\Action; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\WhiteList; + +class XList extends Action +{ + public static function getName(): string + { + return 'listDatabaseUsage'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases/usage') + ->desc('Get databases usage stats') + ->groups(['api', 'database', 'usage']) + ->label('scope', 'collections.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', [ + new Method( + namespace: 'databases', + group: null, + name: 'listUsage', + description: '/docs/references/databases/list-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_USAGE_DATABASES, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.listUsage' + ) + ), + ]) + ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } + + public function action(string $range, UtopiaResponse $response, Database $dbForProject): void + { + + $periods = Config::getParam('usage', []); + $stats = $usage = []; + $days = $periods[$range]; + $metrics = [ + METRIC_DATABASES, + METRIC_COLLECTIONS, + METRIC_DOCUMENTS, + METRIC_DATABASES_STORAGE, + METRIC_DATABASES_OPERATIONS_READS, + METRIC_DATABASES_OPERATIONS_WRITES, + ]; + + Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + foreach ($metrics as $metric) { + $result = $dbForProject->findOne('stats', [ + Query::equal('metric', [$metric]), + Query::equal('period', ['inf']) + ]); + + $stats[$metric]['total'] = $result['value'] ?? 0; + $limit = $days['limit']; + $period = $days['period']; + $results = $dbForProject->find('stats', [ + Query::equal('metric', [$metric]), + Query::equal('period', [$period]), + Query::limit($limit), + Query::orderDesc('time'), + ]); + $stats[$metric]['data'] = []; + foreach ($results as $result) { + $stats[$metric]['data'][$result->getAttribute('time')] = [ + 'value' => $result->getAttribute('value'), + ]; + } + } + }); + + $format = match ($days['period']) { + '1h' => 'Y-m-d\TH:00:00.000P', + '1d' => 'Y-m-d\T00:00:00.000P', + }; + + foreach ($metrics as $metric) { + $usage[$metric]['total'] = $stats[$metric]['total']; + $usage[$metric]['data'] = []; + $leap = time() - ($days['limit'] * $days['factor']); + while ($leap < time()) { + $leap += $days['factor']; + $formatDate = date($format, $leap); + $usage[$metric]['data'][] = [ + 'value' => $stats[$metric]['data'][$formatDate]['value'] ?? 0, + 'date' => $formatDate, + ]; + } + } + $response->dynamic(new Document([ + 'range' => $range, + 'databasesTotal' => $usage[$metrics[0]]['total'], + 'collectionsTotal' => $usage[$metrics[1]]['total'], + 'tablesTotal' => $usage[$metrics[1]]['total'], + 'documentsTotal' => $usage[$metrics[2]]['total'], + 'rowsTotal' => $usage[$metrics[2]]['total'], + 'storageTotal' => $usage[$metrics[3]]['total'], + 'databasesReadsTotal' => $usage[$metrics[4]]['total'], + 'databasesWritesTotal' => $usage[$metrics[5]]['total'], + 'databases' => $usage[$metrics[0]]['data'], + 'collections' => $usage[$metrics[1]]['data'], + 'tables' => $usage[$metrics[1]]['data'], + 'documents' => $usage[$metrics[2]]['data'], + 'rows' => $usage[$metrics[2]]['data'], + 'storage' => $usage[$metrics[3]]['data'], + 'databasesReads' => $usage[$metrics[4]]['data'], + 'databasesWrites' => $usage[$metrics[5]]['data'], + ]), UtopiaResponse::MODEL_USAGE_DATABASES); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/XList.php new file mode 100644 index 0000000000..d7c6245e5c --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/XList.php @@ -0,0 +1,113 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Databases; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Deprecated; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Queries\Databases; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Order as OrderException; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Query\Cursor; +use Utopia\Platform\Action; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Text; + +class XList extends Action +{ + public static function getName(): string + { + return 'listDatabases'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/databases') + ->desc('List databases') + ->groups(['api', 'database']) + ->label('scope', 'databases.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', [ + new Method( + namespace: 'databases', + group: 'databases', + name: 'list', + description: '/docs/references/databases/list.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_DATABASE_LIST, + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.list', + ) + ), + ]) + ->param('queries', [], new Databases(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Databases::ALLOWED_ATTRIBUTES), true) + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } + + public function action(array $queries, string $search, UtopiaResponse $response, Database $dbForProject): void + { + $queries = Query::parseQueries($queries); + + if (!empty($search)) { + $queries[] = Query::search('search', $search); + } + + /** + * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries + */ + $cursor = \array_filter($queries, function ($query) { + return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); + }); + $cursor = reset($cursor); + if ($cursor) { + /** @var Query $cursor */ + + $validator = new Cursor(); + if (!$validator->isValid($cursor)) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); + } + + $databaseId = $cursor->getValue(); + $cursorDocument = $dbForProject->getDocument('databases', $databaseId); + + if ($cursorDocument->isEmpty()) { + throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Database '{$databaseId}' for the 'cursor' value not found."); + } + + $cursor->setValue($cursorDocument); + } + + try { + $databases = $dbForProject->find('databases', $queries); + $total = $dbForProject->count('databases', $queries, APP_LIMIT_COUNT); + } catch (OrderException $e) { + throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order column '{$e->getAttribute()}' had a null value. Cursor pagination requires all rows order column values are non-null."); + } catch (QueryException) { + throw new Exception(Exception::GENERAL_QUERY_INVALID); + } + + $response->dynamic(new Document([ + 'databases' => $databases, + 'total' => $total, + ]), UtopiaResponse::MODEL_DATABASE_LIST); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Init/Timeout.php b/src/Appwrite/Platform/Modules/Databases/Http/Init/Timeout.php new file mode 100644 index 0000000000..19e202981b --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Init/Timeout.php @@ -0,0 +1,35 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\Init; + +use Appwrite\Utopia\Request; +use Utopia\App; +use Utopia\Database\Database; +use Utopia\Platform\Action; + +/** + * Project database timeout, + */ +class Timeout extends Action +{ + public static function getName(): string + { + return 'projectDatabaseTimeout'; + } + + public function __construct() + { + $this + ->setType(Action::TYPE_INIT) + ->groups(['api', 'database']) + ->inject('request') + ->inject('dbForProject') + ->callback(function (Request $request, Database $dbForProject) { + $timeout = \intval($request->getHeader('x-appwrite-timeout')); + + if (!empty($timeout) && App::isDevelopment()) { + $dbForProject->setTimeout($timeout); + } + }); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Create.php new file mode 100644 index 0000000000..8993f00368 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Create.php @@ -0,0 +1,57 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Create as DatabaseCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\CustomId; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Text; + +class Create extends DatabaseCreate +{ + public static function getName(): string + { + return 'createTablesDatabase'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb') + ->desc('Create database') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].create') + ->label('scope', 'databases.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'database.create') + ->label('audits.resource', 'database/{response.$id}') + ->label('sdk', new Method( + namespace: 'tablesDB', + group: 'tablesdb', + name: 'create', + description: '/docs/references/tablesdb/create.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: UtopiaResponse::MODEL_DATABASE, + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') + ->param('name', '', new Text(128), 'Database name. Max length: 128 chars.') + ->param('enabled', true, new Boolean(), 'Is the database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Delete.php new file mode 100644 index 0000000000..0a6cb3cd87 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Delete.php @@ -0,0 +1,55 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Delete as DatabaseDelete; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Delete extends DatabaseDelete +{ + public static function getName(): string + { + return 'deleteTablesDatabase'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/tablesdb/:databaseId') + ->desc('Delete database') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'databases.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].delete') + ->label('audits.event', 'database.delete') + ->label('audits.resource', 'database/{request.databaseId}') + ->label('sdk', new Method( + namespace: 'tablesDB', + group: 'tablesdb', + name: 'delete', + description: '/docs/references/tablesdb/delete.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_NOCONTENT, + model: UtopiaResponse::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Get.php new file mode 100644 index 0000000000..9690f25370 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Get.php @@ -0,0 +1,49 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Get as DatabaseGet; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Get extends DatabaseGet +{ + public static function getName(): string + { + return 'getTablesDatabase'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId') + ->desc('Get database') + ->groups(['api', 'database']) + ->label('scope', 'databases.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'tablesDB', + group: 'tablesdb', + name: 'get', + description: '/docs/references/tablesdb/get.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_DATABASE, + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Logs/XList.php new file mode 100644 index 0000000000..02403fe472 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Logs/XList.php @@ -0,0 +1,142 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Logs; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use DeviceDetector\DeviceDetector as Detector; +use MaxMind\Db\Reader; +use Utopia\Audit\Audit; +use Utopia\Database\Database; +use Utopia\Database\DateTime; +use Utopia\Database\Document; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Query; +use Utopia\Database\Validator\Queries; +use Utopia\Database\Validator\Query\Limit; +use Utopia\Database\Validator\Query\Offset; +use Utopia\Database\Validator\UID; +use Utopia\Locale\Locale; +use Utopia\Platform\Action; +use Utopia\Swoole\Response as SwooleResponse; + +class XList extends Action +{ + public static function getName(): string + { + return 'listLogs'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/logs') + ->desc('List database logs') + ->groups(['api', 'database']) + ->label('scope', 'databases.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', [ + new Method( + namespace: 'tablesDB', + group: 'logs', + name: 'listDatabaseLogs', + description: '/docs/references/tablesdb/get-logs.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_LOG_LIST, + ) + ], + contentType: ContentType::JSON + ), + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) + ->inject('response') + ->inject('dbForProject') + ->inject('locale') + ->inject('geodb') + ->callback($this->action(...)); + } + + public function action(string $databaseId, array $queries, UtopiaResponse $response, Database $dbForProject, Locale $locale, Reader $geodb): void + { + $database = $dbForProject->getDocument('databases', $databaseId); + + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + // Temp fix for logs + $queries[] = Query::or([ + Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))), + Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))), + ]); + + $audit = new Audit($dbForProject); + $resource = 'database/' . $databaseId; + $logs = $audit->getLogsByResource($resource, $queries); + + $output = []; + + foreach ($logs as $i => &$log) { + $log['userAgent'] = $log['userAgent'] ?: 'UNKNOWN'; + $detector = new Detector($log['userAgent']); + $detector->skipBotDetection(); + + $os = $detector->getOS(); + $client = $detector->getClient(); + $device = $detector->getDevice(); + + $output[$i] = new Document([ + 'event' => $log['event'], + 'userId' => ID::custom($log['data']['userId']), + 'userEmail' => $log['data']['userEmail'] ?? null, + 'userName' => $log['data']['userName'] ?? null, + 'mode' => $log['data']['mode'] ?? null, + 'ip' => $log['ip'], + 'time' => $log['time'], + 'osCode' => $os['osCode'], + 'osName' => $os['osName'], + 'osVersion' => $os['osVersion'], + 'clientType' => $client['clientType'], + 'clientCode' => $client['clientCode'], + 'clientName' => $client['clientName'], + 'clientVersion' => $client['clientVersion'], + 'clientEngine' => $client['clientEngine'], + 'clientEngineVersion' => $client['clientEngineVersion'], + 'deviceName' => $device['deviceName'], + 'deviceBrand' => $device['deviceBrand'], + 'deviceModel' => $device['deviceModel'], + ]); + + $record = $geodb->get($log['ip']); + if ($record) { + $countryCode = strtolower($record['country']['iso_code']); + $output[$i]['countryCode'] = $locale->getText("countries.{$countryCode}", false) ? $countryCode : '--'; + $output[$i]['countryName'] = $locale->getText("countries.{$countryCode}", $locale->getText('locale.country.unknown')); + } else { + $output[$i]['countryCode'] = '--'; + $output[$i]['countryName'] = $locale->getText('locale.country.unknown'); + } + } + + $response->dynamic(new Document([ + 'total' => $audit->countLogsByResource($resource, $queries), + 'logs' => $output, + ]), UtopiaResponse::MODEL_LOG_LIST); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Create.php new file mode 100644 index 0000000000..5222d2e133 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Create.php @@ -0,0 +1,64 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Boolean; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Boolean\Create as BooleanCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; + +class Create extends BooleanCreate +{ + public static function getName(): string + { + return 'createBooleanColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_BOOLEAN; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/boolean') + ->desc('Create boolean column') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-boolean-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Boolean(), 'Default value for column when not provided. Cannot be set when column is required.', true) + ->param('array', false, new Boolean(), 'Is column an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Update.php new file mode 100644 index 0000000000..3c6ef50813 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Update.php @@ -0,0 +1,66 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Boolean; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Boolean\Update as BooleanUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends BooleanUpdate +{ + public static function getName(): string + { + return 'updateBooleanColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_BOOLEAN; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/boolean/:key') + ->desc('Update boolean column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-boolean-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new Boolean()), 'Default value for column when not provided. Cannot be set when column is required.') + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Create.php new file mode 100644 index 0000000000..9598278ffc --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Create.php @@ -0,0 +1,66 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Datetime; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Datetime\Create as DatetimeCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Datetime as DatetimeValidator; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; + +class Create extends DatetimeCreate +{ + public static function getName(): string + { + return 'createDatetimeColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_DATETIME; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/datetime') + ->desc('Create datetime column') + ->groups(['api', 'database']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-datetime-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, fn (Database $dbForProject) => new DatetimeValidator($dbForProject->getAdapter()->getMinDateTime(), $dbForProject->getAdapter()->getMaxDateTime()), 'Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.', true, ['dbForProject']) + ->param('array', false, new Boolean(), 'Is column an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Update.php new file mode 100644 index 0000000000..d7b5ec2448 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Update.php @@ -0,0 +1,68 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Datetime; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Datetime\Update as DatetimeUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Datetime as DatetimeValidator; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends DatetimeUpdate +{ + public static function getName(): string + { + return 'updateDatetimeColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_DATETIME; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/datetime/:key') + ->desc('Update dateTime column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-datetime-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, fn (Database $dbForProject) => new Nullable(new DatetimeValidator($dbForProject->getAdapter()->getMinDateTime(), $dbForProject->getAdapter()->getMaxDateTime())), 'Default value for column when not provided. Cannot be set when column is required.', injections: ['dbForProject']) + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Delete.php new file mode 100644 index 0000000000..50a148ce19 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Delete.php @@ -0,0 +1,63 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Delete as AttributesDelete; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Delete extends AttributesDelete +{ + public static function getName(): string + { + return 'deleteColumn'; + } + + // parent handles multiple model types internally + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_NONE; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/:key') + ->desc('Delete column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.delete') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/delete-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_NOCONTENT, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::NONE + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Create.php new file mode 100644 index 0000000000..e28a216fff --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Create.php @@ -0,0 +1,65 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Email; + +use Appwrite\Network\Validator\Email; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Email\Create as EmailCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; + +class Create extends EmailCreate +{ + public static function getName(): string + { + return 'createEmailColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_EMAIL; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/email') + ->desc('Create email column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-email-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Email(), 'Default value for column when not provided. Cannot be set when column is required.', true) + ->param('array', false, new Boolean(), 'Is column an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Update.php new file mode 100644 index 0000000000..0fb856acb9 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Update.php @@ -0,0 +1,67 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Email; + +use Appwrite\Network\Validator\Email; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Email\Update as EmailUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends EmailUpdate +{ + public static function getName(): string + { + return 'updateEmailColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_EMAIL; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/email/:key') + ->desc('Update email column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-email-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new Email()), 'Default value for column when not provided. Cannot be set when column is required.') + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Create.php new file mode 100644 index 0000000000..5b9d89c7e9 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Create.php @@ -0,0 +1,68 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Enum; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Enum\Create as EnumCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Boolean; +use Utopia\Validator\Text; + +class Create extends EnumCreate +{ + public static function getName(): string + { + return 'createEnumColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_ENUM; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/enum') + ->desc('Create enum column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-enum-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('elements', [], new ArrayList(new Text(Database::LENGTH_KEY), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of enum values.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Text(0), 'Default value for column when not provided. Cannot be set when column is required.', true) + ->param('array', false, new Boolean(), 'Is column an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Update.php new file mode 100644 index 0000000000..0c00e3f268 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Update.php @@ -0,0 +1,70 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Enum; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Enum\Update as EnumUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; +use Utopia\Validator\Text; + +class Update extends EnumUpdate +{ + public static function getName(): string + { + return 'updateEnumColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_ENUM; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/enum/:key') + ->desc('Update enum column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-enum-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('elements', null, new ArrayList(new Text(Database::LENGTH_KEY), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Updated list of enum values.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new Text(0)), 'Default value for column when not provided. Cannot be set when column is required.') + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Create.php new file mode 100644 index 0000000000..5967b00196 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Create.php @@ -0,0 +1,67 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Float; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Float\Create as FloatCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\FloatValidator; + +class Create extends FloatCreate +{ + public static function getName(): string + { + return 'createFloatColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_FLOAT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/float') + ->desc('Create float column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-float-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('min', null, new FloatValidator(), 'Minimum value', true) + ->param('max', null, new FloatValidator(), 'Maximum value', true) + ->param('default', null, new FloatValidator(), 'Default value. Cannot be set when required.', true) + ->param('array', false, new Boolean(), 'Is column an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Update.php new file mode 100644 index 0000000000..9486b3a75c --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Update.php @@ -0,0 +1,69 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Float; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Float\Update as FloatUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\FloatValidator; +use Utopia\Validator\Nullable; + +class Update extends FloatUpdate +{ + public static function getName(): string + { + return 'updateFloatColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_FLOAT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/float/:key') + ->desc('Update float column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-float-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('min', null, new FloatValidator(), 'Minimum value', true) + ->param('max', null, new FloatValidator(), 'Maximum value', true) + ->param('default', null, new Nullable(new FloatValidator()), 'Default value. Cannot be set when required.') + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Get.php new file mode 100644 index 0000000000..d536a7aaf2 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Get.php @@ -0,0 +1,66 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Get as AttributesGet; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Get extends AttributesGet +{ + public static function getName(): string + { + return 'getColumn'; + } + + protected function getResponseModel(): string|array + { + return [ + UtopiaResponse::MODEL_COLUMN_BOOLEAN, + UtopiaResponse::MODEL_COLUMN_INTEGER, + UtopiaResponse::MODEL_COLUMN_FLOAT, + UtopiaResponse::MODEL_COLUMN_EMAIL, + UtopiaResponse::MODEL_COLUMN_ENUM, + UtopiaResponse::MODEL_COLUMN_URL, + UtopiaResponse::MODEL_COLUMN_IP, + UtopiaResponse::MODEL_COLUMN_DATETIME, + UtopiaResponse::MODEL_COLUMN_RELATIONSHIP, + UtopiaResponse::MODEL_COLUMN_STRING, + ]; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/:key') + ->desc('Get column') + ->groups(['api', 'database']) + ->label('scope', ['tables.read', 'collections.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/get-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel() + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Create.php new file mode 100644 index 0000000000..325a9382e5 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Create.php @@ -0,0 +1,65 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\IP; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\IP\Create as IPCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\IP; + +class Create extends IPCreate +{ + public static function getName(): string + { + return 'createIpColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_IP; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/ip') + ->desc('Create IP address column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-ip-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new IP(), 'Default value. Cannot be set when column is required.', true) + ->param('array', false, new Boolean(), 'Is column an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Update.php new file mode 100644 index 0000000000..b9e6368307 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Update.php @@ -0,0 +1,67 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\IP; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\IP\Update as IPUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\IP; +use Utopia\Validator\Nullable; + +class Update extends IPUpdate +{ + public static function getName(): string + { + return 'updateIpColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_IP; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/ip/:key') + ->desc('Update IP address column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-ip-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new IP()), 'Default value. Cannot be set when column is required.') + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Create.php new file mode 100644 index 0000000000..bd6fec3f53 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Create.php @@ -0,0 +1,67 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Integer; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Integer\Create as IntegerCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Integer; + +class Create extends IntegerCreate +{ + public static function getName(): string + { + return 'createIntegerColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_INTEGER; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/integer') + ->desc('Create integer column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-integer-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('min', null, new Integer(), 'Minimum value', true) + ->param('max', null, new Integer(), 'Maximum value', true) + ->param('default', null, new Integer(), 'Default value. Cannot be set when column is required.', true) + ->param('array', false, new Boolean(), 'Is column an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Update.php new file mode 100644 index 0000000000..be92811d1b --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Update.php @@ -0,0 +1,69 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Integer; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Integer\Update as IntegerUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Integer; +use Utopia\Validator\Nullable; + +class Update extends IntegerUpdate +{ + public static function getName(): string + { + return 'updateIntegerColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_INTEGER; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/integer/:key') + ->desc('Update integer column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-integer-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('min', null, new Integer(), 'Minimum value', true) + ->param('max', null, new Integer(), 'Maximum value', true) + ->param('default', null, new Nullable(new Integer()), 'Default value. Cannot be set when column is required.') + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php new file mode 100644 index 0000000000..f60d4dd5b8 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php @@ -0,0 +1,66 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Line; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Line\Create as LineCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Create extends LineCreate +{ + public static function getName(): string + { + return 'createLineColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_LINE; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/line') + ->desc('Create line column') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-line-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php new file mode 100644 index 0000000000..19c6df202d --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php @@ -0,0 +1,68 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Line; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Line\Update as LineUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends LineUpdate +{ + public static function getName(): string + { + return 'updateLineColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_LINE; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/line/:key') + ->desc('Update line column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-line-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.', true) + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php new file mode 100644 index 0000000000..47d97e8077 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php @@ -0,0 +1,66 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Point; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Point\Create as PointCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Create extends PointCreate +{ + public static function getName(): string + { + return 'createPointColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_POINT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/point') + ->desc('Create point column') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-point-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php new file mode 100644 index 0000000000..2e98bf2cf9 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php @@ -0,0 +1,68 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Point; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Point\Update as PointUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends PointUpdate +{ + public static function getName(): string + { + return 'updatePointColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_POINT; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/point/:key') + ->desc('Update point column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-point-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.', true) + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php new file mode 100644 index 0000000000..371d5f8fd5 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php @@ -0,0 +1,66 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Polygon; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Polygon\Create as PolygonCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Create extends PolygonCreate +{ + public static function getName(): string + { + return 'createPolygonColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_POLYGON; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/polygon') + ->desc('Create polygon column') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-polygon-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php new file mode 100644 index 0000000000..c5654b77d4 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php @@ -0,0 +1,68 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Polygon; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Polygon\Update as PolygonUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; + +class Update extends PolygonUpdate +{ + public static function getName(): string + { + return 'updatePolygonColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_POLYGON; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/polygon/:key') + ->desc('Update polygon column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-polygon-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.', true) + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Create.php new file mode 100644 index 0000000000..b6f9663f77 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Create.php @@ -0,0 +1,77 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Relationship; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Relationship\Create as RelationshipCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\WhiteList; + +class Create extends RelationshipCreate +{ + public static function getName(): string + { + return 'createRelationshipColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_RELATIONSHIP; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/relationship') + ->desc('Create relationship column') + ->groups(['api', 'database']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-relationship-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel() + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('relatedTableId', '', new UID(), 'Related Table ID.') + ->param('type', '', new WhiteList([ + Database::RELATION_ONE_TO_ONE, + Database::RELATION_MANY_TO_ONE, + Database::RELATION_MANY_TO_MANY, + Database::RELATION_ONE_TO_MANY + ], true), 'Relation type') + ->param('twoWay', false, new Boolean(), 'Is Two Way?', true) + ->param('key', null, new Key(), 'Column Key.', true) + ->param('twoWayKey', null, new Key(), 'Two Way Column Key.', true) + ->param('onDelete', Database::RELATION_MUTATE_RESTRICT, new WhiteList([ + Database::RELATION_MUTATE_CASCADE, + Database::RELATION_MUTATE_RESTRICT, + Database::RELATION_MUTATE_SET_NULL + ], true), 'Constraints option', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Update.php new file mode 100644 index 0000000000..421e11af91 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Update.php @@ -0,0 +1,69 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Relationship; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Relationship\Update as RelationshipUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\WhiteList; + +class Update extends RelationshipUpdate +{ + public static function getName(): string + { + return 'updateRelationshipColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_RELATIONSHIP; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/:key/relationship') + ->desc('Update relationship column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-relationship-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel() + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('onDelete', null, new WhiteList([ + Database::RELATION_MUTATE_CASCADE, + Database::RELATION_MUTATE_RESTRICT, + Database::RELATION_MUTATE_SET_NULL + ], true), 'Constraints option', true) + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Create.php new file mode 100644 index 0000000000..14f0c8321e --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Create.php @@ -0,0 +1,70 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\String; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\String\Create as StringCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator; +use Utopia\Validator\Boolean; +use Utopia\Validator\Range; +use Utopia\Validator\Text; + +class Create extends StringCreate +{ + public static function getName(): string + { + return 'createStringColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_STRING; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/string') + ->desc('Create string column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-string-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel() + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('size', null, new Range(1, APP_DATABASE_ATTRIBUTE_STRING_MAX_LENGTH, Validator::TYPE_INTEGER), 'Column size for text columns, in number of characters.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Text(0, 0), 'Default value for column when not provided. Cannot be set when column is required.', true) + ->param('array', false, new Boolean(), 'Is column an array?', true) + ->param('encrypt', false, new Boolean(), 'Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->inject('plan') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Update.php new file mode 100644 index 0000000000..fc45557f3b --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Update.php @@ -0,0 +1,70 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\String; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\String\Update as StringUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; +use Utopia\Validator\Range; +use Utopia\Validator\Text; + +class Update extends StringUpdate +{ + public static function getName(): string + { + return 'updateStringColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_STRING; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/string/:key') + ->desc('Update string column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-string-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new Text(0, 0)), 'Default value for column when not provided. Cannot be set when column is required.') + ->param('size', null, new Range(1, APP_DATABASE_ATTRIBUTE_STRING_MAX_LENGTH, Validator::TYPE_INTEGER), 'Maximum size of the string column.', true) + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Create.php new file mode 100644 index 0000000000..bc53ad5250 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Create.php @@ -0,0 +1,65 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\URL; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\URL\Create as URLCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\URL; + +class Create extends URLCreate +{ + public static function getName(): string + { + return 'createUrlColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_URL; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/url') + ->desc('Create URL column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-url-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new URL(), 'Default value for column when not provided. Cannot be set when column is required.', true) + ->param('array', false, new Boolean(), 'Is column an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Update.php new file mode 100644 index 0000000000..36bd7dc054 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Update.php @@ -0,0 +1,67 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\URL; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\URL\Update as URLUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Nullable; +use Utopia\Validator\URL; + +class Update extends URLUpdate +{ + public static function getName(): string + { + return 'updateUrlColumn'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_URL; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/url/:key') + ->desc('Update URL column') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-url-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new URL()), 'Default value for column when not provided. Cannot be set when column is required.') + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/XList.php new file mode 100644 index 0000000000..ca41bb024d --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/XList.php @@ -0,0 +1,55 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\XList as AttributesXList; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Queries\Columns; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class XList extends AttributesXList +{ + public static function getName(): string + { + return 'listColumns'; + } + + protected function getResponseModel(): string|array + { + return UtopiaResponse::MODEL_COLUMN_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns') + ->desc('List columns') + ->groups(['api', 'database']) + ->label('scope', ['tables.read', 'collections.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/list-columns.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel() + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('queries', [], new Columns(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following columns: ' . implode(', ', Columns::ALLOWED_COLUMNS), true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Create.php new file mode 100644 index 0000000000..3965e12a74 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Create.php @@ -0,0 +1,67 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Create as CollectionCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\CustomId; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Permissions; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Text; + +class Create extends CollectionCreate +{ + public static function getName(): string + { + return 'createTable'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_TABLE; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables') + ->desc('Create table') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].tables.[tableId].create') + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'table.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{response.$id}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: 'tables', + name: self::getName(), + description: '/docs/references/tablesdb/create-table.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') + ->param('name', '', new Text(128), 'Table name. Max length: 128 chars.') + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('rowSecurity', false, new Boolean(true), 'Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('enabled', true, new Boolean(), 'Is table enabled? When set to \'disabled\', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Delete.php new file mode 100644 index 0000000000..9bfdf42cef --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Delete.php @@ -0,0 +1,60 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Delete as CollectionDelete; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Delete extends CollectionDelete +{ + public static function getName(): string + { + return 'deleteTable'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_TABLE; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId') + ->desc('Delete table') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].delete') + ->label('audits.event', 'table.delete') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: 'tables', + name: self::getName(), + description: '/docs/references/tablesdb/delete-table.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_NOCONTENT, + model: UtopiaResponse::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Get.php new file mode 100644 index 0000000000..a7d33478f7 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Get.php @@ -0,0 +1,55 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Get as CollectionGet; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Get extends CollectionGet +{ + public static function getName(): string + { + return 'getTable'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_TABLE; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId') + ->desc('Get table') + ->groups(['api', 'database']) + ->label('scope', ['tables.read', 'collections.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: 'tables', + name: self::getName(), + description: '/docs/references/tablesdb/get-table.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Create.php new file mode 100644 index 0000000000..a2a5c8b453 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Create.php @@ -0,0 +1,71 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Indexes; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Create as IndexCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Integer; +use Utopia\Validator\Nullable; +use Utopia\Validator\WhiteList; + +class Create extends IndexCreate +{ + public static function getName(): string + { + return 'createColumnIndex'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_COLUMN_INDEX; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/indexes') + ->desc('Create index') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].tables.[tableId].indexes.[indexId].create') + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'index.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: 'createIndex', // getName needs to be different from parent action to avoid conflict in path name + description: '/docs/references/tablesdb/create-index.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', null, new Key(), 'Index Key.') + ->param('type', null, new WhiteList([Database::INDEX_KEY, Database::INDEX_FULLTEXT, Database::INDEX_UNIQUE, Database::INDEX_SPATIAL]), 'Index type.') + ->param('columns', null, new ArrayList(new Key(true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of columns to index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' columns are allowed, each 32 characters long.') + ->param('orders', [], new ArrayList(new WhiteList(['ASC', 'DESC'], false, Database::VAR_STRING), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of index orders. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' orders are allowed.', true) + ->param('lengths', [], new ArrayList(new Nullable(new Integer()), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Length of index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE, optional: true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Delete.php new file mode 100644 index 0000000000..586bad78f4 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Delete.php @@ -0,0 +1,66 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Indexes; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Delete as IndexDelete; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Delete extends IndexDelete +{ + public static function getName(): string + { + return 'deleteColumnIndex'; + } + + /** + * 1. `SDKResponse` uses `UtopiaResponse::MODEL_NONE`. + * 2. But we later need the actual return type for events queue below! + */ + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_COLUMN_INDEX; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/indexes/:key') + ->desc('Delete index') + ->groups(['api', 'database']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].indexes.[indexId].update') + ->label('audits.event', 'index.delete') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: 'deleteIndex', // getName needs to be different from parent action to avoid conflict in path name + description: '/docs/references/tablesdb/delete-index.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_NOCONTENT, + model: UtopiaResponse::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Index Key.') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Get.php new file mode 100644 index 0000000000..3f2978b547 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Get.php @@ -0,0 +1,57 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Indexes; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Get as IndexGet; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Get extends IndexGet +{ + public static function getName(): string + { + return 'getColumnIndex'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_COLUMN_INDEX; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/indexes/:key') + ->desc('Get index') + ->groups(['api', 'database']) + ->label('scope', ['tables.read', 'collections.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: 'getIndex', // getName needs to be different from parent action to avoid conflict in path name + description: '/docs/references/tablesdb/get-index.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', null, new Key(), 'Index Key.') + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/XList.php new file mode 100644 index 0000000000..c275fd2771 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/XList.php @@ -0,0 +1,57 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Indexes; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\XList as IndexXList; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Queries\Indexes; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class XList extends IndexXList +{ + public static function getName(): string + { + return 'listColumnIndexes'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_COLUMN_INDEX_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/indexes') + ->desc('List indexes') + ->groups(['api', 'database']) + ->label('scope', ['tables.read', 'collections.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: 'listIndexes', // getName needs to be different from parent action to avoid conflict in path name + description: '/docs/references/tablesdb/list-indexes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('queries', [], new Indexes(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following columns: ' . implode(', ', Indexes::ALLOWED_ATTRIBUTES), true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Logs/XList.php new file mode 100644 index 0000000000..6d386df4f6 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Logs/XList.php @@ -0,0 +1,55 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Logs; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Logs\XList as CollectionLogXList; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Utopia\Database\Validator\Queries; +use Utopia\Database\Validator\Query\Limit; +use Utopia\Database\Validator\Query\Offset; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class XList extends CollectionLogXList +{ + public static function getName(): string + { + return 'listTableLogs'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/logs') + ->desc('List table logs') + ->groups(['api', 'database']) + ->label('scope', ['tables.read', 'collections.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/get-table-logs.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) + ->inject('response') + ->inject('dbForProject') + ->inject('locale') + ->inject('geodb') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Delete.php new file mode 100644 index 0000000000..c9729d714d --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Delete.php @@ -0,0 +1,69 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Bulk; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Delete as DocumentsDelete; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Text; + +class Delete extends DocumentsDelete +{ + public static function getName(): string + { + return 'deleteRows'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_ROW_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows') + ->desc('Delete rows') + ->groups(['api', 'database']) + ->label('scope', ['rows.write', 'documents.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'rows.delete') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/delete-rows.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForStatsUsage') + ->inject('queueForEvents') + ->inject('queueForRealtime') + ->inject('queueForFunctions') + ->inject('queueForWebhooks') + ->inject('plan') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Update.php new file mode 100644 index 0000000000..13778b9474 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Update.php @@ -0,0 +1,71 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Bulk; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Update as DocumentsUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\JSON; +use Utopia\Validator\Text; + +class Update extends DocumentsUpdate +{ + public static function getName(): string + { + return 'updateRows'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_ROW_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows') + ->desc('Update rows') + ->groups(['api', 'database']) + ->label('scope', ['rows.write', 'documents.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'rows.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-rows.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('data', [], new JSON(), 'Row data as JSON object. Include only column and value pairs to be updated.', true) + ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForStatsUsage') + ->inject('queueForEvents') + ->inject('queueForRealtime') + ->inject('queueForFunctions') + ->inject('queueForWebhooks') + ->inject('plan') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php new file mode 100644 index 0000000000..26c5c8030c --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php @@ -0,0 +1,71 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Bulk; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Upsert as DocumentsUpsert; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\JSON; + +class Upsert extends DocumentsUpsert +{ + public static function getName(): string + { + return 'upsertRows'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_ROW_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows') + ->desc('Upsert rows') + ->groups(['api', 'database']) + ->label('scope', ['rows.write', 'documents.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'row.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', [ + new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/upsert-rows.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + ) + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('rows', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of row data as JSON objects. May contain partial rows.', false, ['plan']) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForStatsUsage') + ->inject('queueForEvents') + ->inject('queueForRealtime') + ->inject('queueForFunctions') + ->inject('queueForWebhooks') + ->inject('plan') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Decrement.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Decrement.php new file mode 100644 index 0000000000..46e9c8d6af --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Decrement.php @@ -0,0 +1,69 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Column; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Attribute\Decrement as DecrementDocumentAttribute; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Numeric; + +class Decrement extends DecrementDocumentAttribute +{ + public static function getName(): string + { + return 'decrementRowColumn'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_ROW; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows/:rowId/:column/decrement') + ->desc('Decrement row column') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].tables.[tableId].rows.[rowId].update') + ->label('scope', ['rows.write', 'documents.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'rows.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/decrement-row-column.md', + auth: [AuthType::SESSION, AuthType::JWT, AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('rowId', '', new UID(), 'Row ID.') + ->param('column', '', new Key(), 'Column key.') + ->param('value', 1, new Numeric(), 'Value to increment the column by. The value must be a number.', true) + ->param('min', null, new Numeric(), 'Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Increment.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Increment.php new file mode 100644 index 0000000000..d921e9b8be --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Increment.php @@ -0,0 +1,69 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Column; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Attribute\Increment as IncrementDocumentAttribute; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Numeric; + +class Increment extends IncrementDocumentAttribute +{ + public static function getName(): string + { + return 'incrementRowColumn'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_ROW; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows/:rowId/:column/increment') + ->desc('Increment row column') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].tables.[tableId].rows.[rowId].update') + ->label('scope', ['rows.write', 'documents.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'rows.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/increment-row-column.md', + auth: [AuthType::SESSION, AuthType::JWT, AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('rowId', '', new UID(), 'Row ID.') + ->param('column', '', new Key(), 'Column key.') + ->param('value', 1, new Numeric(), 'Value to increment the column by. The value must be a number.', true) + ->param('max', null, new Numeric(), 'Maximum value for the column. If the current value is greater than this value, an error will be thrown.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Create.php new file mode 100644 index 0000000000..cf38bac63b --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Create.php @@ -0,0 +1,111 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Create as DocumentCreate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Parameter; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\CustomId; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Permissions; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\JSON; + +class Create extends DocumentCreate +{ + public static function getName(): string + { + return 'createRow'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_ROW; + } + + protected function getBulkResponseModel(): string + { + return UtopiaResponse::MODEL_ROW_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows') + ->desc('Create row') + ->groups(['api', 'database']) + ->label('scope', ['rows.write', 'documents.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'row.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', [ + new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + desc: 'Create row', + description: '/docs/references/tablesdb/create-row.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + parameters: [ + new Parameter('databaseId', optional: false), + new Parameter('tableId', optional: false), + new Parameter('rowId', optional: false), + new Parameter('data', optional: false), + new Parameter('permissions', optional: true), + ] + ), + new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: $this->getBulkActionName(self::getName()), + desc: 'Create rows', + description: '/docs/references/tablesdb/create-rows.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: $this->getBulkResponseModel(), + ) + ], + contentType: ContentType::JSON, + parameters: [ + new Parameter('databaseId', optional: false), + new Parameter('tableId', optional: false), + new Parameter('rows', optional: false), + ] + ) + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('rowId', '', new CustomId(), 'Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.') + ->param('data', [], new JSON(), 'Row data as JSON object.', true, example: '{"username":"walter.obrien","email":"walter.obrien@example.com","fullName":"Walter O\'Brien","age":30,"isAdmin":false}') + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('rows', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of rows data as JSON objects.', true, ['plan']) + ->inject('response') + ->inject('dbForProject') + ->inject('user') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->inject('queueForRealtime') + ->inject('queueForFunctions') + ->inject('queueForWebhooks') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Delete.php new file mode 100644 index 0000000000..7ac954c5dd --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Delete.php @@ -0,0 +1,71 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Delete as DocumentDelete; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class Delete extends DocumentDelete +{ + public static function getName(): string + { + return 'deleteRow'; + } + + /** + * Same explanation as the parent action. + * + * 1. `SDKResponse` uses `UtopiaResponse::MODEL_NONE`. + * 2. But we later need the actual return type for events queue below! + */ + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_ROW; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows/:rowId') + ->desc('Delete row') + ->groups(['api', 'database']) + ->label('scope', ['rows.write', 'documents.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].rows.[rowId].delete') + ->label('audits.event', 'row.delete') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}/row/{request.rowId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/delete-row.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_NOCONTENT, + model: UtopiaResponse::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('rowId', '', new UID(), 'Row ID.') + ->inject('requestTimestamp') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Get.php new file mode 100644 index 0000000000..5704f75d82 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Get.php @@ -0,0 +1,60 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Get as DocumentGet; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Text; + +class Get extends DocumentGet +{ + public static function getName(): string + { + return 'getRow'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_ROW; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows/:rowId') + ->desc('Get row') + ->groups(['api', 'database']) + ->label('scope', ['rows.read', 'documents.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/get-row.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('rowId', '', new UID(), 'Row ID.') + ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Logs/XList.php new file mode 100644 index 0000000000..a80249070b --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Logs/XList.php @@ -0,0 +1,56 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Logs; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Logs\XList as DocumentLogXList; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Utopia\Database\Validator\Queries; +use Utopia\Database\Validator\Query\Limit; +use Utopia\Database\Validator\Query\Offset; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; + +class XList extends DocumentLogXList +{ + public static function getName(): string + { + return 'listRowLogs'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows/:rowId/logs') + ->desc('List row logs') + ->groups(['api', 'database']) + ->label('scope', ['rows.read', 'documents.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: 'logs', + name: self::getName(), + description: '/docs/references/tablesdb/get-row-logs.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('rowId', '', new UID(), 'Row ID.') + ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) + ->inject('response') + ->inject('dbForProject') + ->inject('locale') + ->inject('geodb') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Update.php new file mode 100644 index 0000000000..b0e321b262 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Update.php @@ -0,0 +1,70 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Update as DocumentUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Permissions; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\JSON; + +class Update extends DocumentUpdate +{ + public static function getName(): string + { + return 'updateRow'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_ROW; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows/:rowId') + ->desc('Update row') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].tables.[tableId].rows.[rowId].update') + ->label('scope', ['rows.write', 'documents.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'row.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}/row/{response.$id}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-row.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('rowId', '', new UID(), 'Row ID.') + ->param('data', [], new JSON(), 'Row data as JSON object. Include only columns and value pairs to be updated.', true) + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->inject('requestTimestamp') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Upsert.php new file mode 100644 index 0000000000..c2695379e3 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Upsert.php @@ -0,0 +1,73 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Upsert as DocumentUpsert; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; +use Utopia\Database\Validator\Permissions; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\JSON; + +class Upsert extends DocumentUpsert +{ + public static function getName(): string + { + return 'upsertRow'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_ROW; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows/:rowId') + ->desc('Upsert a row') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].tables.[tableId].rows.[rowId].upsert') + ->label('scope', ['rows.write', 'documents.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'row.upsert') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}/row/{response.$id}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', [ + new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/upsert-row.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_CREATED, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + ), + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('rowId', '', new UID(), 'Row ID.') + ->param('data', [], new JSON(), 'Row data as JSON object. Include all required columns of the row to be created or updated.', true) + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->inject('requestTimestamp') + ->inject('response') + ->inject('user') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/XList.php new file mode 100644 index 0000000000..5d503f1c59 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/XList.php @@ -0,0 +1,59 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\XList as DocumentXList; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\ArrayList; +use Utopia\Validator\Text; + +class XList extends DocumentXList +{ + public static function getName(): string + { + return 'listRows'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_ROW_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/rows') + ->desc('List rows') + ->groups(['api', 'database']) + ->label('scope', ['rows.read', 'documents.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/list-rows.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TableDB service [server integration](https://appwrite.io/docs/server/tablesdbdb#tablesdbCreate).') + ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForStatsUsage') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Update.php new file mode 100644 index 0000000000..0fcdf319d2 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Update.php @@ -0,0 +1,66 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Update as CollectionUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\Permissions; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Text; + +class Update extends CollectionUpdate +{ + public static function getName(): string + { + return 'updateTable'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_TABLE; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId') + ->desc('Update table') + ->groups(['api', 'database', 'schema']) + ->label('scope', ['tables.write', 'collections.write']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].update') + ->label('audits.event', 'table.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: 'tables', + name: self::getName(), + description: '/docs/references/tablesdb/update-table.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_TABLE, + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID.') + ->param('name', null, new Text(128), 'Table name. Max length: 128 chars.') + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('rowSecurity', false, new Boolean(true), 'Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('enabled', true, new Boolean(), 'Is table enabled? When set to \'disabled\', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Usage/Get.php new file mode 100644 index 0000000000..87f720e689 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Usage/Get.php @@ -0,0 +1,57 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Usage; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Usage\Get as CollectionUsageGet; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\WhiteList; + +class Get extends CollectionUsageGet +{ + public static function getName(): string + { + return 'getTableUsage'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_USAGE_TABLE; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/usage') + ->desc('Get table usage stats') + ->groups(['api', 'database', 'usage']) + ->label('scope', ['tables.read', 'collections.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: null, + name: self::getName(), + description: '/docs/references/tablesdb/get-table-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) + ->param('tableId', '', new UID(), 'Table ID.') + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/XList.php new file mode 100644 index 0000000000..d9a92e41b1 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/XList.php @@ -0,0 +1,58 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\XList as CollectionXList; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Queries\Tables; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Text; + +class XList extends CollectionXList +{ + public static function getName(): string + { + return 'listTables'; + } + + protected function getResponseModel(): string + { + return UtopiaResponse::MODEL_TABLE_LIST; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/tables') + ->desc('List tables') + ->groups(['api', 'database']) + ->label('scope', ['tables.read', 'collections.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: 'tables', + name: self::getName(), + description: '/docs/references/tablesdb/list-tables.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('queries', [], new Tables(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following columns: ' . implode(', ', Tables::ALLOWED_COLUMNS), true) + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Update.php new file mode 100644 index 0000000000..10d4284947 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Update.php @@ -0,0 +1,57 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Update as DatabaseUpdate; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\Text; + +class Update extends DatabaseUpdate +{ + public static function getName(): string + { + return 'updateTablesDatabase'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) + ->setHttpPath('/v1/tablesdb/:databaseId') + ->desc('Update database') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'databases.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].update') + ->label('audits.event', 'database.update') + ->label('audits.resource', 'database/{response.$id}') + ->label('sdk', new Method( + namespace: 'tablesDB', + group: 'tablesdb', + name: 'update', + description: '/docs/references/tablesdb/update.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_DATABASE, + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('name', null, new Text(128), 'Database name. Max length: 128 chars.') + ->param('enabled', true, new Boolean(), 'Is database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/Get.php new file mode 100644 index 0000000000..89b9fbd8c2 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/Get.php @@ -0,0 +1,53 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Usage; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\Get as DatabaseUsageGet; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Validator\UID; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\WhiteList; + +class Get extends DatabaseUsageGet +{ + public static function getName(): string + { + return 'getTablesDBUsage'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/:databaseId/usage') + ->desc('Get TablesDB usage stats') + ->groups(['api', 'database', 'usage']) + ->label('scope', ['tables.read', 'collections.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', [ + new Method( + namespace: 'tablesDB', + group: null, + name: 'getUsage', + description: '/docs/references/tablesdb/get-database-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_USAGE_DATABASE, + ) + ], + contentType: ContentType::JSON, + ), + ]) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/XList.php new file mode 100644 index 0000000000..0bd96fc40a --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/XList.php @@ -0,0 +1,51 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB\Usage; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\XList as DatabaseUsageXList; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\WhiteList; + +class XList extends DatabaseUsageXList +{ + public static function getName(): string + { + return 'listTablesDBUsage'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb/usage') + ->desc('Get TablesDB usage stats') + ->groups(['api', 'database', 'usage']) + ->label('scope', ['tables.read', 'collections.read']) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', [ + new Method( + namespace: 'tablesDB', + group: null, + name: 'listUsage', + description: '/docs/references/tablesdb/list-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_USAGE_DATABASES, + ) + ], + contentType: ContentType::JSON + ), + ]) + ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/XList.php new file mode 100644 index 0000000000..4d28834d31 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/XList.php @@ -0,0 +1,51 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Http\TablesDB; + +use Appwrite\Platform\Modules\Databases\Http\Databases\XList as DatabaseXList; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Queries\Databases; +use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Text; + +class XList extends DatabaseXList +{ + public static function getName(): string + { + return 'listTablesDatabases'; + } + + public function __construct() + { + $this + ->setHttpMethod(self::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tablesdb') + ->desc('List databases') + ->groups(['api', 'database']) + ->label('scope', 'databases.read') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'tablesDB', + group: 'tablesdb', + name: 'list', + description: '/docs/references/tablesdb/list.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: UtopiaResponse::MODEL_DATABASE_LIST, + ) + ], + contentType: ContentType::JSON + )) + ->param('queries', [], new Databases(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following columns: ' . implode(', ', Databases::ALLOWED_ATTRIBUTES), true) + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->inject('response') + ->inject('dbForProject') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Module.php b/src/Appwrite/Platform/Modules/Databases/Module.php new file mode 100644 index 0000000000..bf336413d4 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Module.php @@ -0,0 +1,18 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases; + +require_once __DIR__ . '/Constants.php'; + +use Appwrite\Platform\Modules\Databases\Services\Http; +use Appwrite\Platform\Modules\Databases\Services\Workers; +use Utopia\Platform; + +class Module extends Platform\Module +{ + public function __construct() + { + $this->addService('http', new Http()); + $this->addService('workers', new Workers()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Services/Http.php b/src/Appwrite/Platform/Modules/Databases/Services/Http.php new file mode 100644 index 0000000000..ccd9dfd140 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Services/Http.php @@ -0,0 +1,27 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Services; + +use Appwrite\Platform\Modules\Databases\Http\Init\Timeout; +use Appwrite\Platform\Modules\Databases\Services\Registry\Collections as CollectionsRegistry; +use Appwrite\Platform\Modules\Databases\Services\Registry\Databases as DatabasesRegistry; +use Appwrite\Platform\Modules\Databases\Services\Registry\Tables as TablesRegistry; +use Utopia\Platform\Service; + +class Http extends Service +{ + public function __construct() + { + $this->type = Service::TYPE_HTTP; + + $this->addAction(Timeout::getName(), new Timeout()); + + foreach ([ + DatabasesRegistry::class, + CollectionsRegistry::class, + TablesRegistry::class, + ] as $registrar) { + new $registrar($this); + } + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Services/Registry/Base.php b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Base.php new file mode 100644 index 0000000000..43bc4b2959 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Base.php @@ -0,0 +1,24 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Services\Registry; + +use Utopia\Platform\Service; + +/** + * Abstract base class for service registrars in the Databases module. + */ +abstract class Base +{ + /** + * Constructs the registrar and triggers the registration of actions. + */ + public function __construct(Service $service) + { + $this->register($service); + } + + /** + * Register all HTTP actions related to this module. + */ + abstract protected function register(Service $service): void; +} diff --git a/src/Appwrite/Platform/Modules/Databases/Services/Registry/Collections.php b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Collections.php new file mode 100644 index 0000000000..404f784611 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Collections.php @@ -0,0 +1,173 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Services\Registry; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Boolean\Create as CreateBooleanAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Boolean\Update as UpdateBooleanAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Datetime\Create as CreateDatetimeAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Datetime\Update as UpdateDatetimeAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Delete as DeleteAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Email\Create as CreateEmailAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Email\Update as UpdateEmailAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Enum\Create as CreateEnumAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Enum\Update as UpdateEnumAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Float\Create as CreateFloatAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Float\Update as UpdateFloatAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Get as GetAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Integer\Create as CreateIntegerAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Integer\Update as UpdateIntegerAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\IP\Create as CreateIPAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\IP\Update as UpdateIPAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Line\Create as CreateLineAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Line\Update as UpdateLineAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Point\Create as CreatePointAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Point\Update as UpdatePointAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Polygon\Create as CreatePolygonAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Polygon\Update as UpdatePolygonAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Relationship\Create as CreateRelationshipAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Relationship\Update as UpdateRelationshipAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\String\Create as CreateStringAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\String\Update as UpdateStringAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\URL\Create as CreateURLAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\URL\Update as UpdateURLAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\XList as ListAttributes; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Create as CreateCollection; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Delete as DeleteCollection; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Attribute\Decrement as DecrementDocumentAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Attribute\Increment as IncrementDocumentAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Delete as DeleteDocuments; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Update as UpdateDocuments; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Upsert as UpsertDocuments; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Create as CreateDocument; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Delete as DeleteDocument; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Get as GetDocument; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Logs\XList as ListDocumentLogs; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Update as UpdateDocument; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Upsert as UpsertDocument; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\XList as ListDocuments; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Get as GetCollection; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Create as CreateIndex; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Delete as DeleteIndex; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Get as GetIndex; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\XList as ListIndexes; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Logs\XList as ListCollectionLogs; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Update as UpdateCollection; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Usage\Get as GetCollectionUsage; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\XList as ListCollections; +use Utopia\Platform\Service; + +/** + * Registers all HTTP actions related to collections in the database module. + * + * This includes: + * - Collections + * - Documents + * - Attributes + * - Indexes + */ +class Collections extends Base +{ + protected function register(Service $service): void + { + $this->registerCollectionActions($service); + $this->registerDocumentActions($service); + $this->registerAttributeActions($service); + $this->registerIndexActions($service); + } + + private function registerCollectionActions(Service $service): void + { + $service->addAction(CreateCollection::getName(), new CreateCollection()); + $service->addAction(GetCollection::getName(), new GetCollection()); + $service->addAction(UpdateCollection::getName(), new UpdateCollection()); + $service->addAction(DeleteCollection::getName(), new DeleteCollection()); + $service->addAction(ListCollections::getName(), new ListCollections()); + $service->addAction(ListCollectionLogs::getName(), new ListCollectionLogs()); + $service->addAction(GetCollectionUsage::getName(), new GetCollectionUsage()); + } + + private function registerDocumentActions(Service $service): void + { + $service->addAction(CreateDocument::getName(), new CreateDocument()); + $service->addAction(GetDocument::getName(), new GetDocument()); + $service->addAction(UpdateDocument::getName(), new UpdateDocument()); + $service->addAction(UpdateDocuments::getName(), new UpdateDocuments()); + $service->addAction(UpsertDocument::getName(), new UpsertDocument()); + $service->addAction(UpsertDocuments::getName(), new UpsertDocuments()); + $service->addAction(DeleteDocument::getName(), new DeleteDocument()); + $service->addAction(DeleteDocuments::getName(), new DeleteDocuments()); + $service->addAction(ListDocuments::getName(), new ListDocuments()); + $service->addAction(ListDocumentLogs::getName(), new ListDocumentLogs()); + $service->addAction(IncrementDocumentAttribute::getName(), new IncrementDocumentAttribute()); + $service->addAction(DecrementDocumentAttribute::getName(), new DecrementDocumentAttribute()); + + } + + private function registerAttributeActions(Service $service): void + { + // Attribute top-level actions + $service->addAction(GetAttribute::getName(), new GetAttribute()); + $service->addAction(DeleteAttribute::getName(), new DeleteAttribute()); + $service->addAction(ListAttributes::getName(), new ListAttributes()); + + // Attribute: Boolean + $service->addAction(CreateBooleanAttribute::getName(), new CreateBooleanAttribute()); + $service->addAction(UpdateBooleanAttribute::getName(), new UpdateBooleanAttribute()); + + // Attribute: Datetime + $service->addAction(CreateDatetimeAttribute::getName(), new CreateDatetimeAttribute()); + $service->addAction(UpdateDatetimeAttribute::getName(), new UpdateDatetimeAttribute()); + + // Attribute: Email + $service->addAction(CreateEmailAttribute::getName(), new CreateEmailAttribute()); + $service->addAction(UpdateEmailAttribute::getName(), new UpdateEmailAttribute()); + + // Attribute: Enum + $service->addAction(CreateEnumAttribute::getName(), new CreateEnumAttribute()); + $service->addAction(UpdateEnumAttribute::getName(), new UpdateEnumAttribute()); + + // Attribute: Float + $service->addAction(CreateFloatAttribute::getName(), new CreateFloatAttribute()); + $service->addAction(UpdateFloatAttribute::getName(), new UpdateFloatAttribute()); + + // Attribute: Integer + $service->addAction(CreateIntegerAttribute::getName(), new CreateIntegerAttribute()); + $service->addAction(UpdateIntegerAttribute::getName(), new UpdateIntegerAttribute()); + + // Attribute: IP + $service->addAction(CreateIPAttribute::getName(), new CreateIPAttribute()); + $service->addAction(UpdateIPAttribute::getName(), new UpdateIPAttribute()); + + // Attribute: Line + $service->addAction(CreateLineAttribute::getName(), new CreateLineAttribute()); + $service->addAction(UpdateLineAttribute::getName(), new UpdateLineAttribute()); + + // Attribute: Point + $service->addAction(CreatePointAttribute::getName(), new CreatePointAttribute()); + $service->addAction(UpdatePointAttribute::getName(), new UpdatePointAttribute()); + + // Attribute: Polygon + $service->addAction(CreatePolygonAttribute::getName(), new CreatePolygonAttribute()); + $service->addAction(UpdatePolygonAttribute::getName(), new UpdatePolygonAttribute()); + + // Attribute: Relationship + $service->addAction(CreateRelationshipAttribute::getName(), new CreateRelationshipAttribute()); + $service->addAction(UpdateRelationshipAttribute::getName(), new UpdateRelationshipAttribute()); + + // Attribute: String + $service->addAction(CreateStringAttribute::getName(), new CreateStringAttribute()); + $service->addAction(UpdateStringAttribute::getName(), new UpdateStringAttribute()); + + // Attribute: URL + $service->addAction(CreateURLAttribute::getName(), new CreateURLAttribute()); + $service->addAction(UpdateURLAttribute::getName(), new UpdateURLAttribute()); + } + + private function registerIndexActions(Service $service): void + { + $service->addAction(CreateIndex::getName(), new CreateIndex()); + $service->addAction(GetIndex::getName(), new GetIndex()); + $service->addAction(DeleteIndex::getName(), new DeleteIndex()); + $service->addAction(ListIndexes::getName(), new ListIndexes()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Services/Registry/Databases.php b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Databases.php new file mode 100644 index 0000000000..81c9174253 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Databases.php @@ -0,0 +1,31 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Services\Registry; + +use Appwrite\Platform\Modules\Databases\Http\Databases\Create as CreateDatabase; +use Appwrite\Platform\Modules\Databases\Http\Databases\Delete as DeleteDatabase; +use Appwrite\Platform\Modules\Databases\Http\Databases\Get as GetDatabase; +use Appwrite\Platform\Modules\Databases\Http\Databases\Logs\XList as ListDatabaseLogs; +use Appwrite\Platform\Modules\Databases\Http\Databases\Update as UpdateDatabase; +use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\Get as GetDatabaseUsage; +use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\XList as ListDatabaseUsage; +use Appwrite\Platform\Modules\Databases\Http\Databases\XList as ListDatabases; +use Utopia\Platform\Service; + +/** + * Registers all HTTP actions related to database in the module. + */ +class Databases extends Base +{ + public function register(Service $service): void + { + $service->addAction(CreateDatabase::getName(), new CreateDatabase()); + $service->addAction(GetDatabase::getName(), new GetDatabase()); + $service->addAction(UpdateDatabase::getName(), new UpdateDatabase()); + $service->addAction(DeleteDatabase::getName(), new DeleteDatabase()); + $service->addAction(ListDatabases::getName(), new ListDatabases()); + $service->addAction(ListDatabaseLogs::getName(), new ListDatabaseLogs()); + $service->addAction(GetDatabaseUsage::getName(), new GetDatabaseUsage()); + $service->addAction(ListDatabaseUsage::getName(), new ListDatabaseUsage()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Services/Registry/Tables.php b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Tables.php new file mode 100644 index 0000000000..d570745148 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Tables.php @@ -0,0 +1,191 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Services\Registry; + +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Create as CreateTablesDatabase; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Delete as DeleteTablesDatabase; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Get as GetTablesDatabase; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Boolean\Create as CreateBoolean; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Boolean\Update as UpdateBoolean; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Datetime\Create as CreateDatetime; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Datetime\Update as UpdateDatetime; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Delete as DeleteColumn; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Email\Create as CreateEmail; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Email\Update as UpdateEmail; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Enum\Create as CreateEnum; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Enum\Update as UpdateEnum; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Float\Create as CreateFloat; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Float\Update as UpdateFloat; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Get as GetColumn; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Integer\Create as CreateInteger; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Integer\Update as UpdateInteger; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\IP\Create as CreateIP; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\IP\Update as UpdateIP; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Line\Create as CreateLine; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Line\Update as UpdateLine; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Point\Create as CreatePoint; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Point\Update as UpdatePoint; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Polygon\Create as CreatePolygon; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Polygon\Update as UpdatePolygon; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Relationship\Create as CreateRelationship; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Relationship\Update as UpdateRelationship; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\String\Create as CreateString; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\String\Update as UpdateString; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\URL\Create as CreateURL; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\URL\Update as UpdateURL; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\XList as ListColumns; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Create as CreateTable; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Delete as DeleteTable; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Get as GetTable; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Indexes\Create as CreateColumnIndex; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Indexes\Delete as DeleteColumnIndex; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Indexes\Get as GetColumnIndex; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Indexes\XList as ListColumnIndexes; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Logs\XList as ListTableLogs; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Bulk\Delete as DeleteRows; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Bulk\Update as UpdateRows; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Bulk\Upsert as UpsertRows; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Column\Decrement as DecrementRowColumn; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Column\Increment as IncrementRowColumn; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Create as CreateRow; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Delete as DeleteRow; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Get as GetRow; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Logs\XList as ListRowLogs; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Update as UpdateRow; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\Upsert as UpsertRow; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Rows\XList as ListRows; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Update as UpdateTable; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Usage\Get as GetTableUsage; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\XList as ListTables; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Update as UpdateTablesDatabase; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Usage\Get as GetTablesDatabaseUsage; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Usage\XList as ListTablesDatabaseUsage; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\XList as ListTablesDatabase; +use Utopia\Platform\Service; + +/** + * Registers all HTTP actions related to tables in the database module. + * + * This includes: + * - Tables + * - Rows + * - Columns + * - Column-Indexes + */ +class Tables extends Base +{ + protected function register(Service $service): void + { + $this->registerDatabaseActions($service); + $this->registerTableActions($service); + $this->registerColumnActions($service); + $this->registerIndexActions($service); + $this->registerRowActions($service); + } + + private function registerDatabaseActions(Service $service): void + { + $service->addAction(CreateTablesDatabase::getName(), new CreateTablesDatabase()); + $service->addAction(GetTablesDatabase::getName(), new GetTablesDatabase()); + $service->addAction(UpdateTablesDatabase::getName(), new UpdateTablesDatabase()); + $service->addAction(DeleteTablesDatabase::getName(), new DeleteTablesDatabase()); + $service->addAction(ListTablesDatabase::getName(), new ListTablesDatabase()); + $service->addAction(GetTablesDatabaseUsage::getName(), new GetTablesDatabaseUsage()); + $service->addAction(ListTablesDatabaseUsage::getName(), new ListTablesDatabaseUsage()); + } + + private function registerTableActions(Service $service): void + { + $service->addAction(CreateTable::getName(), new CreateTable()); + $service->addAction(GetTable::getName(), new GetTable()); + $service->addAction(UpdateTable::getName(), new UpdateTable()); + $service->addAction(DeleteTable::getName(), new DeleteTable()); + $service->addAction(ListTables::getName(), new ListTables()); + $service->addAction(ListTableLogs::getName(), new ListTableLogs()); + $service->addAction(GetTableUsage::getName(), new GetTableUsage()); + } + + private function registerColumnActions(Service $service): void + { + // Column top level actions + $service->addAction(GetColumn::getName(), new GetColumn()); + $service->addAction(DeleteColumn::getName(), new DeleteColumn()); + $service->addAction(ListColumns::getName(), new ListColumns()); + + // Column: Boolean + $service->addAction(CreateBoolean::getName(), new CreateBoolean()); + $service->addAction(UpdateBoolean::getName(), new UpdateBoolean()); + + // Column: Datetime + $service->addAction(CreateDatetime::getName(), new CreateDatetime()); + $service->addAction(UpdateDatetime::getName(), new UpdateDatetime()); + + // Column: Email + $service->addAction(CreateEmail::getName(), new CreateEmail()); + $service->addAction(UpdateEmail::getName(), new UpdateEmail()); + + // Column: Enum + $service->addAction(CreateEnum::getName(), new CreateEnum()); + $service->addAction(UpdateEnum::getName(), new UpdateEnum()); + + // Column: Float + $service->addAction(CreateFloat::getName(), new CreateFloat()); + $service->addAction(UpdateFloat::getName(), new UpdateFloat()); + + // Column: Integer + $service->addAction(CreateInteger::getName(), new CreateInteger()); + $service->addAction(UpdateInteger::getName(), new UpdateInteger()); + + // Column: IP + $service->addAction(CreateIP::getName(), new CreateIP()); + $service->addAction(UpdateIP::getName(), new UpdateIP()); + + // Column: Line + $service->addAction(CreateLine::getName(), new CreateLine()); + $service->addAction(UpdateLine::getName(), new UpdateLine()); + + // Column: Point + $service->addAction(CreatePoint::getName(), new CreatePoint()); + $service->addAction(UpdatePoint::getName(), new UpdatePoint()); + + // Column: Polygon + $service->addAction(CreatePolygon::getName(), new CreatePolygon()); + $service->addAction(UpdatePolygon::getName(), new UpdatePolygon()); + + // Column: Relationship + $service->addAction(CreateRelationship::getName(), new CreateRelationship()); + $service->addAction(UpdateRelationship::getName(), new UpdateRelationship()); + + // Column: String + $service->addAction(CreateString::getName(), new CreateString()); + $service->addAction(UpdateString::getName(), new UpdateString()); + + // Column: URL + $service->addAction(CreateURL::getName(), new CreateURL()); + $service->addAction(UpdateURL::getName(), new UpdateURL()); + } + + private function registerIndexActions(Service $service): void + { + $service->addAction(CreateColumnIndex::getName(), new CreateColumnIndex()); + $service->addAction(GetColumnIndex::getName(), new GetColumnIndex()); + $service->addAction(DeleteColumnIndex::getName(), new DeleteColumnIndex()); + $service->addAction(ListColumnIndexes::getName(), new ListColumnIndexes()); + } + + private function registerRowActions(Service $service): void + { + $service->addAction(CreateRow::getName(), new CreateRow()); + $service->addAction(GetRow::getName(), new GetRow()); + $service->addAction(UpdateRow::getName(), new UpdateRow()); + $service->addAction(UpdateRows::getName(), new UpdateRows()); + $service->addAction(UpsertRow::getName(), new UpsertRow()); + $service->addAction(UpsertRows::getName(), new UpsertRows()); + $service->addAction(DeleteRow::getName(), new DeleteRow()); + $service->addAction(DeleteRows::getName(), new DeleteRows()); + $service->addAction(ListRows::getName(), new ListRows()); + $service->addAction(ListRowLogs::getName(), new ListRowLogs()); + $service->addAction(IncrementRowColumn::getName(), new IncrementRowColumn()); + $service->addAction(DecrementRowColumn::getName(), new DecrementRowColumn()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Services/Workers.php b/src/Appwrite/Platform/Modules/Databases/Services/Workers.php new file mode 100644 index 0000000000..55388ea7ff --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Services/Workers.php @@ -0,0 +1,15 @@ +<?php + +namespace Appwrite\Platform\Modules\Databases\Services; + +use Appwrite\Platform\Modules\Databases\Workers\Databases; +use Utopia\Platform\Service; + +class Workers extends Service +{ + public function __construct() + { + $this->type = Service::TYPE_WORKER; + $this->addAction(Databases::getName(), new Databases()); + } +} diff --git a/src/Appwrite/Platform/Workers/Databases.php b/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php similarity index 88% rename from src/Appwrite/Platform/Workers/Databases.php rename to src/Appwrite/Platform/Modules/Databases/Workers/Databases.php index 8c6f6f0252..9a98d77d2d 100644 --- a/src/Appwrite/Platform/Workers/Databases.php +++ b/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php @@ -1,6 +1,6 @@ <?php -namespace Appwrite\Platform\Workers; +namespace Appwrite\Platform\Modules\Databases\Workers; use Appwrite\Event\Realtime; use Exception; @@ -38,7 +38,7 @@ class Databases extends Action ->inject('dbForProject') ->inject('queueForRealtime') ->inject('log') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -60,8 +60,8 @@ class Databases extends Action } $type = $payload['type']; - $collection = new Document($payload['collection'] ?? []); - $document = new Document($payload['document'] ?? []); + $document = new Document($payload['row'] ?? $payload['document'] ?? []); + $collection = new Document($payload['table'] ?? $payload['collection'] ?? []); $database = new Document($payload['database'] ?? []); $log->addTag('projectId', $project->getId()); @@ -74,14 +74,22 @@ class Databases extends Action $log->addTag('databaseId', $database->getId()); match (\strval($type)) { - DATABASE_TYPE_DELETE_DATABASE => $this->deleteDatabase($database, $project, $dbForProject), - DATABASE_TYPE_DELETE_COLLECTION => $this->deleteCollection($database, $collection, $project, $dbForProject), + DATABASE_TYPE_DELETE_DATABASE => $this->deleteDatabase($database, $dbForProject), + DATABASE_TYPE_DELETE_COLLECTION => $this->deleteCollection($database, $collection, $dbForProject), DATABASE_TYPE_CREATE_ATTRIBUTE => $this->createAttribute($database, $collection, $document, $project, $dbForPlatform, $dbForProject, $queueForRealtime), DATABASE_TYPE_DELETE_ATTRIBUTE => $this->deleteAttribute($database, $collection, $document, $project, $dbForPlatform, $dbForProject, $queueForRealtime), DATABASE_TYPE_CREATE_INDEX => $this->createIndex($database, $collection, $document, $project, $dbForPlatform, $dbForProject, $queueForRealtime), DATABASE_TYPE_DELETE_INDEX => $this->deleteIndex($database, $collection, $document, $project, $dbForPlatform, $dbForProject, $queueForRealtime), default => throw new Exception('No database operation for type: ' . \strval($type)), }; + + Console::info("Finished processing database operation: \n" . \json_encode([ + 'type' => $type, + 'projectId' => $project->getId(), + 'databaseId' => $database->getId(), + 'collectionId' => $collection->getId(), + 'documentId' => $document->getId(), + ], JSON_PRETTY_PRINT)); } /** @@ -108,17 +116,18 @@ class Databases extends Action Realtime $queueForRealtime ): void { if ($collection->isEmpty()) { - throw new Exception('Missing collection'); + throw new Exception('Missing collection/table'); } if ($attribute->isEmpty()) { - throw new Exception('Missing attribute'); + throw new Exception('Missing attribute/column'); } $projectId = $project->getId(); $event = "databases.[databaseId].collections.[collectionId].attributes.[attributeId].update"; + /** * TODO @christyjacob4 verify if this is still the case - * Fetch attribute from the database, since with Resque float values are loosing informations. + * Fetch attribute from the database, since with Resque float values are loosing information. */ $attribute = $dbForProject->getDocument('attributes', $attribute->getId()); @@ -149,7 +158,7 @@ class Databases extends Action case Database::VAR_RELATIONSHIP: $relatedCollection = $dbForProject->getDocument('database_' . $database->getSequence(), $options['relatedCollection']); if ($relatedCollection->isEmpty()) { - throw new DatabaseException('Collection not found'); + throw new DatabaseException('Collection/Table not found'); } if ( @@ -163,7 +172,7 @@ class Databases extends Action onDelete: $options['onDelete'], ) ) { - throw new DatabaseException('Failed to create Attribute'); + throw new DatabaseException('Failed to create attribute/column'); } if ($options['twoWay']) { @@ -173,7 +182,7 @@ class Databases extends Action break; default: if (!$dbForProject->createAttribute('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $key, $type, $size, $required, $default, $signed, $array, $format, $formatOptions, $filters)) { - throw new Exception('Failed to create Attribute'); + throw new Exception('Failed to create attribute/column'); } } @@ -208,9 +217,11 @@ class Databases extends Action if (! $relatedCollection->isEmpty()) { $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $relatedCollection->getId()); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence()); } $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); } } @@ -231,10 +242,10 @@ class Databases extends Action private function deleteAttribute(Document $database, Document $collection, Document $attribute, Document $project, Database $dbForPlatform, Database $dbForProject, Realtime $queueForRealtime): void { if ($collection->isEmpty()) { - throw new Exception('Missing collection'); + throw new Exception('Missing collection/table'); } if ($attribute->isEmpty()) { - throw new Exception('Missing attribute'); + throw new Exception('Missing attribute/column'); } $projectId = $project->getId(); @@ -259,7 +270,7 @@ class Databases extends Action if ($options['twoWay']) { $relatedCollection = $dbForProject->getDocument('database_' . $database->getSequence(), $options['relatedCollection']); if ($relatedCollection->isEmpty()) { - throw new DatabaseException('Collection not found'); + throw new DatabaseException('Collection/Table not found'); } $relatedAttribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $options['twoWayKey']); } @@ -269,7 +280,7 @@ class Databases extends Action throw new DatabaseException('Failed to delete Relationship'); } } elseif (!$dbForProject->deleteAttribute('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $key)) { - throw new DatabaseException('Failed to delete Attribute'); + throw new DatabaseException('Failed to delete attribute/column'); } $dbForProject->deleteDocument('attributes', $attribute->getId()); @@ -366,9 +377,11 @@ class Databases extends Action } } finally { $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); if (! $relatedCollection->isEmpty()) { $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $relatedCollection->getId()); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence()); } } } @@ -391,7 +404,7 @@ class Databases extends Action private function createIndex(Document $database, Document $collection, Document $index, Document $project, Database $dbForPlatform, Database $dbForProject, Realtime $queueForRealtime): void { if ($collection->isEmpty()) { - throw new Exception('Missing collection'); + throw new Exception('Missing collection/table'); } if ($index->isEmpty()) { throw new Exception('Missing index'); @@ -427,6 +440,7 @@ class Databases extends Action } finally { $this->trigger($database, $collection, $project, $event, $queueForRealtime, null, $index); $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); } } @@ -448,7 +462,7 @@ class Databases extends Action private function deleteIndex(Document $database, Document $collection, Document $index, Document $project, Database $dbForPlatform, Database $dbForProject, Realtime $queueForRealtime): void { if ($collection->isEmpty()) { - throw new Exception('Missing collection'); + throw new Exception('Missing collection/table'); } if ($index->isEmpty()) { throw new Exception('Missing index'); @@ -483,20 +497,20 @@ class Databases extends Action } finally { $this->trigger($database, $collection, $project, $event, $queueForRealtime, null, $index); $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collection->getId()); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); } } /** * @param Document $database - * @param Document $project * @param $dbForProject * @return void * @throws Exception */ - protected function deleteDatabase(Document $database, Document $project, $dbForProject): void + protected function deleteDatabase(Document $database, $dbForProject): void { - $this->deleteByGroup('database_' . $database->getSequence(), [], $dbForProject, function ($collection) use ($database, $project, $dbForProject) { - $this->deleteCollection($database, $collection, $project, $dbForProject); + $this->deleteByGroup('database_' . $database->getSequence(), [], $dbForProject, function ($collection) use ($database, $dbForProject) { + $this->deleteCollection($database, $collection, $dbForProject); }); $dbForProject->deleteCollection('database_' . $database->getSequence()); @@ -505,7 +519,6 @@ class Databases extends Action /** * @param Document $database * @param Document $collection - * @param Document $project * @param Database $dbForProject * @return void * @throws Authorization @@ -515,10 +528,10 @@ class Databases extends Action * @throws Structure * @throws Exception */ - protected function deleteCollection(Document $database, Document $collection, Document $project, Database $dbForProject): void + protected function deleteCollection(Document $database, Document $collection, Database $dbForProject): void { if ($collection->isEmpty()) { - throw new Exception('Missing collection'); + throw new Exception('Missing collection/table'); } $collectionId = $collection->getId(); @@ -578,29 +591,31 @@ class Databases extends Action ); } catch (\Throwable $th) { $tenant = $database->getSharedTables() ? 'Tenant:'.$database->getTenant() : ''; - Console::error("Failed to delete documents for collection:{$database->getNamespace()}_{$collectionId} {$tenant} :{$th->getMessage()}"); + Console::error("Failed to delete documents/rows for collection/table: {$database->getNamespace()}_{$collectionId} {$tenant} :{$th->getMessage()}"); return; } $end = \microtime(true); - Console::info("Deleted {$count} documents by group in " . ($end - $start) . " seconds"); + Console::info("Deleted {$count} documents/rows by group in " . ($end - $start) . " seconds"); } /** * @param Document $database * @param Document $collection * @param Document $project + * @param string $event * @param Realtime $queueForRealtime * @param Document|null $attribute * @param Document|null $index * @return void + * @throws DatabaseException */ protected function trigger( - Document $database, - Document $collection, - Document $project, - string $event, - Realtime $queueForRealtime, + Document $database, + Document $collection, + Document $project, + string $event, + Realtime $queueForRealtime, Document|null $attribute = null, Document|null $index = null, ): void { @@ -609,14 +624,16 @@ class Databases extends Action ->setSubscribers(['console']) ->setEvent($event) ->setParam('databaseId', $database->getId()) + ->setParam('tableId', $collection->getId()) ->setParam('collectionId', $collection->getId()); - if ($attribute !== null && !empty($attribute)) { + if (! empty($attribute)) { $queueForRealtime + ->setParam('columnId', $attribute->getId()) ->setParam('attributeId', $attribute->getId()) ->setPayload($attribute->getArrayCopy()); } - if ($index !== null && !empty($index)) { + if (! empty($index)) { $queueForRealtime ->setParam('indexId', $index->getId()) ->setPayload($index->getArrayCopy()); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php index 007cea0252..f64a960507 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php @@ -87,7 +87,7 @@ class Create extends Action ->inject('deviceForLocal') ->inject('queueForBuilds') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php index 912e12bdc1..9e314d05c6 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php @@ -62,7 +62,7 @@ class Delete extends Action ->inject('queueForDeletes') ->inject('queueForEvents') ->inject('deviceForFunctions') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php index 9456ff13a6..fd22248fa3 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php @@ -61,7 +61,7 @@ class Get extends Action ->inject('dbForProject') ->inject('deviceForFunctions') ->inject('deviceForBuilds') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -105,9 +105,11 @@ class Get extends Action $response ->setContentType('application/gzip') - ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days + ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') + ->addHeader('Expires', '0') + ->addHeader('Pragma', 'no-cache') ->addHeader('X-Peak', \memory_get_peak_usage()) - ->addHeader('Content-Disposition', 'attachment; filename="' . $deploymentId . '.tar.gz"'); + ->addHeader('Content-Disposition', 'attachment; filename="' . $deploymentId . '-' . $type . '.tar.gz"'); $size = $device->getFileSize($path); $rangeHeader = $request->getHeader('range'); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php index 0a07440dff..e2d49ecb8b 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php @@ -62,7 +62,7 @@ class Create extends Action ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('deviceForFunctions') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -97,8 +97,8 @@ class Create extends Action $deviceForFunctions->transfer($path, $destination, $deviceForFunctions); $deployment->removeAttribute('$sequence'); + $deployment = $dbForProject->createDocument('deployments', $deployment->setAttributes([ - '$sequence' => '', '$id' => $deploymentId, 'sourcePath' => $destination, 'totalSize' => $deployment->getAttribute('sourceSize', 0), diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php index e9c5240f5c..a79da7f908 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php @@ -49,7 +49,7 @@ class Get extends Action ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php index 4c924a64d1..e6b45b27de 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php @@ -59,7 +59,7 @@ class Update extends Action ->inject('project') ->inject('queueForEvents') ->inject('executor') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php index f1bd4b71e4..4d93c8e8cd 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php @@ -75,7 +75,7 @@ class Create extends Base ->inject('project') ->inject('queueForBuilds') ->inject('gitHub') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php index 48f3894bb2..0ad9852722 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php @@ -72,7 +72,7 @@ class Create extends Base ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('gitHub') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php index 2ffcfc5d11..2850c5b279 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php @@ -3,10 +3,12 @@ namespace Appwrite\Platform\Modules\Functions\Http\Deployments; use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Compute\Base; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Deployments; +use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; @@ -19,7 +21,7 @@ use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; use Utopia\Validator\Text; -class XList extends Action +class XList extends Base { use HTTP; @@ -55,15 +57,17 @@ class XList extends Action ->param('functionId', '', new UID(), 'Function ID.') ->param('queries', [], new Deployments(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Deployments::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->inject('request') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( string $functionId, array $queries, string $search, + Request $request, Response $response, Database $dbForProject ) { @@ -121,6 +125,7 @@ class XList extends Action throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); } + $this->applySelectQueries($request, $response, Response::MODEL_DEPLOYMENT); $response->dynamic(new Document([ 'deployments' => $results, 'total' => $total, diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php index 0aec31e5fd..69af3b7d04 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php @@ -11,7 +11,6 @@ use Appwrite\Extend\Exception; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Functions\Validator\Headers; use Appwrite\Platform\Modules\Compute\Base; -use Appwrite\Platform\Tasks\ScheduleExecutions; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; @@ -80,9 +79,9 @@ class Create extends Base ->param('body', '', new Text(10485760, 0), 'HTTP body of execution. Default value is empty string.', true) ->param('async', false, new Boolean(true), 'Execute code in the background. Default value is false.', true) ->param('path', '/', new Text(2048), 'HTTP path of execution. Path can include query params. Default value is /', true) - ->param('method', 'POST', new Whitelist(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], true), 'HTTP method of execution. Default value is GET.', true) + ->param('method', 'POST', new Whitelist(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS', 'HEAD'], true), 'HTTP method of execution. Default value is POST.', true) ->param('headers', [], new AnyOf([new Assoc(), new Text(65535)], AnyOf::TYPE_MIXED), 'HTTP headers of execution. Defaults to empty.', true) - ->param('scheduledAt', null, new DatetimeValidator(requireDateInFuture: true, precision: DateTimeValidator::PRECISION_MINUTES, offset: 60), 'Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.', true) + ->param('scheduledAt', null, new Text(100), 'Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.', true) ->inject('response') ->inject('request') ->inject('project') @@ -94,7 +93,7 @@ class Create extends Base ->inject('queueForFunctions') ->inject('geodb') ->inject('executor') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -123,6 +122,13 @@ class Create extends Base throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Scheduled executions must run asynchronously. Set scheduledAt to a future date, or set async to true.'); } + if (!is_null($scheduledAt)) { + $validator = new DatetimeValidator(requireDateInFuture: true, precision: DateTimeValidator::PRECISION_MINUTES, offset: 60); + if (!$validator->isValid($scheduledAt)) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Execution schedule must be a valid date, and at least 1 minute from now'); + } + } + /** * @var array<string, mixed> $headers */ @@ -198,7 +204,7 @@ class Create extends Base } if (!$current->isEmpty()) { - $jwtExpiry = $function->getAttribute('timeout', 900); + $jwtExpiry = $function->getAttribute('timeout', 900) + 60; // 1min extra to account for possible cold-starts $jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $jwtExpiry, 0); $jwt = $jwtObj->encode([ 'userId' => $user->getId(), @@ -207,13 +213,15 @@ class Create extends Base } } - $jwtExpiry = $function->getAttribute('timeout', 900); + $jwtExpiry = $function->getAttribute('timeout', 900) + 60; // 1min extra to account for possible cold-starts $jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $jwtExpiry, 0); $apiKey = $jwtObj->encode([ 'projectId' => $project->getId(), 'scopes' => $function->getAttribute('scopes', []) ]); + $executionId = ID::unique(); + $headers['x-appwrite-execution-id'] = $executionId ?? ''; $headers['x-appwrite-key'] = API_KEY_DYNAMIC . '_' . $apiKey; $headers['x-appwrite-trigger'] = 'http'; $headers['x-appwrite-user-id'] = $user->getId() ?? ''; @@ -221,8 +229,9 @@ class Create extends Base $headers['x-appwrite-country-code'] = ''; $headers['x-appwrite-continent-code'] = ''; $headers['x-appwrite-continent-eu'] = 'false'; + $ip = $request->getIP(); + $headers['x-appwrite-client-ip'] = $ip; - $ip = $headers['x-real-ip'] ?? ''; if (!empty($ip)) { $record = $geodb->get($ip); @@ -242,7 +251,7 @@ class Create extends Base } } - $executionId = ID::unique(); + $status = $async ? 'waiting' : 'processing'; @@ -303,7 +312,7 @@ class Create extends Base $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => ScheduleExecutions::getSupportedResource(), + 'resourceType' => SCHEDULE_RESOURCE_TYPE_EXECUTION, 'resourceId' => $execution->getId(), 'resourceInternalId' => $execution->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -386,7 +395,9 @@ class Create extends Base try { $version = $function->getAttribute('version', 'v2'); $command = $runtime['startCommand']; - $command = $version === 'v2' ? '' : 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $command . '"'; + $source = $deployment->getAttribute('buildPath', ''); + $extension = str_ends_with($source, '.tar') ? 'tar' : 'tar.gz'; + $command = $version === 'v2' ? '' : "cp /tmp/code.$extension /mnt/code/code.$extension && nohup helpers/start.sh \"$command\""; $executionResponse = $executor->createExecution( projectId: $project->getId(), deploymentId: $deployment->getId(), @@ -394,7 +405,7 @@ class Create extends Base variables: $vars, timeout: $function->getAttribute('timeout', 0), image: $runtime['image'], - source: $deployment->getAttribute('buildPath', ''), + source: $source, entrypoint: $deployment->getAttribute('entrypoint', ''), version: $version, path: $path, @@ -414,13 +425,34 @@ class Create extends Base } } + $maxLogLength = APP_FUNCTION_LOG_LENGTH_LIMIT; + $logs = $executionResponse['logs'] ?? ''; + + if (\is_string($logs) && \strlen($logs) > $maxLogLength) { + $warningMessage = "[WARNING] Logs truncated. The output exceeded {$maxLogLength} characters.\n"; + $warningLength = \strlen($warningMessage); + $maxContentLength = $maxLogLength - $warningLength; + $logs = $warningMessage . \substr($logs, -$maxContentLength); + } + + // Truncate errors if they exceed the limit + $maxErrorLength = APP_FUNCTION_ERROR_LENGTH_LIMIT; + $errors = $executionResponse['errors'] ?? ''; + + if (\is_string($errors) && \strlen($errors) > $maxErrorLength) { + $warningMessage = "[WARNING] Errors truncated. The output exceeded {$maxErrorLength} characters.\n"; + $warningLength = \strlen($warningMessage); + $maxContentLength = $maxErrorLength - $warningLength; + $errors = $warningMessage . \substr($errors, -$maxContentLength); + } + /** Update execution status */ $status = $executionResponse['statusCode'] >= 500 ? 'failed' : 'completed'; $execution->setAttribute('status', $status); $execution->setAttribute('responseStatusCode', $executionResponse['statusCode']); $execution->setAttribute('responseHeaders', $headersFiltered); - $execution->setAttribute('logs', $executionResponse['logs']); - $execution->setAttribute('errors', $executionResponse['errors']); + $execution->setAttribute('logs', $logs); + $execution->setAttribute('errors', $errors); $execution->setAttribute('duration', $executionResponse['duration']); } catch (\Throwable $th) { $durationEnd = \microtime(true); @@ -451,6 +483,8 @@ class Create extends Base $execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', $execution)); } + $executionResponse['headers']['x-appwrite-execution-id'] = $execution->getId(); + $headers = []; foreach (($executionResponse['headers'] ?? []) as $key => $value) { $headers[] = ['name' => $key, 'value' => $value]; diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php index 8a3d5f2a49..666cb8310c 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php @@ -5,7 +5,6 @@ namespace Appwrite\Platform\Modules\Functions\Http\Executions; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Compute\Base; -use Appwrite\Platform\Tasks\ScheduleExecutions; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; @@ -62,7 +61,7 @@ class Delete extends Base ->inject('dbForProject') ->inject('dbForPlatform') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -100,7 +99,7 @@ class Delete extends Base if ($status === 'scheduled') { $schedule = $dbForPlatform->findOne('schedules', [ Query::equal('resourceId', [$execution->getId()]), - Query::equal('resourceType', [ScheduleExecutions::getSupportedResource()]), + Query::equal('resourceType', [SCHEDULE_RESOURCE_TYPE_EXECUTION]), Query::equal('active', [true]), ]); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php index 659682ab55..42d78f8ca8 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php @@ -52,7 +52,7 @@ class Get extends Base ->param('executionId', '', new UID(), 'Execution ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php index 91683c915b..46a41e6517 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php @@ -58,7 +58,7 @@ class XList extends Base ->param('queries', [], new Executions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php index c644c681d8..b00a2ad2bf 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php @@ -114,7 +114,7 @@ class Create extends Base ->inject('dbForPlatform') ->inject('request') ->inject('gitHub') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -235,7 +235,7 @@ class Create extends Base $schedule = Authorization::skip( fn () => $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'function', + 'resourceType' => SCHEDULE_RESOURCE_TYPE_FUNCTION, 'resourceId' => $function->getId(), 'resourceInternalId' => $function->getSequence(), 'resourceUpdatedAt' => DateTime::now(), diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php index 91da68538c..72d5589252 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php @@ -61,7 +61,7 @@ class Delete extends Base ->inject('queueForDeletes') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php index 1f3e39dee1..8846329d27 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php @@ -5,7 +5,6 @@ namespace Appwrite\Platform\Modules\Functions\Http\Functions\Deployment; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Compute\Base; -use Appwrite\Query; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; @@ -13,6 +12,7 @@ use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Document; +use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; @@ -62,7 +62,7 @@ class Update extends Base ->inject('dbForProject') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -89,8 +89,6 @@ class Update extends Base throw new Exception(Exception::BUILD_NOT_READY); } - $oldDeploymentInternalId = $function->getAttribute('deploymentInternalId', ''); - $function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [ 'deploymentInternalId' => $deployment->getSequence(), 'deploymentId' => $deployment->getId(), @@ -106,24 +104,21 @@ class Update extends Base Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $queries = [ - Query::equal('trigger', 'manual'), - Query::equal("type", ["deployment"]), - Query::equal("deploymentResourceType", ["function"]), - Query::equal("deploymentResourceInternalId", [$function->getSequence()]), + Query::equal('trigger', ['manual']), + Query::equal('type', ['deployment']), + Query::equal('deploymentResourceType', ['function']), + Query::equal('deploymentResourceInternalId', [$function->getSequence()]), + Query::equal('deploymentVcsProviderBranch', ['']), + Query::equal('projectInternalId', [$project->getSequence()]) ]; - if (empty($oldDeploymentInternalId)) { - $queries[] = Query::equal("deploymentInternalId", [""]); - } else { - $queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]); - } - - $this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment) { + Authorization::skip(fn () => $dbForPlatform->foreach('rules', function (Document $rule) use ($dbForPlatform, $deployment) { $rule = $rule ->setAttribute('deploymentId', $deployment->getId()) ->setAttribute('deploymentInternalId', $deployment->getSequence()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); - }); + + Authorization::skip(fn () => $dbForPlatform->updateDocument('rules', $rule->getId(), $rule)); + }, $queries)); $queueForEvents ->setParam('functionId', $function->getId()) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php index 9ce6560fd0..e8da162b8a 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php @@ -49,7 +49,7 @@ class Get extends Base ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php index 2bfe8b1344..aaff953af0 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php @@ -104,7 +104,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('gitHub') ->inject('executor') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php index cd0eba2c50..4b03a5b6cc 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php @@ -56,7 +56,7 @@ class XList extends Base ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Runtimes/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Runtimes/XList.php index bfccff0479..0690d1a139 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Runtimes/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Runtimes/XList.php @@ -47,7 +47,7 @@ class XList extends Base ] )) ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Response $response) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Specifications/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Specifications/XList.php index 39186e7ab7..d76584534d 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Specifications/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Specifications/XList.php @@ -48,7 +48,7 @@ class XList extends Base )) ->inject('response') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Response $response, array $plan) @@ -63,8 +63,8 @@ class XList extends Base $spec['enabled'] = in_array($spec['slug'], $plan['runtimeSpecifications']); } - $maxCpus = System::getEnv('_APP_FUNCTIONS_CPUS', 0); - $maxMemory = System::getEnv('_APP_FUNCTIONS_MEMORY', 0); + $maxCpus = System::getEnv('_APP_COMPUTE_CPUS', 0); + $maxMemory = System::getEnv('_APP_COMPUTE_MEMORY', 0); // Only add specs that are within the limits set by environment variables // Treat 0 as no limit diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Templates/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Templates/Get.php index 237898f6fa..f66322839b 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Templates/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Templates/Get.php @@ -49,7 +49,7 @@ class Get extends Base )) ->param('templateId', '', new Text(128), 'Template ID.') ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $templateId, Response $response) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Templates/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Templates/XList.php index 05b54a75d0..86e7f21362 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Templates/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Templates/XList.php @@ -53,7 +53,7 @@ class XList extends Base ->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true) ->param('offset', 0, new Range(0, 5000), 'Offset the list of returned templates. Maximum offset is 5000.', true) ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(array $runtimes, array $usecases, int $limit, int $offset, Response $response) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php index 947da4cd37..acb6995d6f 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php @@ -55,7 +55,7 @@ class Get extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $functionId, string $range, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php index e64fe9a600..6a4ded4db7 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php @@ -52,7 +52,7 @@ class XList extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $range, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php index ee892fe1ed..815d364dad 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php @@ -65,7 +65,7 @@ class Create extends Base ->inject('dbForProject') ->inject('dbForPlatform') ->inject('project') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php index dda1f97f6b..35f9618edb 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php @@ -57,7 +57,7 @@ class Delete extends Base ->inject('response') ->inject('dbForProject') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Get.php index 98119c4a66..3955b854e9 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Get.php @@ -53,7 +53,7 @@ class Get extends Base ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $functionId, string $variableId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php index 7a6acf88e3..639b1c74d5 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php @@ -61,7 +61,7 @@ class Update extends Base ->inject('response') ->inject('dbForProject') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/XList.php index 9c02cfe07c..29465b7572 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/XList.php @@ -53,7 +53,7 @@ class XList extends Base ->param('functionId', '', new UID(), 'Function unique ID.', false) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $functionId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index a01250c05a..ce45d6b629 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -75,7 +75,7 @@ class Builds extends Action ->inject('log') ->inject('executor') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -117,6 +117,8 @@ class Builds extends Action Executor $executor, array $plan ): void { + Console::log('Build action started'); + $payload = $message->getPayload() ?? []; if (empty($payload)) { @@ -209,6 +211,11 @@ class Builds extends Action Executor $executor, array $plan ): void { + Console::info('Deployment action started'); + + $startTime = DateTime::now(); + $durationStart = \microtime(true); + $resourceKey = match ($resource->getCollection()) { 'functions' => 'functionId', 'sites' => 'siteId', @@ -260,11 +267,8 @@ class Builds extends Action ->setParam($resourceKey, $resource->getId()) ->setParam('deploymentId', $deployment->getId()); - $startTime = DateTime::now(); - $durationStart = \microtime(true); - if ($deployment->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } @@ -275,10 +279,11 @@ class Builds extends Action $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); if ($deployment->getSequence() === $resource->getAttribute('latestDeploymentInternalId', '')) { - $resource = $resource->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); - $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), $resource); + $resource = $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), new Document(['latestDeploymentStatus' => $deployment->getAttribute('status', '')])); } + Console::log('Status marked as processing'); + $queueForRealtime ->setPayload($deployment->getArrayCopy()) ->trigger(); @@ -360,6 +365,8 @@ class Builds extends Action $queueForRealtime ->setPayload($deployment->getArrayCopy()) ->trigger(); + + Console::log('Template cloned'); } } elseif ($isVcsEnabled) { // VCS and VCS+Temaplte @@ -392,7 +399,7 @@ class Builds extends Action Console::execute('mkdir -p ' . \escapeshellarg('/tmp/builds/' . $deploymentId), '', $stdout, $stderr); if ($dbForProject->getDocument('deployments', $deploymentId)->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } @@ -402,6 +409,8 @@ class Builds extends Action throw new \Exception('Unable to clone code repository: ' . $stderr); } + Console::log('Git repository cloned'); + // Local refactoring for function folder with spaces if (str_contains($rootDirectory, ' ')) { $rootDirectoryWithoutSpaces = str_replace(' ', '', $rootDirectory); @@ -445,7 +454,7 @@ class Builds extends Action Console::execute('rsync -av --exclude \'.git\' ' . \escapeshellarg($tmpTemplateDirectory . '/' . $templateRootDirectory . '/') . ' ' . \escapeshellarg($tmpDirectory . '/' . $rootDirectory), '', $stdout, $stderr); // Commit and push - $exit = Console::execute('git config --global user.email "team@appwrite.io" && git config --global user.name "Appwrite" && cd ' . \escapeshellarg($tmpDirectory) . ' && git add . && git commit -m "Create ' . \escapeshellarg($resource->getAttribute('name', '')) . ' function" && git push origin ' . \escapeshellarg($branchName), '', $stdout, $stderr); + $exit = Console::execute('git config --global user.email '. \escapeshellarg(APP_VCS_GITHUB_EMAIL) .' && git config --global user.name '. \escapeshellarg(APP_VCS_GITHUB_USERNAME) .' && cd ' . \escapeshellarg($tmpDirectory) . ' && git checkout -b ' . \escapeshellarg($branchName) . ' && git add . && git commit -m "Create ' . \escapeshellarg($resource->getAttribute('name', '')) . ' function" && git push origin ' . \escapeshellarg($branchName), '', $stdout, $stderr); if ($exit !== 0) { throw new \Exception('Unable to push code repository: ' . $stderr); @@ -470,6 +479,8 @@ class Builds extends Action $queueForRealtime ->setPayload($deployment->getArrayCopy()) ->trigger(); + + Console::log('Git template pushed'); } $tmpPath = '/tmp/builds/' . $deploymentId; @@ -517,16 +528,19 @@ class Builds extends Action ->setPayload($deployment->getArrayCopy()) ->trigger(); - $this->runGitAction('processing', $github, $providerCommitHash, $owner, $repositoryName, $project, $resource, $deployment->getId(), $dbForProject, $dbForPlatform); + Console::log('Git source uploaded'); + + $this->runGitAction('processing', $github, $providerCommitHash, $owner, $repositoryName, $project, $resource, $deployment->getId(), $dbForProject, $dbForPlatform, $queueForRealtime); } + Console::log('Status marked as building'); + /** Request the executor to build the code... */ $deployment->setAttribute('status', 'building'); $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); if ($deployment->getSequence() === $resource->getAttribute('latestDeploymentInternalId', '')) { - $resource = $resource->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); - $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), $resource); + $resource = $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), new Document(['latestDeploymentStatus' => $deployment->getAttribute('status', '')])); } $queueForRealtime @@ -534,7 +548,7 @@ class Builds extends Action ->trigger(); if ($isVcsEnabled) { - $this->runGitAction('building', $github, $providerCommitHash, $owner, $repositoryName, $project, $resource, $deployment->getId(), $dbForProject, $dbForPlatform); + $this->runGitAction('building', $github, $providerCommitHash, $owner, $repositoryName, $project, $resource, $deployment->getId(), $dbForProject, $dbForPlatform, $queueForRealtime); } $deploymentModel = new Deployment(); @@ -658,12 +672,14 @@ class Builds extends Action $err = null; if ($dbForProject->getDocument('deployments', $deploymentId)->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } $isCanceled = false; + Console::log('Runtime creation started'); + Co::join([ Co\go(function () use ($executor, &$response, $project, $deployment, $source, $resource, $runtime, $vars, $command, $cpus, $memory, $timeout, &$err, $version) { try { @@ -711,7 +727,10 @@ class Builds extends Action command: $command, outputDirectory: $resource->getAttribute('outputDirectory', '') ); + + Console::log('createRuntime finished'); } catch (\Throwable $error) { + Console::warning('createRuntime failed'); $err = $error; } }), @@ -747,6 +766,13 @@ class Builds extends Action if ($separator !== false) { $logs = \substr($logs, 0, $separator); $insideSeparation = true; + + $leftover = \substr($logs, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR_START}')); + $separator = \strpos($leftover, '{APPWRITE_DETECTION_SEPARATOR_END}'); + if ($separator !== false) { + $logs .= \substr($leftover, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR_END}')); + $insideSeparation = false; + } } } else { $separator = \strpos($logs, '{APPWRITE_DETECTION_SEPARATOR_END}'); @@ -793,7 +819,9 @@ class Builds extends Action } } ); + Console::warning('listLogs finished'); } catch (\Throwable $error) { + Console::warning('listLogs failed'); if (empty($err)) { $err = $error; } @@ -801,8 +829,10 @@ class Builds extends Action }), ]); + Console::log('Runtime creation finished'); + if ($dbForProject->getDocument('deployments', $deploymentId)->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } @@ -810,9 +840,6 @@ class Builds extends Action throw $err; } - $endTime = DateTime::now(); - $durationEnd = \microtime(true); - $buildSizeLimit = (int)System::getEnv('_APP_COMPUTE_BUILD_SIZE_LIMIT', '2000000000'); if (isset($plan['buildSize'])) { $buildSizeLimit = $plan['buildSize'] * 1000 * 1000; @@ -821,10 +848,6 @@ class Builds extends Action throw new \Exception('Build size should be less than ' . number_format($buildSizeLimit / (1000 * 1000), 2) . ' MBs.'); } - /** Update the build document */ - $deployment->setAttribute('buildStartedAt', DateTime::format((new \DateTime())->setTimestamp(floor($response['startTime'])))); - $deployment->setAttribute('buildEndedAt', $endTime); - $deployment->setAttribute('buildDuration', \intval(\ceil($durationEnd - $durationStart))); $deployment->setAttribute('buildPath', $response['path']); $deployment->setAttribute('buildSize', $response['size']); $deployment->setAttribute('totalSize', $deployment->getAttribute('buildSize', 0) + $deployment->getAttribute('sourceSize', 0)); @@ -836,18 +859,10 @@ class Builds extends Action // Separate logs for SSR detection $detectionLogs = ''; - $separator = \strpos($logs, '{APPWRITE_DETECTION_SEPARATOR_START}'); - if ($separator !== false) { - $detectionLogs = \substr($logs, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR}')); - $separatorEnd = \strpos($detectionLogs, '{APPWRITE_DETECTION_SEPARATOR_END}'); - $logs .= \substr($detectionLogs, $separatorEnd + strlen('{APPWRITE_DETECTION_SEPARATOR_END}')); - $detectionLogs = \substr($detectionLogs, 0, $separatorEnd); - $logs = \substr($logs, 0, $separator); - } - - if ($resource->getCollection() === 'sites') { - $date = \date('H:i:s'); - $logs .= "[$date] [appwrite] Screenshot capturing started. \n"; + if (\str_contains($logs, '{APPWRITE_DETECTION_SEPARATOR_START}')) { + [$logsBefore, $detectionLogsStart] = \explode('{APPWRITE_DETECTION_SEPARATOR_START}', $logs, 2); + [$detectionLogs, $logsAfter] = \explode('{APPWRITE_DETECTION_SEPARATOR_END}', $detectionLogsStart, 2); + $logs = ($logsBefore ?? '') . ($logsAfter ?? ''); } $deployment->setAttribute('buildLogs', $logs); @@ -866,25 +881,39 @@ class Builds extends Action $adapter = $resource->getAttribute('adapter', ''); if (empty($adapter)) { - $resource->setAttribute('adapter', $detection->getName()); - $resource->setAttribute('fallbackFile', $detection->getFallbackFile() ?? ''); - $resource = $dbForProject->updateDocument('sites', $resource->getId(), $resource); + $resource = $dbForProject->updateDocument('sites', $resource->getId(), new Document(['adapter' => $detection->getName(), 'fallbackFile' => $detection->getFallbackFile() ?? ''])); $deployment->setAttribute('adapter', $detection->getName()); $deployment->setAttribute('fallbackFile', $detection->getFallbackFile() ?? ''); + + Console::log('Adapter detected'); } elseif ($adapter === 'ssr' && $detection->getName() === 'static') { throw new \Exception('Adapter mismatch. Detected: ' . $detection->getName() . ' does not match with the set adapter: ' . $adapter); } } $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); - $queueForRealtime ->setPayload($deployment->getArrayCopy()) ->trigger(); + Console::log('Build details stored'); + + $this->afterBuildSuccess($queueForRealtime, $dbForProject, $deployment, $runtime, $adapter); + $logs = $deployment->getAttribute('buildLogs', ''); + /** Screenshot site */ if ($resource->getCollection() === 'sites') { + Console::log('Site screenshot started'); + + $date = \date('H:i:s'); + $logs .= "[$date] [appwrite] Screenshot capturing started. \n"; + $deployment->setAttribute('buildLogs', $logs); + $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); + $queueForRealtime + ->setPayload($deployment->getArrayCopy()) + ->trigger(); + try { $rule = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [ Query::equal("projectInternalId", [$project->getSequence()]), @@ -955,8 +984,9 @@ class Builds extends Action $config['sleep'] = $framework['screenshotSleep']; } + $browserEndpoint = Config::getParam('_APP_BROWSER_HOST', 'http://appwrite-browser:3000/v1'); $fetchResponse = $client->fetch( - url: 'http://appwrite-browser:3000/v1/screenshots', + url: $browserEndpoint . '/screenshots', method: 'POST', body: $config ); @@ -979,6 +1009,8 @@ class Builds extends Action throw new \Exception($screenshotError); } + $mimeType = "image/png"; + foreach ($screenshots as $data) { $key = $data['key']; $screenshot = $data['screenshot']; @@ -987,7 +1019,7 @@ class Builds extends Action $fileName = $fileId . '.png'; $path = $deviceForFiles->getPath($fileName); $path = str_ireplace($deviceForFiles->getRoot(), $deviceForFiles->getRoot() . DIRECTORY_SEPARATOR . $bucket->getId(), $path); // Add bucket id to path after root - $success = $deviceForFiles->write($path, $screenshot, "image/png"); + $success = $deviceForFiles->write($path, $screenshot, $mimeType); if (!$success) { throw new \Exception("Screenshot failed to save"); @@ -1004,10 +1036,10 @@ class Builds extends Action 'name' => $fileName, 'path' => $path, 'signature' => $deviceForFiles->getFileHash($path), - 'mimeType' => $deviceForFiles->getFileMimeType($path), + 'mimeType' => $mimeType, 'sizeOriginal' => \strlen($screenshot), 'sizeActual' => $deviceForFiles->getFileSize($path), - 'algorithm' => Compression::GZIP, + 'algorithm' => Compression::NONE, 'comment' => '', 'chunksTotal' => 1, 'chunksUploaded' => 1, @@ -1016,7 +1048,7 @@ class Builds extends Action 'openSSLTag' => null, 'openSSLIV' => null, 'search' => implode(' ', [$fileId, $fileName]), - 'metadata' => ['content_type' => $deviceForFiles->getFileMimeType($path)], + 'metadata' => ['content_type' => $mimeType], ]); Authorization::skip(fn () => $dbForPlatform->createDocument('bucket_' . $bucket->getSequence(), $file)); @@ -1028,6 +1060,7 @@ class Builds extends Action $date = \date('H:i:s'); $logs .= "[$date] [appwrite] Screenshot capturing finished. \n"; + $deployment->setAttribute('buildLogs', $logs); $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); $queueForRealtime @@ -1042,8 +1075,11 @@ class Builds extends Action $date = \date('H:i:s'); $logs .= "[$date] [appwrite] Screenshot capturing failed. Deployment will continue. \n"; + $deployment->setAttribute('buildLogs', $logs); $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); } + + Console::log('Site screenshot finished'); } $logs = $deployment->getAttribute('buildLogs', ''); @@ -1055,9 +1091,10 @@ class Builds extends Action $deployment->setAttribute('status', 'ready'); $deployment = $dbForProject->updateDocument('deployments', $deploymentId, $deployment); + Console::log('Status marked as ready'); + if ($deployment->getSequence() === $resource->getAttribute('latestDeploymentInternalId', '')) { - $resource = $resource->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); - $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), $resource); + $resource = $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), new Document(['latestDeploymentStatus' => $deployment->getAttribute('status', '')])); } $queueForRealtime @@ -1065,78 +1102,90 @@ class Builds extends Action ->trigger(); if ($isVcsEnabled) { - $this->runGitAction('ready', $github, $providerCommitHash, $owner, $repositoryName, $project, $resource, $deployment->getId(), $dbForProject, $dbForPlatform); + $this->runGitAction('ready', $github, $providerCommitHash, $owner, $repositoryName, $project, $resource, $deployment->getId(), $dbForProject, $dbForPlatform, $queueForRealtime); } - Console::success("Build id: $deploymentId created"); - /** Set auto deploy */ + $activateBuild = false; if ($deployment->getAttribute('activate') === true) { - $resource->setAttribute('live', true); + // Check if current active deployment started later than this deployment + $resource = $dbForProject->getDocument($resource->getCollection(), $resource->getId()); + $currentActiveDeploymentId = $resource->getAttribute('deploymentId', ''); + if (!empty($currentActiveDeploymentId)) { + $currentActiveDeployment = $dbForProject->getDocument('deployments', $currentActiveDeploymentId); + if (!$currentActiveDeployment->isEmpty()) { + $currentActiveStartTime = $currentActiveDeployment->getCreatedAt(); + $deploymentStartTime = $deployment->getCreatedAt(); + + // Skip auto-activation if current active deployment started later than deployment that is being activated + if ($currentActiveStartTime < $deploymentStartTime) { + $activateBuild = true; + } else { + Console::info('Skipping auto-activation as current deployment is more recent'); + } + } + } else { + $activateBuild = true; + } + } + + if ($activateBuild) { switch ($resource->getCollection()) { case 'functions': - $oldDeploymentInternalId = $resource->getAttribute('deploymentInternalId', ''); - - $resource->setAttribute('deploymentId', $deployment->getId()); - $resource->setAttribute('deploymentInternalId', $deployment->getSequence()); - $resource->setAttribute('deploymentCreatedAt', $deployment->getCreatedAt()); - $resource = $dbForProject->updateDocument('functions', $resource->getId(), $resource); + $resource = $dbForProject->updateDocument('functions', $resource->getId(), new Document([ + 'live' => true, + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + 'deploymentCreatedAt' => $deployment->getCreatedAt(), + ])); $queries = [ - Query::equal("projectInternalId", [$project->getSequence()]), - Query::equal("type", ["deployment"]), - Query::equal("deploymentResourceInternalId", [$resource->getSequence()]), + Query::equal('projectInternalId', [$project->getSequence()]), + Query::equal('type', ['deployment']), + Query::equal('deploymentResourceInternalId', [$resource->getSequence()]), Query::equal('deploymentResourceType', ['function']), Query::equal('trigger', ['manual']), + Query::equal('deploymentVcsProviderBranch', ['']), ]; - if (empty($oldDeploymentInternalId)) { - $queries[] = Query::equal("deploymentInternalId", [""]); - } else { - $queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]); - } - $rulesUpdated = false; - $this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment, &$rulesUpdated) { + $dbForPlatform->forEach('rules', function (Document $rule) use ($dbForPlatform, $deployment, &$rulesUpdated) { $rulesUpdated = true; - $rule = $rule - ->setAttribute('deploymentId', $deployment->getId()) - ->setAttribute('deploymentInternalId', $deployment->getSequence()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); - }); + $rule = $dbForPlatform->updateDocument('rules', $rule->getId(), new Document([ + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + ])); + }, $queries); break; case 'sites': - $oldDeploymentInternalId = $resource->getAttribute('deploymentInternalId', ''); - - $resource->setAttribute('deploymentId', $deployment->getId()); - $resource->setAttribute('deploymentInternalId', $deployment->getSequence()); - $resource->setAttribute('deploymentScreenshotDark', $deployment->getAttribute('screenshotDark', '')); - $resource->setAttribute('deploymentScreenshotLight', $deployment->getAttribute('screenshotLight', '')); - $resource->setAttribute('deploymentCreatedAt', $deployment->getCreatedAt()); - $resource = $dbForProject->updateDocument('sites', $resource->getId(), $resource); + $resource = $dbForProject->updateDocument('sites', $resource->getId(), new Document([ + 'live' => true, + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + 'deploymentScreenshotDark' => $deployment->getAttribute('screenshotDark', ''), + 'deploymentScreenshotLight' => $deployment->getAttribute('screenshotLight', ''), + 'deploymentCreatedAt' => $deployment->getCreatedAt(), + ])); $queries = [ - Query::equal("projectInternalId", [$project->getSequence()]), - Query::equal("type", ["deployment"]), - Query::equal("deploymentResourceInternalId", [$resource->getSequence()]), + Query::equal('projectInternalId', [$project->getSequence()]), + Query::equal('type', ['deployment']), + Query::equal('deploymentResourceInternalId', [$resource->getSequence()]), Query::equal('deploymentResourceType', ['site']), Query::equal('trigger', ['manual']), + Query::equal('deploymentVcsProviderBranch', ['']), ]; - if (empty($oldDeploymentInternalId)) { - $queries[] = Query::equal("deploymentInternalId", [""]); - } else { - $queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]); - } - - $this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment) { - $rule = $rule - ->setAttribute('deploymentId', $deployment->getId()) - ->setAttribute('deploymentInternalId', $deployment->getSequence()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); - }); + $dbForPlatform->forEach('rules', function (Document $rule) use ($dbForPlatform, $deployment) { + $rule = $dbForPlatform->updateDocument('rules', $rule->getId(), new Document([ + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + ])); + }, $queries); break; } + + Console::log('Deployment activated'); } if ($resource->getCollection() === 'sites') { @@ -1144,7 +1193,13 @@ class Builds extends Action $branchName = $deployment->getAttribute('providerBranch'); if (!empty($branchName)) { $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); - $domain = "branch-{$branchName}-{$resource->getId()}-{$project->getId()}.{$sitesDomain}"; + $branchPrefix = substr($branchName, 0, 16); + if (strlen($branchName) > 16) { + $remainingChars = substr($branchName, 16); + $branchPrefix .= '-' . substr(hash('sha256', $remainingChars), 0, 7); + } + $resourceProjectHash = substr(hash('sha256', $resource->getId() . $project->getId()), 0, 7); + $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; $ruleId = md5($domain); try { @@ -1168,34 +1223,48 @@ class Builds extends Action 'region' => $project->getAttribute('region') ])); } catch (Duplicate $err) { - $rule = $dbForPlatform->getDocument('rules', $ruleId); - $rule = $rule - ->setAttribute('deploymentId', $deployment->getId()) - ->setAttribute('deploymentInternalId', $deployment->getSequence()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); + $rule = $dbForPlatform->updateDocument('rules', $ruleId, new Document([ + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + ])); } - $this->listRules($project, [ - Query::equal("projectInternalId", [$project->getSequence()]), - Query::equal("type", ["deployment"]), - Query::equal("deploymentResourceInternalId", [$resource->getSequence()]), + $queries = [ + Query::equal('projectInternalId', [$project->getSequence()]), + Query::equal('type', ['deployment']), + Query::equal('deploymentResourceInternalId', [$resource->getSequence()]), Query::equal('deploymentResourceType', ['site']), - Query::equal("deploymentVcsProviderBranch", [$branchName]), - Query::equal("trigger", ['manual']), - ], $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment) { - $rule = $rule - ->setAttribute('deploymentId', $deployment->getId()) - ->setAttribute('deploymentInternalId', $deployment->getSequence()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); - }); + Query::equal('deploymentVcsProviderBranch', [$branchName]), + Query::equal('trigger', ['manual']), + ]; + + $dbForPlatform->foreach('rules', function (Document $rule) use ($dbForPlatform, $deployment) { + $rule = $dbForPlatform->updateDocument('rules', $rule->getId(), new Document([ + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + ])); + }, $queries); + + Console::log('Preview rule created'); } } + $endTime = DateTime::now(); + $durationEnd = \microtime(true); + $deployment->setAttribute('buildEndedAt', $endTime); + $deployment->setAttribute('buildDuration', \intval(\ceil($durationEnd - $durationStart))); + $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); + $queueForRealtime + ->setPayload($deployment->getArrayCopy()) + ->trigger(); + if ($dbForProject->getDocument('deployments', $deploymentId)->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } + Console::log('Build duration updated'); + /** Update function schedule */ // Inform scheduler if function is still active @@ -1207,6 +1276,8 @@ class Builds extends Action ->setAttribute('active', !empty($resource->getAttribute('schedule')) && !empty($resource->getAttribute('deploymentId'))); Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); } + + Console::info('Deployment action finished'); } catch (\Throwable $th) { Console::warning('Build failed:'); Console::error($th->getMessage()); @@ -1215,7 +1286,7 @@ class Builds extends Action Console::error($th->getTraceAsString()); if ($dbForProject->getDocument('deployments', $deploymentId)->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } @@ -1225,16 +1296,12 @@ class Builds extends Action $message = "" . $message; } - $separator = \strpos($message, '{APPWRITE_DETECTION_SEPARATOR_START}'); - if ($separator !== false) { - $error = \substr($message, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR_START}')); - $message = \substr($message, 0, $separator); - $message .= "\n" . $error; - } + $message = \str_replace('{APPWRITE_DETECTION_SEPARATOR_START}', '', $message); + $message = \str_replace('{APPWRITE_DETECTION_SEPARATOR_END}', '', $message); // Combine with previous logs if deployment got past build process $previousLogs = ''; - if (!empty($deployment->getAttribute('buildEndedAt', ''))) { + if (!is_null($deployment->getAttribute('buildSize', null))) { $previousLogs = $deployment->getAttribute('buildLogs', ''); if (!empty($previousLogs)) { $message = $previousLogs . "\n" . $message; @@ -1251,8 +1318,7 @@ class Builds extends Action $deployment = $dbForProject->updateDocument('deployments', $deploymentId, $deployment); if ($deployment->getSequence() === $resource->getAttribute('latestDeploymentInternalId', '')) { - $resource = $resource->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); - $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), $resource); + $resource = $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), new Document(['latestDeploymentStatus' => $deployment->getAttribute('status', '')])); } $queueForRealtime @@ -1260,7 +1326,7 @@ class Builds extends Action ->trigger(); if ($isVcsEnabled) { - $this->runGitAction('failed', $github, $providerCommitHash, $owner, $repositoryName, $project, $resource, $deployment->getId(), $dbForProject, $dbForPlatform); + $this->runGitAction('failed', $github, $providerCommitHash, $owner, $repositoryName, $project, $resource, $deployment->getId(), $dbForProject, $dbForPlatform, $queueForRealtime); } } finally { $queueForRealtime @@ -1278,6 +1344,8 @@ class Builds extends Action protected function sendUsage(Document $resource, Document $deployment, Document $project, StatsUsage $queue): void { + $spec = Config::getParam('specifications')[$resource->getAttribute('specification', APP_COMPUTE_SPECIFICATION_DEFAULT)]; + switch ($deployment->getAttribute('status')) { case 'ready': $queue @@ -1316,6 +1384,36 @@ class Builds extends Action ->trigger(); } + /** + * Hook to run after build success + * + * @param Realtime $queueForRealtime + * @param Database $dbForProject + * @param Document $deployment + * @param array $runtime + * @param string|null $adapter + * @return void + * @throws Exception + */ + protected function afterBuildSuccess(Realtime $queueForRealtime, Database $dbForProject, Document &$deployment, array $runtime, ?string $adapter): void + { + if (!($queueForRealtime instanceof Realtime)) { + throw new Exception('queueForRealtime must be an instance of Realtime'); + } + if (!($dbForProject instanceof Database)) { + throw new Exception('dbForProject must be an instance of Database'); + } + if (!($deployment instanceof Document)) { + throw new Exception('deployment must be an instance of Document'); + } + if (!is_array($runtime)) { + throw new Exception('runtime must be an array'); + } + if (!is_string($adapter) && !is_null($adapter)) { + throw new Exception('adapter must be a string or null'); + } + } + protected function getRuntime(Document $resource, string $version): array { $runtimes = Config::getParam($version === 'v2' ? 'runtimes-v2' : 'runtimes', []); @@ -1397,131 +1495,134 @@ class Builds extends Action Document $resource, string $deploymentId, Database $dbForProject, - Database $dbForPlatform + Database $dbForPlatform, + Realtime $queueForRealtime, ): void { - if ($resource->getAttribute('providerSilentMode', false) === true) { - return; - } - - $deployment = $dbForProject->getDocument('deployments', $deploymentId); - $commentId = $deployment->getAttribute('providerCommentId', ''); - - if (!empty($providerCommitHash)) { - $message = match ($status) { - 'ready' => 'Build succeeded.', - 'failed' => 'Build failed.', - 'processing' => 'Building...', - default => $status - }; - - $state = match ($status) { - 'ready' => 'success', - 'failed' => 'failure', - 'processing' => 'pending', - default => $status - }; - - $resourceName = $resource->getAttribute('name'); - $projectName = $project->getAttribute('name'); - - $name = "{$resourceName} ({$projectName})"; - - $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; - $hostname = System::getEnv('_APP_DOMAIN'); - - $projectId = $project->getId(); - $resourceId = $resource->getId(); - $providerTargetUrl = match ($resource->getCollection()) { - 'functions' => "{$protocol}://{$hostname}/console/project-{$projectId}/functions/function-{$resourceId}", - 'sites' => "{$protocol}://{$hostname}/console/project-{$projectId}/sites/site-{$resourceId}", - default => throw new \Exception('Invalid resource type') - }; - - $github->updateCommitStatus($repositoryName, $providerCommitHash, $owner, $state, $message, $providerTargetUrl, $name); - } - - if (!empty($commentId)) { - $retries = 0; - - while (true) { - $retries++; - - try { - $dbForPlatform->createDocument('vcsCommentLocks', new Document([ - '$id' => $commentId - ])); - break; - } catch (\Throwable $err) { - if ($retries >= 9) { - throw $err; - } - - \sleep(1); - } + try { + if ($resource->getAttribute('providerSilentMode', false) === true) { + return; } - // Wrap in try/finally to ensure lock file gets deleted - try { - $resourceType = match($resource->getCollection()) { - 'functions' => 'function', - 'sites' => 'site', - default => throw new \Exception('Invalid resource type') + $deployment = $dbForProject->getDocument('deployments', $deploymentId); + $commentId = $deployment->getAttribute('providerCommentId', ''); + + if (!empty($providerCommitHash)) { + $message = match ($status) { + 'ready' => 'Build succeeded.', + 'failed' => 'Build failed.', + 'processing' => 'Building...', + default => $status }; - $rule = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [ - Query::equal("projectInternalId", [$project->getSequence()]), - Query::equal("type", ["deployment"]), - Query::equal("deploymentInternalId", [$deployment->getSequence()]), - ])); + $state = match ($status) { + 'ready' => 'success', + 'failed' => 'failure', + 'processing' => 'pending', + default => $status + }; + + $resourceName = $resource->getAttribute('name'); + $projectName = $project->getAttribute('name'); + + $name = "{$resourceName} ({$projectName})"; $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; - $previewUrl = match($resource->getCollection()) { - 'functions' => '', - 'sites' => !empty($rule) ? ("{$protocol}://" . $rule->getAttribute('domain', '')) : '', + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); + + $projectId = $project->getId(); + $region = $project->getAttribute('region', 'default'); + $resourceId = $resource->getId(); + $providerTargetUrl = match ($resource->getCollection()) { + 'functions' => "{$protocol}://{$hostname}/console/project-{$region}-{$projectId}/functions/function-{$resourceId}", + 'sites' => "{$protocol}://{$hostname}/console/project-{$region}-{$projectId}/sites/site-{$resourceId}", default => throw new \Exception('Invalid resource type') }; - $comment = new Comment(); - $comment->parseComment($github->getComment($owner, $repositoryName, $commentId)); - $comment->addBuild($project, $resource, $resourceType, $status, $deployment->getId(), ['type' => 'logs'], $previewUrl); - $github->updateComment($owner, $repositoryName, $commentId, $comment->generateComment()); - } finally { - $dbForPlatform->deleteDocument('vcsCommentLocks', $commentId); + $github->updateCommitStatus($repositoryName, $providerCommitHash, $owner, $state, $message, $providerTargetUrl, $name); } + + if (!empty($commentId)) { + $retries = 0; + + while (true) { + $retries++; + + try { + $dbForPlatform->createDocument('vcsCommentLocks', new Document([ + '$id' => $commentId + ])); + break; + } catch (\Throwable $err) { + if ($retries >= 9) { + throw $err; + } + + \sleep(1); + } + } + + // Wrap in try/finally to ensure lock file gets deleted + try { + $resourceType = match($resource->getCollection()) { + 'functions' => 'function', + 'sites' => 'site', + default => throw new \Exception('Invalid resource type') + }; + + $rule = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [ + Query::equal("projectInternalId", [$project->getSequence()]), + Query::equal("type", ["deployment"]), + Query::equal("deploymentInternalId", [$deployment->getSequence()]), + ])); + + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; + $previewUrl = match($resource->getCollection()) { + 'functions' => '', + 'sites' => !empty($rule) ? ("{$protocol}://" . $rule->getAttribute('domain', '')) : '', + default => throw new \Exception('Invalid resource type') + }; + + $comment = new Comment(); + $comment->parseComment($github->getComment($owner, $repositoryName, $commentId)); + $comment->addBuild($project, $resource, $resourceType, $status, $deployment->getId(), ['type' => 'logs'], $previewUrl); + $github->updateComment($owner, $repositoryName, $commentId, $comment->generateComment()); + } finally { + $dbForPlatform->deleteDocument('vcsCommentLocks', $commentId); + } + } + } catch (\Throwable $th) { + Console::warning("Git action failed:"); + Console::warning($th->getMessage()); + Console::warning($th->getTraceAsString()); + + $logs = $deployment->getAttribute('buildLogs', ''); + $date = \date('H:i:s'); + $logs .= "[$date] [appwrite] Git action failed. Deployment will continue. \n"; + + $deployment->setAttribute('buildLogs', $logs); + $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); + + $queueForRealtime + ->setPayload($deployment->getArrayCopy()) + ->trigger(); } } - protected function listRules(Document $project, array $queries, Database $database, callable $callback): void + private function cancelDeployment(string $deploymentId, Database $dbForProject, Realtime $queueForRealtime) { - $limit = 100; - $cursor = null; + Console::info('Build has been canceled'); - do { - $queries = \array_merge([ - Query::limit($limit), - Query::equal("projectInternalId", [$project->getSequence()]) - ], $queries); + $deployment = $dbForProject->getDocument('deployments', $deploymentId); - if ($cursor !== null) { - $queries[] = Query::cursorAfter($cursor); - } + $logs = $deployment->getAttribute('buildLogs', ''); + $date = \date('H:i:s'); + $logs .= "[$date] [appwrite] Build has been canceled. \n"; - $results = $database->find('rules', $queries); + $deployment->setAttribute('buildLogs', $logs); + $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); - $total = \count($results); - if ($total > 0) { - $cursor = $results[$total - 1]; - } - - if ($total < $limit) { - $cursor = null; - } - - foreach ($results as $document) { - if (is_callable($callback)) { - $callback($document); - } - } - } while (!\is_null($cursor)); + $queueForRealtime + ->setPayload($deployment->getArrayCopy()) + ->trigger(); } } diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php index 54ff189c20..9332453eea 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php @@ -57,7 +57,7 @@ class Create extends Action ->inject('user') ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $projectId, string $name, ?string $expire, Document $user, Response $response, Database $dbForPlatform) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php index eac42be5f0..2bfea6c55b 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php @@ -49,7 +49,7 @@ class Delete extends Action ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php index 6255976de4..29cda90f66 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php @@ -49,7 +49,7 @@ class Get extends Action ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php index 33b91eb0b6..b13bc535dd 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php @@ -52,7 +52,7 @@ class Update extends Action ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.') ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $projectId, string $keyId, string $name, ?string $expire, Response $response, Database $dbForPlatform) { diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php index 73e79a783a..209387018b 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php @@ -53,7 +53,7 @@ class XList extends Action ->param('queries', [], new DevKeys(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', DevKeys::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $projectId, ?array $queries, Response $response, Database $dbForPlatform) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php new file mode 100644 index 0000000000..3d06103e75 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php @@ -0,0 +1,116 @@ +<?php + +namespace Appwrite\Platform\Modules\Projects\Http\Projects; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Queries\Projects; +use Appwrite\Utopia\Response; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Order; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Query\Cursor; +use Utopia\Platform\Action; +use Utopia\Platform\Scope\HTTP; +use Utopia\Validator; +use Utopia\Validator\Text; + +class XList extends Action +{ + use HTTP; + public static function getName() + { + return 'listProjects'; + } + + protected function getQueriesValidator(): Validator + { + return new Projects(); + } + + public function __construct() + { + $this + ->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/projects') + ->desc('List projects') + ->groups(['api', 'projects']) + ->label('scope', 'projects.read') + ->label('sdk', new Method( + namespace: 'projects', + group: 'projects', + name: 'list', + description: <<<EOT + Get a list of all projects. You can use the query params to filter your results. + EOT, + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT_LIST + ) + ], + contentType: ContentType::JSON + )) + ->param('queries', [], $this->getQueriesValidator(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true) + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->inject('response') + ->inject('dbForPlatform') + ->callback($this->action(...)); + } + + public function action(array $queries, string $search, Response $response, Database $dbForPlatform) + { + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + if (!empty($search)) { + $queries[] = Query::search('search', $search); + } + + /** + * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries + */ + $cursor = \array_filter($queries, function ($query) { + return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); + }); + $cursor = reset($cursor); + if ($cursor) { + /** @var Query $cursor */ + + $validator = new Cursor(); + if (!$validator->isValid($cursor)) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); + } + + $projectId = $cursor->getValue(); + $cursorDocument = $dbForPlatform->getDocument('projects', $projectId); + + if ($cursorDocument->isEmpty()) { + throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Project '{$projectId}' for the 'cursor' value not found."); + } + + $cursor->setValue($cursorDocument); + } + + $filterQueries = Query::groupByType($queries)['filters']; + try { + $projects = $dbForPlatform->find('projects', $queries); + $total = $dbForPlatform->count('projects', $filterQueries, APP_LIMIT_COUNT); + } catch (Order $e) { + throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); + } + $response->dynamic(new Document([ + 'projects' => $projects, + 'total' => $total, + ]), Response::MODEL_PROJECT_LIST); + } +} diff --git a/src/Appwrite/Platform/Modules/Projects/Services/Http.php b/src/Appwrite/Platform/Modules/Projects/Services/Http.php index cec8ed6d16..2a0dd0aa60 100644 --- a/src/Appwrite/Platform/Modules/Projects/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Projects/Services/Http.php @@ -7,6 +7,7 @@ use Appwrite\Platform\Modules\Projects\Http\DevKeys\Delete as DeleteDevKey; use Appwrite\Platform\Modules\Projects\Http\DevKeys\Get as GetDevKey; use Appwrite\Platform\Modules\Projects\Http\DevKeys\Update as UpdateDevKey; use Appwrite\Platform\Modules\Projects\Http\DevKeys\XList as ListDevKeys; +use Appwrite\Platform\Modules\Projects\Http\Projects\XList as ListProjects; use Utopia\Platform\Service; class Http extends Service @@ -19,5 +20,7 @@ class Http extends Service $this->addAction(GetDevKey::getName(), new GetDevKey()); $this->addAction(ListDevKeys::getName(), new ListDevKeys()); $this->addAction(DeleteDevKey::getName(), new DeleteDevKey()); + + $this->addAction(ListProjects::getName(), new ListProjects()); } } diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php index 33eb5313a0..4cc8f48e7c 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php @@ -66,11 +66,29 @@ class Create extends Action ->inject('queueForCertificates') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $domain, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform) { + $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); + $functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); + + $restrictions = []; + if (!empty($sitesDomain)) { + $domainLevel = \count(\explode('.', $sitesDomain)); + $restrictions[] = ValidatorDomain::createRestriction($sitesDomain, $domainLevel + 1, ['commit-', 'branch-']); + } + if (!empty($functionsDomain)) { + $domainLevel = \count(\explode('.', $functionsDomain)); + $restrictions[] = ValidatorDomain::createRestriction($functionsDomain, $domainLevel + 1); + } + $validator = new ValidatorDomain($restrictions); + + if (!$validator->isValid($domain)) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); + } + $deniedDomains = [ 'localhost', APP_HOSTNAME_INTERNAL @@ -79,12 +97,10 @@ class Create extends Action $mainDomain = System::getEnv('_APP_DOMAIN', ''); $deniedDomains[] = $mainDomain; - $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); if (!empty($sitesDomain)) { $deniedDomains[] = $sitesDomain; } - $functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); if (!empty($functionsDomain)) { $deniedDomains[] = $functionsDomain; } @@ -102,10 +118,6 @@ class Create extends Action throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); } - if (\str_starts_with($domain, 'commit-') || \str_starts_with($domain, 'branch-')) { - throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); - } - try { $domain = new Domain($domain); } catch (\Throwable) { diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Delete.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Delete.php new file mode 100644 index 0000000000..5d76cc161e --- /dev/null +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Delete.php @@ -0,0 +1,88 @@ +<?php + +namespace Appwrite\Platform\Modules\Proxy\Http\Rules; + +use Appwrite\Event\Delete as DeleteEvent; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\UID; +use Utopia\Platform\Action; +use Utopia\Platform\Scope\HTTP; + +class Delete extends Action +{ + use HTTP; + + public static function getName() + { + return 'deleteRule'; + } + + public function __construct() + { + $this + ->setHttpMethod(Action::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/proxy/rules/:ruleId') + ->desc('Delete rule') + ->groups(['api', 'proxy']) + ->label('scope', 'rules.write') + ->label('event', 'rules.[ruleId].delete') + ->label('audits.event', 'rules.delete') + ->label('audits.resource', 'rule/{request.ruleId}') + ->label('sdk', new Method( + namespace: 'proxy', + group: null, + name: 'deleteRule', + description: <<<EOT + Delete a proxy rule by its unique ID. + EOT, + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) + ->param('ruleId', '', new UID(), 'Rule ID.') + ->inject('response') + ->inject('project') + ->inject('dbForPlatform') + ->inject('queueForDeletes') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action( + string $ruleId, + Response $response, + Document $project, + Database $dbForPlatform, + DeleteEvent $queueForDeletes, + Event $queueForEvents + ) { + $rule = $dbForPlatform->getDocument('rules', $ruleId); + + if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getSequence()) { + throw new Exception(Exception::RULE_NOT_FOUND); + } + + $dbForPlatform->deleteDocument('rules', $rule->getId()); + + $queueForDeletes + ->setType(DELETE_TYPE_DOCUMENT) + ->setDocument($rule); + + $queueForEvents->setParam('ruleId', $rule->getId()); + + $response->noContent(); + } +} diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php index 0b68b80aa3..5839e03e25 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php @@ -71,11 +71,29 @@ class Create extends Action ->inject('queueForEvents') ->inject('dbForPlatform') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $domain, string $functionId, string $branch, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform, Database $dbForProject) { + $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); + $functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); + + $restrictions = []; + if (!empty($sitesDomain)) { + $domainLevel = \count(\explode('.', $sitesDomain)); + $restrictions[] = ValidatorDomain::createRestriction($sitesDomain, $domainLevel + 1, ['commit-', 'branch-']); + } + if (!empty($functionsDomain)) { + $domainLevel = \count(\explode('.', $functionsDomain)); + $restrictions[] = ValidatorDomain::createRestriction($functionsDomain, $domainLevel + 1); + } + $validator = new ValidatorDomain($restrictions); + + if (!$validator->isValid($domain)) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); + } + $deniedDomains = [ 'localhost', APP_HOSTNAME_INTERNAL @@ -84,12 +102,10 @@ class Create extends Action $mainDomain = System::getEnv('_APP_DOMAIN', ''); $deniedDomains[] = $mainDomain; - $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); if (!empty($sitesDomain)) { $deniedDomains[] = $sitesDomain; } - $functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); if (!empty($functionsDomain)) { $deniedDomains[] = $functionsDomain; } @@ -107,10 +123,6 @@ class Create extends Action throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); } - if (\str_starts_with($domain, 'commit-') || \str_starts_with($domain, 'branch-')) { - throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); - } - try { $domain = new Domain($domain); } catch (\Throwable) { diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Get.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Get.php new file mode 100644 index 0000000000..77aa3df581 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Get.php @@ -0,0 +1,73 @@ +<?php + +namespace Appwrite\Platform\Modules\Proxy\Http\Rules; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\UID; +use Utopia\Platform\Action; +use Utopia\Platform\Scope\HTTP; + +class Get extends Action +{ + use HTTP; + + public static function getName() + { + return 'getRule'; + } + + public function __construct() + { + $this + ->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/proxy/rules/:ruleId') + ->desc('Get rule') + ->groups(['api', 'proxy']) + ->label('scope', 'rules.read') + ->label('sdk', new Method( + namespace: 'proxy', + group: null, + name: 'getRule', + description: <<<EOT + Get a proxy rule by its unique ID. + EOT, + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE, + ) + ] + )) + ->param('ruleId', '', new UID(), 'Rule ID.') + ->inject('response') + ->inject('project') + ->inject('dbForPlatform') + ->callback($this->action(...)); + } + + public function action( + string $ruleId, + Response $response, + Document $project, + Database $dbForPlatform + ) { + $rule = $dbForPlatform->getDocument('rules', $ruleId); + + if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getSequence()) { + throw new Exception(Exception::RULE_NOT_FOUND); + } + + $certificate = $dbForPlatform->getDocument('certificates', $rule->getAttribute('certificateId', '')); + $rule->setAttribute('logs', $certificate->getAttribute('logs', '')); + $rule->setAttribute('renewAt', $certificate->getAttribute('renewDate', '')); + + $response->dynamic($rule, Response::MODEL_PROXY_RULE); + } +} diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php index ed84b8498b..1dfef8bcc7 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php @@ -14,6 +14,7 @@ use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Exception\Duplicate; use Utopia\Database\Helpers\ID; +use Utopia\Database\Validator\UID; use Utopia\Domains\Domain; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -65,16 +66,37 @@ class Create extends Action ->param('domain', null, new ValidatorDomain(), 'Domain name.') ->param('url', null, new URL(), 'Target URL of redirection') ->param('statusCode', null, new WhiteList([301, 302, 307, 308]), 'Status code of redirection') + ->param('resourceId', '', new UID(), 'ID of parent resource.') + ->param('resourceType', '', new WhiteList(['site', 'function']), 'Type of parent resource.') ->inject('response') ->inject('project') ->inject('queueForCertificates') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->inject('dbForProject') + ->callback($this->action(...)); } - public function action(string $domain, string $url, int $statusCode, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform) + public function action(string $domain, string $url, int $statusCode, string $resourceId, string $resourceType, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform, Database $dbForProject) { + $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); + $functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); + + $restrictions = []; + if (!empty($sitesDomain)) { + $domainLevel = \count(\explode('.', $sitesDomain)); + $restrictions[] = ValidatorDomain::createRestriction($sitesDomain, $domainLevel + 1, ['commit-', 'branch-']); + } + if (!empty($functionsDomain)) { + $domainLevel = \count(\explode('.', $functionsDomain)); + $restrictions[] = ValidatorDomain::createRestriction($functionsDomain, $domainLevel + 1); + } + $validator = new ValidatorDomain($restrictions); + + if (!$validator->isValid($domain)) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); + } + $deniedDomains = [ 'localhost', APP_HOSTNAME_INTERNAL @@ -83,12 +105,10 @@ class Create extends Action $mainDomain = System::getEnv('_APP_DOMAIN', ''); $deniedDomains[] = $mainDomain; - $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); if (!empty($sitesDomain)) { $deniedDomains[] = $sitesDomain; } - $functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); if (!empty($functionsDomain)) { $deniedDomains[] = $functionsDomain; } @@ -106,16 +126,21 @@ class Create extends Action throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); } - if (\str_starts_with($domain, 'commit-') || \str_starts_with($domain, 'branch-')) { - throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); - } - try { $domain = new Domain($domain); } catch (\Throwable) { throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Domain may not start with http:// or https://.'); } + $collection = match ($resourceType) { + 'site' => 'sites', + 'function' => 'functions' + }; + $resource = $dbForProject->getDocument($collection, $resourceId); + if ($resource->isEmpty()) { + throw new Exception(Exception::RULE_RESOURCE_NOT_FOUND); + } + // TODO: @christyjacob remove once we migrate the rules in 1.7.x $ruleId = System::getEnv('_APP_RULES_FORMAT') === 'md5' ? md5($domain->get()) : ID::unique(); @@ -164,6 +189,9 @@ class Create extends Action 'trigger' => 'manual', 'redirectUrl' => $url, 'redirectStatusCode' => $statusCode, + 'deploymentResourceType' => $resourceType, + 'deploymentResourceId' => $resource->getId(), + 'deploymentResourceInternalId' => $resource->getSequence(), 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain->get()]), 'owner' => $owner, diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php index 7c2a640cdf..43cf09eaca 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php @@ -71,11 +71,29 @@ class Create extends Action ->inject('queueForEvents') ->inject('dbForPlatform') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $domain, string $siteId, string $branch, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform, Database $dbForProject) { + $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); + $functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); + + $restrictions = []; + if (!empty($sitesDomain)) { + $domainLevel = \count(\explode('.', $sitesDomain)); + $restrictions[] = ValidatorDomain::createRestriction($sitesDomain, $domainLevel + 1, ['commit-', 'branch-']); + } + if (!empty($functionsDomain)) { + $domainLevel = \count(\explode('.', $functionsDomain)); + $restrictions[] = ValidatorDomain::createRestriction($functionsDomain, $domainLevel + 1); + } + $validator = new ValidatorDomain($restrictions); + + if (!$validator->isValid($domain)) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); + } + $deniedDomains = [ 'localhost', APP_HOSTNAME_INTERNAL @@ -84,12 +102,10 @@ class Create extends Action $mainDomain = System::getEnv('_APP_DOMAIN', ''); $deniedDomains[] = $mainDomain; - $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); if (!empty($sitesDomain)) { $deniedDomains[] = $sitesDomain; } - $functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); if (!empty($functionsDomain)) { $deniedDomains[] = $functionsDomain; } @@ -107,10 +123,6 @@ class Create extends Action throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); } - if (\str_starts_with($domain, 'commit-') || \str_starts_with($domain, 'branch-')) { - throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.'); - } - try { $domain = new Domain($domain); } catch (\Throwable) { diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Verification/Update.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Verification/Update.php new file mode 100644 index 0000000000..3d52d203c3 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Verification/Update.php @@ -0,0 +1,186 @@ +<?php + +namespace Appwrite\Platform\Modules\Proxy\Http\Rules\Verification; + +use Appwrite\Event\Certificate; +use Appwrite\Event\Event; +use Appwrite\Extend\Exception; +use Appwrite\Network\Validator\DNS; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Validator\UID; +use Utopia\Domains\Domain; +use Utopia\Logger\Log; +use Utopia\Platform\Action; +use Utopia\Platform\Scope\HTTP; +use Utopia\System\System; +use Utopia\Validator\AnyOf; +use Utopia\Validator\IP; + +class Update extends Action +{ + use HTTP; + + public static function getName() + { + return 'updateRuleVerification'; + } + + public function __construct() + { + $this + ->setHttpMethod(Action::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/proxy/rules/:ruleId/verification') + ->desc('Update rule verification status') + ->groups(['api', 'proxy']) + ->label('scope', 'rules.write') + ->label('event', 'rules.[ruleId].update') + ->label('audits.event', 'rule.update') + ->label('audits.resource', 'rule/{response.$id}') + ->label('sdk', new Method( + namespace: 'proxy', + group: null, + name: 'updateRuleVerification', + description: <<<EOT + Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain. + EOT, + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE, + ) + ] + )) + ->param('ruleId', '', new UID(), 'Rule ID.') + ->inject('response') + ->inject('queueForCertificates') + ->inject('queueForEvents') + ->inject('project') + ->inject('dbForPlatform') + ->inject('log') + ->callback($this->action(...)); + } + + public function action( + string $ruleId, + Response $response, + Certificate $queueForCertificates, + Event $queueForEvents, + Document $project, + Database $dbForPlatform, + Log $log + ) { + $rule = $dbForPlatform->getDocument('rules', $ruleId); + + if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getSequence()) { + throw new Exception(Exception::RULE_NOT_FOUND); + } + + $targetCNAME = null; + switch ($rule->getAttribute('type', '')) { + case 'api': + // For example: fra.cloud.appwrite.io + $targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_TARGET_CNAME', '')); + break; + case 'redirect': + // For example: appwrite.network + $targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_SITES', '')); + break; + case 'deployment': + switch ($rule->getAttribute('deploymentResourceType', '')) { + case 'function': + // For example: fra.appwrite.run + $targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_FUNCTIONS', '')); + break; + case 'site': + // For example: appwrite.network + $targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_SITES', '')); + break; + default: + break; + } + // no break + default: + break; + } + + $validators = []; + + if (!is_null($targetCNAME)) { + if ($targetCNAME->isKnown() && !$targetCNAME->isTest()) { + $validators[] = new DNS($targetCNAME->get(), DNS::RECORD_CNAME); + } + } + + if ((new IP(IP::V4))->isValid(System::getEnv('_APP_DOMAIN_TARGET_A', ''))) { + $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_A', ''), DNS::RECORD_A); + } + if ((new IP(IP::V6))->isValid(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''))) { + $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); + } + + if (empty($validators)) { + throw new Exception(Exception::GENERAL_SERVER_ERROR, 'At least one of domain targets environment variable must be configured.'); + } + + if ($rule->getAttribute('verification') === true) { + return $response->dynamic($rule, Response::MODEL_PROXY_RULE); + } + + $validator = new AnyOf($validators, AnyOf::TYPE_STRING); + $domain = new Domain($rule->getAttribute('domain', '')); + + $validationStart = \microtime(true); + if (!$validator->isValid($domain->get())) { + $log->addExtra('dnsTiming', \strval(\microtime(true) - $validationStart)); + $log->addTag('dnsDomain', $domain->get()); + + $errors = []; + foreach ($validators as $validator) { + if (!empty($validator->getLogs())) { + $errors[] = $validator->getLogs(); + } + } + + $error = \implode("\n", $errors); + $log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error)); + + throw new Exception(Exception::RULE_VERIFICATION_FAILED); + } + + // Ensure CAA won't block certificate issuance + if (!empty(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''))) { + $validationStart = \microtime(true); + $validator = new DNS(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''), DNS::RECORD_CAA); + if (!$validator->isValid($domain->get())) { + $log->addExtra('dnsTimingCaa', \strval(\microtime(true) - $validationStart)); + $log->addTag('dnsDomain', $domain->get()); + $error = $validator->getDescription(); + $log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error)); + throw new Exception(Exception::RULE_VERIFICATION_FAILED, 'Domain verification failed because CAA records do not allow Appwrite\'s certificate issuer.'); + } + } + + $dbForPlatform->updateDocument('rules', $rule->getId(), $rule->setAttribute('status', 'verifying')); + + // Issue a TLS certificate when domain is verified + $queueForCertificates + ->setDomain(new Document([ + 'domain' => $rule->getAttribute('domain'), + 'domainType' => $rule->getAttribute('deploymentResourceType', $rule->getAttribute('type')), + ])) + ->trigger(); + + $queueForEvents->setParam('ruleId', $rule->getId()); + + $certificate = $dbForPlatform->getDocument('certificates', $rule->getAttribute('certificateId', '')); + $rule->setAttribute('logs', $certificate->getAttribute('logs', '')); + + $response->dynamic($rule, Response::MODEL_PROXY_RULE); + } +} diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/XList.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/XList.php new file mode 100644 index 0000000000..e084cf76b2 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/XList.php @@ -0,0 +1,118 @@ +<?php + +namespace Appwrite\Platform\Modules\Proxy\Http\Rules; + +use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Queries\Rules; +use Appwrite\Utopia\Response; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Query\Cursor; +use Utopia\Platform\Action; +use Utopia\Platform\Scope\HTTP; +use Utopia\Validator\Text; + +class XList extends Action +{ + use HTTP; + + public static function getName() + { + return 'listRules'; + } + + public function __construct() + { + $this + ->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/proxy/rules') + ->desc('List rules') + ->groups(['api', 'proxy']) + ->label('scope', 'rules.read') + ->label('sdk', new Method( + namespace: 'proxy', + group: null, + name: 'listRules', + description: <<<EOT + Get a list of all the proxy rules. You can use the query params to filter your results. + EOT, + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE_LIST, + ) + ] + )) + ->param('queries', [], new Rules(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Rules::ALLOWED_ATTRIBUTES), true) + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->inject('response') + ->inject('project') + ->inject('dbForPlatform') + ->callback($this->action(...)); + } + + public function action( + array $queries, + string $search, + Response $response, + Document $project, + Database $dbForPlatform + ) { + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + if (!empty($search)) { + $queries[] = Query::search('search', $search); + } + + $queries[] = Query::equal('projectInternalId', [$project->getSequence()]); + + /** + * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries + */ + $cursor = \array_filter($queries, function ($query) { + return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); + }); + $cursor = reset($cursor); + if ($cursor) { + /** @var Query $cursor */ + + $validator = new Cursor(); + if (!$validator->isValid($cursor)) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); + } + + $ruleId = $cursor->getValue(); + $cursorDocument = $dbForPlatform->getDocument('rules', $ruleId); + + if ($cursorDocument->isEmpty()) { + throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Rule '{$ruleId}' for the 'cursor' value not found."); + } + + $cursor->setValue($cursorDocument); + } + + $filterQueries = Query::groupByType($queries)['filters']; + + $rules = $dbForPlatform->find('rules', $queries); + foreach ($rules as $rule) { + $certificate = $dbForPlatform->getDocument('certificates', $rule->getAttribute('certificateId', '')); + $rule->setAttribute('logs', $certificate->getAttribute('logs', '')); + $rule->setAttribute('renewAt', $certificate->getAttribute('renewDate', '')); + } + + $response->dynamic(new Document([ + 'rules' => $rules, + 'total' => $dbForPlatform->count('rules', $filterQueries, APP_LIMIT_COUNT), + ]), Response::MODEL_PROXY_RULE_LIST); + } +} diff --git a/src/Appwrite/Platform/Modules/Proxy/Services/Http.php b/src/Appwrite/Platform/Modules/Proxy/Services/Http.php index c5f11ad5be..980c64cc54 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Proxy/Services/Http.php @@ -3,9 +3,13 @@ namespace Appwrite\Platform\Modules\Proxy\Services; use Appwrite\Platform\Modules\Proxy\Http\Rules\API\Create as CreateAPIRule; +use Appwrite\Platform\Modules\Proxy\Http\Rules\Delete as DeleteRule; use Appwrite\Platform\Modules\Proxy\Http\Rules\Function\Create as CreateFunctionRule; +use Appwrite\Platform\Modules\Proxy\Http\Rules\Get as GetRule; use Appwrite\Platform\Modules\Proxy\Http\Rules\Redirect\Create as CreateRedirectRule; use Appwrite\Platform\Modules\Proxy\Http\Rules\Site\Create as CreateSiteRule; +use Appwrite\Platform\Modules\Proxy\Http\Rules\Verification\Update as UpdateRuleVerification; +use Appwrite\Platform\Modules\Proxy\Http\Rules\XList as ListRules; use Utopia\Platform\Service; class Http extends Service @@ -19,5 +23,9 @@ class Http extends Service $this->addAction(CreateSiteRule::getName(), new CreateSiteRule()); $this->addAction(CreateFunctionRule::getName(), new CreateFunctionRule()); $this->addAction(CreateRedirectRule::getName(), new CreateRedirectRule()); + $this->addAction(GetRule::getName(), new GetRule()); + $this->addAction(ListRules::getName(), new ListRules()); + $this->addAction(DeleteRule::getName(), new DeleteRule()); + $this->addAction(UpdateRuleVerification::getName(), new UpdateRuleVerification()); } } diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php index 77d7a80f70..65a0fcf143 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php @@ -86,7 +86,7 @@ class Create extends Action ->inject('deviceForLocal') ->inject('queueForBuilds') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -347,10 +347,16 @@ class Create extends Action 'domain' => $domain, 'type' => 'deployment', 'trigger' => 'deployment', - 'value' => $deployment->getId(), + 'deploymentId' => $deployment->isEmpty() ? '' : $deployment->getId(), + 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getSequence(), + 'deploymentResourceType' => 'site', + 'deploymentResourceId' => $site->getId(), + 'deploymentResourceInternalId' => $site->getSequence(), 'status' => 'verified', 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain]), + 'owner' => 'Appwrite', + 'region' => $project->getAttribute('region') ])) ); } else { diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php index 8717d04fc2..dfc0f0c976 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php @@ -62,7 +62,7 @@ class Delete extends Action ->inject('queueForDeletes') ->inject('queueForEvents') ->inject('deviceForSites') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php index e83af0bab6..5a87ce453f 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php @@ -60,7 +60,7 @@ class Get extends Action ->inject('dbForProject') ->inject('deviceForSites') ->inject('deviceForBuilds') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -99,12 +99,14 @@ class Get extends Action } if (!$device->exists($path)) { - throw new Exception(Exception::BUILD_NOT_FOUND); + throw new Exception(Exception::DEPLOYMENT_NOT_FOUND); } $response ->setContentType('application/gzip') - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') + ->addHeader('Expires', '0') + ->addHeader('Pragma', 'no-cache') ->addHeader('X-Peak', \memory_get_peak_usage()) ->addHeader('Content-Disposition', 'attachment; filename="' . $deploymentId . '-' . $type . '.tar.gz"'); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php index 739c701a2e..065dd13e88 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php @@ -65,7 +65,7 @@ class Create extends Action ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('deviceForSites') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -111,8 +111,8 @@ class Create extends Action } $deployment->removeAttribute('$sequence'); + $deployment = $dbForProject->createDocument('deployments', $deployment->setAttributes([ - '$sequence' => '', '$id' => $deploymentId, 'sourcePath' => $destination, 'totalSize' => $deployment->getAttribute('sourceSize', 0), diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Get.php index d280231159..d583c62fb1 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Get.php @@ -49,7 +49,7 @@ class Get extends Action ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $deploymentId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php index 046ddd1ac8..a447e54f8d 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php @@ -57,7 +57,7 @@ class Update extends Action ->inject('project') ->inject('queueForEvents') ->inject('executor') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php index 5de688fbf8..a2040d830b 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php @@ -77,7 +77,7 @@ class Create extends Base ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('gitHub') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php index eb6fdf4094..ddad5d793a 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php @@ -72,7 +72,7 @@ class Create extends Base ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('gitHub') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/XList.php index 306f756d87..436cd69b52 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/XList.php @@ -3,10 +3,12 @@ namespace Appwrite\Platform\Modules\Sites\Http\Deployments; use Appwrite\Extend\Exception; +use Appwrite\Platform\Modules\Compute\Base; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Deployments; +use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; @@ -19,7 +21,7 @@ use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; use Utopia\Validator\Text; -class XList extends Action +class XList extends Base { use HTTP; @@ -55,13 +57,20 @@ class XList extends Action ->param('siteId', '', new UID(), 'Site ID.') ->param('queries', [], new Deployments(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Deployments::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->inject('request') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } - public function action(string $siteId, array $queries, string $search, Response $response, Database $dbForProject) - { + public function action( + string $siteId, + array $queries, + string $search, + Request $request, + Response $response, + Database $dbForProject + ) { $site = $dbForProject->getDocument('sites', $siteId); if ($site->isEmpty()) { @@ -116,6 +125,7 @@ class XList extends Action throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); } + $this->applySelectQueries($request, $response, Response::MODEL_DEPLOYMENT); $response->dynamic(new Document([ 'deployments' => $results, 'total' => $total, diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php index cf2bb8c62b..a042fd6e7c 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php @@ -46,7 +46,7 @@ class XList extends Base ] )) ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Response $response) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Logs/Delete.php b/src/Appwrite/Platform/Modules/Sites/Http/Logs/Delete.php index 2d87321086..0f53985039 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Logs/Delete.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Logs/Delete.php @@ -55,7 +55,7 @@ class Delete extends Base ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $logId, Response $response, Database $dbForProject, Event $queueForEvents) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Logs/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Logs/Get.php index 2ef7d75539..935e790113 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Logs/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Logs/Get.php @@ -50,7 +50,7 @@ class Get extends Base ->param('logId', '', new UID(), 'Log ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $logId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Logs/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Logs/XList.php index 7e2c587797..f9bee3e425 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Logs/XList.php @@ -57,7 +57,7 @@ class XList extends Base ->param('queries', [], new Logs(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, array $queries, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php index 6dd1865047..9be95441cb 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php @@ -89,7 +89,7 @@ class Create extends Base ->inject('project') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php index 37666215e5..ed9b059c33 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php @@ -58,7 +58,7 @@ class Delete extends Base ->inject('dbForProject') ->inject('queueForDeletes') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php index 835068be88..bb6bd4f632 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php @@ -5,13 +5,14 @@ namespace Appwrite\Platform\Modules\Sites\Http\Sites\Deployment; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Compute\Base; -use Appwrite\Query; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -59,7 +60,7 @@ class Update extends Base ->inject('dbForProject') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -86,8 +87,6 @@ class Update extends Base throw new Exception(Exception::BUILD_NOT_READY); } - $oldDeploymentInternalId = $site->getAttribute('deploymentInternalId', ''); - $site = $dbForProject->updateDocument('sites', $site->getId(), new Document(array_merge($site->getArrayCopy(), [ 'deploymentInternalId' => $deployment->getSequence(), 'deploymentId' => $deployment->getId(), @@ -97,24 +96,21 @@ class Update extends Base ]))); $queries = [ - Query::equal('trigger', 'manual'), - Query::equal("type", ["deployment"]), - Query::equal("deploymentResourceType", ["site"]), - Query::equal("deploymentResourceInternalId", [$site->getSequence()]), + Query::equal('trigger', ['manual']), + Query::equal('type', ['deployment']), + Query::equal('deploymentResourceType', ['site']), + Query::equal('deploymentResourceInternalId', [$site->getSequence()]), + Query::equal('deploymentVcsProviderBranch', ['']), + Query::equal('projectInternalId', [$project->getSequence()]) ]; - if (empty($oldDeploymentInternalId)) { - $queries[] = Query::equal("deploymentInternalId", [""]); - } else { - $queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]); - } - - $this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment) { + Authorization::skip(fn () => $dbForPlatform->foreach('rules', function (Document $rule) use ($dbForPlatform, $deployment) { $rule = $rule ->setAttribute('deploymentId', $deployment->getId()) ->setAttribute('deploymentInternalId', $deployment->getSequence()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); - }); + + Authorization::skip(fn () => $dbForPlatform->updateDocument('rules', $rule->getId(), $rule)); + }, $queries)); $queueForEvents ->setParam('siteId', $site->getId()) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Get.php index 88ff5f1d51..d86d98ef71 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Get.php @@ -49,7 +49,7 @@ class Get extends Base ->param('siteId', '', new UID(), 'Site ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php index 85f1ee8845..80354d5067 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php @@ -97,7 +97,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('gitHub') ->inject('executor') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/XList.php index 0a3b257f59..988a2d2e20 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/XList.php @@ -56,7 +56,7 @@ class XList extends Base ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(array $queries, string $search, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Specifications/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Specifications/XList.php index 2a9447f8c6..4bda37df73 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Specifications/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Specifications/XList.php @@ -48,7 +48,7 @@ class XList extends Base )) ->inject('response') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Response $response, array $plan) @@ -63,8 +63,8 @@ class XList extends Base $spec['enabled'] = in_array($spec['slug'], $plan['runtimeSpecifications']); } - $maxCpus = System::getEnv('_APP_FUNCTIONS_CPUS', 0); - $maxMemory = System::getEnv('_APP_FUNCTIONS_MEMORY', 0); + $maxCpus = System::getEnv('_APP_COMPUTE_CPUS', 0); + $maxMemory = System::getEnv('_APP_COMPUTE_MEMORY', 0); // Only add specs that are within the limits set by environment variables // Treat 0 as no limit diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Templates/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Templates/Get.php index a4066fb787..633ef31e68 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Templates/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Templates/Get.php @@ -49,7 +49,7 @@ class Get extends Base )) ->param('templateId', '', new Text(128), 'Template ID.') ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $templateId, Response $response) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php index 414ecc9987..4fe00f3edf 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php @@ -53,7 +53,7 @@ class XList extends Base ->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true) ->param('offset', 0, new Range(0, 5000), 'Offset the list of returned templates. Maximum offset is 5000.', true) ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php index f8df836085..af96c10457 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php @@ -55,7 +55,7 @@ class Get extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php index e37d3e792e..d36cc56ae5 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php @@ -52,7 +52,7 @@ class XList extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $range, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Create.php index 88da635fe4..ef504fe663 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Create.php @@ -62,7 +62,7 @@ class Create extends Base ->inject('response') ->inject('dbForProject') ->inject('project') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $key, string $value, bool $secret, Response $response, Database $dbForProject, Document $project) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Delete.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Delete.php index ea927be367..be0addb34c 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Delete.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Delete.php @@ -54,7 +54,7 @@ class Delete extends Base ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $variableId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Get.php index 1c25f9e701..11eb546092 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Get.php @@ -53,7 +53,7 @@ class Get extends Base ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $variableId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php index 698992f79f..3cf2e2f85f 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php @@ -58,7 +58,7 @@ class Update extends Base ->param('secret', null, new Boolean(), 'Secret variables can be updated or deleted, but only sites can read them during build and runtime.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php index 15e21296a5..51ab355c75 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php @@ -53,7 +53,7 @@ class XList extends Base ->param('siteId', '', new UID(), 'Site unique ID.', false) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php index bcefaf353f..5708f1b83b 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php @@ -37,6 +37,7 @@ class Action extends UtopiaAction if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } + return [ 'bucket' => $bucket, 'file' => $file, diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php index dc1e5232b6..fe7a0187e9 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php @@ -65,7 +65,7 @@ class Create extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $bucketId, string $fileId, ?string $expire, Response $response, Database $dbForProject, Event $queueForEvents): void diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php index 628d9b768f..231164d6ee 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php @@ -55,7 +55,7 @@ class XList extends Action ->param('queries', [], new FileTokens(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', FileTokens::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $bucketId, string $fileId, array $queries, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Delete.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Delete.php index fcac9a6b24..c36df367ee 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Delete.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Delete.php @@ -58,7 +58,7 @@ class Delete extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $tokenId, Response $response, Database $dbForProject, Event $queueForEvents) diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Get.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Get.php index 66b9c1b5cb..4da9e125f2 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Get.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Get.php @@ -50,7 +50,7 @@ class Get extends Action ->param('tokenId', '', new UID(), 'Token ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $tokenId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Update.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Update.php index c341831c0d..7a15708011 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Update.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Update.php @@ -61,7 +61,7 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $tokenId, ?string $expire, Response $response, Database $dbForProject, Event $queueForEvents) diff --git a/src/Appwrite/Platform/Services/Workers.php b/src/Appwrite/Platform/Services/Workers.php index e22f402145..f2cbeb390a 100644 --- a/src/Appwrite/Platform/Services/Workers.php +++ b/src/Appwrite/Platform/Services/Workers.php @@ -4,7 +4,6 @@ namespace Appwrite\Platform\Services; use Appwrite\Platform\Workers\Audits; use Appwrite\Platform\Workers\Certificates; -use Appwrite\Platform\Workers\Databases; use Appwrite\Platform\Workers\Deletes; use Appwrite\Platform\Workers\Functions; use Appwrite\Platform\Workers\Mails; @@ -23,7 +22,6 @@ class Workers extends Service $this ->addAction(Audits::getName(), new Audits()) ->addAction(Certificates::getName(), new Certificates()) - ->addAction(Databases::getName(), new Databases()) ->addAction(Deletes::getName(), new Deletes()) ->addAction(Functions::getName(), new Functions()) ->addAction(Mails::getName(), new Mails()) diff --git a/src/Appwrite/Platform/Tasks/Doctor.php b/src/Appwrite/Platform/Tasks/Doctor.php index b543555477..20eeb0826e 100644 --- a/src/Appwrite/Platform/Tasks/Doctor.php +++ b/src/Appwrite/Platform/Tasks/Doctor.php @@ -34,7 +34,7 @@ class Doctor extends Action $this ->desc('Validate server health') ->inject('register') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Registry $register): void diff --git a/src/Appwrite/Platform/Tasks/Install.php b/src/Appwrite/Platform/Tasks/Install.php index c7b1f72453..c3b4e33593 100644 --- a/src/Appwrite/Platform/Tasks/Install.php +++ b/src/Appwrite/Platform/Tasks/Install.php @@ -31,7 +31,7 @@ class Install extends Action ->param('image', 'appwrite', new Text(0), 'Main appwrite docker image', true) ->param('interactive', 'Y', new Text(1), 'Run an interactive session', true) ->param('no-start', false, new Boolean(true), 'Run an interactive session', true) - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $httpPort, string $httpsPort, string $organization, string $image, string $interactive, bool $noStart): void diff --git a/src/Appwrite/Platform/Tasks/Maintenance.php b/src/Appwrite/Platform/Tasks/Maintenance.php index fd9d05dec9..036e8783d4 100644 --- a/src/Appwrite/Platform/Tasks/Maintenance.php +++ b/src/Appwrite/Platform/Tasks/Maintenance.php @@ -4,9 +4,11 @@ namespace Appwrite\Platform\Tasks; use Appwrite\Event\Certificate; use Appwrite\Event\Delete; +use DateInterval; +use DateTime; use Utopia\CLI\Console; use Utopia\Database\Database; -use Utopia\Database\DateTime; +use Utopia\Database\DateTime as DatabaseDateTime; use Utopia\Database\Document; use Utopia\Database\Query; use Utopia\Platform\Action; @@ -27,7 +29,7 @@ class Maintenance extends Action ->inject('console') ->inject('queueForCertificates') ->inject('queueForDeletes') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Database $dbForPlatform, Document $console, Certificate $queueForCertificates, Delete $queueForDeletes): void @@ -58,29 +60,35 @@ class Maintenance extends Action Console::info('Setting loop start time to ' . $next->format("Y-m-d H:i:s.v") . '. Delaying for ' . $delay . ' seconds.'); Console::loop(function () use ($interval, $cacheRetention, $schedulesDeletionRetention, $usageStatsRetentionHourly, $dbForPlatform, $console, $queueForDeletes, $queueForCertificates) { - $time = DateTime::now(); + $time = DatabaseDateTime::now(); Console::info("[{$time}] Notifying workers with maintenance tasks every {$interval} seconds"); + // Iterate through project only if it was accessed in last 30 days + $dateInterval = DateInterval::createFromDateString('30 days'); + $before30days = (new DateTime())->sub($dateInterval); + $dbForPlatform->foreach( 'projects', function (Document $project) use ($queueForDeletes, $usageStatsRetentionHourly) { $queueForDeletes ->setType(DELETE_TYPE_MAINTENANCE) ->setProject($project) - ->setUsageRetentionHourlyDateTime(DateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly)) + ->setUsageRetentionHourlyDateTime(DatabaseDateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly)) ->trigger(); }, [ Query::equal('region', [System::getEnv('_APP_REGION', 'default')]), Query::limit(100), + Query::greaterThanEqual('accessedAt', DatabaseDateTime::format($before30days)), + Query::orderAsc('teamInternalId'), ] ); $queueForDeletes ->setType(DELETE_TYPE_MAINTENANCE) ->setProject($console) - ->setUsageRetentionHourlyDateTime(DateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly)) + ->setUsageRetentionHourlyDateTime(DatabaseDateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly)) ->trigger(); $this->notifyDeleteConnections($queueForDeletes); @@ -94,13 +102,13 @@ class Maintenance extends Action { $queueForDeletes ->setType(DELETE_TYPE_REALTIME) - ->setDatetime(DateTime::addSeconds(new \DateTime(), -60)) + ->setDatetime(DatabaseDateTime::addSeconds(new \DateTime(), -60)) ->trigger(); } private function renewCertificates(Database $dbForPlatform, Certificate $queueForCertificate): void { - $time = DateTime::now(); + $time = DatabaseDateTime::now(); $certificates = $dbForPlatform->find('certificates', [ Query::lessThan('attempts', 5), // Maximum 5 attempts @@ -114,6 +122,19 @@ class Maintenance extends Action Console::info("[{$time}] Found " . \count($certificates) . " certificates for renewal, scheduling jobs."); foreach ($certificates as $certificate) { + $domain = $certificate->getAttribute('domain'); + if (System::getEnv('_APP_RULES_FORMAT') === 'md5') { + $rule = $dbForPlatform->getDocument('rules', md5($domain)); + } else { + $rule = $dbForPlatform->findOne('rules', [ + Query::equal('domain', [$domain]), + ]); + } + + if ($rule->isEmpty() || $rule->getAttribute('region') !== System::getEnv('_APP_REGION', 'default')) { + continue; + } + $queueForCertificate ->setDomain(new Document([ 'domain' => $certificate->getAttribute('domain') @@ -129,7 +150,7 @@ class Maintenance extends Action { $queueForDeletes ->setType(DELETE_TYPE_CACHE_BY_TIMESTAMP) - ->setDatetime(DateTime::addSeconds(new \DateTime(), -1 * $interval)) + ->setDatetime(DatabaseDateTime::addSeconds(new \DateTime(), -1 * $interval)) ->trigger(); } @@ -137,7 +158,7 @@ class Maintenance extends Action { $queueForDeletes ->setType(DELETE_TYPE_SCHEDULES) - ->setDatetime(DateTime::addSeconds(new \DateTime(), -1 * $interval)) + ->setDatetime(DatabaseDateTime::addSeconds(new \DateTime(), -1 * $interval)) ->trigger(); } } diff --git a/src/Appwrite/Platform/Tasks/Migrate.php b/src/Appwrite/Platform/Tasks/Migrate.php index 5407c772ab..3e35c1c1fa 100644 --- a/src/Appwrite/Platform/Tasks/Migrate.php +++ b/src/Appwrite/Platform/Tasks/Migrate.php @@ -51,12 +51,12 @@ class Migrate extends Action Authorization::disable(); if (!\array_key_exists($version, Migration::$versions)) { - Console::error("Version {$version} not found."); + Console::error("No migration found for version $version."); Console::exit(1); return; } - Console::success('Starting Data Migration to version ' . $version); + Console::success('Starting data migration to version ' . $version); $class = 'Appwrite\\Migration\\Version\\' . Migration::$versions[$version]; diff --git a/src/Appwrite/Platform/Tasks/QueueRetry.php b/src/Appwrite/Platform/Tasks/QueueRetry.php index f8099dcb00..442fa39823 100644 --- a/src/Appwrite/Platform/Tasks/QueueRetry.php +++ b/src/Appwrite/Platform/Tasks/QueueRetry.php @@ -24,7 +24,7 @@ class QueueRetry extends Action ->param('name', '', new Text(100), 'Queue name') ->param('limit', 0, new Wildcard(), 'jobs limit', true) ->inject('publisher') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index a0009fd59f..e5c18338bf 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -46,7 +46,7 @@ class SDKs extends Action ->param('git', null, new Nullable(new WhiteList(['yes', 'no'])), 'Should we use git push?', optional: true) ->param('production', null, new Nullable(new WhiteList(['yes', 'no'])), 'Should we push to production?', optional: true) ->param('message', null, new Nullable(new Text(256)), 'Commit Message', optional: true) - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(?string $selectedPlatform, ?string $selectedSDK, ?string $version, ?string $git, ?string $production, ?string $message): void @@ -62,9 +62,33 @@ class SDKs extends Action $production ??= Console::confirm('Type "Appwrite" to push code to production git repos'); $production = $production === 'Appwrite'; $message ??= Console::confirm('Please enter your commit message:'); + + $createPr = Console::confirm('Should we create pull request automatically? (yes/no)'); + $createPr = $createPr === 'yes'; } - if (!in_array($version, ['0.6.x', '0.7.x', '0.8.x', '0.9.x', '0.10.x', '0.11.x', '0.12.x', '0.13.x', '0.14.x', '0.15.x', '1.0.x', '1.1.x', '1.2.x', '1.3.x', '1.4.x', '1.5.x', '1.6.x', '1.7.x', 'latest'])) { + if (!\in_array($version, [ + '0.6.x', + '0.7.x', + '0.8.x', + '0.9.x', + '0.10.x', + '0.11.x', + '0.12.x', + '0.13.x', + '0.14.x', + '0.15.x', + '1.0.x', + '1.1.x', + '1.2.x', + '1.3.x', + '1.4.x', + '1.5.x', + '1.6.x', + '1.7.x', + '1.8.x', + 'latest' + ])) { throw new \Exception('Unknown version given'); } @@ -98,7 +122,7 @@ class SDKs extends Action $gettingStarted = ($gettingStarted) ? \file_get_contents($gettingStarted) : ''; $examples = \realpath(__DIR__ . '/../../../../docs/sdks/' . $language['key'] . '/EXAMPLES.md'); $examples = ($examples) ? \file_get_contents($examples) : ''; - $changelog = \realpath(__DIR__ . '/../../../../docs/sdks/' . $language['key'] . '/CHANGELOG.md'); + $changelog = $language['changelog'] ?? ''; $changelog = ($changelog) ? \file_get_contents($changelog) : '# Change Log'; $warning = '**This SDK is compatible with Appwrite server version ' . $version . '. For older versions, please check [previous releases](' . $language['url'] . '/releases).**'; $license = 'BSD-3-Clause'; @@ -250,8 +274,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ->setTwitter(APP_SOCIAL_TWITTER_HANDLE) ->setDiscord(APP_SOCIAL_DISCORD_CHANNEL, APP_SOCIAL_DISCORD) ->setDefaultHeaders([ - 'X-Appwrite-Response-Format' => '1.7.0', - ]); + 'X-Appwrite-Response-Format' => '1.8.0', + ]) + ->setExclude($language['exclude'] ?? []); // Make sure we have a clean slate. // Otherwise, all files in this dir will be pushed, @@ -271,6 +296,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND $gitUrl = 'git@github.com:aw-tests/' . $language['gitRepoName'] . '.git'; } + $repoBranch = $language['repoBranch'] ?? 'main'; if ($git && !empty($gitUrl)) { \exec('rm -rf ' . $target . ' && \ mkdir -p ' . $target . ' && \ @@ -278,8 +304,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND git init && \ git remote add origin ' . $gitUrl . ' && \ git fetch origin && \ - git checkout main || git checkout -b main && \ - git pull origin main && \ + git checkout ' . $repoBranch . ' || git checkout -b ' . $repoBranch . ' && \ + git pull origin ' . $repoBranch . ' && \ git checkout ' . $gitBranch . ' || git checkout -b ' . $gitBranch . ' && \ git fetch origin ' . $gitBranch . ' || git push -u origin ' . $gitBranch . ' && \ git pull origin ' . $gitBranch . ' && \ @@ -292,6 +318,47 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND Console::success("Pushed {$language['name']} SDK to {$gitUrl}"); + if ($createPr) { + $prTitle = "feat: {$language['name']} SDK update for version {$language['version']}"; + $prBody = "This PR contains updates to the {$language['name']} SDK for version {$language['version']}."; + + $repoName = $language['gitRepoName']; + if (!$production) { + $repoName = 'aw-tests/' . $language['gitRepoName']; + } else { + $repoName = $language['gitUserName'] . '/' . $language['gitRepoName']; + } + + Console::info("Creating pull request for {$language['name']} SDK..."); + + $prCommand = 'cd ' . $target . ' && \ + gh pr create \ + --repo "' . $repoName . '" \ + --title "' . $prTitle . '" \ + --body "' . $prBody . '" \ + --base "' . $repoBranch . '" \ + --head "' . $gitBranch . '" \ + 2>&1'; + + $prOutput = []; + $prReturnCode = 0; + \exec($prCommand, $prOutput, $prReturnCode); + + if ($prReturnCode === 0) { + Console::success("Successfully created pull request for {$language['name']} SDK"); + if (!empty($prOutput)) { + Console::info("PR URL: " . end($prOutput)); + } + } else { + $errorMessage = implode("\n", $prOutput); + if (strpos($errorMessage, 'already exists') !== false) { + Console::warning("Pull request already exists for {$language['name']} SDK"); + } else { + Console::error("Failed to create pull request for {$language['name']} SDK: " . $errorMessage); + } + } + } + \exec('rm -rf ' . $target); Console::success("Remove temp directory '{$target}' for {$language['name']} SDK"); } diff --git a/src/Appwrite/Platform/Tasks/SSL.php b/src/Appwrite/Platform/Tasks/SSL.php index ae1c93a360..651cb4de11 100644 --- a/src/Appwrite/Platform/Tasks/SSL.php +++ b/src/Appwrite/Platform/Tasks/SSL.php @@ -24,7 +24,7 @@ class SSL extends Action ->param('domain', System::getEnv('_APP_DOMAIN', ''), new Hostname(), 'Domain to generate certificate for. If empty, main domain will be used.', true) ->param('skip-check', true, new Boolean(true), 'If DNS and renew check should be skipped. Defaults to true, and when true, all jobs will result in certificate generation attempt.', true) ->inject('queueForCertificates') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $domain, bool|string $skipCheck, Certificate $queueForCertificates): void diff --git a/src/Appwrite/Platform/Tasks/ScheduleBase.php b/src/Appwrite/Platform/Tasks/ScheduleBase.php index 6d0968a804..5cd25b09b4 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleBase.php +++ b/src/Appwrite/Platform/Tasks/ScheduleBase.php @@ -11,7 +11,6 @@ use Utopia\Database\Exception; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\Platform\Action; -use Utopia\Pools\Group; use Utopia\Queue\Broker\Pool as BrokerPool; use Utopia\System\System; use Utopia\Telemetry\Adapter as Telemetry; @@ -26,6 +25,9 @@ abstract class ScheduleBase extends Action protected array $schedules = []; protected BrokerPool $publisher; + protected BrokerPool $publisherMigrations; + protected BrokerPool $publisherFunctions; + protected BrokerPool $publisherMessaging; private ?Histogram $collectSchedulesTelemetryDuration = null; private ?Gauge $collectSchedulesTelemetryCount = null; @@ -35,7 +37,7 @@ abstract class ScheduleBase extends Action abstract public static function getName(): string; abstract public static function getSupportedResource(): string; abstract public static function getCollectionId(): string; - abstract protected function enqueueResources(Group $pools, Database $dbForPlatform, callable $getProjectDB): void; + abstract protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void; public function __construct() { @@ -43,7 +45,10 @@ abstract class ScheduleBase extends Action $this ->desc("Execute {$type}s scheduled in Appwrite") - ->inject('pools') + ->inject('publisher') + ->inject('publisherMigrations') + ->inject('publisherFunctions') + ->inject('publisherMessaging') ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('telemetry') @@ -66,12 +71,16 @@ abstract class ScheduleBase extends Action * 2. Create timer that sync all changes from 'schedules' collection to local copy. Only reading changes thanks to 'resourceUpdatedAt' attribute * 3. Create timer that prepares coroutines for soon-to-execute schedules. When it's ready, coroutine sleeps until exact time before sending request to worker. */ - public function action(Group $pools, Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void + public function action(BrokerPool $publisher, BrokerPool $publisherMigrations, BrokerPool $publisherFunctions, BrokerPool $publisherMessaging, Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void { Console::title(\ucfirst(static::getSupportedResource()) . ' scheduler V1'); Console::success(APP_NAME . ' ' . \ucfirst(static::getSupportedResource()) . ' scheduler v1 has started'); - $this->publisher = new BrokerPool($pools->get('publisher')); + $this->publisher = $publisher; + $this->publisherMigrations = $publisherMigrations; + $this->publisherFunctions = $publisherFunctions; + $this->publisherMessaging = $publisherMessaging; + $this->scheduleTelemetryCount = $telemetry->createGauge('task.schedule.count'); $this->collectSchedulesTelemetryDuration = $telemetry->createHistogram('task.schedule.collect_schedules.duration', 's'); $this->collectSchedulesTelemetryCount = $telemetry->createGauge('task.schedule.collect_schedules.count'); @@ -79,21 +88,21 @@ abstract class ScheduleBase extends Action // start with "0" to load all active documents. $lastSyncUpdate = "0"; - $this->collectSchedules($pools, $dbForPlatform, $getProjectDB, $lastSyncUpdate); + $this->collectSchedules($dbForPlatform, $getProjectDB, $lastSyncUpdate); Console::success("Starting timers at " . DateTime::now()); /** * The timer synchronize $schedules copy with database collection. */ - Timer::tick(static::UPDATE_TIMER * 1000, function () use ($pools, $dbForPlatform, $getProjectDB, &$lastSyncUpdate) { + Timer::tick(static::UPDATE_TIMER * 1000, function () use ($dbForPlatform, $getProjectDB, &$lastSyncUpdate) { $time = DateTime::now(); Console::log("Sync tick: Running at $time"); - $this->collectSchedules($pools, $dbForPlatform, $getProjectDB, $lastSyncUpdate); + $this->collectSchedules($dbForPlatform, $getProjectDB, $lastSyncUpdate); }); while (true) { try { - go(fn () => $this->enqueueResources($pools, $dbForPlatform, $getProjectDB)); + go(fn () => $this->enqueueResources($dbForPlatform, $getProjectDB)); $this->scheduleTelemetryCount->record(count($this->schedules), ['resourceType' => static::getSupportedResource()]); sleep(static::ENQUEUE_TIMER); } catch (\Throwable $th) { @@ -103,7 +112,7 @@ abstract class ScheduleBase extends Action } } - private function collectSchedules(Group $pools, Database $dbForPlatform, callable $getProjectDB, string &$lastSyncUpdate): void + private function collectSchedules(Database $dbForPlatform, callable $getProjectDB, string &$lastSyncUpdate): void { // If we haven't synced yet, load all active schedules $initialLoad = $lastSyncUpdate === "0"; @@ -115,7 +124,7 @@ abstract class ScheduleBase extends Action * @throws Exception * @var Document $schedule */ - $getSchedule = function (Document $schedule) use ($pools, $dbForPlatform, $getProjectDB): array { + $getSchedule = function (Document $schedule) use ($dbForPlatform, $getProjectDB): array { $project = $dbForPlatform->getDocument('projects', $schedule->getAttribute('projectId')); $resource = $getProjectDB($project)->getDocument( diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index 27a7c1dbf1..83a3f51b03 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -5,8 +5,13 @@ namespace Appwrite\Platform\Tasks; use Appwrite\Event\Func; use Swoole\Coroutine as Co; use Utopia\Database\Database; -use Utopia\Pools\Group; +/** + * ScheduleExecutions + * + * Handles delayed executions by processing one-time scheduled tasks + * that are executed at a specific future time. + */ class ScheduleExecutions extends ScheduleBase { public const UPDATE_TIMER = 3; // seconds @@ -19,19 +24,20 @@ class ScheduleExecutions extends ScheduleBase public static function getSupportedResource(): string { - return 'execution'; + return SCHEDULE_RESOURCE_TYPE_EXECUTION; } public static function getCollectionId(): string { - return 'executions'; + return RESOURCE_TYPE_EXECUTIONS; } - protected function enqueueResources(Group $pools, Database $dbForPlatform, callable $getProjectDB): void + protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void { - $queueForFunctions = new Func($this->publisher); $intervalEnd = (new \DateTime())->modify('+' . self::ENQUEUE_TIMER . ' seconds'); + $queueForFunctions = new Func($this->publisherFunctions); + foreach ($this->schedules as $schedule) { if (!$schedule['active']) { $dbForPlatform->deleteDocument( diff --git a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php index 19e068107a..7fda2f75df 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php @@ -7,8 +7,13 @@ use Cron\CronExpression; use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\DateTime; -use Utopia\Pools\Group; +/** + * ScheduleFunctions + * + * Handles cron job related executions by processing cron expressions + * and scheduling function executions based on recurring schedules. + */ class ScheduleFunctions extends ScheduleBase { public const UPDATE_TIMER = 10; // seconds @@ -23,15 +28,15 @@ class ScheduleFunctions extends ScheduleBase public static function getSupportedResource(): string { - return 'function'; + return SCHEDULE_RESOURCE_TYPE_FUNCTION; } public static function getCollectionId(): string { - return 'functions'; + return RESOURCE_TYPE_FUNCTIONS; } - protected function enqueueResources(Group $pools, Database $dbForPlatform, callable $getProjectDB): void + protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void { $timerStart = \microtime(true); $time = DateTime::now(); @@ -76,7 +81,7 @@ class ScheduleFunctions extends ScheduleBase } foreach ($delayedExecutions as $delay => $schedules) { - \go(function () use ($delay, $schedules, $pools, $dbForPlatform) { + \go(function () use ($delay, $schedules, $dbForPlatform) { \sleep($delay); // in seconds foreach ($schedules as $delayConfig) { @@ -90,7 +95,7 @@ class ScheduleFunctions extends ScheduleBase $this->updateProjectAccess($schedule['project'], $dbForPlatform); - $queueForFunctions = new Func($this->publisher); + $queueForFunctions = new Func($this->publisherFunctions); $queueForFunctions ->setType('schedule') diff --git a/src/Appwrite/Platform/Tasks/ScheduleMessages.php b/src/Appwrite/Platform/Tasks/ScheduleMessages.php index 4d971e1b36..57f6dd8002 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleMessages.php +++ b/src/Appwrite/Platform/Tasks/ScheduleMessages.php @@ -4,7 +4,6 @@ namespace Appwrite\Platform\Tasks; use Appwrite\Event\Messaging; use Utopia\Database\Database; -use Utopia\Pools\Group; class ScheduleMessages extends ScheduleBase { @@ -18,15 +17,15 @@ class ScheduleMessages extends ScheduleBase public static function getSupportedResource(): string { - return 'message'; + return SCHEDULE_RESOURCE_TYPE_MESSAGE; } public static function getCollectionId(): string { - return 'messages'; + return RESOURCE_TYPE_MESSAGES; } - protected function enqueueResources(Group $pools, Database $dbForPlatform, callable $getProjectDB): void + protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void { foreach ($this->schedules as $schedule) { if (!$schedule['active']) { @@ -40,8 +39,8 @@ class ScheduleMessages extends ScheduleBase continue; } - \go(function () use ($schedule, $scheduledAt, $pools, $dbForPlatform) { - $queueForMessaging = new Messaging($this->publisher); + \go(function () use ($schedule, $scheduledAt, $dbForPlatform) { + $queueForMessaging = new Messaging($this->publisherMessaging); $this->updateProjectAccess($schedule['project'], $dbForPlatform); diff --git a/src/Appwrite/Platform/Tasks/Screenshot.php b/src/Appwrite/Platform/Tasks/Screenshot.php index 3a9c9a64f5..5a4d8a76b7 100644 --- a/src/Appwrite/Platform/Tasks/Screenshot.php +++ b/src/Appwrite/Platform/Tasks/Screenshot.php @@ -21,7 +21,7 @@ class Screenshot extends Action $this ->desc('Create Site template screenshot') ->param('templateId', '', new Text(128), 'Template ID.') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $templateId): void diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 4876e8d96c..53cbced174 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -200,7 +200,6 @@ class Specs extends Action foreach ($sdks as $sdk) { /** @var Method $sdk */ - $hide = $sdk->isHidden(); if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { continue; @@ -284,7 +283,8 @@ class Specs extends Action $routes, $models, $keys[$platform], - $authCounts[$platform] ?? 0 + $authCounts[$platform] ?? 0, + $platforms[$platform] ]; foreach (['swagger2', 'open-api3'] as $format) { diff --git a/src/Appwrite/Platform/Tasks/StatsResources.php b/src/Appwrite/Platform/Tasks/StatsResources.php index a0b5056b0f..b64dd61f86 100644 --- a/src/Appwrite/Platform/Tasks/StatsResources.php +++ b/src/Appwrite/Platform/Tasks/StatsResources.php @@ -45,7 +45,7 @@ class StatsResources extends Action ->inject('dbForPlatform') ->inject('logError') ->inject('queueForStatsResources') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Database $dbForPlatform, callable $logError, EventStatsResources $queue): void @@ -53,11 +53,14 @@ class StatsResources extends Action $this->logError = $logError; $this->dbForPlatform = $dbForPlatform; + $this->disableSubqueries(); + Console::title("Stats resources V1"); Console::success('Stats resources: started'); $interval = (int) System::getEnv('_APP_STATS_RESOURCES_INTERVAL', '3600'); + Console::loop(function () use ($queue) { Authorization::disable(); Authorization::setDefaultStatus(false); diff --git a/src/Appwrite/Platform/Tasks/Upgrade.php b/src/Appwrite/Platform/Tasks/Upgrade.php index dfd10d347e..d6159d2718 100644 --- a/src/Appwrite/Platform/Tasks/Upgrade.php +++ b/src/Appwrite/Platform/Tasks/Upgrade.php @@ -23,7 +23,7 @@ class Upgrade extends Install ->param('image', 'appwrite', new Text(0), 'Main appwrite docker image', true) ->param('interactive', 'Y', new Text(1), 'Run an interactive session', true) ->param('no-start', false, new Boolean(true), 'Run an interactive session', true) - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $httpPort, string $httpsPort, string $organization, string $image, string $interactive, bool $noStart): void diff --git a/src/Appwrite/Platform/Tasks/Vars.php b/src/Appwrite/Platform/Tasks/Vars.php index 70ae550ef9..542b5bdc9f 100644 --- a/src/Appwrite/Platform/Tasks/Vars.php +++ b/src/Appwrite/Platform/Tasks/Vars.php @@ -18,7 +18,7 @@ class Vars extends Action { $this ->desc('List all the server environment variables') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(): void diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index 19ca5181ce..a88e2e641f 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -12,13 +12,13 @@ use Utopia\Database\Exception\Authorization; use Utopia\Database\Exception\Structure; use Utopia\Platform\Action; use Utopia\Queue\Message; +use Utopia\Queue\Result\Commit; +use Utopia\Queue\Result\NoCommit; use Utopia\System\System; class Audits extends Action { - protected const BATCH_SIZE_DEVELOPMENT = 1; // smaller batch size for development - protected const BATCH_SIZE_PRODUCTION = 5_000; - protected const BATCH_AGGREGATION_INTERVAL = 60; // in seconds + protected const int BATCH_AGGREGATION_INTERVAL = 60; // in seconds private int $lastTriggeredTime = 0; @@ -27,9 +27,7 @@ class Audits extends Action protected function getBatchSize(): int { - return System::getEnv('_APP_ENV', 'development') === 'development' - ? self::BATCH_SIZE_DEVELOPMENT - : self::BATCH_SIZE_PRODUCTION; + return intval(System::getEnv('_APP_QUEUE_PREFETCH_COUNT', 1)); } public static function getName(): string @@ -47,7 +45,7 @@ class Audits extends Action ->inject('message') ->inject('getProjectDB') ->inject('project') - ->callback([$this, 'action']); + ->callback($this->action(...)); $this->lastTriggeredTime = time(); } @@ -57,13 +55,13 @@ class Audits extends Action * @param Message $message * @param callable $getProjectDB * @param Document $project - * @return void + * @return Commit|NoCommit * @throws Throwable * @throws \Utopia\Database\Exception * @throws Authorization * @throws Structure */ - public function action(Message $message, callable $getProjectDB, Document $project): void + public function action(Message $message, callable $getProjectDB, Document $project): Commit|NoCommit { $payload = $message->getPayload() ?? []; @@ -123,29 +121,34 @@ class Audits extends Action // Check if we should process the batch by checking both for the batch size and the elapsed time $batchSize = $this->getBatchSize(); - $shouldProcessBatch = \count($this->logs) >= $batchSize; - if (!$shouldProcessBatch && \count($this->logs) > 0) { + $logCount = array_reduce($this->logs, fn (int $current, $logs) => $current + count($logs['logs']), 0); + $shouldProcessBatch = $logCount >= $batchSize; + if (!$shouldProcessBatch && $logCount > 0) { $shouldProcessBatch = (\time() - $this->lastTriggeredTime) >= self::BATCH_AGGREGATION_INTERVAL; } - if ($shouldProcessBatch) { + if (!$shouldProcessBatch) { + return new NoCommit(); + } + + foreach ($this->logs as $sequence => $projectLogs) { try { - foreach ($this->logs as $sequence => $projectLogs) { - $dbForProject = $getProjectDB($projectLogs['project']); + Console::log('Processing Project "' . $sequence . '" batch with ' . count($projectLogs['logs']) . ' events'); - Console::log('Processing batch with ' . count($projectLogs['logs']) . ' events'); - $audit = new Audit($dbForProject); + $projectDocument = $projectLogs['project']; + $dbForProject = $getProjectDB($projectDocument); + $audit = new Audit($dbForProject); + $audit->logBatch($projectLogs['logs']); - $audit->logBatch($projectLogs['logs']); - Console::success('Audit logs processed successfully'); - - unset($this->logs[$sequence]); - } + Console::success('Audit logs processed successfully'); } catch (Throwable $e) { - Console::error('Error processing audit logs: ' . $e->getMessage()); + Console::error('Error processing audit logs for Project "' . $sequence . '": ' . $e->getMessage()); } finally { - $this->lastTriggeredTime = time(); + unset($this->logs[$sequence]); } } + + $this->lastTriggeredTime = time(); + return new Commit(); } } diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index a9104e0017..73447b5515 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -93,12 +93,13 @@ class Certificates extends Action $document = new Document($payload['domain'] ?? []); $domain = new Domain($document->getAttribute('domain', '')); $skipRenewCheck = $payload['skipRenewCheck'] ?? false; + $validationDomain = $payload['validationDomain'] ?? null; $log->addTag('domain', $domain->get()); $domainType = $document->getAttribute('domainType'); - $this->execute($domain, $domainType, $dbForPlatform, $queueForMails, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $log, $certificates, $skipRenewCheck, $plan); + $this->execute($domain, $domainType, $dbForPlatform, $queueForMails, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $log, $certificates, $skipRenewCheck, $plan, $validationDomain); } /** @@ -112,6 +113,7 @@ class Certificates extends Action * @param CertificatesAdapter $certificates * @param bool $skipRenewCheck * @param array $plan + * @param string|null $validationDomain * @return void * @throws Throwable * @throws \Utopia\Database\Exception @@ -128,7 +130,8 @@ class Certificates extends Action Log $log, CertificatesAdapter $certificates, bool $skipRenewCheck = false, - array $plan = [] + array $plan = [], + ?string $validationDomain = null ): void { /** * 1. Read arguments and validate domain @@ -171,9 +174,12 @@ class Certificates extends Action $success = false; try { + $date = \date('H:i:s'); + $certificate->setAttribute('logs', "\033[90m[{$date}] \033[97mCertificate generation started. \033[0m\n"); + // Validate domain and DNS records. Skip if job is forced if (!$skipRenewCheck) { - $mainDomain = $this->getMainDomain(); + $mainDomain = $validationDomain ?? $this->getMainDomain(); $isMainDomain = !isset($mainDomain) || $domain->get() === $mainDomain; $this->validateDomain($domain, $isMainDomain, $log); @@ -198,9 +204,11 @@ class Certificates extends Action $success = true; } catch (Throwable $e) { $logs = $e->getMessage(); + $currentLogs = $certificate->getAttribute('logs', ''); + $date = \date('H:i:s'); + $errorMessage = "\033[90m[{$date}] \033[31mCertificate generation failed: \033[0m\n"; - // Set exception as log in certificate document - $certificate->setAttribute('logs', \mb_strcut($logs, 0, 1000000));// Limit to 1MB + $certificate->setAttribute('logs', $currentLogs . $errorMessage . \mb_strcut($logs, 0, 500000));// Limit to 500kb // Increase attempts count $attempts = $certificate->getAttribute('attempts', 0) + 1; @@ -337,6 +345,19 @@ class Certificates extends Action throw new Exception('Failed to verify domain DNS records.'); } + + // Ensure CAA won't block certificate issuance + if (!empty(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''))) { + $validationStart = \microtime(true); + $validator = new DNS(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''), DNS::RECORD_CAA); + if (!$validator->isValid($domain->get())) { + $log->addExtra('dnsTimingCaa', \strval(\microtime(true) - $validationStart)); + $log->addTag('dnsDomain', $domain->get()); + $error = $validator->getDescription(); + $log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error)); + throw new Exception('Failed to verify domain DNS records. CAA records do not allow Appwrite\'s certificate issuer.'); + } + } } else { // Main domain validation // TODO: Would be awesome to check A/AAAA record here. Maybe dry run? @@ -360,6 +381,7 @@ class Certificates extends Action Console::warning('Cannot renew domain (' . $domain . ') on attempt no. ' . $attempt . ' certificate: ' . $errorMessage); $locale = new Locale(System::getEnv('_APP_LOCALE', 'en')); + $locale->setFallback(System::getEnv('_APP_LOCALE', 'en')); // Send mail to administrator mail $template = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-certificate-failed.tpl'); @@ -367,27 +389,29 @@ class Certificates extends Action $template->setParam('{{error}}', \nl2br($errorMessage)); $template->setParam('{{attempts}}', $attempt); - $template->setParam('{{logoUrl}}', $plan['logoUrl'] ?? APP_EMAIL_LOGO_URL); - $template->setParam('{{accentColor}}', $plan['accentColor'] ?? APP_EMAIL_ACCENT_COLOR); - $template->setParam('{{twitterUrl}}', $plan['twitterUrl'] ?? APP_SOCIAL_TWITTER); - $template->setParam('{{discordUrl}}', $plan['discordUrl'] ?? APP_SOCIAL_DISCORD); - $template->setParam('{{githubUrl}}', $plan['githubUrl'] ?? APP_SOCIAL_GITHUB_APPWRITE); - $template->setParam('{{termsUrl}}', $plan['termsUrl'] ?? APP_EMAIL_TERMS_URL); - $template->setParam('{{privacyUrl}}', $plan['privacyUrl'] ?? APP_EMAIL_PRIVACY_URL); - $body = $template->render(); $emailVariables = [ 'direction' => $locale->getText('settings.direction'), + 'domain' => $domain, + 'logoUrl' => $plan['logoUrl'] ?? APP_EMAIL_LOGO_URL, + 'accentColor' => $plan['accentColor'] ?? APP_EMAIL_ACCENT_COLOR, + 'twitterUrl' => $plan['twitterUrl'] ?? APP_SOCIAL_TWITTER, + 'discordUrl' => $plan['discordUrl'] ?? APP_SOCIAL_DISCORD, + 'githubUrl' => $plan['githubUrl'] ?? APP_SOCIAL_GITHUB_APPWRITE, + 'termsUrl' => $plan['termsUrl'] ?? APP_EMAIL_TERMS_URL, + 'privacyUrl' => $plan['privacyUrl'] ?? APP_EMAIL_PRIVACY_URL, ]; - $subject = \sprintf($locale->getText("emails.certificate.subject"), $domain); + $subject = $locale->getText("emails.certificate.subject"); + $preview = $locale->getText("emails.certificate.preview"); $queueForMails ->setSubject($subject) + ->setPreview($preview) ->setBody($body) ->setName('Appwrite Administrator') - ->setbodyTemplate(__DIR__ . '/../../../../app/config/locale/templates/email-base-styled.tpl') + ->setBodyTemplate(__DIR__ . '/../../../../app/config/locale/templates/email-base-styled.tpl') ->setVariables($emailVariables) ->setRecipient(System::getEnv('_APP_EMAIL_CERTIFICATES', System::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS'))) ->trigger(); diff --git a/src/Appwrite/Platform/Workers/Deletes.php b/src/Appwrite/Platform/Workers/Deletes.php index 8ed96c76a2..a07d0b3cbe 100644 --- a/src/Appwrite/Platform/Workers/Deletes.php +++ b/src/Appwrite/Platform/Workers/Deletes.php @@ -495,7 +495,7 @@ class Deletes extends Action * @throws Authorization * @throws DatabaseException */ - private function deleteProject(Database $dbForPlatform, callable $getProjectDB, Device $deviceForFiles, Device $deviceForSites, Device $deviceForFunctions, Device $deviceForBuilds, Device $deviceForCache, CertificatesAdapter $certificates, Document $document): void + protected function deleteProject(Database $dbForPlatform, callable $getProjectDB, Device $deviceForFiles, Device $deviceForSites, Device $deviceForFunctions, Device $deviceForBuilds, Device $deviceForCache, CertificatesAdapter $certificates, Document $document): void { $projectInternalId = $document->getSequence(); $projectId = $document->getId(); @@ -1117,6 +1117,9 @@ class Deletes extends Action ): void { $start = \microtime(true); + $deleteBatchSize = Database::DELETE_BATCH_SIZE; + $deleteBatchSize = 500; // TODO: Set right value in DB library after investigation + /** * deleteDocuments uses a cursor, we need to add a unique order by field or use default */ @@ -1124,7 +1127,7 @@ class Deletes extends Action $count = $database->deleteDocuments( $collection, $queries, - Database::DELETE_BATCH_SIZE, + $deleteBatchSize, $callback ); } catch (Throwable $th) { @@ -1189,7 +1192,7 @@ class Deletes extends Action * @param Document $document rule document * @return void */ - private function deleteRule(Database $dbForPlatform, Document $document, CertificatesAdapter $certificates): void + protected function deleteRule(Database $dbForPlatform, Document $document, CertificatesAdapter $certificates): void { $domain = $document->getAttribute('domain'); $certificates->deleteCertificate($domain); diff --git a/src/Appwrite/Platform/Workers/Functions.php b/src/Appwrite/Platform/Workers/Functions.php index a9126583ce..df1833ad33 100644 --- a/src/Appwrite/Platform/Workers/Functions.php +++ b/src/Appwrite/Platform/Workers/Functions.php @@ -53,7 +53,7 @@ class Functions extends Action ->inject('log') ->inject('executor') ->inject('isResourceBlocked') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -101,7 +101,7 @@ class Functions extends Action } if (empty($jwt) && !$user->isEmpty()) { - $jwtExpiry = $function->getAttribute('timeout', 900); + $jwtExpiry = $function->getAttribute('timeout', 900) + 60; // 1min extra to account for possible cold-starts $jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $jwtExpiry, 0); $jwt = $jwtObj->encode([ 'userId' => $user->getId(), @@ -264,6 +264,8 @@ class Functions extends Action string $jwt = null, string $event = null, ): void { + $executionId = ID::unique(); + $headers['x-appwrite-execution-id'] = $executionId ?? ''; $headers['x-appwrite-trigger'] = $trigger; $headers['x-appwrite-event'] = $event ?? ''; $headers['x-appwrite-user-id'] = $user->getId() ?? ''; @@ -276,7 +278,6 @@ class Functions extends Action } } - $executionId = ID::unique(); $execution = new Document([ '$id' => $executionId, '$permissions' => $user->isEmpty() ? [] : [Permission::read(Role::user($user->getId()))], @@ -390,13 +391,14 @@ class Functions extends Action $runtime = $runtimes[$function->getAttribute('runtime')]; - $jwtExpiry = $function->getAttribute('timeout', 900); + $jwtExpiry = $function->getAttribute('timeout', 900) + 60; // 1min extra to account for possible cold-starts $jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $jwtExpiry, 0); $apiKey = $jwtObj->encode([ 'projectId' => $project->getId(), 'scopes' => $function->getAttribute('scopes', []) ]); + $headers['x-appwrite-execution-id'] = $executionId ?? ''; $headers['x-appwrite-key'] = API_KEY_DYNAMIC . '_' . $apiKey; $headers['x-appwrite-trigger'] = $trigger; $headers['x-appwrite-event'] = $event ?? ''; @@ -409,6 +411,8 @@ class Functions extends Action /** Create execution or update execution status */ $execution = $dbForProject->getDocument('executions', $executionId ?? ''); if ($execution->isEmpty()) { + $executionId = ID::unique(); + $headers['x-appwrite-execution-id'] = $executionId; $headersFiltered = []; foreach ($headers as $key => $value) { if (\in_array(\strtolower($key), FUNCTION_ALLOWLIST_HEADERS_REQUEST)) { @@ -416,7 +420,6 @@ class Functions extends Action } } - $executionId = ID::unique(); $execution = new Document([ '$id' => $executionId, '$permissions' => $user->isEmpty() ? [] : [Permission::read(Role::user($user->getId()))], @@ -519,7 +522,9 @@ class Functions extends Action try { $version = $function->getAttribute('version', 'v2'); $command = $runtime['startCommand']; - $command = $version === 'v2' ? '' : 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $command . '"'; + $source = $deployment->getAttribute('buildPath', ''); + $extension = str_ends_with($source, '.tar') ? 'tar' : 'tar.gz'; + $command = $version === 'v2' ? '' : "cp /tmp/code.$extension /mnt/code/code.$extension && nohup helpers/start.sh \"$command\""; $executionResponse = $executor->createExecution( projectId: $project->getId(), deploymentId: $deploymentId, @@ -527,7 +532,7 @@ class Functions extends Action variables: $vars, timeout: $function->getAttribute('timeout', 0), image: $runtime['image'], - source: $deployment->getAttribute('buildPath', ''), + source: $source, entrypoint: $deployment->getAttribute('entrypoint', ''), version: $version, path: $path, @@ -541,6 +546,8 @@ class Functions extends Action $status = $executionResponse['statusCode'] >= 500 ? 'failed' : 'completed'; + $executionResponse['headers']['x-appwrite-execution-id'] = $execution->getId(); + $headersFiltered = []; foreach ($executionResponse['headers'] as $key => $value) { if (\in_array(\strtolower($key), FUNCTION_ALLOWLIST_HEADERS_RESPONSE)) { @@ -548,14 +555,36 @@ class Functions extends Action } } + $maxLogLength = APP_FUNCTION_LOG_LENGTH_LIMIT; + $logs = $executionResponse['logs'] ?? ''; + + if (\is_string($logs) && \strlen($logs) > $maxLogLength) { + $warningMessage = "[WARNING] Logs truncated. The output exceeded {$maxLogLength} characters.\n"; + $warningLength = \strlen($warningMessage); + $maxContentLength = $maxLogLength - $warningLength; + $logs = $warningMessage . \substr($logs, -$maxContentLength); + } + + // Truncate errors if they exceed the limit + $maxErrorLength = APP_FUNCTION_ERROR_LENGTH_LIMIT; + $errors = $executionResponse['errors'] ?? ''; + + if (\is_string($errors) && \strlen($errors) > $maxErrorLength) { + $warningMessage = "[WARNING] Errors truncated. The output exceeded {$maxErrorLength} characters.\n"; + $warningLength = \strlen($warningMessage); + $maxContentLength = $maxErrorLength - $warningLength; + $errors = $warningMessage . \substr($errors, -$maxContentLength); + } + /** Update execution status */ $execution ->setAttribute('status', $status) ->setAttribute('responseStatusCode', $executionResponse['statusCode']) ->setAttribute('responseHeaders', $headersFiltered) - ->setAttribute('logs', $executionResponse['logs']) - ->setAttribute('errors', $executionResponse['errors']) + ->setAttribute('logs', $logs) + ->setAttribute('errors', $errors) ->setAttribute('duration', $executionResponse['duration']); + } catch (\Throwable $th) { $durationEnd = \microtime(true); $execution diff --git a/src/Appwrite/Platform/Workers/Mails.php b/src/Appwrite/Platform/Workers/Mails.php index 3a15182e51..117b689863 100644 --- a/src/Appwrite/Platform/Workers/Mails.php +++ b/src/Appwrite/Platform/Workers/Mails.php @@ -14,6 +14,11 @@ use Utopia\System\System; class Mails extends Action { + protected int $previewMaxLen = 150; + + protected string $whitespaceCodes = ' ‌​‍‎‏'; + + public static function getName(): string { return 'mails'; @@ -29,7 +34,7 @@ class Mails extends Action ->inject('message') ->inject('register') ->inject('log') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -74,6 +79,7 @@ class Mails extends Action $variables['host'] = $protocol . '://' . $hostname; $name = $payload['name']; $body = $payload['body']; + $preview = $payload['preview'] ?? ''; $variables['subject'] = $subject; $variables['year'] = date("Y"); @@ -92,6 +98,27 @@ class Mails extends Action foreach ($this->richTextParams as $key => $value) { $bodyTemplate->setParam('{{' . $key . '}}', $value, escapeHtml: false); } + + $previewWhitespace = ''; + + if (!empty($preview)) { + $previewTemplate = Template::fromString($preview); + foreach ($variables as $key => $value) { + $previewTemplate->setParam('{{' . $key . '}}', $value); + } + // render() will return the subject in <p> tags, so use strip_tags() to remove them + $preview = \strip_tags($previewTemplate->render()); + + $previewLen = strlen($preview); + if ($previewLen < $this->previewMaxLen) { + $previewWhitespace = str_repeat($this->whitespaceCodes, $this->previewMaxLen - $previewLen); + } + } + + + $bodyTemplate->setParam('{{preview}}', $preview); + $bodyTemplate->setParam('{{previewWhitespace}}', $previewWhitespace, false); + $body = $bodyTemplate->render(); $subjectTemplate = Template::fromString($subject); diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index 2ee107a319..668993fdae 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -72,7 +72,7 @@ class Messaging extends Action ->inject('dbForProject') ->inject('deviceForFiles') ->inject('queueForStatsUsage') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -426,7 +426,7 @@ class Messaging extends Action $credentials = $provider->getAttribute('credentials'); return match ($provider->getAttribute('provider')) { - 'mock' => new Mock('username', 'password'), + 'mock' => (new Mock('username', 'password'))->setEndpoint('http://request-catcher-sms:5000/'), 'twilio' => new Twilio( $credentials['accountSid'] ?? '', $credentials['authToken'] ?? '', diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 395ec1351e..cd7a6a1058 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -69,7 +69,7 @@ class Migrations extends Action ->inject('logError') ->inject('queueForRealtime') ->inject('deviceForImports') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -185,13 +185,32 @@ class Migrations extends Action */ protected function updateMigrationDocument(Document $migration, Document $project, Realtime $queueForRealtime): Document { + $errorMessages = []; + $clonedMigrationDocument = clone $migration; + + // we cannot use #sensitive because + // `errors` is nested which requires an override. + $errors = $clonedMigrationDocument->getAttribute('errors', []); + + foreach ($errors as $error) { + $decoded = json_decode($error, true); + + if (is_array($decoded) && isset($decoded['trace'])) { + unset($decoded['trace']); + $errorMessages[] = json_encode($decoded); + } + } + + // set the errors back without trace + $clonedMigrationDocument->setAttribute('errors', $errorMessages); + /** Trigger Realtime Events */ $queueForRealtime ->setProject($project) ->setSubscribers(['console', $project->getId()]) ->setEvent('migrations.[migrationId].update') ->setParam('migrationId', $migration->getId()) - ->setPayload($migration->getArrayCopy()) + ->setPayload($clonedMigrationDocument->getArrayCopy(), ['options', 'credentials']) ->trigger(); return $this->dbForProject->updateDocument('migrations', $migration->getId(), $migration); @@ -226,8 +245,11 @@ class Migrations extends Action 'functions.write', 'databases.read', 'collections.read', + 'tables.read', 'documents.read', 'documents.write', + 'rows.read', + 'rows.write', 'tokens.read', 'tokens.write', ] @@ -279,19 +301,21 @@ class Migrations extends Action ); /** Start Transfer */ - $migration->setAttribute('stage', 'migrating'); - $this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime); + if (empty($source->getErrors())) { + $migration->setAttribute('stage', 'migrating'); + $this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime); - $transfer->run( - $migration->getAttribute('resources'), - function () use ($migration, $transfer, $projectDocument, $queueForRealtime) { - $migration->setAttribute('resourceData', json_encode($transfer->getCache())); - $migration->setAttribute('statusCounters', json_encode($transfer->getStatusCounters())); - $this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime); - }, - $migration->getAttribute('resourceId'), - $migration->getAttribute('resourceType') - ); + $transfer->run( + $migration->getAttribute('resources'), + function () use ($migration, $transfer, $projectDocument, $queueForRealtime) { + $migration->setAttribute('resourceData', json_encode($transfer->getCache())); + $migration->setAttribute('statusCounters', json_encode($transfer->getStatusCounters())); + $this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime); + }, + $migration->getAttribute('resourceId'), + $migration->getAttribute('resourceType') + ); + } $destination->shutDown(); $source->shutDown(); @@ -305,26 +329,13 @@ class Migrations extends Action $errorMessages = []; foreach ($sourceErrors as $error) { - $message = "Error occurred while fetching '{$error->getResourceName()}:{$error->getResourceId()}' from source with message: '{$error->getMessage()}'"; - if ($error->getPrevious()) { - $message .= " Message: ".$error->getPrevious()->getMessage() . " File: ".$error->getPrevious()->getFile() . " Line: ".$error->getPrevious()->getLine(); - } - - $errorMessages[] = $message; + $errorMessages[] = json_encode($error); } foreach ($destinationErrors as $error) { - $message = "Error occurred while pushing '{$error->getResourceName()}:{$error->getResourceId()}' to destination with message: '{$error->getMessage()}'"; - - if ($error->getPrevious()) { - $message .= " Message: ".$error->getPrevious()->getMessage() . " File: ".$error->getPrevious()->getFile() . " Line: ".$error->getPrevious()->getLine(); - } - - /** @var MigrationException $error */ - $errorMessages[] = $message; + $errorMessages[] = json_encode($error); } $migration->setAttribute('errors', $errorMessages); - $this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime); return; } @@ -354,12 +365,10 @@ class Migrations extends Action $errorMessages = []; foreach ($sourceErrors as $error) { - /** @var MigrationException $error */ - $errorMessages[] = "Error occurred while fetching '{$error->getResourceName()}:{$error->getResourceId()}' from source with message '{$error->getMessage()}'"; + $errorMessages[] = json_encode($error); } foreach ($destinationErrors as $error) { - /** @var MigrationException $error */ - $errorMessages[] = "Error occurred while pushing '{$error->getResourceName()}:{$error->getResourceId()}' to destination with message '{$error->getMessage()}'"; + $errorMessages[] = json_encode($error); } $migration->setAttribute('errors', $errorMessages); diff --git a/src/Appwrite/Platform/Workers/StatsResources.php b/src/Appwrite/Platform/Workers/StatsResources.php index c68465f8df..0c8f11c07b 100644 --- a/src/Appwrite/Platform/Workers/StatsResources.php +++ b/src/Appwrite/Platform/Workers/StatsResources.php @@ -49,7 +49,7 @@ class StatsResources extends Action ->inject('getLogsDB') ->inject('dbForPlatform') ->inject('logError') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -432,11 +432,45 @@ class StatsResources extends Action protected function writeDocuments(Database $dbForLogs, Document $project): void { - $dbForLogs->createOrUpdateDocuments( - 'stats', - $this->documents - ); - $this->documents = []; - Console::success('Stats written to logs db for project: ' . $project->getId() . '(' . $project->getSequence() . ')'); + $message = 'Stats writeDocuments project: ' . $project->getId() . '(' . $project->getSequence() . ')'; + + /** + * sort by unique index key reduce locks/deadlocks + */ + usort($this->documents, function ($a, $b) { + // Metric DESC + $cmp = strcmp($b['metric'], $a['metric']); + if ($cmp !== 0) { + return $cmp; + } + + // Period ASC + $cmp = strcmp($a['period'], $b['period']); + if ($cmp !== 0) { + return $cmp; + } + + // Time ASC, NULLs first + if ($a['time'] === null) { + return ($b['time'] === null) ? 0 : -1; + } + if ($b['time'] === null) { + return 1; + } + + return strcmp($a['time'], $b['time']); + }); + + try { + $dbForLogs->createOrUpdateDocuments( + 'stats', + $this->documents, + ); + + Console::success($message . ' | Documents: ' . count($this->documents)); + } catch (\Throwable $e) { + Console::error('Error: ' . $message . ' | Exception: ' . $e->getMessage()); + throw $e; + } } } diff --git a/src/Appwrite/Platform/Workers/StatsUsage.php b/src/Appwrite/Platform/Workers/StatsUsage.php index 59b5a15ada..bd34d53b00 100644 --- a/src/Appwrite/Platform/Workers/StatsUsage.php +++ b/src/Appwrite/Platform/Workers/StatsUsage.php @@ -119,7 +119,7 @@ class StatsUsage extends Action ->inject('getProjectDB') ->inject('getLogsDB') ->inject('register') - ->callback([$this, 'action']); + ->callback($this->action(...)); $this->lastTriggeredTime = time(); } @@ -424,12 +424,40 @@ class StatsUsage extends Action try { $dbForProject = $getProjectDB($projectStats['project']); Console::log('Processing batch with ' . count($projectStats['stats']) . ' stats'); + + /** + * Sort by unique index key reduce locks/deadlocks + */ + usort($projectStats['stats'], function ($a, $b) { + // Metric DESC + $cmp = strcmp($b['metric'], $a['metric']); + if ($cmp !== 0) { + return $cmp; + } + + // Period ASC + $cmp = strcmp($a['period'], $b['period']); + if ($cmp !== 0) { + return $cmp; + } + + // Time ASC, NULLs first + if ($a['time'] === null) { + return ($b['time'] === null) ? 0 : -1; + } + if ($b['time'] === null) { + return 1; + } + + return strcmp($a['time'], $b['time']); + }); + $dbForProject->createOrUpdateDocumentsWithIncrease('stats', 'value', $projectStats['stats']); Console::success('Batch successfully written to DB'); - - unset($this->projects[$sequence]); } catch (Throwable $e) { Console::error('Error processing stats: ' . $e->getMessage()); + } finally { + unset($this->projects[$sequence]); } } @@ -468,12 +496,53 @@ class StatsUsage extends Action try { Console::log('Processing batch with ' . count($this->statDocuments) . ' stats'); + + /** + * Sort by UNIQUE KEY "_key_metric_period_time" ("_tenant","metric" DESC,"period","time") + * Here we sort by _tenant as well because of setTenantPerDocument + */ + + usort($this->statDocuments, function ($a, $b) { + // Tenant ASC + $cmp = $a['$tenant'] <=> $b['$tenant']; + if ($cmp !== 0) { + return $cmp; + } + + // Metric DESC + $cmp = strcmp($b['metric'], $a['metric']); + if ($cmp !== 0) { + return $cmp; + } + + // Period ASC + $cmp = strcmp($a['period'], $b['period']); + if ($cmp !== 0) { + return $cmp; + } + + // Time ASC, NULLs first + if ($a['time'] === null) { + return ($b['time'] === null) ? 0 : -1; + } + if ($b['time'] === null) { + return 1; + } + + return strcmp($a['time'], $b['time']); + }); + $dbForLogs->createOrUpdateDocumentsWithIncrease( 'stats', 'value', $this->statDocuments ); Console::success('Usage logs pushed to Logs DB'); + + /** + * todo: Do we need to unset $this->statDocuments? + */ + } catch (Throwable $th) { Console::error($th->getMessage()); } diff --git a/src/Appwrite/Platform/Workers/StatsUsageDump.php b/src/Appwrite/Platform/Workers/StatsUsageDump.php deleted file mode 100644 index 7c2da8fd4d..0000000000 --- a/src/Appwrite/Platform/Workers/StatsUsageDump.php +++ /dev/null @@ -1,206 +0,0 @@ -<?php - -namespace Appwrite\Platform\Workers; - -use Appwrite\Extend\Exception; -use Utopia\CLI\Console; -use Utopia\Database\DateTime; -use Utopia\Database\Document; -use Utopia\Platform\Action; -use Utopia\Queue\Message; -use Utopia\Registry\Registry; -use Utopia\System\System; - -/** - * TODO remove later - */ -class StatsUsageDump extends Action -{ - public const METRIC_COLLECTION_LEVEL_STORAGE = 4; - public const METRIC_DATABASE_LEVEL_STORAGE = 3; - public const METRIC_PROJECT_LEVEL_STORAGE = 2; - protected array $stats = []; - - protected Registry $register; - - /** - * Metrics to skip writing to logsDB - * As these metrics are calculated separately - * by logs DB - * @var array - */ - protected array $skipBaseMetrics = [ - METRIC_DATABASES => true, - METRIC_BUCKETS => true, - METRIC_USERS => true, - METRIC_FUNCTIONS => true, - METRIC_TEAMS => true, - METRIC_MESSAGES => true, - METRIC_MAU => true, - METRIC_WEBHOOKS => true, - METRIC_PLATFORMS => true, - METRIC_PROVIDERS => true, - METRIC_TOPICS => true, - METRIC_KEYS => true, - METRIC_FILES => true, - METRIC_FILES_STORAGE => true, - METRIC_DEPLOYMENTS_STORAGE => true, - METRIC_BUILDS_STORAGE => true, - METRIC_DEPLOYMENTS => true, - METRIC_BUILDS => true, - METRIC_COLLECTIONS => true, - METRIC_DOCUMENTS => true, - METRIC_DATABASES_STORAGE => true, - ]; - - /** - * Skip metrics associated with parent IDs - * these need to be checked individually with `str_ends_with` - */ - protected array $skipParentIdMetrics = [ - '.files', - '.files.storage', - '.collections', - '.documents', - '.deployments', - '.deployments.storage', - '.builds', - '.builds.storage', - '.databases.storage' - ]; - - /** - * @var callable(Document): Database - */ - protected $getLogsDB; - - protected array $periods = [ - '1h' => 'Y-m-d H:00', - '1d' => 'Y-m-d 00:00', - 'inf' => '0000-00-00 00:00' - ]; - - public static function getName(): string - { - return 'stats-usage-dump'; - } - - /** - * @throws \Exception - */ - public function __construct() - { - $this - ->inject('message') - ->inject('getProjectDB') - ->inject('getLogsDB') - ->inject('register') - ->callback([$this, 'action']); - } - - /** - * @param Message $message - * @param callable $getProjectDB - * @param callable $getLogsDB - * @param Registry $register - * @return void - * @throws Exception - * @throws \Throwable - * @throws \Utopia\Database\Exception - */ - public function action(Message $message, callable $getProjectDB, callable $getLogsDB, Registry $register): void - { - $this->getLogsDB = $getLogsDB; - $this->register = $register; - $payload = $message->getPayload() ?? []; - if (empty($payload)) { - throw new Exception('Missing payload'); - } - - foreach ($payload['stats'] ?? [] as $stats) { - $project = new Document($stats['project'] ?? []); - - $numberOfKeys = !empty($stats['keys']) ? count($stats['keys']) : 0; - $receivedAt = $stats['receivedAt'] ?? null; - if ($numberOfKeys === 0) { - continue; - } - - Console::log('['.DateTime::now().'] Id: '.$project->getId(). ' InternalId: '.$project->getSequence(). ' Db: '.$project->getAttribute('database').' ReceivedAt: '.$receivedAt. ' Keys: '.$numberOfKeys); - - try { - /** @var Database $dbForProject */ - $dbForProject = $getProjectDB($project); - foreach ($stats['keys'] ?? [] as $key => $value) { - if ($value == 0) { - continue; - } - - if (str_contains($key, METRIC_DATABASES_STORAGE)) { - continue; - } - - foreach ($this->periods as $period => $format) { - $time = null; - - if ($period !== 'inf') { - $time = !empty($receivedAt) ? (new \DateTime($receivedAt))->format($format) : date($format, time()); - } - $id = \md5("{$time}_{$period}_{$key}"); - - $document = new Document([ - '$id' => $id, - 'period' => $period, - 'time' => $time, - 'metric' => $key, - 'value' => $value, - 'region' => System::getEnv('_APP_REGION', 'default'), - ]); - - $documentClone = clone $document; - - $dbForProject->createOrUpdateDocumentsWithIncrease( - 'stats', - 'value', - [$document] - ); - - $this->writeToLogsDB($project, $documentClone); - } - } - } catch (\Exception $e) { - Console::error('[' . DateTime::now() . '] project [' . $project->getSequence() . '] database [' . $project['database'] . '] ' . ' ' . $e->getMessage()); - } - } - } - - protected function writeToLogsDB(Document $project, Document $document): void - { - if (System::getEnv('_APP_STATS_USAGE_DUAL_WRITING', 'disabled') === 'disabled') { - Console::log('Dual Writing is disabled. Skipping...'); - return; - } - - if (array_key_exists($document->getAttribute('metric'), $this->skipBaseMetrics)) { - return; - } - foreach ($this->skipParentIdMetrics as $skipMetric) { - if (str_ends_with($document->getAttribute('metric'), $skipMetric)) { - return; - } - } - - $dbForLogs = ($this->getLogsDB)($project); - - try { - $dbForLogs->createOrUpdateDocumentsWithIncrease( - 'stats', - 'value', - [$document] - ); - Console::success('Usage logs pushed to Logs DB'); - } catch (\Throwable $th) { - Console::error($th->getMessage()); - } - } -} diff --git a/src/Appwrite/Platform/Workers/Webhooks.php b/src/Appwrite/Platform/Workers/Webhooks.php index 4c081aaa13..394eae5fb8 100644 --- a/src/Appwrite/Platform/Workers/Webhooks.php +++ b/src/Appwrite/Platform/Workers/Webhooks.php @@ -38,7 +38,7 @@ class Webhooks extends Action ->inject('queueForStatsUsage') ->inject('log') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -219,6 +219,7 @@ class Webhooks extends Action ]); $projectId = $project->getId(); + $region = $project->getAttribute('region', 'default'); $webhookId = $webhook->getId(); $template = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-webhook-failed.tpl'); @@ -227,7 +228,7 @@ class Webhooks extends Action $template->setParam('{{project}}', $project->getAttribute('name')); $template->setParam('{{url}}', $webhook->getAttribute('url')); $template->setParam('{{error}}', $curlError ?? 'The server returned ' . $statusCode . ' status code'); - $template->setParam('{{path}}', "/console/project-$projectId/settings/webhooks/$webhookId"); + $template->setParam('{{path}}', "/console/project-$region-$projectId/settings/webhooks/$webhookId"); $template->setParam('{{attempts}}', $attempts); $template->setParam('{{logoUrl}}', $plan['logoUrl'] ?? APP_EMAIL_LOGO_URL); @@ -240,6 +241,7 @@ class Webhooks extends Action // TODO: Use setbodyTemplate once #7307 is merged $subject = 'Webhook deliveries have been paused'; + $preview = 'Webhook deliveries to your endpoint have been paused.'; $body = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-base-styled.tpl'); $body @@ -249,6 +251,7 @@ class Webhooks extends Action $queueForMails ->setSubject($subject) + ->setPreview($preview) ->setBody($body->render()); foreach ($users as $user) { diff --git a/src/Appwrite/SDK/Deprecated.php b/src/Appwrite/SDK/Deprecated.php new file mode 100644 index 0000000000..1d74c108c9 --- /dev/null +++ b/src/Appwrite/SDK/Deprecated.php @@ -0,0 +1,32 @@ +<?php + +namespace Appwrite\SDK; + +class Deprecated +{ + /** + * @param string $since + * @param string|null $replaceWith + */ + public function __construct( + private string $since, + private ?string $replaceWith = null, + ) { + } + + /** + * @return string + */ + public function getSince(): string + { + return $this->since; + } + + /** + * @return string|null + */ + public function getReplaceWith(): ?string + { + return $this->replaceWith; + } +} diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index d0b08f154e..8d11b07198 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -18,17 +18,19 @@ class Method * @param string $namespace * @param ?string $group * @param string $name + * @param string $desc * @param string $description * @param array<AuthType> $auth * @param array<SDKResponse> $responses * @param ContentType $contentType * @param MethodType|null $type - * @param bool $deprecated + * @param Deprecated|null $deprecated * @param array|bool $hide * @param bool $packaging * @param ContentType $requestType * @param array<Parameter> $parameters * @param array $additionalParameters + * @param string $desc */ public function __construct( protected string $namespace, @@ -39,12 +41,13 @@ class Method protected array $responses, protected ContentType $contentType = ContentType::JSON, protected ?MethodType $type = null, - protected bool $deprecated = false, + protected ?Deprecated $deprecated = null, protected array|bool $hide = false, protected bool $packaging = false, protected ContentType $requestType = ContentType::JSON, protected array $parameters = [], - protected array $additionalParameters = [] + protected array $additionalParameters = [], + protected string $desc = '' ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); @@ -137,6 +140,11 @@ class Method return $this->name; } + public function getDesc(): string + { + return $this->desc; + } + public function getDescription(): string { return $this->description; @@ -176,6 +184,11 @@ class Method } public function isDeprecated(): bool + { + return $this->deprecated !== null; + } + + public function getDeprecated(): ?Deprecated { return $this->deprecated; } @@ -220,6 +233,12 @@ class Method return $this; } + public function setDesc(string $desc): self + { + $this->desc = $desc; + return $this; + } + public function setDescription(string $description): self { $this->description = $description; @@ -258,13 +277,13 @@ class Method return $this; } - public function setDeprecated(bool $deprecated): self + public function setDeprecated(bool|Deprecated $deprecated): self { $this->deprecated = $deprecated; return $this; } - public function setHide(bool|array $hide): self + public function setHide(bool|Deprecated $hide): self { $this->hide = $hide; return $this; diff --git a/src/Appwrite/SDK/Specification/Format.php b/src/Appwrite/SDK/Specification/Format.php index 8dbccf5cbb..db7335e40f 100644 --- a/src/Appwrite/SDK/Specification/Format.php +++ b/src/Appwrite/SDK/Specification/Format.php @@ -24,6 +24,7 @@ abstract class Format protected array $services; protected array $keys; protected int $authCount; + protected string $platform; protected array $params = [ 'name' => '', 'description' => '', @@ -50,7 +51,7 @@ abstract class Format ] ]; - public function __construct(App $app, array $services, array $routes, array $models, array $keys, int $authCount) + public function __construct(App $app, array $services, array $routes, array $models, array $keys, int $authCount, string $platform) { $this->app = $app; $this->services = $services; @@ -58,6 +59,7 @@ abstract class Format $this->models = $models; $this->keys = $keys; $this->authCount = $authCount; + $this->platform = $platform; } /** @@ -110,9 +112,20 @@ abstract class Format return $this->params[$key] ?? $default; } - protected function getEnumName(string $service, string $method, string $param): ?string + protected function getRequestEnumName(string $service, string $method, string $param): ?string { + /* `$service` is `$namespace` */ switch ($service) { + case 'proxy': + switch ($method) { + case 'createRedirectRule': + switch ($param) { + case 'resourceType': + return 'ProxyResourceType'; + } + break; + } + break; case 'console': switch ($method) { case 'getResource': @@ -163,11 +176,11 @@ abstract class Format case 'databases': switch ($method) { case 'getUsage': + case 'listUsage': case 'getCollectionUsage': - case 'getDatabaseUsage': switch ($param) { case 'range': - return 'DatabaseUsageRange'; + return 'UsageRange'; } break; case 'createRelationshipAttribute': @@ -193,13 +206,46 @@ abstract class Format } } break; + case 'tablesDB': + switch ($method) { + case 'getUsage': + case 'listUsage': + case 'getTableUsage': + switch ($param) { + case 'range': + return 'UsageRange'; + } + break; + case 'createRelationshipColumn': + switch ($param) { + case 'type': + return 'RelationshipType'; + case 'onDelete': + return 'RelationMutate'; + } + break; + case 'updateRelationshipColumn': + switch ($param) { + case 'onDelete': + return 'RelationMutate'; + } + break; + case 'createIndex': + switch ($param) { + case 'type': + return 'IndexType'; + case 'orders': + return 'OrderBy'; + } + } + break; case 'functions': switch ($method) { case 'getUsage': case 'listUsage': switch ($param) { case 'range': - return 'FunctionUsageRange'; + return 'UsageRange'; } break; case 'createExecution': @@ -234,7 +280,7 @@ abstract class Format case 'listUsage': switch ($param) { case 'range': - return 'SiteUsageRange'; + return 'UsageRange'; } break; case 'createVcsDeployment': @@ -357,7 +403,7 @@ abstract class Format case 'getBucketUsage': switch ($param) { case 'range': - return 'StorageUsageRange'; + return 'UsageRange'; } break; case 'getFilePreview': @@ -375,7 +421,7 @@ abstract class Format case 'getUsage': switch ($param) { case 'range': - return 'UserUsageRange'; + return 'UsageRange'; } break; case 'createMfaAuthenticator': @@ -403,7 +449,8 @@ abstract class Format } return null; } - public function getEnumKeys(string $service, string $method, string $param): array + + public function getRequestEnumKeys(string $service, string $method, string $param): array { $values = []; switch ($service) { @@ -432,8 +479,17 @@ abstract class Format case 'databases': switch ($method) { case 'getUsage': + case 'listUsage': case 'getCollectionUsage': - case 'getDatabaseUsage': + // Range Enum Keys + return ['Twenty Four Hours', 'Thirty Days', 'Ninety Days']; + } + break; + case 'tablesDB': + switch ($method) { + case 'getUsage': + case 'listUsage': + case 'getTableUsage': // Range Enum Keys return ['Twenty Four Hours', 'Thirty Days', 'Ninety Days']; } @@ -441,18 +497,17 @@ abstract class Format case 'proxy': switch ($method) { case 'createRedirectRule': - return ['Moved Permanently 301', 'Found 302', 'Temporary Redirect 307', 'Permanent Redirect 308']; - } - break; - case 'functions': - switch ($method) { - case 'getUsage': - case 'listUsage': - // Range Enum Keys - return ['Twenty Four Hours', 'Thirty Days', 'Ninety Days']; + switch ($param) { + case 'statusCode': + return ['Moved Permanently 301', 'Found 302', 'Temporary Redirect 307', 'Permanent Redirect 308']; + case 'resourceType': + return ['Site', 'Function']; + } + break; } break; case 'sites': + case 'functions': switch ($method) { case 'getUsage': case 'listUsage': @@ -488,6 +543,97 @@ abstract class Format return $values; } + public function getResponseEnumName(string $model, string $param): ?string + { + switch ($model) { + case 'attributeString': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeInteger': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeFloat': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeBoolean': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeEmail': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeEnum': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeIp': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeUrl': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeDatetime': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeRelationship': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributePoint': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeLine': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributePolygon': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'healthStatus': + switch ($param) { + case 'status': + return 'HealthCheckStatus'; + } + break; + } + return null; + } + protected function getNestedModels(Model $model, array &$usedModels): void { foreach ($model->getRules() as $rule) { diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 19742ee3ee..2380f03920 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -9,8 +9,11 @@ use Appwrite\SDK\Response; use Appwrite\SDK\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; +use Appwrite\Utopia\Response\Model\Any; +use Utopia\Database\Database; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\Spatial; use Utopia\Validator; use Utopia\Validator\ArrayList; use Utopia\Validator\Nullable; @@ -110,11 +113,7 @@ class OpenAPI3 extends Format */ $consumes = [$sdk->getRequestType()->value]; - $method = $sdk->getMethodName() ?? \uniqid(); - - if (!empty($method) && \is_array($method)) { - $method = \array_keys($method)[0]; - } + $methodName = $sdk->getMethodName() ?? \uniqid(); $desc = $sdk->getDescriptionFilePath() ?: $sdk->getDescription(); $produces = ($sdk->getContentType())->value; @@ -148,18 +147,18 @@ class OpenAPI3 extends Format $temp = [ 'summary' => $route->getDesc(), - 'operationId' => $namespace . ucfirst($method), + 'operationId' => $namespace . ucfirst($methodName), 'tags' => [$namespace], 'description' => $descContents, 'responses' => [], + 'deprecated' => $sdk->isDeprecated(), 'x-appwrite' => [ // Appwrite related metadata - 'method' => $method, + 'method' => $methodName, 'group' => $sdk->getGroup(), 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), 'type' => $sdk->getType()->value ?? '', - 'deprecated' => $sdk->isDeprecated(), - 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', + 'demo' => \strtolower($namespace) . '/' . Template::fromCamelCaseToDash($methodName) . '.md', 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', 'rate-limit' => $route->getLabel('abuse-limit', 0), 'rate-time' => $route->getLabel('abuse-time', 3600), @@ -170,40 +169,107 @@ class OpenAPI3 extends Format ], ]; + if ($sdk->getDeprecated()) { + $temp['x-appwrite']['deprecated'] = [ + 'since' => $sdk->getDeprecated()->getSince(), + 'replaceWith' => $sdk->getDeprecated()->getReplaceWith(), + ]; + } if (!empty($additionalMethods)) { $temp['x-appwrite']['methods'] = []; - foreach ($additionalMethods as $method) { - /** @var Method $method */ - $desc = $method->getDescriptionFilePath(); + foreach ($additionalMethods as $methodObj) { + /** @var Method $methodObj */ + $desc = $methodObj->getDescriptionFilePath(); + + $methodSecurities = $methodObj->getAuth(); + $methodSdkPlatforms = []; + foreach ($methodSecurities as $value) { + switch ($value) { + case AuthType::SESSION: + $methodSdkPlatforms[] = APP_PLATFORM_CLIENT; + break; + case AuthType::JWT: + case AuthType::KEY: + $methodSdkPlatforms[] = APP_PLATFORM_SERVER; + break; + case AuthType::ADMIN: + $methodSdkPlatforms[] = APP_PLATFORM_CONSOLE; + break; + } + } + + if (empty($methodSecurities)) { + $methodSdkPlatforms[] = APP_PLATFORM_SERVER; + $methodSdkPlatforms[] = APP_PLATFORM_CLIENT; + } + + if ($this->platform !== APP_PLATFORM_CONSOLE && !\in_array($this->platform, $methodSdkPlatforms)) { + continue; + } + + $methodSecurities = ['Project' => []]; + foreach ($methodObj->getAuth() as $security) { + if (\array_key_exists($security->value, $this->keys)) { + $methodSecurities[$security->value] = []; + } + } + $additionalMethod = [ - 'name' => $method->getMethodName(), - 'auth' => \array_merge(...\array_map(fn ($auth) => [$auth->value => []], $method->getAuth())), + 'name' => $methodObj->getMethodName(), + 'namespace' => $methodObj->getNamespace(), + 'desc' => $methodObj->getDesc() ?? '', + 'auth' => \array_slice($methodSecurities, 0, $this->authCount), 'parameters' => [], 'required' => [], 'responses' => [], 'description' => ($desc) ? \file_get_contents($desc) : '', + 'demo' => \strtolower($namespace) . '/' . Template::fromCamelCaseToDash($methodObj->getMethodName()) . '.md', ]; - foreach ($method->getParameters() as $parameter) { - $additionalMethod['parameters'][] = $parameter->getName(); + // add deprecation only if method has it! + if ($methodObj->getDeprecated()) { + $additionalMethod['deprecated'] = [ + 'since' => $methodObj->getDeprecated()->getSince(), + 'replaceWith' => $methodObj->getDeprecated()->getReplaceWith(), + ]; + } - if (!$parameter->getOptional()) { - $additionalMethod['required'][] = $parameter->getName(); + // If additional method has no parameters, inherit from route + if (empty($methodObj->getParameters())) { + foreach ($route->getParams() as $name => $param) { + $additionalMethod['parameters'][] = $name; + if (!$param['optional']) { + $additionalMethod['required'][] = $name; + } + } + } else { + // Use method's own parameters + foreach ($methodObj->getParameters() as $parameter) { + $additionalMethod['parameters'][] = $parameter->getName(); + if (!$parameter->getOptional()) { + $additionalMethod['required'][] = $parameter->getName(); + } } } - foreach ($method->getResponses() as $response) { + foreach ($methodObj->getResponses() as $response) { if (\is_array($response->getModel())) { $additionalMethod['responses'][] = [ 'code' => $response->getCode(), 'model' => \array_map(fn ($m) => '#/components/schemas/' . $m, $response->getModel()) ]; } else { - $additionalMethod['responses'][] = [ + $responseData = [ 'code' => $response->getCode(), - 'model' => '#/components/schemas/' . $response->getModel() ]; + + // lets not assume stuff here! + if ($response->getCode() !== 204) { + $responseData['model'] = '#/components/schemas/' . $response->getModel(); + } + + $additionalMethod['responses'][] = $responseData; } } @@ -281,7 +347,7 @@ class OpenAPI3 extends Format } } - if ((!empty($scope))) { + if (!empty($scope)) { $securities = ['Project' => []]; foreach ($sdk->getAuth() as $security) { @@ -360,6 +426,7 @@ class OpenAPI3 extends Format break; case 'Utopia\Validator\Host': case 'Utopia\Validator\URL': + case 'Appwrite\Network\Validator\Redirect': $node['schema']['type'] = $validator->getType(); $node['schema']['format'] = 'url'; $node['schema']['x-example'] = 'https://example.com'; @@ -369,7 +436,7 @@ class OpenAPI3 extends Format case 'Utopia\Validator\Assoc': $param['default'] = (empty($param['default'])) ? new \stdClass() : $param['default']; $node['schema']['type'] = 'object'; - $node['schema']['x-example'] = '{}'; + $node['schema']['x-example'] = ($param['example'] ?? '') ?: '{}'; break; case 'Utopia\Storage\Validator\File': $consumes = ['multipart/form-data']; @@ -383,8 +450,24 @@ class OpenAPI3 extends Format 'type' => $validator->getValidator()->getType(), ]; break; + case 'Utopia\Database\Validator\Spatial': + /** @var Spatial $validator */ + $node['schema']['type'] = 'array'; + $node['schema']['items'] = [ + 'oneOf' => [ + ['type' => 'array'] + ] + ]; + $node['schema']['x-example'] = match ($validator->getSpatialType()) { + Database::VAR_POINT => '[1, 2]', + Database::VAR_LINESTRING => '[[1, 2], [3, 4], [5, 6]]', + Database::VAR_POLYGON => '[[[1, 2], [3, 4], [5, 6], [1, 2]]]', + }; + break; + case 'Appwrite\Utopia\Database\Validator\Queries\Columns': case 'Appwrite\Utopia\Database\Validator\Queries\Attributes': case 'Appwrite\Utopia\Database\Validator\Queries\Buckets': + case 'Appwrite\Utopia\Database\Validator\Queries\Tables': case 'Appwrite\Utopia\Database\Validator\Queries\Collections': case 'Appwrite\Utopia\Database\Validator\Queries\Databases': case 'Appwrite\Utopia\Database\Validator\Queries\Deployments': @@ -444,11 +527,11 @@ class OpenAPI3 extends Format $node['schema']['format'] = $validator->getType() == Validator::TYPE_INTEGER ? 'int32' : 'float'; $node['schema']['x-example'] = $validator->getMin(); break; - case 'Utopia\Validator\Numeric': case 'Utopia\Validator\Integer': $node['schema']['type'] = $validator->getType(); $node['schema']['format'] = 'int32'; break; + case 'Utopia\Validator\Numeric': case 'Utopia\Validator\FloatValidator': $node['schema']['type'] = 'number'; $node['schema']['format'] = 'float'; @@ -461,13 +544,13 @@ class OpenAPI3 extends Format $node['schema']['type'] = $validator->getType(); $node['schema']['x-example'] = $validator->getList()[0]; - //Iterate from the blackList. If it matches with the current one, then it is a blackList + // Iterate from the blackList. If it matches with the current one, then it is a blackList // Do not add the enum $allowed = true; foreach ($this->enumBlacklist as $blacklist) { if ( $blacklist['namespace'] == $sdk->getNamespace() - && $blacklist['method'] == $method + && $blacklist['method'] == $methodName && $blacklist['parameter'] == $name ) { $allowed = false; @@ -477,8 +560,8 @@ class OpenAPI3 extends Format if ($allowed) { $node['schema']['enum'] = $validator->getList(); - $node['schema']['x-enum-name'] = $this->getEnumName($sdk->getNamespace() ?? '', $method, $name); - $node['schema']['x-enum-keys'] = $this->getEnumKeys($sdk->getNamespace() ?? '', $method, $name); + $node['schema']['x-enum-name'] = $this->getRequestEnumName($sdk->getNamespace() ?? '', $methodName, $name); + $node['schema']['x-enum-keys'] = $this->getRequestEnumKeys($sdk->getNamespace() ?? '', $methodName, $name); } if ($validator->getType() === 'integer') { $node['format'] = 'int32'; @@ -567,6 +650,7 @@ class OpenAPI3 extends Format $required = $model->getRequired(); $rules = $model->getRules(); + $examples = []; $output['components']['schemas'][$model->getType()] = [ 'description' => $model->getName(), @@ -590,6 +674,8 @@ class OpenAPI3 extends Format $format = null; $items = null; + $examples[$name] = $rule['example'] ?? null; + switch ($rule['type']) { case 'string': case 'datetime': @@ -597,11 +683,19 @@ class OpenAPI3 extends Format $type = 'string'; break; + case 'enum': + $type = 'string'; + break; + case 'json': $type = 'object'; $output['components']['schemas'][$model->getType()]['properties'][$name]['additionalProperties'] = true; break; + case 'array': + $type = 'array'; + break; + case 'integer': $type = 'integer'; $format = 'int32'; @@ -647,6 +741,7 @@ class OpenAPI3 extends Format break; } + $readOnly = $rule['readOnly'] ?? false; if ($rule['array']) { $output['components']['schemas'][$model->getType()]['properties'][$name] = [ 'type' => 'array', @@ -660,6 +755,9 @@ class OpenAPI3 extends Format if ($format) { $output['components']['schemas'][$model->getType()]['properties'][$name]['items']['format'] = $format; } + if ($readOnly) { + $output['components']['schemas'][$model->getType()]['properties'][$name]['readOnly'] = true; + } } else { $output['components']['schemas'][$model->getType()]['properties'][$name] = [ 'type' => $type, @@ -670,14 +768,39 @@ class OpenAPI3 extends Format if ($format) { $output['components']['schemas'][$model->getType()]['properties'][$name]['format'] = $format; } + if ($readOnly) { + $output['components']['schemas'][$model->getType()]['properties'][$name]['readOnly'] = true; + } } if ($items) { $output['components']['schemas'][$model->getType()]['properties'][$name]['items'] = $items; } + if ($rule['type'] === 'enum' && !empty($rule['enum'])) { + if ($rule['array']) { + $output['components']['schemas'][$model->getType()]['properties'][$name]['items']['enum'] = $rule['enum']; + $enumName = $this->getResponseEnumName($model->getType(), $name); + if ($enumName) { + $output['components']['schemas'][$model->getType()]['properties'][$name]['items']['x-enum-name'] = $enumName; + } + } else { + $output['components']['schemas'][$model->getType()]['properties'][$name]['enum'] = $rule['enum']; + $enumName = $this->getResponseEnumName($model->getType(), $name); + if ($enumName) { + $output['components']['schemas'][$model->getType()]['properties'][$name]['x-enum-name'] = $enumName; + } + } + } if (!in_array($name, $required)) { $output['components']['schemas'][$model->getType()]['properties'][$name]['nullable'] = true; } } + + /** @var Any $model */ + if ($model->isAny() && !empty($model->getSampleData())) { + $examples = array_merge($examples, $model->getSampleData()); + } + + $output['components']['schemas'][$model->getType()]['example'] = $examples; } \ksort($output['paths']); diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index bac483ffee..ed1217d86c 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -9,8 +9,11 @@ use Appwrite\SDK\Response; use Appwrite\SDK\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; +use Appwrite\Utopia\Response\Model\Any; +use Utopia\Database\Database; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\Spatial; use Utopia\Route; use Utopia\Validator; use Utopia\Validator\ArrayList; @@ -102,6 +105,7 @@ class Swagger2 extends Format $additionalMethods = null; if (\is_array($sdk)) { $additionalMethods = $sdk; + /** @var Method $sdk */ $sdk = $sdk[0]; } @@ -110,11 +114,7 @@ class Swagger2 extends Format $consumes = [$sdk->getRequestType()->value]; } - $method = $sdk->getMethodName() ?? \uniqid(); - - if (!empty($method) && is_array($method)) { - $method = array_keys($method)[0]; - } + $methodName = $sdk->getMethodName() ?? \uniqid(); $desc = $sdk->getDescriptionFilePath() ?: $sdk->getDescription(); $produces = ($sdk->getContentType())->value; @@ -141,6 +141,7 @@ class Swagger2 extends Format $sdkPlatforms[] = APP_PLATFORM_CLIENT; } + $sdkPlatforms = array_values(array_unique($sdkPlatforms)); $namespace = $sdk->getNamespace() ?? 'default'; $desc ??= ''; @@ -148,58 +149,120 @@ class Swagger2 extends Format $temp = [ 'summary' => $route->getDesc(), - 'operationId' => $namespace . ucfirst($method), + 'operationId' => $namespace . ucfirst($methodName), 'consumes' => [], 'produces' => [], 'tags' => [$namespace], 'description' => $descContents, 'responses' => [], + 'deprecated' => $sdk->isDeprecated(), 'x-appwrite' => [ // Appwrite related metadata - 'method' => $method, + 'method' => $methodName, 'group' => $sdk->getGroup(), 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), 'type' => $sdk->getType()->value ?? '', - 'deprecated' => $sdk->isDeprecated(), - 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', + 'demo' => \strtolower($namespace) . '/' . Template::fromCamelCaseToDash($methodName) . '.md', 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', 'rate-limit' => $route->getLabel('abuse-limit', 0), 'rate-time' => $route->getLabel('abuse-time', 3600), 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $sdkPlatforms, - 'packaging' => $sdk->isPackaging() + 'packaging' => $sdk->isPackaging(), ], ]; + if ($sdk->getDeprecated()) { + $temp['x-appwrite']['deprecated'] = [ + 'since' => $sdk->getDeprecated()->getSince(), + 'replaceWith' => $sdk->getDeprecated()->getReplaceWith(), + ]; + } + if ($produces) { $temp['produces'][] = $produces; } if (!empty($additionalMethods)) { $temp['x-appwrite']['methods'] = []; - foreach ($additionalMethods as $method) { - /** @var Method $method */ - $desc = $method->getDescriptionFilePath(); + foreach ($additionalMethods as $methodObj) { + /** @var Method $methodObj */ + $desc = $methodObj->getDescriptionFilePath(); + + $methodSecurities = $methodObj->getAuth(); + $methodSdkPlatforms = []; + foreach ($methodSecurities as $value) { + switch ($value) { + case AuthType::SESSION: + $methodSdkPlatforms[] = APP_PLATFORM_CLIENT; + break; + case AuthType::JWT: + case AuthType::KEY: + $methodSdkPlatforms[] = APP_PLATFORM_SERVER; + break; + case AuthType::ADMIN: + $methodSdkPlatforms[] = APP_PLATFORM_CONSOLE; + break; + } + } + + if (empty($methodSecurities)) { + $methodSdkPlatforms[] = APP_PLATFORM_SERVER; + $methodSdkPlatforms[] = APP_PLATFORM_CLIENT; + } + + if ($this->platform !== APP_PLATFORM_CONSOLE && !\in_array($this->platform, $methodSdkPlatforms)) { + continue; + } + + $methodSecurities = ['Project' => []]; + foreach ($methodObj->getAuth() as $security) { + /** @var AuthType $security */ + if (\array_key_exists($security->value, $this->keys)) { + $methodSecurities[$security->value] = []; + } + } $additionalMethod = [ - 'name' => $method->getMethodName(), - 'auth' => \array_merge(...\array_map(fn ($auth) => [$auth->value => []], $method->getAuth())), + 'name' => $methodObj->getMethodName(), + 'namespace' => $methodObj->getNamespace(), + 'desc' => $methodObj->getDesc() ?? '', + 'auth' => \array_slice($methodSecurities, 0, $this->authCount), 'parameters' => [], 'required' => [], 'responses' => [], 'description' => ($desc) ? \file_get_contents($desc) : '', + 'demo' => \strtolower($namespace) . '/' . Template::fromCamelCaseToDash($methodObj->getMethodName()) . '.md', ]; - foreach ($method->getParameters() as $parameter) { - $additionalMethod['parameters'][] = $parameter->getName(); + // add deprecation only if method has it! + if ($methodObj->getDeprecated()) { + $additionalMethod['deprecated'] = [ + 'since' => $methodObj->getDeprecated()->getSince(), + 'replaceWith' => $methodObj->getDeprecated()->getReplaceWith(), + ]; + } - if (!$parameter->getOptional()) { - $additionalMethod['required'][] = $parameter->getName(); + // If additional method has no parameters, inherit from route + if (empty($methodObj->getParameters())) { + foreach ($route->getParams() as $name => $param) { + $additionalMethod['parameters'][] = $name; + if (!$param['optional']) { + $additionalMethod['required'][] = $name; + } + } + } else { + // Use method's own parameters + foreach ($methodObj->getParameters() as $parameter) { + $additionalMethod['parameters'][] = $parameter->getName(); + if (!$parameter->getOptional()) { + $additionalMethod['required'][] = $parameter->getName(); + } } } - foreach ($method->getResponses() as $response) { + foreach ($methodObj->getResponses() as $response) { /** @var Response $response */ if (\is_array($response->getModel())) { $additionalMethod['responses'][] = [ @@ -207,10 +270,16 @@ class Swagger2 extends Format 'model' => \array_map(fn ($m) => '#/definitions/' . $m, $response->getModel()) ]; } else { - $additionalMethod['responses'][] = [ + $responseData = [ 'code' => $response->getCode(), - 'model' => '#/definitions/' . $response->getModel() ]; + + // lets not assume stuff here! + if ($response->getCode() !== 204) { + $responseData['model'] = '#/definitions/' . $response->getModel(); + } + + $additionalMethod['responses'][] = $responseData; } } @@ -283,11 +352,10 @@ class Swagger2 extends Format } } - if ((!empty($scope))) { // && 'public' != $scope + if (!empty($scope)) { $securities = ['Project' => []]; foreach ($sdk->getAuth() as $security) { - /** @var AuthType $security */ if (\array_key_exists($security->value, $this->keys)) { $securities[$security->value] = []; } @@ -384,6 +452,7 @@ class Swagger2 extends Format break; case 'Utopia\Validator\Host': case 'Utopia\Validator\URL': + case 'Appwrite\Network\Validator\Redirect': $node['type'] = $validator->getType(); $node['format'] = 'url'; $node['x-example'] = 'https://example.com'; @@ -396,12 +465,26 @@ class Swagger2 extends Format 'type' => $validator->getValidator()->getType(), ]; break; + case 'Utopia\Database\Validator\Spatial': + /** @var Spatial $validator */ + $node['type'] = 'array'; + $node['schema']['items'] = [ + 'oneOf' => [ + ['type' => 'array'] + ] + ]; + $node['x-example'] = match ($validator->getSpatialType()) { + Database::VAR_POINT => '[1, 2]', + Database::VAR_LINESTRING => '[[1, 2], [3, 4], [5, 6]]', + Database::VAR_POLYGON => '[[[1, 2], [3, 4], [5, 6], [1, 2]]]', + }; + break; case 'Utopia\Validator\JSON': case 'Utopia\Validator\Mock': case 'Utopia\Validator\Assoc': $node['type'] = 'object'; $node['default'] = (empty($param['default'])) ? new \stdClass() : $param['default']; - $node['x-example'] = '{}'; + $node['x-example'] = ($param['example'] ?? '') ?: '{}'; break; case 'Utopia\Storage\Validator\File': $consumes = ['multipart/form-data']; @@ -415,6 +498,8 @@ class Swagger2 extends Format case 'Utopia\Database\Validator\Queries': case 'Utopia\Database\Validator\Queries\Document': case 'Utopia\Database\Validator\Queries\Documents': + case 'Appwrite\Utopia\Database\Validator\Queries\Columns': + case 'Appwrite\Utopia\Database\Validator\Queries\Tables': $node['type'] = 'array'; $node['collectionFormat'] = 'multi'; $node['items'] = [ @@ -453,11 +538,11 @@ class Swagger2 extends Format $node['format'] = $validator->getType() == Validator::TYPE_INTEGER ? 'int32' : 'float'; $node['x-example'] = $validator->getMin(); break; - case 'Utopia\Validator\Numeric': case 'Utopia\Validator\Integer': $node['type'] = $validator->getType(); $node['format'] = 'int32'; break; + case 'Utopia\Validator\Numeric': case 'Utopia\Validator\FloatValidator': $node['type'] = 'number'; $node['format'] = 'float'; @@ -470,10 +555,10 @@ class Swagger2 extends Format $node['type'] = $validator->getType(); $node['x-example'] = $validator->getList()[0]; - //Iterate the blackList. If it matches with the current one, then it is blackListed + // Iterate the blackList. If it matches with the current one, then it is blackListed $allowed = true; foreach ($this->enumBlacklist as $blacklist) { - if ($blacklist['namespace'] == $namespace && $blacklist['method'] == $method && $blacklist['parameter'] == $name) { + if ($blacklist['namespace'] == $namespace && $blacklist['method'] == $methodName && $blacklist['parameter'] == $name) { $allowed = false; break; } @@ -481,8 +566,8 @@ class Swagger2 extends Format if ($allowed && $validator->getType() === 'string') { $node['enum'] = $validator->getList(); - $node['x-enum-name'] = $this->getEnumName($namespace, $method, $name); - $node['x-enum-keys'] = $this->getEnumKeys($namespace, $method, $name); + $node['x-enum-name'] = $this->getRequestEnumName($namespace, $methodName, $name); + $node['x-enum-keys'] = $this->getRequestEnumKeys($namespace, $methodName, $name); } if ($validator->getType() === 'integer') { @@ -574,6 +659,7 @@ class Swagger2 extends Format $required = $model->getRequired(); $rules = $model->getRules(); + $examples = []; $output['definitions'][$model->getType()] = [ 'description' => $model->getName(), @@ -597,16 +683,26 @@ class Swagger2 extends Format $format = null; $items = null; + $examples[$name] = $rule['example'] ?? null; + switch ($rule['type']) { case 'string': case 'datetime': $type = 'string'; break; + case 'enum': + $type = 'string'; + break; + case 'json': $type = 'object'; break; + case 'array': + $type = 'array'; + break; + case 'integer': $type = 'integer'; $format = 'int32'; @@ -653,6 +749,7 @@ class Swagger2 extends Format break; } + $readOnly = $rule['readOnly'] ?? false; if ($rule['type'] == 'json') { $output['definitions'][$model->getType()]['properties'][$name] = [ 'type' => $type, @@ -660,6 +757,10 @@ class Swagger2 extends Format 'description' => $rule['description'] ?? '', 'x-example' => $rule['example'] ?? null, ]; + + if ($readOnly) { + $output['definitions'][$model->getType()]['properties'][$name]['readOnly'] = true; + } continue; } @@ -676,6 +777,9 @@ class Swagger2 extends Format if ($format) { $output['definitions'][$model->getType()]['properties'][$name]['items']['format'] = $format; } + if ($readOnly) { + $output['definitions'][$model->getType()]['properties'][$name]['readOnly'] = true; + } } else { $output['definitions'][$model->getType()]['properties'][$name] = [ 'type' => $type, @@ -686,14 +790,39 @@ class Swagger2 extends Format if ($format) { $output['definitions'][$model->getType()]['properties'][$name]['format'] = $format; } + if ($readOnly) { + $output['definitions'][$model->getType()]['properties'][$name]['readOnly'] = true; + } } if ($items) { $output['definitions'][$model->getType()]['properties'][$name]['items'] = $items; } + if ($rule['type'] === 'enum' && !empty($rule['enum'])) { + if ($rule['array']) { + $output['definitions'][$model->getType()]['properties'][$name]['items']['enum'] = $rule['enum']; + $enumName = $this->getResponseEnumName($model->getType(), $name); + if ($enumName) { + $output['definitions'][$model->getType()]['properties'][$name]['items']['x-enum-name'] = $enumName; + } + } else { + $output['definitions'][$model->getType()]['properties'][$name]['enum'] = $rule['enum']; + $enumName = $this->getResponseEnumName($model->getType(), $name); + if ($enumName) { + $output['definitions'][$model->getType()]['properties'][$name]['x-enum-name'] = $enumName; + } + } + } if (!in_array($name, $required)) { $output['definitions'][$model->getType()]['properties'][$name]['x-nullable'] = true; } } + + /** @var Any $model */ + if ($model->isAny() && !empty($model->getSampleData())) { + $examples = array_merge($examples, $model->getSampleData()); + } + + $output['definitions'][$model->getType()]['example'] = $examples; } \ksort($output['paths']); diff --git a/src/Appwrite/Template/Template.php b/src/Appwrite/Template/Template.php index c01d54389b..c8744c87bb 100644 --- a/src/Appwrite/Template/Template.php +++ b/src/Appwrite/Template/Template.php @@ -63,7 +63,7 @@ class Template extends View * * @throws Exception */ - public function render($minify = true): string + public function render($minify = true, $useContent = false): string { if ($this->rendered) { // Don't render any template return ''; @@ -72,7 +72,7 @@ class Template extends View if (\is_readable($this->path)) { $template = \file_get_contents($this->path); // Include template file } elseif (!empty($this->content)) { - $template = $this->print($this->content, self::FILTER_NL2P); + $template = !$useContent ? $this->print($this->content, self::FILTER_NL2P) : $this->content; } else { throw new Exception('"' . $this->path . '" template is not readable or not found'); } @@ -173,6 +173,6 @@ class Template extends View */ public static function fromCamelCaseToDash($input): string { - return \str_replace([' ', '_'], '-', \strtolower(\preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $input))); + return \str_replace([' ', '_'], '', \strtolower(\preg_replace('/(?<!^)([A-Z][a-z]|(?<=[a-z])[^a-z\s]|(?<=[A-Z])[0-9_])/', '-$1', $input))); } } diff --git a/src/Appwrite/Transformation/Adapter/Preview.php b/src/Appwrite/Transformation/Adapter/Preview.php index 7c08777413..e69ab5252e 100644 --- a/src/Appwrite/Transformation/Adapter/Preview.php +++ b/src/Appwrite/Transformation/Adapter/Preview.php @@ -32,9 +32,24 @@ class Preview extends Adapter $this->output = $this->input; $banner = <<<EOT + <link rel="preconnect" href="https://assets.appwrite.io/" crossorigin> + <style> + @font-face { + font-family: 'Inter'; + src: url('https://assets.appwrite.io/fonts/inter/Inter-Regular.woff2') format('woff2'); + font-weight: 400; + font-style: normal; + font-display: swap; + } + @font-face { + font-family: 'Inter'; + src: url('https://assets.appwrite.io/fonts/inter/Inter-Medium.woff2') format('woff2'); + font-weight: 500; + font-style: normal; + font-display: swap; + } + </style> <style> - @import url(https://fonts.bunny.net/css?family=fira-code:400|inter:400); - #appwrite-preview { min-width: auto; min-height: auto; diff --git a/src/Appwrite/URL/URL.php b/src/Appwrite/URL/URL.php index 98250ab429..49e95929e7 100644 --- a/src/Appwrite/URL/URL.php +++ b/src/Appwrite/URL/URL.php @@ -26,7 +26,20 @@ class URL 'fragment' => '', ]; - return \array_merge($default, \parse_url($url)); + $parsed = \parse_url($url); + if (is_array($parsed)) { + return \array_merge($default, $parsed); + } + + // see if $url is just a scheme + if (preg_match('/^([a-z][a-z0-9+.-]*):/i', $url, $matches)) { + $scheme = $matches[1]; + return \array_merge($default, [ + 'scheme' => $scheme + ]); + } + + throw new \InvalidArgumentException('Invalid URL: ' . $url); } /** @@ -55,9 +68,9 @@ class URL $parts['user'] = isset($url['user']) ? $url['user'] : ''; - $parts['pass'] = isset($url['pass']) ? ':' . $url['pass'] : ''; + $parts['pass'] = !empty($url['pass']) ? ':' . $url['pass'] : ''; - $parts['pass'] = ($parts['user'] || $parts['pass']) ? $parts['pass'] . '@' : ''; + $parts['pass'] = ($parts['user'] || !empty($parts['pass'])) ? $parts['pass'] . '@' : ''; $parts['path'] = isset($url['path']) ? $url['path'] : ''; diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Attributes.php b/src/Appwrite/Utopia/Database/Validator/Queries/Attributes.php index 4a35c82b73..953948c045 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/Attributes.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Attributes.php @@ -4,7 +4,7 @@ namespace Appwrite\Utopia\Database\Validator\Queries; class Attributes extends Base { - public const ALLOWED_ATTRIBUTES = [ + public const array ALLOWED_ATTRIBUTES = [ 'key', 'type', 'size', diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Base.php b/src/Appwrite/Utopia/Database/Validator/Queries/Base.php index 20e7d5cb93..9d9bbde00b 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/Base.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Base.php @@ -11,6 +11,7 @@ use Utopia\Database\Validator\Query\Filter; use Utopia\Database\Validator\Query\Limit; use Utopia\Database\Validator\Query\Offset; use Utopia\Database\Validator\Query\Order; +use Utopia\Database\Validator\Query\Select; class Base extends Queries { @@ -25,7 +26,7 @@ class Base extends Queries { $config = Config::getParam('collections', []); - $collections = array_merge( + $collections = \array_merge( $config['projects'], $config['buckets'], $config['databases'], @@ -34,57 +35,75 @@ class Base extends Queries ); $collection = $collections[$collection]; - // array for constant lookup time + $allowedAttributesLookup = []; foreach ($allowedAttributes as $attribute) { $allowedAttributesLookup[$attribute] = true; } + $allAttributes = []; $attributes = []; foreach ($collection['attributes'] as $attribute) { $key = $attribute['$id']; - if (!isset($allowedAttributesLookup[$key])) { - continue; - } - - $attributes[] = new Document([ + $attributeDocument = new Document([ 'key' => $key, 'type' => $attribute['type'], 'array' => $attribute['array'], ]); + + $allAttributes[] = $attributeDocument; + + if (isset($allowedAttributesLookup[$key])) { + $attributes[] = $attributeDocument; + } } - $attributes[] = new Document([ - 'key' => '$id', - 'type' => Database::VAR_STRING, - 'array' => false, - ]); - $attributes[] = new Document([ - 'key' => '$createdAt', - 'type' => Database::VAR_DATETIME, - 'array' => false, - ]); - $attributes[] = new Document([ - 'key' => '$updatedAt', - 'type' => Database::VAR_DATETIME, - 'array' => false, - ]); + $internalAttributes = [ + new Document([ + 'key' => '$id', + 'type' => Database::VAR_STRING, + 'array' => false, + ]), + new Document([ + 'key' => '$createdAt', + 'type' => Database::VAR_DATETIME, + 'array' => false, + ]), + new Document([ + 'key' => '$updatedAt', + 'type' => Database::VAR_DATETIME, + 'array' => false, + ]), + new Document([ + 'key' => '$sequence', + 'type' => Database::VAR_INTEGER, + 'array' => false, + ]) + ]; - $sequence = new Document([ - 'key' => '$sequence', - 'type' => Database::VAR_STRING, - 'array' => false, - ]); + foreach ($internalAttributes as $attribute) { + $attributes[] = $attribute; + $allAttributes[] = $attribute; + } $validators = [ new Limit(), new Offset(), new Cursor(), new Filter($attributes, APP_DATABASE_QUERY_MAX_VALUES), - new Order([...$attributes, $sequence]), + new Order($attributes), ]; + if ($this->isSelectQueryAllowed()) { + $validators[] = new Select($allAttributes); + } + parent::__construct($validators); } + + public function isSelectQueryAllowed(): bool + { + return false; + } } diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Collections.php b/src/Appwrite/Utopia/Database/Validator/Queries/Collections.php index 6e8fcb8339..cdaaa104dc 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/Collections.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Collections.php @@ -4,7 +4,7 @@ namespace Appwrite\Utopia\Database\Validator\Queries; class Collections extends Base { - public const ALLOWED_ATTRIBUTES = [ + public const array ALLOWED_ATTRIBUTES = [ 'name', 'enabled', 'documentSecurity' diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Columns.php b/src/Appwrite/Utopia/Database/Validator/Queries/Columns.php new file mode 100644 index 0000000000..c990dfc18a --- /dev/null +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Columns.php @@ -0,0 +1,25 @@ +<?php + +namespace Appwrite\Utopia\Database\Validator\Queries; + +class Columns extends Base +{ + public const array ALLOWED_COLUMNS = [ + 'key', + 'type', + 'size', + 'required', + 'array', + 'status', + 'error' + ]; + + /** + * Expression constructor + * + */ + public function __construct() + { + parent::__construct('attributes', self::ALLOWED_COLUMNS); + } +} diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Deployments.php b/src/Appwrite/Utopia/Database/Validator/Queries/Deployments.php index 73631ecfb8..6348e69cd9 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/Deployments.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Deployments.php @@ -22,4 +22,9 @@ class Deployments extends Base { parent::__construct('deployments', self::ALLOWED_ATTRIBUTES); } + + public function isSelectQueryAllowed(): bool + { + return true; + } } diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Tables.php b/src/Appwrite/Utopia/Database/Validator/Queries/Tables.php new file mode 100644 index 0000000000..f3aadb69ac --- /dev/null +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Tables.php @@ -0,0 +1,21 @@ +<?php + +namespace Appwrite\Utopia\Database\Validator\Queries; + +class Tables extends Base +{ + public const array ALLOWED_COLUMNS = [ + 'name', + 'enabled', + 'rowSecurity' + ]; + + /** + * Expression constructor + * + */ + public function __construct() + { + parent::__construct('collections', self::ALLOWED_COLUMNS); + } +} diff --git a/src/Appwrite/Utopia/Request/Filter.php b/src/Appwrite/Utopia/Request/Filter.php index 59346c7e17..56fed746d9 100644 --- a/src/Appwrite/Utopia/Request/Filter.php +++ b/src/Appwrite/Utopia/Request/Filter.php @@ -2,8 +2,20 @@ namespace Appwrite\Utopia\Request; +use Utopia\Database\Database; +use Utopia\Route; + abstract class Filter { + private array $params; + private ?Database $dbForProject; + + public function __construct(Database $dbForProject = null, array $params = []) + { + $this->params = $params; + $this->dbForProject = $dbForProject; + } + /** * Parse params to another format. * @@ -13,4 +25,33 @@ abstract class Filter * @return array */ abstract public function parse(array $content, string $model): array; + + /** + * Get the database for the current project. + * + * @return null|Database + */ + public function getDbForProject(): ?Database + { + return $this->dbForProject; + } + + /** + * Returns the value of the given route param key, or a default if not found or on error. + * + * @param string $key + * @param mixed $default + * + * @return mixed + */ + public function getParamValue(string $key, mixed $default = ''): mixed + { + try { + $value = $this->params[$key] ?? $default; + } catch (\Exception $e) { + $value = $default; + } + + return $value; + } } diff --git a/src/Appwrite/Utopia/Request/Filters/V16.php b/src/Appwrite/Utopia/Request/Filters/V16.php index 51b05359b3..55db1f4756 100644 --- a/src/Appwrite/Utopia/Request/Filters/V16.php +++ b/src/Appwrite/Utopia/Request/Filters/V16.php @@ -11,8 +11,6 @@ class V16 extends Filter { switch ($model) { case 'functions.create': - $content['commands'] = $this->getCommands($content['runtime'] ?? ''); - break; case 'functions.update': $content['commands'] = $this->getCommands($content['runtime'] ?? ''); break; diff --git a/src/Appwrite/Utopia/Request/Filters/V17.php b/src/Appwrite/Utopia/Request/Filters/V17.php index 83ec62a168..2cdf3973b2 100644 --- a/src/Appwrite/Utopia/Request/Filters/V17.php +++ b/src/Appwrite/Utopia/Request/Filters/V17.php @@ -2,6 +2,7 @@ namespace Appwrite\Utopia\Request\Filters; +use Appwrite\Extend\Exception; use Appwrite\Utopia\Request\Filter; use Utopia\Database\Query; @@ -67,9 +68,9 @@ class V17 extends Filter foreach ($content['queries'] as $query) { try { $query = $this->parseQuery($query); - $parsed[] = json_encode(array_filter($query->toArray())); + $parsed[] = \json_encode(\array_filter($query->toArray())); } catch (\Throwable $th) { - throw new \Exception("Invalid query: {$query}", previous: $th); + throw new Exception(Exception::GENERAL_QUERY_INVALID, $th->getMessage()); } } @@ -83,6 +84,7 @@ class V17 extends Filter { // Init empty vars we fill later $method = ''; + $attribute = null; $params = []; // Separate method from filter @@ -92,7 +94,7 @@ class V17 extends Filter throw new \Exception('Invalid query'); } - $method = mb_substr($filter, 0, $paramsStart); + $method = \mb_substr($filter, 0, $paramsStart); // Separate params from filter $paramsEnd = \strlen($filter) - 1; // -1 to ignore ) @@ -103,14 +105,13 @@ class V17 extends Filter throw new \Exception('Invalid query method'); } - $currentParam = ""; // We build param here before pushing when it's ended + $currentParam = ''; // We build param here before pushing when it's ended $currentArrayParam = []; // We build array param here before pushing when it's ended $stack = []; // State for stack of parentheses $stackCount = 0; // Length of stack array. Kept as variable to improve performance $stringStackState = null; // State for string support - // Loop thorough all characters for ($i = $parametersStart; $i < $paramsEnd; $i++) { $char = $filter[$i]; @@ -135,20 +136,25 @@ class V17 extends Filter ($filter[$i - 1] !== static::CHAR_BACKSLASH || $filter[$i - 2] === static::CHAR_BACKSLASH) // Must not be escaped; ) { if ($isStringStack) { - // Dont mix-up string symbols. Only allow the same as on start + // Don't mix up string symbols. Only allow the same as on start if ($char === $stringStackState) { // End of string $stringStackState = null; } - - // Either way, add symbol to builder - static::appendSymbol($isStringStack, $char, $i, $filter, $currentParam); } else { // Start of string $stringStackState = $char; - static::appendSymbol($isStringStack, $char, $i, $filter, $currentParam); } + // Either way, add symbol to builder + static::appendSymbol( + $isStringStack, + $char, + $i, + $filter, + $currentParam, + ); + continue; } @@ -174,12 +180,12 @@ class V17 extends Filter continue; } elseif ($char === static::CHAR_COMMA) { // Params separation support - // If in array stack, dont merge yet, just mark it in array param builder + // If in array stack, don't merge yet, just mark it in array param builder if ($isArrayStack) { $currentArrayParam[] = $currentParam; $currentParam = ""; } else { - // Append from parap builder. Either value, or array + // Append from param builder. Either value, or array if (empty($currentArrayParam)) { if (strlen($currentParam)) { $params[] = $currentParam; @@ -193,23 +199,28 @@ class V17 extends Filter } // Value, not relevant to syntax - static::appendSymbol($isStringStack, $char, $i, $filter, $currentParam); + static::appendSymbol( + $isStringStack, + $char, + $i, + $filter, + $currentParam, + ); } - if (strlen($currentParam)) { + if (\strlen($currentParam)) { $params[] = $currentParam; - $currentParam = ""; + $currentParam = ''; } $parsedParams = []; foreach ($params as $param) { - // If array, parse each child separatelly + // If array, parse each child separately if (\is_array($param)) { foreach ($param as $element) { $arr[] = self::parseValue($element); } - $parsedParams[] = $arr ?? []; } else { $parsedParams[] = self::parseValue($param); @@ -295,8 +306,13 @@ class V17 extends Filter * @param string $currentParam * @return void */ - private function appendSymbol(bool $isStringStack, string $char, int $index, string $filter, string &$currentParam): void - { + private function appendSymbol( + bool $isStringStack, + string $char, + int $index, + string $filter, + string &$currentParam + ): void { // Ignore spaces and commas outside of string $canBeIgnored = false; diff --git a/src/Appwrite/Utopia/Request/Filters/V19.php b/src/Appwrite/Utopia/Request/Filters/V19.php index 8680cd642c..e7789ac0f7 100644 --- a/src/Appwrite/Utopia/Request/Filters/V19.php +++ b/src/Appwrite/Utopia/Request/Filters/V19.php @@ -39,7 +39,7 @@ class V19 extends Filter return $content; } - public function convertQueryAttribute(array $content, string $old, string $new) + public function convertQueryAttribute(array $content, string $old, string $new): array { if (isset($content['queries']) && is_array($content['queries'])) { foreach ($content['queries'] as $index => $query) { diff --git a/src/Appwrite/Utopia/Request/Filters/V20.php b/src/Appwrite/Utopia/Request/Filters/V20.php new file mode 100644 index 0000000000..3783a61947 --- /dev/null +++ b/src/Appwrite/Utopia/Request/Filters/V20.php @@ -0,0 +1,204 @@ +<?php + +namespace Appwrite\Utopia\Request\Filters; + +use Appwrite\Extend\Exception; +use Appwrite\Utopia\Request\Filter; +use Utopia\Database\Database; +use Utopia\Database\Exception\NotFound; +use Utopia\Database\Exception\Query as QueryException; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; + +class V20 extends Filter +{ + // Convert 1.7 params to 1.8 + public function parse(array $content, string $model): array + { + switch ($model) { + case 'databases.getDocument': + case 'databases.listDocuments': + $content = $this->manageSelectQueries($content); + break; + } + return $content; + } + + /** + * From 1.8.x onward, related documents are no longer returned by default to improve performance. + * + * Use `Query::select(['related.*'])` for full documents or `Query::select(['related.key'])` for specific fields. + * + * This filter preserves 1.7.x behavior by including all related documents for backward compatibility with + * `listDocuments` and `getDocument` calls. + */ + protected function manageSelectQueries(array $content): array + { + if (!isset($content['queries'])) { + $content['queries'] = []; + } + + // Handle case where queries is an array but empty + if (\is_array($content['queries'])) { + $content['queries'] = \array_filter($content['queries'], function ($q) { + if (\is_object($q) && empty((array)$q)) { + return false; + } + if (\is_string($q) && \trim($q) === '') { + return false; + } + if (empty($q)) { + return false; + } + return true; + }); + } + + try { + $parsed = Query::parseQueries($content['queries']); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + $selections = Query::groupByType($parsed)['selections'] ?? []; + + // Check if we need to add wildcard + relationships + // This happens when: + // 1. No select queries exist, OR + // 2. A wildcard select exists + $needsRelationships = empty($selections); + if (!$needsRelationships) { + foreach ($selections as $select) { + if (\in_array('*', $select->getValues(), true)) { + $needsRelationships = true; + break; + } + } + } + + /** + * Add wildcard and relationship selects for backward compatibility + */ + if ($needsRelationships) { + $relatedKeys = $this->getRelatedCollectionKeys(); + $selects = \array_values(\array_unique(\array_merge(['*'], $relatedKeys))); + + // Remove any existing select queries + $parsed = \array_filter( + $parsed, + fn ($query) => $query->getMethod() !== Query::TYPE_SELECT + ); + + // Add wildcard + relationship(s) selects + $parsed[] = Query::select($selects); + } + + $resolvedQueries = []; + foreach ($parsed as $query) { + $resolvedQueries[] = $query->toString(); + } + + $content['queries'] = $resolvedQueries; + + return $content; + } + + /** + * Returns all relationship attribute keys in `key.*` format for use with `Query::select`. + * Recursively includes nested relationships up to 3 levels deep. + * Prevents infinite loops by tracking all visited collections in the current path. + */ + private function getRelatedCollectionKeys( + ?string $databaseId = null, + ?string $collectionId = null, + ?string $prefix = null, + int $depth = 1, + array $visited = [] + ): array { + $databaseId ??= $this->getParamValue('databaseId'); + $collectionId ??= $this->getParamValue('collectionId'); + + if ( + empty($databaseId) || + empty($collectionId) || + $depth > Database::RELATION_MAX_DEPTH + ) { + return []; + } + + // Check if we've already visited this collection in the current path to prevent cycles + if (in_array($collectionId, $visited)) { + return []; + } + + $visited[] = $collectionId; + + $dbForProject = $this->getDbForProject(); + if ($dbForProject === null) { + return []; + } + + try { + $database = Authorization::skip(fn () => $dbForProject->getDocument( + 'databases', + $databaseId + )); + if ($database->isEmpty()) { + return []; + } + } catch (NotFound) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + try { + $collection = Authorization::skip(fn () => $dbForProject->getDocument( + 'database_' . $database->getSequence(), + $collectionId + )); + if ($collection->isEmpty()) { + return []; + } + } catch (NotFound) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); + } + + $attributes = $collection->getAttribute('attributes', []); + $relationshipKeys = []; + + foreach ($attributes as $attr) { + if ( + ($attr['type'] ?? null) !== Database::VAR_RELATIONSHIP || + $attr['status'] !== 'available' + ) { + continue; + } + + $key = $attr['key']; + $fullKey = $prefix ? $prefix . '.' . $key : $key; + $relatedCollectionId = $attr['relatedCollection'] ?? null; + + // Skip this relationship entirely if it points to an already visited collection + if ($relatedCollectionId && in_array($relatedCollectionId, $visited)) { + continue; + } + + // Add the wildcard select for this relationship + $relationshipKeys[] = $fullKey . '.*'; + + // Continue recursively if we have a related collection + if ($relatedCollectionId) { + $nestedKeys = $this->getRelatedCollectionKeys( + $databaseId, + $relatedCollectionId, + $fullKey, + $depth + 1, + $visited + ); + + $relationshipKeys = \array_merge($relationshipKeys, $nestedKeys); + } + } + + return \array_values(\array_unique($relationshipKeys)); + } +} diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 3d69ac1291..67fc83b9fd 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -23,7 +23,10 @@ use Appwrite\Utopia\Response\Model\AttributeEnum; use Appwrite\Utopia\Response\Model\AttributeFloat; use Appwrite\Utopia\Response\Model\AttributeInteger; use Appwrite\Utopia\Response\Model\AttributeIP; +use Appwrite\Utopia\Response\Model\AttributeLine; use Appwrite\Utopia\Response\Model\AttributeList; +use Appwrite\Utopia\Response\Model\AttributePoint; +use Appwrite\Utopia\Response\Model\AttributePolygon; use Appwrite\Utopia\Response\Model\AttributeRelationship; use Appwrite\Utopia\Response\Model\AttributeString; use Appwrite\Utopia\Response\Model\AttributeURL; @@ -32,6 +35,22 @@ use Appwrite\Utopia\Response\Model\BaseList; use Appwrite\Utopia\Response\Model\Branch; use Appwrite\Utopia\Response\Model\Bucket; use Appwrite\Utopia\Response\Model\Collection; +use Appwrite\Utopia\Response\Model\Column; +use Appwrite\Utopia\Response\Model\ColumnBoolean; +use Appwrite\Utopia\Response\Model\ColumnDatetime; +use Appwrite\Utopia\Response\Model\ColumnEmail; +use Appwrite\Utopia\Response\Model\ColumnEnum; +use Appwrite\Utopia\Response\Model\ColumnFloat; +use Appwrite\Utopia\Response\Model\ColumnIndex; +use Appwrite\Utopia\Response\Model\ColumnInteger; +use Appwrite\Utopia\Response\Model\ColumnIP; +use Appwrite\Utopia\Response\Model\ColumnLine; +use Appwrite\Utopia\Response\Model\ColumnList; +use Appwrite\Utopia\Response\Model\ColumnPoint; +use Appwrite\Utopia\Response\Model\ColumnPolygon; +use Appwrite\Utopia\Response\Model\ColumnRelationship; +use Appwrite\Utopia\Response\Model\ColumnString; +use Appwrite\Utopia\Response\Model\ColumnURL; use Appwrite\Utopia\Response\Model\ConsoleVariables; use Appwrite\Utopia\Response\Model\Continent; use Appwrite\Utopia\Response\Model\Country; @@ -88,12 +107,14 @@ use Appwrite\Utopia\Response\Model\ProviderRepository; use Appwrite\Utopia\Response\Model\ProviderRepositoryFramework; use Appwrite\Utopia\Response\Model\ProviderRepositoryRuntime; use Appwrite\Utopia\Response\Model\ResourceToken; +use Appwrite\Utopia\Response\Model\Row; use Appwrite\Utopia\Response\Model\Rule; use Appwrite\Utopia\Response\Model\Runtime; use Appwrite\Utopia\Response\Model\Session; use Appwrite\Utopia\Response\Model\Site; use Appwrite\Utopia\Response\Model\Specification; use Appwrite\Utopia\Response\Model\Subscriber; +use Appwrite\Utopia\Response\Model\Table; use Appwrite\Utopia\Response\Model\Target; use Appwrite\Utopia\Response\Model\Team; use Appwrite\Utopia\Response\Model\TemplateEmail; @@ -115,6 +136,7 @@ use Appwrite\Utopia\Response\Model\UsageProject; use Appwrite\Utopia\Response\Model\UsageSite; use Appwrite\Utopia\Response\Model\UsageSites; use Appwrite\Utopia\Response\Model\UsageStorage; +use Appwrite\Utopia\Response\Model\UsageTable; use Appwrite\Utopia\Response\Model\UsageUsers; use Appwrite\Utopia\Response\Model\User; use Appwrite\Utopia\Response\Model\Variable; @@ -147,6 +169,7 @@ class Response extends SwooleResponse public const MODEL_BASE_LIST = 'baseList'; public const MODEL_USAGE_DATABASES = 'usageDatabases'; public const MODEL_USAGE_DATABASE = 'usageDatabase'; + public const MODEL_USAGE_TABLE = 'usageTable'; public const MODEL_USAGE_COLLECTION = 'usageCollection'; public const MODEL_USAGE_USERS = 'usageUsers'; public const MODEL_USAGE_BUCKETS = 'usageBuckets'; @@ -162,10 +185,16 @@ class Response extends SwooleResponse public const MODEL_DATABASE_LIST = 'databaseList'; public const MODEL_COLLECTION = 'collection'; public const MODEL_COLLECTION_LIST = 'collectionList'; + public const MODEL_TABLE = 'table'; + public const MODEL_TABLE_LIST = 'tableList'; public const MODEL_INDEX = 'index'; public const MODEL_INDEX_LIST = 'indexList'; + public const MODEL_COLUMN_INDEX = 'columnIndex'; + public const MODEL_COLUMN_INDEX_LIST = 'columnIndexList'; public const MODEL_DOCUMENT = 'document'; public const MODEL_DOCUMENT_LIST = 'documentList'; + public const MODEL_ROW = 'row'; + public const MODEL_ROW_LIST = 'rowList'; // Database Attributes public const MODEL_ATTRIBUTE = 'attribute'; @@ -180,6 +209,26 @@ class Response extends SwooleResponse public const MODEL_ATTRIBUTE_URL = 'attributeUrl'; public const MODEL_ATTRIBUTE_DATETIME = 'attributeDatetime'; public const MODEL_ATTRIBUTE_RELATIONSHIP = 'attributeRelationship'; + public const MODEL_ATTRIBUTE_POINT = 'attributePoint'; + public const MODEL_ATTRIBUTE_LINE = 'attributeLine'; + public const MODEL_ATTRIBUTE_POLYGON = 'attributePolygon'; + + // Database Columns + public const MODEL_COLUMN = 'column'; + public const MODEL_COLUMN_LIST = 'columnList'; + public const MODEL_COLUMN_STRING = 'columnString'; + public const MODEL_COLUMN_INTEGER = 'columnInteger'; + public const MODEL_COLUMN_FLOAT = 'columnFloat'; + public const MODEL_COLUMN_BOOLEAN = 'columnBoolean'; + public const MODEL_COLUMN_EMAIL = 'columnEmail'; + public const MODEL_COLUMN_ENUM = 'columnEnum'; + public const MODEL_COLUMN_IP = 'columnIp'; + public const MODEL_COLUMN_URL = 'columnUrl'; + public const MODEL_COLUMN_DATETIME = 'columnDatetime'; + public const MODEL_COLUMN_RELATIONSHIP = 'columnRelationship'; + public const MODEL_COLUMN_POINT = 'columnPoint'; + public const MODEL_COLUMN_LINE = 'columnLine'; + public const MODEL_COLUMN_POLYGON = 'columnPolygon'; // Users public const MODEL_ACCOUNT = 'account'; @@ -362,13 +411,17 @@ class Response extends SwooleResponse */ protected static bool $showSensitive = false; + protected SwooleHTTPResponse $swoole; + /** * Response constructor. * - * @param float $time + * @param SwooleHTTPResponse $response Native response to be passed to parent constructor */ public function __construct(SwooleHTTPResponse $response) { + $this->swoole = $response; + $this // General ->setModel(new None()) @@ -376,10 +429,13 @@ class Response extends SwooleResponse ->setModel(new Error()) ->setModel(new ErrorDev()) // Lists + ->setModel(new BaseList('Rows List', self::MODEL_ROW_LIST, 'rows', self::MODEL_ROW)) ->setModel(new BaseList('Documents List', self::MODEL_DOCUMENT_LIST, 'documents', self::MODEL_DOCUMENT)) + ->setModel(new BaseList('Tables List', self::MODEL_TABLE_LIST, 'tables', self::MODEL_TABLE)) ->setModel(new BaseList('Collections List', self::MODEL_COLLECTION_LIST, 'collections', self::MODEL_COLLECTION)) ->setModel(new BaseList('Databases List', self::MODEL_DATABASE_LIST, 'databases', self::MODEL_DATABASE)) ->setModel(new BaseList('Indexes List', self::MODEL_INDEX_LIST, 'indexes', self::MODEL_INDEX)) + ->setModel(new BaseList('Column Indexes List', self::MODEL_COLUMN_INDEX_LIST, 'indexes', self::MODEL_COLUMN_INDEX)) ->setModel(new BaseList('Users List', self::MODEL_USER_LIST, 'users', self::MODEL_USER)) ->setModel(new BaseList('Sessions List', self::MODEL_SESSION_LIST, 'sessions', self::MODEL_SESSION)) ->setModel(new BaseList('Identities List', self::MODEL_IDENTITY_LIST, 'identities', self::MODEL_IDENTITY)) @@ -428,6 +484,7 @@ class Response extends SwooleResponse ->setModel(new BaseList('VCS Content List', self::MODEL_VCS_CONTENT_LIST, 'contents', self::MODEL_VCS_CONTENT)) // Entities ->setModel(new Database()) + // Collection API Models ->setModel(new Collection()) ->setModel(new Attribute()) ->setModel(new AttributeList()) @@ -441,7 +498,29 @@ class Response extends SwooleResponse ->setModel(new AttributeURL()) ->setModel(new AttributeDatetime()) ->setModel(new AttributeRelationship()) + ->setModel(new AttributePoint()) + ->setModel(new AttributeLine()) + ->setModel(new AttributePolygon()) + // Table API Models + ->setModel(new Table()) + ->setModel(new Column()) + ->setModel(new ColumnList()) + ->setModel(new ColumnString()) + ->setModel(new ColumnInteger()) + ->setModel(new ColumnFloat()) + ->setModel(new ColumnBoolean()) + ->setModel(new ColumnEmail()) + ->setModel(new ColumnEnum()) + ->setModel(new ColumnIP()) + ->setModel(new ColumnURL()) + ->setModel(new ColumnDatetime()) + ->setModel(new ColumnRelationship()) + ->setModel(new ColumnPoint()) + ->setModel(new ColumnLine()) + ->setModel(new ColumnPolygon()) ->setModel(new Index()) + ->setModel(new ColumnIndex()) + ->setModel(new Row()) ->setModel(new ModelDocument()) ->setModel(new Log()) ->setModel(new User()) @@ -508,6 +587,7 @@ class Response extends SwooleResponse ->setModel(new MetricBreakdown()) ->setModel(new UsageDatabases()) ->setModel(new UsageDatabase()) + ->setModel(new UsageTable()) ->setModel(new UsageCollection()) ->setModel(new UsageUsers()) ->setModel(new UsageStorage()) @@ -558,7 +638,7 @@ class Response extends SwooleResponse * * @return self */ - public function setModel(Model $instance) + public function setModel(Model $instance): Response { $this->models[$instance->getType()] = $instance; @@ -836,7 +916,7 @@ class Response extends SwooleResponse /** * Function to add a response filter, the order of filters are first in - first out. * - * @param $filter the response filter to set + * @param $filter - the response filter to set * * @return void */ @@ -875,18 +955,6 @@ class Response extends SwooleResponse return !empty($this->filters); } - /** - * Set Header - * - * @param string $key - * @param string $value - * @return void - */ - public function setHeader(string $key, string $value): void - { - $this->sendHeader($key, $value); - } - /** * Static wrapper to show sensitive data in response * diff --git a/src/Appwrite/Utopia/Response/Filters/V19.php b/src/Appwrite/Utopia/Response/Filters/V19.php index 2025cb629d..88f8323da9 100644 --- a/src/Appwrite/Utopia/Response/Filters/V19.php +++ b/src/Appwrite/Utopia/Response/Filters/V19.php @@ -35,7 +35,7 @@ class V19 extends Filter return $parsedResponse; } - protected function parseFunction(array $content) + protected function parseFunction(array $content): array { $content['deployment'] = $content['deploymentId'] ?? ''; unset($content['deploymentId']); diff --git a/src/Appwrite/Utopia/Response/Filters/V20.php b/src/Appwrite/Utopia/Response/Filters/V20.php new file mode 100644 index 0000000000..8bccd3ea1d --- /dev/null +++ b/src/Appwrite/Utopia/Response/Filters/V20.php @@ -0,0 +1,26 @@ +<?php + +namespace Appwrite\Utopia\Response\Filters; + +use Appwrite\Utopia\Response; +use Appwrite\Utopia\Response\Filter; + +class V20 extends Filter +{ + // removing $sequence from all versions less than 1.8 + public function parse(array $content, string $model): array + { + $parsedResponse = $content; + + return match($model) { + Response::MODEL_DOCUMENT => $this->parseDocument($content), + Response::MODEL_DOCUMENT_LIST => $this->handleList($content, 'documents', fn ($item) => $this->parseDocument($item)), + default => $parsedResponse, + }; + } + + protected function parseDocument(array $content): array + { + return $content; + } +} diff --git a/src/Appwrite/Utopia/Response/Model.php b/src/Appwrite/Utopia/Response/Model.php index 32de9fa035..59c786ee1f 100644 --- a/src/Appwrite/Utopia/Response/Model.php +++ b/src/Appwrite/Utopia/Response/Model.php @@ -15,6 +15,8 @@ abstract class Model public const TYPE_DATETIME_EXAMPLE = '2020-10-15T06:38:00.000+00:00'; public const TYPE_RELATIONSHIP = 'relationship'; public const TYPE_PAYLOAD = 'payload'; + public const TYPE_ARRAY = 'array'; + public const TYPE_ENUM = 'enum'; /** * @var bool @@ -44,6 +46,7 @@ abstract class Model /** * Filter Document Structure + * @param Document $document Document to apply filter on * * @return Document */ @@ -91,7 +94,8 @@ abstract class Model 'array' => false, 'description' => '', 'example' => '', - 'sensitive' => false + 'sensitive' => false, + 'readOnly' => false ], $options); return $this; @@ -104,7 +108,7 @@ abstract class Model * @param string $key * @return Model */ - protected function removeRule(string $key): self + public function removeRule(string $key): self { if (isset($this->rules[$key])) { unset($this->rules[$key]); @@ -129,6 +133,27 @@ abstract class Model return $list; } + /** + * Get Readonly Fields + * + * Returns list of field names that are marked as readOnly + * and should not be allowed in create/update payloads + * + * @return array + */ + public function getReadonlyFields(): array + { + $list = []; + + foreach ($this->rules as $key => $rule) { + if ($rule['readOnly'] ?? false) { + $list[] = $key; + } + } + + return $list; + } + /** * Is None * diff --git a/src/Appwrite/Utopia/Response/Model/Any.php b/src/Appwrite/Utopia/Response/Model/Any.php index 634e0859b9..6863748ac8 100644 --- a/src/Appwrite/Utopia/Response/Model/Any.php +++ b/src/Appwrite/Utopia/Response/Model/Any.php @@ -31,4 +31,14 @@ class Any extends Model { return Response::MODEL_ANY; } + + /** + * Get sample data + * + * @return array + */ + public function getSampleData(): array + { + return []; + } } diff --git a/src/Appwrite/Utopia/Response/Model/Attribute.php b/src/Appwrite/Utopia/Response/Model/Attribute.php index 8c43f8d21c..35de6bacc5 100644 --- a/src/Appwrite/Utopia/Response/Model/Attribute.php +++ b/src/Appwrite/Utopia/Response/Model/Attribute.php @@ -23,10 +23,11 @@ class Attribute extends Model 'example' => 'string', ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`', 'default' => '', 'example' => 'available', + 'enum' => ['available', 'processing', 'deleting', 'stuck', 'failed'], ]) ->addRule('error', [ 'type' => self::TYPE_STRING, diff --git a/src/Appwrite/Utopia/Response/Model/AttributeLine.php b/src/Appwrite/Utopia/Response/Model/AttributeLine.php new file mode 100644 index 0000000000..4f8ed60e89 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/AttributeLine.php @@ -0,0 +1,47 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class AttributeLine extends Attribute +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('default', [ + 'type' => self::TYPE_ARRAY, + 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', + 'default' => null, + 'required' => false, + 'example' => [[0, 0], [1, 1]] + ]) + ; + } + + public array $conditions = [ + 'type' => 'linestring', + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'AttributeLine'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_ATTRIBUTE_LINE; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/AttributeList.php b/src/Appwrite/Utopia/Response/Model/AttributeList.php index 8b04475a14..6b9a7365bd 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeList.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeList.php @@ -27,6 +27,9 @@ class AttributeList extends Model Response::MODEL_ATTRIBUTE_IP, Response::MODEL_ATTRIBUTE_DATETIME, Response::MODEL_ATTRIBUTE_RELATIONSHIP, + Response::MODEL_ATTRIBUTE_POINT, + Response::MODEL_ATTRIBUTE_LINE, + Response::MODEL_ATTRIBUTE_POLYGON, Response::MODEL_ATTRIBUTE_STRING // needs to be last, since its condition would dominate any other string attribute ], 'description' => 'List of attributes.', diff --git a/src/Appwrite/Utopia/Response/Model/AttributePoint.php b/src/Appwrite/Utopia/Response/Model/AttributePoint.php new file mode 100644 index 0000000000..19f7056b41 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/AttributePoint.php @@ -0,0 +1,47 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class AttributePoint extends Attribute +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('default', [ + 'type' => self::TYPE_ARRAY, + 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', + 'default' => null, + 'required' => false, + 'example' => [0, 0] + ]) + ; + } + + public array $conditions = [ + 'type' => 'point', + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'AttributePoint'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_ATTRIBUTE_POINT; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/AttributePolygon.php b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php new file mode 100644 index 0000000000..13caa19ccf --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php @@ -0,0 +1,47 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class AttributePolygon extends Attribute +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('default', [ + 'type' => self::TYPE_ARRAY, + 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', + 'default' => null, + 'required' => false, + 'example' => [[[0, 0], [0, 10]], [[10, 10], [0, 0]]] + ]) + ; + } + + public array $conditions = [ + 'type' => 'polygon', + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'AttributePolygon'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_ATTRIBUTE_POLYGON; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/BaseList.php b/src/Appwrite/Utopia/Response/Model/BaseList.php index d4ba6b0ab7..447a4436e3 100644 --- a/src/Appwrite/Utopia/Response/Model/BaseList.php +++ b/src/Appwrite/Utopia/Response/Model/BaseList.php @@ -24,23 +24,31 @@ class BaseList extends Model * @param bool $paging * @param bool $public */ - public function __construct(string $name, string $type, string $key, string $model, bool $paging = true, bool $public = true) - { + public function __construct( + string $name, + string $type, + string $key, + string $model, + bool $paging = true, + bool $public = true + ) { $this->name = $name; $this->type = $type; $this->public = $public; if ($paging) { $namesWithCap = [ - 'documents', 'collections', 'users', 'files', 'buckets', 'functions', - 'deployments', 'executions', 'projects', 'webhooks', 'keys', - 'platforms', 'rules', 'memberships', 'teams' + 'rows', 'tables', // new api + 'documents', 'collections', // legacy api + 'users', 'files', 'buckets', 'functions', + 'deployments', 'executions', 'projects', + 'webhooks', 'keys', 'platforms', 'rules', 'memberships', 'teams' ]; if (\in_array($name, $namesWithCap)) { - $description = 'Total number of ' . $key . ' documents that matched your query used as reference for offset pagination. When the `total` number of ' . $key . ' documents available is greater than 5000, total returned will be capped at 5000, and cursor pagination should be used. Read more about [pagination](https://appwrite.io/docs/pagination).'; + $description = 'Total number of ' . $key . ' that matched your query used as reference for offset pagination. When the `total` number of ' . $key . ' rows available is greater than 5000, total returned will be capped at 5000, and cursor pagination should be used. Read more about [pagination](https://appwrite.io/docs/pagination).'; } else { - $description = 'Total number of ' . $key . ' documents that matched your query.'; + $description = 'Total number of ' . $key . ' that matched your query.'; } $this->addRule('total', [ diff --git a/src/Appwrite/Utopia/Response/Model/Collection.php b/src/Appwrite/Utopia/Response/Model/Collection.php index 2c2bf0cca8..9350b6298c 100644 --- a/src/Appwrite/Utopia/Response/Model/Collection.php +++ b/src/Appwrite/Utopia/Response/Model/Collection.php @@ -70,6 +70,9 @@ class Collection extends Model Response::MODEL_ATTRIBUTE_IP, Response::MODEL_ATTRIBUTE_DATETIME, Response::MODEL_ATTRIBUTE_RELATIONSHIP, + Response::MODEL_ATTRIBUTE_POINT, + Response::MODEL_ATTRIBUTE_LINE, + Response::MODEL_ATTRIBUTE_POLYGON, Response::MODEL_ATTRIBUTE_STRING, // needs to be last, since its condition would dominate any other string attribute ], 'description' => 'Collection attributes.', diff --git a/src/Appwrite/Utopia/Response/Model/Column.php b/src/Appwrite/Utopia/Response/Model/Column.php new file mode 100644 index 0000000000..5562de39f2 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/Column.php @@ -0,0 +1,85 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; +use Appwrite\Utopia\Response\Model; + +class Column extends Model +{ + public function __construct() + { + $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'fullName', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => 'string', + ]) + ->addRule('status', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`', + 'default' => '', + 'example' => 'available', + ]) + ->addRule('error', [ + 'type' => self::TYPE_STRING, + 'description' => 'Error message. Displays error generated on failure of creating or deleting an column.', + 'default' => '', + 'example' => 'string', + ]) + ->addRule('required', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Is column required?', + 'default' => false, + 'example' => true, + ]) + ->addRule('array', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Is column an array?', + 'default' => false, + 'required' => false, + 'example' => false, + ]) + ->addRule('$createdAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Column creation date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('$updatedAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Column update date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]); + } + + public array $conditions = []; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'Column'; + } + + /** + * Get Collection + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnBoolean.php b/src/Appwrite/Utopia/Response/Model/ColumnBoolean.php new file mode 100644 index 0000000000..0b273ca81a --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnBoolean.php @@ -0,0 +1,59 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnBoolean extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'isEnabled', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => 'boolean', + ]) + ->addRule('default', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => false + ]) + ; + } + + public array $conditions = [ + 'type' => self::TYPE_BOOLEAN + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnBoolean'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_BOOLEAN; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnDatetime.php b/src/Appwrite/Utopia/Response/Model/ColumnDatetime.php new file mode 100644 index 0000000000..6a0321c4a8 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnDatetime.php @@ -0,0 +1,67 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnDatetime extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'birthDay', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => self::TYPE_DATETIME, + ]) + ->addRule('format', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'ISO 8601 format.', + 'default' => APP_DATABASE_ATTRIBUTE_DATETIME, + 'example' => APP_DATABASE_ATTRIBUTE_DATETIME, + 'array' => false, + ]) + ->addRule('default', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default value for column when not provided. Only null is optional', + 'default' => null, + 'example' => self::TYPE_DATETIME_EXAMPLE, + 'array' => false, + 'required' => false, + ]) + ; + } + + public array $conditions = [ + 'type' => self::TYPE_DATETIME + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnDatetime'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_DATETIME; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnEmail.php b/src/Appwrite/Utopia/Response/Model/ColumnEmail.php new file mode 100644 index 0000000000..df42a32836 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnEmail.php @@ -0,0 +1,66 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnEmail extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'userEmail', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => 'string', + ]) + ->addRule('format', [ + 'type' => self::TYPE_STRING, + 'description' => 'String format.', + 'default' => APP_DATABASE_ATTRIBUTE_EMAIL, + 'example' => APP_DATABASE_ATTRIBUTE_EMAIL, + ]) + ->addRule('default', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => 'default@example.com', + ]) + ; + } + + public array $conditions = [ + 'type' => self::TYPE_STRING, + 'format' => \APP_DATABASE_ATTRIBUTE_EMAIL + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnEmail'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_EMAIL; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnEnum.php b/src/Appwrite/Utopia/Response/Model/ColumnEnum.php new file mode 100644 index 0000000000..d450c0bef5 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnEnum.php @@ -0,0 +1,73 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnEnum extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'status', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => 'string', + ]) + ->addRule('elements', [ + 'type' => self::TYPE_STRING, + 'description' => 'Array of elements in enumerated type.', + 'default' => null, + 'example' => 'element', + 'array' => true, + ]) + ->addRule('format', [ + 'type' => self::TYPE_STRING, + 'description' => 'String format.', + 'default' => APP_DATABASE_ATTRIBUTE_ENUM, + 'example' => APP_DATABASE_ATTRIBUTE_ENUM, + ]) + ->addRule('default', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => 'element', + ]) + ; + } + + public array $conditions = [ + 'type' => self::TYPE_STRING, + 'format' => \APP_DATABASE_ATTRIBUTE_ENUM + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnEnum'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_ENUM; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnFloat.php b/src/Appwrite/Utopia/Response/Model/ColumnFloat.php new file mode 100644 index 0000000000..e547a4b474 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnFloat.php @@ -0,0 +1,73 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnFloat extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'percentageCompleted', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => 'double', + ]) + ->addRule('min', [ + 'type' => self::TYPE_FLOAT, + 'description' => 'Minimum value to enforce for new documents.', + 'default' => null, + 'required' => false, + 'example' => 1.5, + ]) + ->addRule('max', [ + 'type' => self::TYPE_FLOAT, + 'description' => 'Maximum value to enforce for new documents.', + 'default' => null, + 'required' => false, + 'example' => 10.5, + ]) + ->addRule('default', [ + 'type' => self::TYPE_FLOAT, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => 2.5, + ]) + ; + } + + public array $conditions = [ + 'type' => self::TYPE_FLOAT, + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnFloat'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_FLOAT; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnIP.php b/src/Appwrite/Utopia/Response/Model/ColumnIP.php new file mode 100644 index 0000000000..7190f0106d --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnIP.php @@ -0,0 +1,66 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnIP extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'ipAddress', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => 'string', + ]) + ->addRule('format', [ + 'type' => self::TYPE_STRING, + 'description' => 'String format.', + 'default' => APP_DATABASE_ATTRIBUTE_IP, + 'example' => APP_DATABASE_ATTRIBUTE_IP, + ]) + ->addRule('default', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => '192.0.2.0', + ]) + ; + } + + public array $conditions = [ + 'type' => self::TYPE_STRING, + 'format' => \APP_DATABASE_ATTRIBUTE_IP + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnIP'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_IP; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnIndex.php b/src/Appwrite/Utopia/Response/Model/ColumnIndex.php new file mode 100644 index 0000000000..547312d677 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnIndex.php @@ -0,0 +1,106 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; +use Appwrite\Utopia\Response\Model; +use Utopia\Database\Document; + +class ColumnIndex extends Model +{ + public function __construct() + { + $this + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Index ID.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('$createdAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Index creation date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('$updatedAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Index update date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Index Key.', + 'default' => '', + 'example' => 'index1', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Index type.', + 'default' => '', + 'example' => 'primary', + ]) + ->addRule('status', [ + 'type' => self::TYPE_STRING, + 'description' => 'Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`', + 'default' => '', + 'example' => 'available', + ]) + ->addRule('error', [ + 'type' => self::TYPE_STRING, + 'description' => 'Error message. Displays error generated on failure of creating or deleting an index.', + 'default' => '', + 'example' => 'string', + ]) + ->addRule('columns', [ + 'type' => self::TYPE_STRING, + 'description' => 'Index columns.', + 'default' => [], + 'example' => [], + 'array' => true, + ]) + ->addRule('lengths', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Index columns length.', + 'default' => [], + 'example' => [], + 'array' => true, + ]) + ->addRule('orders', [ + 'type' => self::TYPE_STRING, + 'description' => 'Index orders.', + 'default' => [], + 'example' => [], + 'array' => true, + 'required' => false, + ]); + } + + /** + * Get Name + */ + public function getName(): string + { + return 'Index'; + } + + /** + * Get Collection + */ + public function getType(): string + { + return Response::MODEL_COLUMN_INDEX; + } + + public function filter(Document $document): Document + { + $columns = $document->getAttribute('attributes', []); + $document + ->removeAttribute('attributes') + ->setAttribute('columns', $columns); + + return $document; + + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnInteger.php b/src/Appwrite/Utopia/Response/Model/ColumnInteger.php new file mode 100644 index 0000000000..9f6c2c89ab --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnInteger.php @@ -0,0 +1,72 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnInteger extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'count', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => 'integer', + ]) + ->addRule('min', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Minimum value to enforce for new documents.', + 'default' => null, + 'required' => false, + 'example' => 1, + ]) + ->addRule('max', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Maximum value to enforce for new documents.', + 'default' => null, + 'required' => false, + 'example' => 10, + ]) + ->addRule('default', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => 10, + ]) + ; + } + + public array $conditions = [ + 'type' => self::TYPE_INTEGER, + ]; + + /** + * Get Name * + * @return string + */ + public function getName(): string + { + return 'ColumnInteger'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_INTEGER; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnLine.php b/src/Appwrite/Utopia/Response/Model/ColumnLine.php new file mode 100644 index 0000000000..e46741d0f3 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnLine.php @@ -0,0 +1,47 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnLine extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('default', [ + 'type' => self::TYPE_ARRAY, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => [[0, 0], [1, 1]] + ]) + ; + } + + public array $conditions = [ + 'type' => 'linestring', + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnLine'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_LINE; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnList.php b/src/Appwrite/Utopia/Response/Model/ColumnList.php new file mode 100644 index 0000000000..4e76645d1b --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnList.php @@ -0,0 +1,61 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; +use Appwrite\Utopia\Response\Model; + +class ColumnList extends Model +{ + public function __construct() + { + $this + ->addRule('total', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total number of columns in the given table.', + 'default' => 0, + 'example' => 5, + ]) + ->addRule('columns', [ + 'type' => [ + Response::MODEL_COLUMN_BOOLEAN, + Response::MODEL_COLUMN_INTEGER, + Response::MODEL_COLUMN_FLOAT, + Response::MODEL_COLUMN_EMAIL, + Response::MODEL_COLUMN_ENUM, + Response::MODEL_COLUMN_URL, + Response::MODEL_COLUMN_IP, + Response::MODEL_COLUMN_DATETIME, + Response::MODEL_COLUMN_RELATIONSHIP, + Response::MODEL_COLUMN_POINT, + Response::MODEL_COLUMN_LINE, + Response::MODEL_COLUMN_POLYGON, + Response::MODEL_COLUMN_STRING // needs to be last, since its condition would dominate any other string attribute + ], + 'description' => 'List of columns.', + 'default' => [], + 'array' => true + ]) + ; + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'Columns List'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_LIST; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPoint.php b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php new file mode 100644 index 0000000000..ccc68b283b --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php @@ -0,0 +1,47 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnPoint extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('default', [ + 'type' => self::TYPE_ARRAY, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => [0, 0] + ]) + ; + } + + public array $conditions = [ + 'type' => 'point', + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnPoint'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_POINT; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php new file mode 100644 index 0000000000..811b51fdc1 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php @@ -0,0 +1,47 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnPolygon extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('default', [ + 'type' => self::TYPE_ARRAY, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => [[[0, 0], [0, 10]], [[10, 10], [0, 0]]] + ]) + ; + } + + public array $conditions = [ + 'type' => 'polygon', + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnPolygon'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_POLYGON; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnRelationship.php b/src/Appwrite/Utopia/Response/Model/ColumnRelationship.php new file mode 100644 index 0000000000..877982365b --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnRelationship.php @@ -0,0 +1,96 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; +use Utopia\Database\Document; + +class ColumnRelationship extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('relatedTable', [ + 'type' => self::TYPE_STRING, + 'description' => 'The ID of the related table.', + 'default' => null, + 'example' => 'table', + ]) + ->addRule('relationType', [ + 'type' => self::TYPE_STRING, + 'description' => 'The type of the relationship.', + 'default' => '', + 'example' => 'oneToOne|oneToMany|manyToOne|manyToMany', + ]) + ->addRule('twoWay', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Is the relationship two-way?', + 'default' => false, + 'example' => false, + ]) + ->addRule('twoWayKey', [ + 'type' => self::TYPE_STRING, + 'description' => 'The key of the two-way relationship.', + 'default' => '', + 'example' => 'string', + ]) + ->addRule('onDelete', [ + 'type' => self::TYPE_STRING, + 'description' => 'How deleting the parent document will propagate to child documents.', + 'default' => 'restrict', + 'example' => 'restrict|cascade|setNull', + ]) + ->addRule('side', [ + 'type' => self::TYPE_STRING, + 'description' => 'Whether this is the parent or child side of the relationship', + 'default' => '', + 'example' => 'parent|child', + ]) + ; + } + + public array $conditions = [ + 'type' => self::TYPE_RELATIONSHIP, + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnRelationship'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_RELATIONSHIP; + } + + /** + * Process Document before returning it to the client + * + * @return Document + */ + public function filter(Document $document): Document + { + $options = $document->getAttribute('options'); + if (!\is_null($options)) { + $document->setAttribute('relatedTable', $options['relatedCollection']); + $document->setAttribute('relationType', $options['relationType']); + $document->setAttribute('twoWay', $options['twoWay']); + $document->setAttribute('twoWayKey', $options['twoWayKey']); + $document->setAttribute('side', $options['side']); + $document->setAttribute('onDelete', $options['onDelete']); + } + return $document; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnString.php b/src/Appwrite/Utopia/Response/Model/ColumnString.php new file mode 100644 index 0000000000..f3a876b7a9 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnString.php @@ -0,0 +1,60 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnString extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('size', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Column size.', + 'default' => 0, + 'example' => 128, + ]) + ->addRule('default', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => 'default', + ]) + ->addRule('encrypt', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Defines whether this column is encrypted or not.', + 'default' => false, + 'required' => false, + 'example' => false, + ]) + ; + } + + public array $conditions = [ + 'type' => self::TYPE_STRING, + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnString'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_STRING; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnURL.php b/src/Appwrite/Utopia/Response/Model/ColumnURL.php new file mode 100644 index 0000000000..12850b3907 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnURL.php @@ -0,0 +1,66 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; + +class ColumnURL extends Column +{ + public function __construct() + { + parent::__construct(); + + $this + ->addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'githubUrl', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => 'string', + ]) + ->addRule('format', [ + 'type' => self::TYPE_STRING, + 'description' => 'String format.', + 'default' => APP_DATABASE_ATTRIBUTE_URL, + 'example' => APP_DATABASE_ATTRIBUTE_URL, + ]) + ->addRule('default', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => 'https://example.com', + ]) + ; + } + + public array $conditions = [ + 'type' => self::TYPE_STRING, + 'format' => \APP_DATABASE_ATTRIBUTE_URL + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnURL'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_URL; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php index 97dae2efcd..b81502f0a1 100644 --- a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php +++ b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php @@ -10,24 +10,30 @@ class ConsoleVariables extends Model public function __construct() { $this - ->addRule('_APP_DOMAIN_TARGET_CNAME', [ - 'type' => self::TYPE_STRING, - 'description' => 'CNAME target for your Appwrite custom domains.', - 'default' => '', - 'example' => 'appwrite.io', - ]) - ->addRule('_APP_DOMAIN_TARGET_A', [ - 'type' => self::TYPE_STRING, - 'description' => 'A target for your Appwrite custom domains.', - 'default' => '', - 'example' => '127.0.0.1', - ]) - ->addRule('_APP_DOMAIN_TARGET_AAAA', [ - 'type' => self::TYPE_STRING, - 'description' => 'AAAA target for your Appwrite custom domains.', - 'default' => '', - 'example' => '::1', - ]) + ->addRule('_APP_DOMAIN_TARGET_CNAME', [ + 'type' => self::TYPE_STRING, + 'description' => 'CNAME target for your Appwrite custom domains.', + 'default' => '', + 'example' => 'appwrite.io', + ]) + ->addRule('_APP_DOMAIN_TARGET_A', [ + 'type' => self::TYPE_STRING, + 'description' => 'A target for your Appwrite custom domains.', + 'default' => '', + 'example' => '127.0.0.1', + ]) + ->addRule('_APP_DOMAIN_TARGET_AAAA', [ + 'type' => self::TYPE_STRING, + 'description' => 'AAAA target for your Appwrite custom domains.', + 'default' => '', + 'example' => '::1', + ]) + ->addRule('_APP_DOMAIN_TARGET_CAA', [ + 'type' => self::TYPE_STRING, + 'description' => 'CAA target for your Appwrite custom domains.', + 'default' => '', + 'example' => 'digicert.com', + ]) ->addRule('_APP_STORAGE_LIMIT', [ 'type' => self::TYPE_INTEGER, 'description' => 'Maximum file size allowed for file upload in bytes.', diff --git a/src/Appwrite/Utopia/Response/Model/Database.php b/src/Appwrite/Utopia/Response/Model/Database.php index 90b4ac8cb4..44a0d52af8 100644 --- a/src/Appwrite/Utopia/Response/Model/Database.php +++ b/src/Appwrite/Utopia/Response/Model/Database.php @@ -40,6 +40,12 @@ class Database extends Model 'default' => true, 'example' => false, ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Database type.', + 'default' => 'legacy', + 'example' => 'legacy', + ]) ; } diff --git a/src/Appwrite/Utopia/Response/Model/Deployment.php b/src/Appwrite/Utopia/Response/Model/Deployment.php index 55c1589af0..f0815630b3 100644 --- a/src/Appwrite/Utopia/Response/Model/Deployment.php +++ b/src/Appwrite/Utopia/Response/Model/Deployment.php @@ -95,10 +95,11 @@ class Deployment extends Model 'example' => '5e5ea5c16897e', ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'The deployment status. Possible values are "waiting", "processing", "building", "ready", and "failed".', 'default' => '', 'example' => 'ready', + 'enum' => ['waiting', 'processing', 'building', 'ready', 'failed'], ]) ->addRule('buildLogs', [ 'type' => self::TYPE_STRING, @@ -130,12 +131,6 @@ class Deployment extends Model 'default' => '', 'example' => 'https://github.com/vermakhushboo/g4-node-function', ]) - ->addRule('providerBranch', [ - 'type' => self::TYPE_STRING, - 'description' => 'The branch name of the vcs provider repository', - 'default' => '', - 'example' => 'main', - ]) ->addRule('providerCommitHash', [ 'type' => self::TYPE_STRING, 'description' => 'The commit hash of the vcs commit', diff --git a/src/Appwrite/Utopia/Response/Model/Document.php b/src/Appwrite/Utopia/Response/Model/Document.php index c4f7eb3044..5bad504a63 100644 --- a/src/Appwrite/Utopia/Response/Model/Document.php +++ b/src/Appwrite/Utopia/Response/Model/Document.php @@ -36,17 +36,26 @@ class Document extends Any 'default' => '', 'example' => '5e5ea5c16897e', ]) + ->addRule('$sequence', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Document automatically incrementing ID.', + 'default' => 0, + 'example' => 1, + 'readOnly' => true, + ]) ->addRule('$collectionId', [ 'type' => self::TYPE_STRING, 'description' => 'Collection ID.', 'default' => '', 'example' => '5e5ea5c15117e', + 'readOnly' => true, ]) ->addRule('$databaseId', [ 'type' => self::TYPE_STRING, 'description' => 'Database ID.', 'default' => '', 'example' => '5e5ea5c15117e', + 'readOnly' => true, ]) ->addRule('$createdAt', [ 'type' => self::TYPE_DATETIME, @@ -71,9 +80,9 @@ class Document extends Any public function filter(DatabaseDocument $document): DatabaseDocument { - $document->removeAttribute('$sequence'); $document->removeAttribute('$collection'); $document->removeAttribute('$tenant'); + $document->setAttribute('$sequence', (int)$document->getAttribute('$sequence', 0)); foreach ($document->getAttributes() as $attribute) { if (\is_array($attribute)) { @@ -89,4 +98,15 @@ class Document extends Any return $document; } + + public function getSampleData(): array + { + return [ + 'username' => 'john.doe', + 'email' => 'john.doe@example.com', + 'fullName' => 'John Doe', + 'age' => 30, + 'isAdmin' => false, + ]; + } } diff --git a/src/Appwrite/Utopia/Response/Model/Execution.php b/src/Appwrite/Utopia/Response/Model/Execution.php index d7d30fe549..f8ee32aa6e 100644 --- a/src/Appwrite/Utopia/Response/Model/Execution.php +++ b/src/Appwrite/Utopia/Response/Model/Execution.php @@ -27,7 +27,7 @@ class Execution extends Model ]) ->addRule('$updatedAt', [ 'type' => self::TYPE_DATETIME, - 'description' => 'Execution upate date in ISO 8601 format.', + 'description' => 'Execution update date in ISO 8601 format.', 'default' => '', 'example' => self::TYPE_DATETIME_EXAMPLE, ]) @@ -38,23 +38,32 @@ class Execution extends Model 'example' => [Role::any()->toString()], 'array' => true, ]) + // TODO: Sites listLogs will not have this, and will need siteId instead ->addRule('functionId', [ 'type' => self::TYPE_STRING, 'description' => 'Function ID.', 'default' => '', 'example' => '5e5ea6g16897e', ]) - ->addRule('trigger', [ + ->addRule('deploymentId', [ 'type' => self::TYPE_STRING, + 'description' => 'Function\'s deployment ID used to create the execution.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('trigger', [ + 'type' => self::TYPE_ENUM, 'description' => 'The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.', 'default' => '', 'example' => 'http', + 'enum' => ['http', 'schedule', 'event'], ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.', 'default' => '', 'example' => 'processing', + 'enum' => ['waiting', 'processing', 'completed', 'failed'], ]) ->addRule('requestMethod', [ 'type' => self::TYPE_STRING, @@ -70,7 +79,7 @@ class Execution extends Model ]) ->addRule('requestHeaders', [ 'type' => Response::MODEL_HEADERS, - 'description' => 'HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.', + 'description' => 'HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.', 'default' => [], 'example' => [['Content-Type' => 'application/json']], 'array' => true, diff --git a/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php b/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php index 7a74195371..29bd420ce5 100644 --- a/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php +++ b/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php @@ -17,10 +17,11 @@ class HealthAntivirus extends Model 'example' => '1.0.0', ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, - 'description' => 'Antivirus status. Possible values can are: `disabled`, `offline`, `online`', + 'type' => self::TYPE_ENUM, + 'description' => 'Antivirus status. Possible values are: `disabled`, `offline`, `online`', 'default' => '', 'example' => 'online', + 'enum' => ['disabled', 'offline', 'online'], ]) ; } diff --git a/src/Appwrite/Utopia/Response/Model/HealthStatus.php b/src/Appwrite/Utopia/Response/Model/HealthStatus.php index ba340107ac..24fb8766ce 100644 --- a/src/Appwrite/Utopia/Response/Model/HealthStatus.php +++ b/src/Appwrite/Utopia/Response/Model/HealthStatus.php @@ -23,10 +23,11 @@ class HealthStatus extends Model 'example' => 128, ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, - 'description' => 'Service status. Possible values can are: `pass`, `fail`', + 'type' => self::TYPE_ENUM, + 'description' => 'Service status. Possible values are: `pass`, `fail`', 'default' => '', 'example' => 'pass', + 'enum' => ['pass', 'fail'], ]) ; } diff --git a/src/Appwrite/Utopia/Response/Model/Index.php b/src/Appwrite/Utopia/Response/Model/Index.php index fcd978b5be..5a4d606408 100644 --- a/src/Appwrite/Utopia/Response/Model/Index.php +++ b/src/Appwrite/Utopia/Response/Model/Index.php @@ -10,9 +10,27 @@ class Index extends Model public function __construct() { $this + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Index ID.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('$createdAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Index creation date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('$updatedAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Index update date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) ->addRule('key', [ 'type' => self::TYPE_STRING, - 'description' => 'Index Key.', + 'description' => 'Index key.', 'default' => '', 'example' => 'index1', ]) @@ -23,10 +41,11 @@ class Index extends Model 'example' => 'primary', ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`', 'default' => '', 'example' => 'available', + 'enum' => ['available', 'processing', 'deleting', 'stuck', 'failed'], ]) ->addRule('error', [ 'type' => self::TYPE_STRING, @@ -55,18 +74,6 @@ class Index extends Model 'example' => [], 'array' => true, 'required' => false, - ]) - ->addRule('$createdAt', [ - 'type' => self::TYPE_DATETIME, - 'description' => 'Index creation date in ISO 8601 format.', - 'default' => '', - 'example' => self::TYPE_DATETIME_EXAMPLE, - ]) - ->addRule('$updatedAt', [ - 'type' => self::TYPE_DATETIME, - 'description' => 'Index update date in ISO 8601 format.', - 'default' => '', - 'example' => self::TYPE_DATETIME_EXAMPLE, ]); } diff --git a/src/Appwrite/Utopia/Response/Model/Message.php b/src/Appwrite/Utopia/Response/Model/Message.php index e52b6836c5..4c1e08b9cb 100644 --- a/src/Appwrite/Utopia/Response/Model/Message.php +++ b/src/Appwrite/Utopia/Response/Model/Message.php @@ -34,6 +34,7 @@ class Message extends Model 'description' => 'Message provider type.', 'default' => '', 'example' => MESSAGE_TYPE_EMAIL, + 'enum' => [MESSAGE_TYPE_EMAIL, MESSAGE_TYPE_SMS, MESSAGE_TYPE_PUSH], ]) ->addRule('topics', [ 'type' => self::TYPE_STRING, @@ -50,7 +51,7 @@ class Message extends Model 'example' => ['5e5ea5c16897e'], ]) ->addRule('targets', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Target IDs set as recipients.', 'default' => '', 'array' => true, @@ -94,10 +95,11 @@ class Message extends Model ], ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Status of delivery.', 'default' => 'draft', 'example' => 'Message status can be one of the following: draft, processing, scheduled, sent, or failed.', + 'enum' => ['draft', 'processing', 'scheduled', 'sent', 'failed'], ]); } diff --git a/src/Appwrite/Utopia/Response/Model/Migration.php b/src/Appwrite/Utopia/Response/Model/Migration.php index 3be1d519a6..76e00b3097 100644 --- a/src/Appwrite/Utopia/Response/Model/Migration.php +++ b/src/Appwrite/Utopia/Response/Model/Migration.php @@ -4,6 +4,7 @@ namespace Appwrite\Utopia\Response\Model; use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Model; +use Utopia\Database\Document; class Migration extends Model { @@ -107,4 +108,29 @@ class Migration extends Model { return Response::MODEL_MIGRATION; } + + public function filter(Document $document): Document + { + $errors = $document->getAttribute('errors', []); + if (empty($errors)) { + return $document; + } + + foreach ($errors as $index => $error) { + $decoded = json_decode($error, true); + + // frontend doesn't need too many details. + if (is_array($decoded)) { + $errors[$index] = json_encode([ + 'code' => $decoded['code'] ?? 0, + 'message' => $decoded['message'] ?? null, + ]); + } + } + + // errors now only have code and message. + $document->setAttribute('errors', $errors); + + return $document; + } } diff --git a/src/Appwrite/Utopia/Response/Model/MigrationReport.php b/src/Appwrite/Utopia/Response/Model/MigrationReport.php index 15164d56fc..56d17d3f7f 100644 --- a/src/Appwrite/Utopia/Response/Model/MigrationReport.php +++ b/src/Appwrite/Utopia/Response/Model/MigrationReport.php @@ -29,9 +29,9 @@ class MigrationReport extends Model 'default' => 0, 'example' => 20, ]) - ->addRule(Resource::TYPE_DOCUMENT, [ + ->addRule(Resource::TYPE_ROW, [ 'type' => self::TYPE_INTEGER, - 'description' => 'Number of documents to be migrated.', + 'description' => 'Number of rows to be migrated.', 'default' => 0, 'example' => 20, ]) diff --git a/src/Appwrite/Utopia/Response/Model/Platform.php b/src/Appwrite/Utopia/Response/Model/Platform.php index 4b8ffb1486..65f3c343d4 100644 --- a/src/Appwrite/Utopia/Response/Model/Platform.php +++ b/src/Appwrite/Utopia/Response/Model/Platform.php @@ -40,10 +40,11 @@ class Platform extends Model 'example' => 'My Web App', ]) ->addRule('type', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.', 'default' => '', 'example' => 'web', + 'enum' => ['web', 'flutter-web', 'flutter-ios', 'flutter-android', 'ios', 'android', 'unity'], ]) ->addRule('key', [ 'type' => self::TYPE_STRING, @@ -60,7 +61,7 @@ class Platform extends Model 'type' => self::TYPE_STRING, 'description' => 'Web app hostname. Empty string for other platforms.', 'default' => '', - 'example' => true, + 'example' => 'app.example.com', ]) ->addRule('httpUser', [ 'type' => self::TYPE_STRING, diff --git a/src/Appwrite/Utopia/Response/Model/Preferences.php b/src/Appwrite/Utopia/Response/Model/Preferences.php index 379543660c..e40ca6bfda 100644 --- a/src/Appwrite/Utopia/Response/Model/Preferences.php +++ b/src/Appwrite/Utopia/Response/Model/Preferences.php @@ -25,4 +25,13 @@ class Preferences extends Any { return Response::MODEL_PREFERENCES; } + + public function getSampleData(): array + { + return [ + 'language' => 'en', + 'timezone' => 'UTC', + 'darkTheme' => true, + ]; + } } diff --git a/src/Appwrite/Utopia/Response/Model/Project.php b/src/Appwrite/Utopia/Response/Model/Project.php index efd002654e..abe67e7e86 100644 --- a/src/Appwrite/Utopia/Response/Model/Project.php +++ b/src/Appwrite/Utopia/Response/Model/Project.php @@ -169,6 +169,12 @@ class Project extends Model 'default' => false, 'example' => true, ]) + ->addRule('authInvalidateSessions', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Whether or not all existing sessions should be invalidated on password change', + 'default' => false, + 'example' => true, + ]) ->addRule('oAuthProviders', [ 'type' => Response::MODEL_AUTH_PROVIDER, 'description' => 'List of Auth Providers.', @@ -376,6 +382,7 @@ class Project extends Model $document->setAttribute('authMembershipsUserName', $authValues['membershipsUserName'] ?? true); $document->setAttribute('authMembershipsUserEmail', $authValues['membershipsUserEmail'] ?? true); $document->setAttribute('authMembershipsMfa', $authValues['membershipsMfa'] ?? true); + $document->setAttribute('authInvalidateSessions', $authValues['invalidateSessions'] ?? false); foreach ($auth as $index => $method) { $key = $method['key']; diff --git a/src/Appwrite/Utopia/Response/Model/ProviderRepository.php b/src/Appwrite/Utopia/Response/Model/ProviderRepository.php index 518b5de9ee..eee058a05b 100644 --- a/src/Appwrite/Utopia/Response/Model/ProviderRepository.php +++ b/src/Appwrite/Utopia/Response/Model/ProviderRepository.php @@ -41,6 +41,12 @@ class ProviderRepository extends Model 'default' => false, 'example' => true, ]) + ->addRule('defaultBranch', [ + 'type' => self::TYPE_STRING, + 'description' => "VCS (Version Control System) repository's default branch name.", + 'default' => '', + 'example' => 'main', + ]) ->addRule('pushedAt', [ 'type' => self::TYPE_DATETIME, 'description' => 'Last commit date in ISO 8601 format.', diff --git a/src/Appwrite/Utopia/Response/Model/ResourceToken.php b/src/Appwrite/Utopia/Response/Model/ResourceToken.php index ef186c3d0b..87ab66ab5d 100644 --- a/src/Appwrite/Utopia/Response/Model/ResourceToken.php +++ b/src/Appwrite/Utopia/Response/Model/ResourceToken.php @@ -61,24 +61,28 @@ class ResourceToken extends Model public function filter(Document $document): Document { - $maxAge = PHP_INT_MAX; $expire = $document->getAttribute('expire'); - if ($expire !== null) { - $now = new \DateTime(); - $expiryDate = new \DateTime($expire); + // Use a large but reasonable maxAge to avoid auto-exp when we set explicit exp + $jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 86400 * 365 * 10, 10); // 10 years - // set 1 min if expired, we check for expiry later on route hooks for validation! - $maxAge = min(60, $expiryDate->getTimestamp() - $now->getTimestamp()); - } - - $jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $maxAge, 10); - $secret = $jwt->encode([ + $payload = [ 'tokenId' => $document->getId(), 'resourceId' => $document->getAttribute('resourceId'), 'resourceType' => $document->getAttribute('resourceType'), 'resourceInternalId' => $document->getAttribute('resourceInternalId'), - ]); + ]; + + // Set explicit expiration in JWT payload if we have an expiry date + if ($expire !== null) { + $expiryDate = new \DateTime($expire); + $payload['exp'] = $expiryDate->getTimestamp(); + } else { + // For infinite expiry, set 'iat' to prevent JWT library from auto-adding 'exp' + $payload['iat'] = time(); + } + + $secret = $jwt->encode($payload); $document->setAttribute('secret', $secret); diff --git a/src/Appwrite/Utopia/Response/Model/Row.php b/src/Appwrite/Utopia/Response/Model/Row.php new file mode 100644 index 0000000000..14a9ec9cda --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/Row.php @@ -0,0 +1,101 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; +use Utopia\Database\Document as DatabaseDocument; + +class Row extends Any +{ + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'Row'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_ROW; + } + + public function __construct() + { + $this + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Row ID.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('$sequence', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Row automatically incrementing ID.', + 'default' => 0, + 'example' => 1, + 'readOnly' => true, + ]) + ->addRule('$tableId', [ + 'type' => self::TYPE_STRING, + 'description' => 'Table ID.', + 'default' => '', + 'example' => '5e5ea5c15117e', + 'readOnly' => true, + ]) + ->addRule('$databaseId', [ + 'type' => self::TYPE_STRING, + 'description' => 'Database ID.', + 'default' => '', + 'example' => '5e5ea5c15117e', + 'readOnly' => true, + ]) + ->addRule('$createdAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Row creation date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('$updatedAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Row update date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('$permissions', [ + 'type' => self::TYPE_STRING, + 'description' => 'Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', + 'default' => '', + 'example' => ['read("any")'], + 'array' => true, + ]); + } + + public function filter(DatabaseDocument $document): DatabaseDocument + { + $document->removeAttribute('$collection'); + $document->removeAttribute('$tenant'); + $document->setAttribute('$sequence', (int)$document->getAttribute('$sequence', 0)); + + foreach ($document->getAttributes() as $column) { + if (\is_array($column)) { + foreach ($column as $subAttribute) { + if ($subAttribute instanceof DatabaseDocument) { + $this->filter($subAttribute); + } + } + } elseif ($column instanceof DatabaseDocument) { + $this->filter($column); + } + } + + return $document; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/Rule.php b/src/Appwrite/Utopia/Response/Model/Rule.php index 12903b270e..d4b8ffd9e7 100644 --- a/src/Appwrite/Utopia/Response/Model/Rule.php +++ b/src/Appwrite/Utopia/Response/Model/Rule.php @@ -55,7 +55,7 @@ class Rule extends Model ->addRule('redirectStatusCode', [ 'type' => self::TYPE_INTEGER, 'description' => 'Status code to apply during redirect. Used if type is "redirect"', - 'default' => '', + 'default' => 301, 'example' => 301, ]) ->addRule('deploymentId', [ @@ -65,10 +65,11 @@ class Rule extends Model 'example' => 'n3u9feiwmf', ]) ->addRule('deploymentResourceType', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Type of deployment. Possible values are "function", "site". Used if rule\'s type is "deployment".', 'default' => '', 'example' => 'function', + 'enum' => ['function', 'site'], ]) ->addRule('deploymentResourceId', [ 'type' => self::TYPE_STRING, @@ -80,13 +81,14 @@ class Rule extends Model 'type' => self::TYPE_STRING, 'description' => 'Name of Git branch that updates rule. Used if type is "deployment"', 'default' => '', - 'example' => 'function', + 'example' => 'main', ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Domain verification status. Possible values are "created", "verifying", "verified" and "unverified"', - 'default' => false, + 'default' => 'created', 'example' => 'verified', + 'enum' => ['created', 'verifying', 'verified', 'unverified'], ]) ->addRule('logs', [ 'type' => self::TYPE_STRING, diff --git a/src/Appwrite/Utopia/Response/Model/Table.php b/src/Appwrite/Utopia/Response/Model/Table.php new file mode 100644 index 0000000000..5018ab38db --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/Table.php @@ -0,0 +1,155 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; +use Appwrite\Utopia\Response\Model; +use Utopia\Database\Document; + +class Table extends Model +{ + public function __construct() + { + $this + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Table ID.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('$createdAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Table creation date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('$updatedAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Table update date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('$permissions', [ + 'type' => self::TYPE_STRING, + 'description' => 'Table permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', + 'default' => '', + 'example' => ['read("any")'], + 'array' => true + ]) + ->addRule('databaseId', [ + 'type' => self::TYPE_STRING, + 'description' => 'Database ID.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('name', [ + 'type' => self::TYPE_STRING, + 'description' => 'Table name.', + 'default' => '', + 'example' => 'My Table', + ]) + ->addRule('enabled', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Table enabled. Can be \'enabled\' or \'disabled\'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.', + 'default' => true, + 'example' => false, + ]) + ->addRule('rowSecurity', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Whether row-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions).', + 'default' => '', + 'example' => true, + ]) + ->addRule('columns', [ + 'type' => [ + Response::MODEL_COLUMN_BOOLEAN, + Response::MODEL_COLUMN_INTEGER, + Response::MODEL_COLUMN_FLOAT, + Response::MODEL_COLUMN_EMAIL, + Response::MODEL_COLUMN_ENUM, + Response::MODEL_COLUMN_URL, + Response::MODEL_COLUMN_IP, + Response::MODEL_COLUMN_DATETIME, + Response::MODEL_COLUMN_RELATIONSHIP, + Response::MODEL_COLUMN_POINT, + Response::MODEL_COLUMN_LINE, + Response::MODEL_COLUMN_POLYGON, + Response::MODEL_COLUMN_STRING, // needs to be last, since its condition would dominate any other string attribute + ], + 'description' => 'Table columns.', + 'default' => [], + 'example' => new \stdClass(), + 'array' => true, + ]) + ->addRule('indexes', [ + 'type' => Response::MODEL_COLUMN_INDEX, + 'description' => 'Table indexes.', + 'default' => [], + 'example' => new \stdClass(), + 'array' => true + ]) + ; + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'Table'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_TABLE; + } + + /** + * Process Document before returning it to the client for backwards compatibility! + */ + public function filter(Document $document): Document + { + $columns = $document->getAttribute('attributes', []); + if (!empty($columns) && \is_array($columns)) { + $columns = $this->remapNestedRelatedCollections($columns); + } + + $document->setAttribute('columns', $columns); + + $related = $document->getAttribute('relatedCollection'); + if ($related !== null) { + $document->setAttribute('relatedTable', $related); + } + + $documentSecurity = $document->getAttribute('documentSecurity'); + $document->setAttribute('rowSecurity', $documentSecurity); + + // remove anyways as they are already copied above. + $document + ->removeAttribute('attributes') + ->removeAttribute('documentSecurity') + ->removeAttribute('relatedCollection'); + + return $document; + } + + // 1.7 now sends back `relatedTable` instead of `relatedCollection`. + // This is necessary because the actual database underneath uses `relatedCollection`. + private function remapNestedRelatedCollections(array $columns): array + { + foreach ($columns as $i => $column) { + if (isset($column['relatedCollection'])) { + $columns[$i]['relatedTable'] = $column['relatedCollection']; + unset($columns[$i]['relatedCollection']); + } + } + return $columns; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/UsageDatabase.php b/src/Appwrite/Utopia/Response/Model/UsageDatabase.php index a0fe421f5f..990a2b3ee9 100644 --- a/src/Appwrite/Utopia/Response/Model/UsageDatabase.php +++ b/src/Appwrite/Utopia/Response/Model/UsageDatabase.php @@ -22,12 +22,24 @@ class UsageDatabase extends Model 'default' => 0, 'example' => 0, ]) + ->addRule('tablesTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total aggregated number of tables.', + 'default' => 0, + 'example' => 0, + ]) ->addRule('documentsTotal', [ 'type' => self::TYPE_INTEGER, 'description' => 'Total aggregated number of documents.', 'default' => 0, 'example' => 0, ]) + ->addRule('rowsTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total aggregated number of rows.', + 'default' => 0, + 'example' => 0, + ]) ->addRule('storageTotal', [ 'type' => self::TYPE_INTEGER, 'description' => 'Total aggregated number of total storage used in bytes.', @@ -53,6 +65,13 @@ class UsageDatabase extends Model 'example' => [], 'array' => true ]) + ->addRule('tables', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'Aggregated number of tables per period.', + 'default' => [], + 'example' => [], + 'array' => true + ]) ->addRule('documents', [ 'type' => Response::MODEL_METRIC, 'description' => 'Aggregated number of documents per period.', @@ -60,6 +79,13 @@ class UsageDatabase extends Model 'example' => [], 'array' => true ]) + ->addRule('rows', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'Aggregated number of rows per period.', + 'default' => [], + 'example' => [], + 'array' => true + ]) ->addRule('storage', [ 'type' => Response::MODEL_METRIC, 'description' => 'Aggregated storage used in bytes per period.', diff --git a/src/Appwrite/Utopia/Response/Model/UsageDatabases.php b/src/Appwrite/Utopia/Response/Model/UsageDatabases.php index 4e053e5223..67568c858c 100644 --- a/src/Appwrite/Utopia/Response/Model/UsageDatabases.php +++ b/src/Appwrite/Utopia/Response/Model/UsageDatabases.php @@ -28,12 +28,24 @@ class UsageDatabases extends Model 'default' => 0, 'example' => 0, ]) + ->addRule('tablesTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total aggregated number of tables.', + 'default' => 0, + 'example' => 0, + ]) ->addRule('documentsTotal', [ 'type' => self::TYPE_INTEGER, 'description' => 'Total aggregated number of documents.', 'default' => 0, 'example' => 0, ]) + ->addRule('rowsTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total aggregated number of rows.', + 'default' => 0, + 'example' => 0, + ]) ->addRule('storageTotal', [ 'type' => self::TYPE_INTEGER, 'description' => 'Total aggregated number of total databases storage in bytes.', @@ -66,6 +78,13 @@ class UsageDatabases extends Model 'example' => [], 'array' => true ]) + ->addRule('tables', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'Aggregated number of tables per period.', + 'default' => [], + 'example' => [], + 'array' => true + ]) ->addRule('documents', [ 'type' => Response::MODEL_METRIC, 'description' => 'Aggregated number of documents per period.', @@ -73,6 +92,13 @@ class UsageDatabases extends Model 'example' => [], 'array' => true ]) + ->addRule('rows', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'Aggregated number of rows per period.', + 'default' => [], + 'example' => [], + 'array' => true + ]) ->addRule('storage', [ 'type' => Response::MODEL_METRIC, 'description' => 'An array of the aggregated number of databases storage in bytes per period.', diff --git a/src/Appwrite/Utopia/Response/Model/UsageProject.php b/src/Appwrite/Utopia/Response/Model/UsageProject.php index 395b19b7cd..ee644aa845 100644 --- a/src/Appwrite/Utopia/Response/Model/UsageProject.php +++ b/src/Appwrite/Utopia/Response/Model/UsageProject.php @@ -22,6 +22,12 @@ class UsageProject extends Model 'default' => 0, 'example' => 0, ]) + ->addRule('rowsTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total aggregated number of rows.', + 'default' => 0, + 'example' => 0, + ]) ->addRule('databasesTotal', [ 'type' => self::TYPE_INTEGER, 'description' => 'Total aggregated number of databases.', diff --git a/src/Appwrite/Utopia/Response/Model/UsageTable.php b/src/Appwrite/Utopia/Response/Model/UsageTable.php new file mode 100644 index 0000000000..553a4b5001 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/UsageTable.php @@ -0,0 +1,54 @@ +<?php + +namespace Appwrite\Utopia\Response\Model; + +use Appwrite\Utopia\Response; +use Appwrite\Utopia\Response\Model; + +class UsageTable extends Model +{ + public function __construct() + { + $this + ->addRule('range', [ + 'type' => self::TYPE_STRING, + 'description' => 'Time range of the usage stats.', + 'default' => '', + 'example' => '30d', + ]) + ->addRule('rowsTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total aggregated number of of rows.', + 'default' => 0, + 'example' => 0, + ]) + ->addRule('rows', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'Aggregated number of rows per period.', + 'default' => [], + 'example' => [], + 'array' => true + ]) + ; + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'UsageTable'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_USAGE_TABLE; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/Webhook.php b/src/Appwrite/Utopia/Response/Model/Webhook.php index 57abb4900d..af1e23447e 100644 --- a/src/Appwrite/Utopia/Response/Model/Webhook.php +++ b/src/Appwrite/Utopia/Response/Model/Webhook.php @@ -49,7 +49,10 @@ class Webhook extends Model 'type' => self::TYPE_STRING, 'description' => 'Webhook trigger events.', 'default' => [], - 'example' => 'database.collections.update', + 'example' => [ + 'databases.tables.update', + 'databases.collections.update' + ], 'array' => true, ]) ->addRule('security', [ diff --git a/src/Appwrite/Vcs/Comment.php b/src/Appwrite/Vcs/Comment.php index 7c550ad528..a66706a4a2 100644 --- a/src/Appwrite/Vcs/Comment.php +++ b/src/Appwrite/Vcs/Comment.php @@ -86,8 +86,8 @@ class Comment $i = 0; foreach ($projects as $projectId => $project) { - $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; - $hostname = System::getEnv('_APP_DOMAIN'); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); $text .= "## {$project['name']}\n\n"; $text .= "Project ID: `{$projectId}`\n\n"; @@ -103,10 +103,12 @@ class Comment $text .= "| :- | :- | :- | :- | :- |\n"; foreach ($project['site'] as $siteId => $site) { + $imageStatus = in_array($site['status'], ['processing', 'building']) ? 'building' : $site['status']; + $extension = $site['status'] === 'building' ? 'gif' : 'png'; - $pathLight = '/images/vcs/status-' . $site['status'] . '-light.' . $extension; - $pathDark = '/images/vcs/status-' . $site['status'] . '-dark.' . $extension; + $pathLight = '/images/vcs/status-' . $imageStatus . '-light.' . $extension; + $pathDark = '/images/vcs/status-' . $imageStatus . '-dark.' . $extension; $status = match ($site['status']) { 'waiting' => $this->generatImage($pathLight, $pathDark, 'Queued', 85) . ' _Queued_', @@ -149,10 +151,11 @@ class Comment $text .= "| :- | :- | :- | :- |\n"; foreach ($project['function'] as $functionId => $function) { - $extension = $function['status'] === 'building' ? 'gif' : 'png'; + $imageStatus = in_array($function['status'], ['processing', 'building']) ? 'building' : $function['status']; + $extension = $imageStatus === 'building' ? 'gif' : 'png'; - $pathLight = '/images/vcs/status-' . $function['status'] . '-light.' . $extension; - $pathDark = '/images/vcs/status-' . $function['status'] . '-dark.' . $extension; + $pathLight = '/images/vcs/status-' . $imageStatus . '-light.' . $extension; + $pathDark = '/images/vcs/status-' . $imageStatus . '-dark.' . $extension; $status = match ($function['status']) { 'waiting' => $this->generatImage($pathLight, $pathDark, 'Queued', 85) . ' _Queued_', @@ -168,7 +171,8 @@ class Comment $action = '[Authorize](' . $function['action']['url'] . ')'; } - $text .= "|  **{$function['name']}**<br>`$functionId`"; + $text .= "|  **{$function['name']}**"; + $text .= "| `{$functionId}`"; $text .= "| {$status}"; $text .= "| {$action}"; $text .= "|\n"; @@ -196,8 +200,8 @@ class Comment public function generatImage(string $pathLight, string $pathDark, string $alt, int $width): string { - $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; - $hostname = System::getEnv('_APP_DOMAIN'); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); $imageLight = $protocol . '://' . $hostname . $pathLight; $imageDark = $protocol . '://' . $hostname . $pathDark; diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 5b204c1910..30c6132b76 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -9,6 +9,12 @@ use Utopia\System\System; class Executor { + // 0.8.6 is last version with object-based headers + public const RESPONSE_FORMAT_OBJECT_HEADERS = '0.10.0'; + + // 0.9.0 is first version with array-based headers + public const RESPONSE_FORMAT_ARRAY_HEADERS = '0.11.0'; + public const METHOD_GET = 'GET'; public const METHOD_POST = 'POST'; public const METHOD_PUT = 'PUT'; @@ -19,21 +25,14 @@ class Executor public const METHOD_CONNECT = 'CONNECT'; public const METHOD_TRACE = 'TRACE'; - private bool $selfSigned = false; - - /** - * @var callable(string, string): string $endpoint - */ - private $endpointSelector; + protected bool $selfSigned = false; + protected string $endpoint; protected array $headers; - /** - * @param callable(string, string): string $endpointSelector - */ - public function __construct(callable $endpointSelector) + public function __construct() { - $this->endpointSelector = $endpointSelector; + $this->endpoint = System::getEnv('_APP_EXECUTOR_HOST', ''); $this->headers = [ 'content-type' => 'application/json', 'authorization' => 'Bearer ' . System::getEnv('_APP_EXECUTOR_SECRET', ''), @@ -71,7 +70,8 @@ class Executor string $destination = '', array $variables = [], string $command = null, - string $outputDirectory = '' + string $outputDirectory = '', + string $runtimeEntrypoint = '' ) { $runtimeId = "$projectId-$deploymentId-build"; $route = "/runtimes"; @@ -94,11 +94,12 @@ class Executor 'memory' => $memory, 'version' => $version, 'timeout' => $timeout, - 'outputDirectory' => $outputDirectory + 'outputDirectory' => $outputDirectory, + 'runtimeEntrypoint' => $runtimeEntrypoint ]; - $endpoint = $this->selectEndpoint($projectId, $deploymentId); - $response = $this->call($endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout); + + $response = $this->call($this->endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout); $status = $response['headers']['status-code']; if ($status >= 400) { @@ -128,8 +129,7 @@ class Executor 'timeout' => $timeout ]; - $endpoint = $this->selectEndpoint($projectId, $deploymentId); - $this->call($endpoint, self::METHOD_GET, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout, $callback); + $this->call($this->endpoint, self::METHOD_GET, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout, $callback); } /** @@ -145,8 +145,7 @@ class Executor $runtimeId = "$projectId-$deploymentId" . $suffix; $route = "/runtimes/$runtimeId"; - $endpoint = $this->selectEndpoint($projectId, $deploymentId); - $response = $this->call($endpoint, self::METHOD_DELETE, $route, [ + $response = $this->call($this->endpoint, self::METHOD_DELETE, $route, [ 'x-opr-addressing-method' => 'broadcast' ], [], true, 30); @@ -177,6 +176,7 @@ class Executor * @param string $entrypoint * @param string $runtimeEntrypoint * @param bool $logging + * @param string $responseFormat * * @return array */ @@ -195,9 +195,10 @@ class Executor array $headers, float $cpus, int $memory, - string $runtimeEntrypoint = null, bool $logging, - int $requestTimeout = null + string $runtimeEntrypoint = '', + ?int $requestTimeout = null, + string $responseFormat = self::RESPONSE_FORMAT_OBJECT_HEADERS ) { if (empty($headers['host'])) { $headers['host'] = System::getEnv('_APP_DOMAIN', ''); @@ -239,8 +240,7 @@ class Executor $requestTimeout = $timeout + 15; } - $endpoint = $this->selectEndpoint($projectId, $deploymentId); - $response = $this->call($endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId, 'content-type' => 'multipart/form-data', 'accept' => 'multipart/form-data' ], $params, true, $requestTimeout); + $response = $this->call($this->endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId, 'content-type' => 'multipart/form-data', 'accept' => 'multipart/form-data', 'x-executor-response-format' => $responseFormat ], $params, true, $requestTimeout); $status = $response['headers']['status-code']; if ($status >= 400) { @@ -274,8 +274,7 @@ class Executor 'timeout' => $timeout ]; - $endpoint = $this->selectEndpoint($projectId, $deploymentId); - $response = $this->call($endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout); + $response = $this->call($this->endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout); $status = $response['headers']['status-code']; if ($status >= 400) { @@ -465,9 +464,4 @@ class Executor return $output; } - - private function selectEndpoint(string $projectId, string $deploymentId): string - { - return call_user_func($this->endpointSelector, $projectId, $deploymentId); - } } diff --git a/tests/e2e/Client.php b/tests/e2e/Client.php index 278d1cd0d5..6b81713654 100644 --- a/tests/e2e/Client.php +++ b/tests/e2e/Client.php @@ -108,6 +108,20 @@ class Client return $this; } + /** + * Set Response Format + * + * @param string $value + * + * @return self $this + */ + public function setResponseFormat(string $value): self + { + $this->addHeader('X-Appwrite-Response-Format', $value); + + return $this; + } + /** * @param bool $status true * @return self $this @@ -216,7 +230,15 @@ class Client return $len; }); - if ($method != self::METHOD_GET) { + + if ($method === self::METHOD_HEAD) { + curl_setopt($ch, CURLOPT_NOBODY, true); // This is crucial for HEAD requests + curl_setopt($ch, CURLOPT_HEADER, false); + } else { + curl_setopt($ch, CURLOPT_NOBODY, false); + } + + if ($method != self::METHOD_GET && $method != self::METHOD_HEAD) { curl_setopt($ch, CURLOPT_POSTFIELDS, $query); } @@ -229,7 +251,7 @@ class Client $responseType = $responseHeaders['content-type'] ?? ''; $responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); - if ($decode) { + if ($decode && $method !== self::METHOD_HEAD) { $strpos = strpos($responseType, ';'); $strpos = \is_bool($strpos) ? \strlen($responseType) : $strpos; switch (substr($responseType, 0, $strpos)) { @@ -255,6 +277,9 @@ class Client $json = null; break; } + } elseif ($method === self::METHOD_HEAD) { + // For HEAD requests, always set body to empty string regardless of decode flag + $responseBody = ''; } if ((curl_errno($ch)/* || 200 != $responseStatus*/)) { diff --git a/tests/e2e/General/AbuseTest.php b/tests/e2e/General/AbuseTest.php index 898fbd4aff..cfd12b0e9f 100644 --- a/tests/e2e/General/AbuseTest.php +++ b/tests/e2e/General/AbuseTest.php @@ -26,9 +26,9 @@ class AbuseTest extends Scope } } - public function testAbuseCreateDocument() + public function testAbuseCreateDocumentCollectionsAPI() { - $data = $this->createCollection(); + $data = $this->createCollectionOrTable(); $databaseId = $data['databaseId']; $collectionId = $data['collectionId']; $max = 120; @@ -52,9 +52,9 @@ class AbuseTest extends Scope } } - public function testAbuseUpdateDocument() + public function testAbuseUpdateDocumentCollectionsAPI() { - $data = $this->createCollection(); + $data = $this->createCollectionOrTable(); $databaseId = $data['databaseId']; $collectionId = $data['collectionId']; $max = 120; @@ -90,9 +90,9 @@ class AbuseTest extends Scope } } - public function testAbuseDeleteDocument() + public function testAbuseDeleteDocumentCollectionsAPI() { - $data = $this->createCollection(); + $data = $this->createCollectionOrTable(); $databaseId = $data['databaseId']; $collectionId = $data['collectionId']; $max = 60; @@ -124,6 +124,104 @@ class AbuseTest extends Scope } } + public function testAbuseCreateDocumentTablesAPI() + { + $data = $this->createCollectionOrTable(false); + $databaseId = $data['databaseId']; + $collectionId = $data['collectionId']; + $max = 120; + + for ($i = 0; $i <= $max + 1; $i++) { + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/tables/' . $collectionId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'The Hulk ' . $i, + ], + ]); + + if ($i < $max) { + $this->assertEquals(201, $response['headers']['status-code']); + } else { + $this->assertEquals(429, $response['headers']['status-code']); + } + } + } + + public function testAbuseUpdateDocumentTablesAPI() + { + $data = $this->createCollectionOrTable(false); + $databaseId = $data['databaseId']; + $collectionId = $data['collectionId']; + $max = 120; + + $row = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/tables/' . $collectionId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'The Hulk', + ], + ]); + + $rowId = $row['body']['$id']; + + for ($i = 0; $i <= $max + 1; $i++) { + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/tables/' . $collectionId . '/rows/' . $rowId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'data' => [ + 'title' => 'The Hulk ' . $i, + ], + ]); + + if ($i < $max) { + $this->assertEquals(200, $response['headers']['status-code']); + } else { + $this->assertEquals(429, $response['headers']['status-code']); + } + } + } + + public function testAbuseDeleteDocumentTablesAPI() + { + $data = $this->createCollectionOrTable(false); + $databaseId = $data['databaseId']; + $collectionId = $data['collectionId']; + $max = 60; + + for ($i = 0; $i <= $max + 1; $i++) { + $document = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/tables/' . $collectionId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'The Hulk', + ], + ]); + + $documentId = $document['body']['$id']; + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/tables/' . $collectionId . '/rows/' . $documentId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]); + + if ($i < $max) { + $this->assertEquals(204, $response['headers']['status-code']); + } else { + $this->assertEquals(429, $response['headers']['status-code']); + } + } + } + public function testAbuseCreateFile() { $data = $this->createBucket(); @@ -211,7 +309,7 @@ class AbuseTest extends Scope } } - private function createCollection(): array + private function createCollectionOrTable(bool $isCollection = true): array { $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ 'content-type' => 'application/json', @@ -227,12 +325,16 @@ class AbuseTest extends Scope $databaseId = $database['body']['$id']; - $movies = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', [ + $endpoint = $isCollection ? 'collections' : 'tables'; + $idParam = $isCollection ? 'collectionId' : 'tableId'; + $attributePath = $isCollection ? 'attributes' : 'columns'; + + $movies = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . "/$endpoint", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ], [ - 'collectionId' => ID::unique(), + $idParam => ID::unique(), 'name' => 'Movies', 'permissions' => [ Permission::read(Role::any()), @@ -244,7 +346,7 @@ class AbuseTest extends Scope $collectionId = $movies['body']['$id']; - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', [ + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . "/$endpoint/" . $collectionId . "/$attributePath/string", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] diff --git a/tests/e2e/General/HTTPTest.php b/tests/e2e/General/HTTPTest.php index 620409bb39..4657e6f2ad 100644 --- a/tests/e2e/General/HTTPTest.php +++ b/tests/e2e/General/HTTPTest.php @@ -60,7 +60,7 @@ class HTTPTest extends Scope 'origin' => 'http://localhost', ])); - $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(200, $response['headers']['status-code'], "Simple GET /robots.txt HTTP request failed: " . \json_encode($response)); $this->assertStringContainsString('# robotstxt.org/', $response['body']); } @@ -153,7 +153,6 @@ class HTTPTest extends Scope $this->assertIsString($body['client-flutter']); $this->assertIsString($body['console-web']); $this->assertIsString($body['server-nodejs']); - $this->assertIsString($body['server-deno']); $this->assertIsString($body['server-php']); $this->assertIsString($body['server-python']); $this->assertIsString($body['server-ruby']); diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index 5549ef800d..8f5477331a 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -3,7 +3,6 @@ namespace Tests\E2E\General; use Appwrite\Platform\Modules\Compute\Specification; -use Appwrite\Tests\Retry; use CURLFile; use DateTime; use Tests\E2E\Client; @@ -183,40 +182,43 @@ class UsageTest extends Scope /** * @depends testPrepareUsersStats */ - #[Retry(count: 1)] public function testUsersStats(array $data): array { $requestsTotal = $data['requestsTotal']; - $response = $this->client->call( - Client::METHOD_GET, - '/project/usage', - $this->getConsoleHeaders(), - [ - 'period' => '1h', - 'startDate' => self::getToday(), - 'endDate' => self::getTomorrow(), - ] - ); + $this->assertEventually(function () { + $response = $this->client->call( + Client::METHOD_GET, + '/project/usage', + $this->getConsoleHeaders(), + [ + 'period' => '1h', + 'startDate' => self::getToday(), + 'endDate' => self::getTomorrow(), + ] + ); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertGreaterThanOrEqual(31, count($response['body'])); - $this->validateDates($response['body']['network']); - $this->validateDates($response['body']['requests']); - $this->validateDates($response['body']['users']); - $this->assertArrayHasKey('executionsBreakdown', $response['body']); - $this->assertArrayHasKey('bucketsBreakdown', $response['body']); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertGreaterThanOrEqual(31, count($response['body'])); + $this->validateDates($response['body']['network']); + $this->validateDates($response['body']['requests']); + $this->validateDates($response['body']['users']); + $this->assertArrayHasKey('executionsBreakdown', $response['body']); + $this->assertArrayHasKey('bucketsBreakdown', $response['body']); + }); - $response = $this->client->call( - Client::METHOD_GET, - '/users/usage?range=90d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () { + $response = $this->client->call( + Client::METHOD_GET, + '/users/usage?range=90d', + $this->getConsoleHeaders() + ); - $this->assertEquals('90d', $response['body']['range']); - $this->assertEquals(90, count($response['body']['users'])); - $this->assertEquals(90, count($response['body']['sessions'])); - $this->assertEquals((self::CREATE / 2), $response['body']['users'][array_key_last($response['body']['users'])]['value']); + $this->assertEquals('90d', $response['body']['range']); + $this->assertEquals(90, count($response['body']['users'])); + $this->assertEquals(90, count($response['body']['sessions'])); + $this->assertEquals((self::CREATE / 2), $response['body']['users'][array_key_last($response['body']['users'])]['value']); + }); return array_merge($data, [ 'requestsTotal' => $requestsTotal @@ -359,7 +361,6 @@ class UsageTest extends Scope /** * @depends testPrepareStorageStats */ - #[Retry(count: 10)] public function testStorageStats(array $data): array { $bucketId = $data['bucketId']; @@ -368,50 +369,56 @@ class UsageTest extends Scope $storageTotal = $data['storageTotal']; $filesTotal = $data['filesTotal']; - $response = $this->client->call( - Client::METHOD_GET, - '/project/usage', - $this->getConsoleHeaders(), - [ - 'period' => '1d', - 'startDate' => self::getToday(), - 'endDate' => self::getTomorrow(), - ] - ); + $this->assertEventually(function () use ($requestsTotal, $storageTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/project/usage', + $this->getConsoleHeaders(), + [ + 'period' => '1d', + 'startDate' => self::getToday(), + 'endDate' => self::getTomorrow(), + ] + ); - $this->assertGreaterThanOrEqual(31, count($response['body'])); - $this->assertEquals(1, count($response['body']['requests'])); - $this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']); - $this->validateDates($response['body']['requests']); - $this->assertEquals($storageTotal, $response['body']['filesStorageTotal']); + $this->assertGreaterThanOrEqual(31, count($response['body'])); + $this->assertEquals(1, count($response['body']['requests'])); + $this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']); + $this->validateDates($response['body']['requests']); + $this->assertEquals($storageTotal, $response['body']['filesStorageTotal']); + }); - $response = $this->client->call( - Client::METHOD_GET, - '/storage/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () use ($bucketsTotal, $filesTotal, $storageTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/storage/usage?range=30d', + $this->getConsoleHeaders() + ); - $this->assertEquals($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']); - $this->validateDates($response['body']['storage']); - $this->assertEquals($bucketsTotal, $response['body']['buckets'][array_key_last($response['body']['buckets'])]['value']); - $this->validateDates($response['body']['buckets']); - $this->assertEquals($filesTotal, $response['body']['files'][array_key_last($response['body']['files'])]['value']); - $this->validateDates($response['body']['files']); + $this->assertEquals($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']); + $this->validateDates($response['body']['storage']); + $this->assertEquals($bucketsTotal, $response['body']['buckets'][array_key_last($response['body']['buckets'])]['value']); + $this->validateDates($response['body']['buckets']); + $this->assertEquals($filesTotal, $response['body']['files'][array_key_last($response['body']['files'])]['value']); + $this->validateDates($response['body']['files']); + }); - $response = $this->client->call( - Client::METHOD_GET, - '/storage/' . $bucketId . '/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () use ($bucketId, $storageTotal, $filesTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/storage/' . $bucketId . '/usage?range=30d', + $this->getConsoleHeaders() + ); - $this->assertEquals($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']); - $this->assertEquals($filesTotal, $response['body']['files'][array_key_last($response['body']['files'])]['value']); + $this->assertEquals($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']); + $this->assertEquals($filesTotal, $response['body']['files'][array_key_last($response['body']['files'])]['value']); + }); return $data; } /** @depends testStorageStats */ - public function testPrepareDatabaseStats(array $data): array + public function testPrepareDatabaseStatsCollectionsAPI(array $data): array { $requestsTotal = $data['requestsTotal']; @@ -576,9 +583,8 @@ class UsageTest extends Scope ]); } - /** @depends testPrepareDatabaseStats */ - #[Retry(count: 1)] - public function testDatabaseStats(array $data): array + /** @depends testPrepareDatabaseStatsCollectionsAPI */ + public function testDatabaseStatsCollectionsAPI(array $data): array { $databaseId = $data['databaseId']; $collectionId = $data['collectionId']; @@ -587,6 +593,257 @@ class UsageTest extends Scope $collectionsTotal = $data['collectionsTotal']; $documentsTotal = $data['documentsTotal']; + $this->assertEventually(function () use ($requestsTotal, $databasesTotal, $documentsTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/project/usage', + $this->getConsoleHeaders(), + [ + 'period' => '1d', + 'startDate' => self::getToday(), + 'endDate' => self::getTomorrow(), + ] + ); + + $this->assertGreaterThanOrEqual(31, count($response['body'])); + $this->assertEquals(1, count($response['body']['requests'])); + $this->assertEquals(1, count($response['body']['network'])); + $this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']); + $this->validateDates($response['body']['requests']); + $this->assertEquals($databasesTotal, $response['body']['databasesTotal']); + $this->assertEquals($documentsTotal, $response['body']['documentsTotal']); + }); + + $this->assertEventually(function () use ($collectionsTotal, $databasesTotal, $documentsTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/databases/usage?range=30d', + $this->getConsoleHeaders() + ); + + $this->assertEquals($databasesTotal, $response['body']['databases'][array_key_last($response['body']['databases'])]['value']); + $this->validateDates($response['body']['databases']); + $this->assertEquals($collectionsTotal, $response['body']['collections'][array_key_last($response['body']['collections'])]['value']); + $this->validateDates($response['body']['collections']); + $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); + $this->validateDates($response['body']['documents']); + }); + + $this->assertEventually(function () use ($databaseId, $collectionsTotal, $documentsTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/databases/' . $databaseId . '/usage?range=30d', + $this->getConsoleHeaders() + ); + + $this->assertEquals($collectionsTotal, $response['body']['collections'][array_key_last($response['body']['collections'])]['value']); + $this->validateDates($response['body']['collections']); + + $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); + $this->validateDates($response['body']['documents']); + }); + + $this->assertEventually(function () use ($databaseId, $collectionId, $documentsTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/databases/' . $databaseId . '/collections/' . $collectionId . '/usage?range=30d', + $this->getConsoleHeaders() + ); + + $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); + $this->validateDates($response['body']['documents']); + }); + + return $data; + } + + /** @depends testDatabaseStatsCollectionsAPI */ + public function testPrepareDatabaseStatsTablesAPI(array $data): array + { + $rowsTotal = 0; + $tablesTotal = 0; + $databasesTotal = $data['databasesTotal']; + $documentsTotal = $data['documentsTotal']; + $collectionsTotal = $data['collectionsTotal']; + + $requestsTotal = $data['requestsTotal']; + + for ($i = 0; $i < self::CREATE; $i++) { + $name = uniqid() . ' database'; + + $response = $this->client->call( + Client::METHOD_POST, + '/databases', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), + [ + 'databaseId' => 'unique()', + 'name' => $name, + ] + ); + + $this->assertEquals($name, $response['body']['name']); + $this->assertNotEmpty($response['body']['$id']); + + $requestsTotal += 1; + $databasesTotal += 1; + + $databaseId = $response['body']['$id']; + + if ($i < (self::CREATE / 2)) { + $response = $this->client->call( + Client::METHOD_DELETE, + '/databases/' . $databaseId, + array_merge([ + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), + ); + + $this->assertEmpty($response['body']); + + $databasesTotal -= 1; + $requestsTotal += 1; + } + } + + for ($i = 0; $i < self::CREATE; $i++) { + $name = uniqid() . ' table'; + + $response = $this->client->call( + Client::METHOD_POST, + '/tablesdb/' . $databaseId . '/tables', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), + [ + 'tableId' => 'unique()', + 'name' => $name, + 'documentSecurity' => false, + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ] + ); + + $this->assertEquals($name, $response['body']['name']); + $this->assertNotEmpty($response['body']['$id']); + + $requestsTotal += 1; + $tablesTotal += 1; + + $tableId = $response['body']['$id']; + + if ($i < (self::CREATE / 2)) { + $response = $this->client->call( + Client::METHOD_DELETE, + '/tablesdb/' . $databaseId . '/tables/' . $tableId, + array_merge([ + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), + ); + + $this->assertEmpty($response['body']); + + $tablesTotal -= 1; + $requestsTotal += 1; + } + } + + $response = $this->client->call( + Client::METHOD_POST, + '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns' . '/string', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), + [ + 'key' => 'name', + 'size' => 255, + 'required' => true, + ] + ); + + $this->assertEquals('name', $response['body']['key']); + + sleep(self::WAIT); + + $requestsTotal += 1; + + for ($i = 0; $i < self::CREATE; $i++) { + $name = uniqid() . ' table'; + + $response = $this->client->call( + Client::METHOD_POST, + '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), + [ + 'rowId' => 'unique()', + 'data' => ['name' => $name] + ] + ); + + $this->assertEquals($name, $response['body']['name']); + $this->assertNotEmpty($response['body']['$id']); + + $requestsTotal += 1; + $rowsTotal += 1; + + $rowId = $response['body']['$id']; + + if ($i < (self::CREATE / 2)) { + $response = $this->client->call( + Client::METHOD_DELETE, + '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, + array_merge([ + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), + ); + + $this->assertEmpty($response['body']); + + $rowsTotal -= 1; + $requestsTotal += 1; + } + } + + return array_merge($data, [ + 'databaseId' => $databaseId, + 'tableId' => $tableId, + 'requestsTotal' => $requestsTotal, + 'databasesTotal' => $databasesTotal, + 'tablesTotal' => $tablesTotal, + 'rowsTotal' => $rowsTotal, + + // For clarity + 'absoluteRowsTotal' => $rowsTotal + $data['documentsTotal'], + 'absoluteTablesTotal' => $tablesTotal + $data['collectionsTotal'], + ]); + } + + /** @depends testPrepareDatabaseStatsTablesAPI */ + #[Retry(count: 1)] + public function testDatabaseStatsTablesAPI(array $data): array + { + $tableId = $data['tableId']; + $databaseId = $data['databaseId']; + $requestsTotal = $data['requestsTotal']; + + $absoluteRowsTotal = $data['absoluteRowsTotal']; + $absoluteTablesTotal = $data['absoluteTablesTotal']; + + $rowsTotal = $data['rowsTotal']; + $tablesTotal = $data['tablesTotal']; + $databasesTotal = $data['databasesTotal']; + sleep(self::WAIT); $response = $this->client->call( @@ -601,12 +858,14 @@ class UsageTest extends Scope ); $this->assertGreaterThanOrEqual(31, count($response['body'])); - $this->assertEquals(1, count($response['body']['requests'])); - $this->assertEquals(1, count($response['body']['network'])); + $this->assertCount(1, $response['body']['requests']); + $this->assertCount(1, $response['body']['network']); $this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']); $this->validateDates($response['body']['requests']); $this->assertEquals($databasesTotal, $response['body']['databasesTotal']); - $this->assertEquals($documentsTotal, $response['body']['documentsTotal']); + + // project level includes all i.e. documents + rows total. + $this->assertEquals($absoluteRowsTotal, $response['body']['rowsTotal']); $response = $this->client->call( Client::METHOD_GET, @@ -616,10 +875,14 @@ class UsageTest extends Scope $this->assertEquals($databasesTotal, $response['body']['databases'][array_key_last($response['body']['databases'])]['value']); $this->validateDates($response['body']['databases']); - $this->assertEquals($collectionsTotal, $response['body']['collections'][array_key_last($response['body']['collections'])]['value']); - $this->validateDates($response['body']['collections']); - $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); - $this->validateDates($response['body']['documents']); + + // database level includes all i.e. collections + tables total. + $this->assertEquals($absoluteTablesTotal, $response['body']['tables'][array_key_last($response['body']['tables'])]['value']); // database level + $this->validateDates($response['body']['tables']); + + // database level includes all i.e. documents + rows total. + $this->assertEquals($absoluteRowsTotal, $response['body']['rows'][array_key_last($response['body']['rows'])]['value']); + $this->validateDates($response['body']['rows']); $response = $this->client->call( Client::METHOD_GET, @@ -627,25 +890,25 @@ class UsageTest extends Scope $this->getConsoleHeaders() ); - $this->assertEquals($collectionsTotal, $response['body']['collections'][array_key_last($response['body']['collections'])]['value']); - $this->validateDates($response['body']['collections']); + $this->assertEquals($tablesTotal, $response['body']['tables'][array_key_last($response['body']['tables'])]['value']); + $this->validateDates($response['body']['tables']); - $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); - $this->validateDates($response['body']['documents']); + $this->assertEquals($rowsTotal, $response['body']['rows'][array_key_last($response['body']['rows'])]['value']); + $this->validateDates($response['body']['rows']); $response = $this->client->call( Client::METHOD_GET, - '/databases/' . $databaseId . '/collections/' . $collectionId . '/usage?range=30d', + '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/usage?range=30d', $this->getConsoleHeaders() ); - $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); - $this->validateDates($response['body']['documents']); + $this->assertEquals($rowsTotal, $response['body']['rows'][array_key_last($response['body']['rows'])]['value']); + $this->validateDates($response['body']['rows']); return $data; } - /** @depends testDatabaseStats */ + /** @depends testDatabaseStatsTablesAPI */ public function testPrepareFunctionsStats(array $data): array { $executionTime = 0; @@ -662,7 +925,8 @@ class UsageTest extends Scope [ 'functionId' => 'unique()', 'name' => 'Test', - 'runtime' => 'php-8.0', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'vars' => [ 'funcKey1' => 'funcValue1', 'funcKey2' => 'funcValue2', @@ -684,8 +948,7 @@ class UsageTest extends Scope $this->assertNotEmpty($response['body']['$id']); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true, ]); $this->assertNotEmpty($deploymentId); @@ -799,67 +1062,69 @@ class UsageTest extends Scope } /** @depends testPrepareFunctionsStats */ - #[Retry(count: 1)] public function testFunctionsStats(array $data): array { $functionId = $data['functionId']; $executionTime = $data['executionTime']; $executions = $data['executions']; - $response = $this->client->call( - Client::METHOD_GET, - '/functions/' . $functionId . '/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () use ($functionId, $executions, $executionTime) { + $response = $this->client->call( + Client::METHOD_GET, + '/functions/' . $functionId . '/usage?range=30d', + $this->getConsoleHeaders() + ); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(24, count($response['body'])); - $this->assertEquals('30d', $response['body']['range']); - $this->assertIsArray($response['body']['deployments']); - $this->assertIsArray($response['body']['deploymentsStorage']); - $this->assertIsNumeric($response['body']['deploymentsStorageTotal']); - $this->assertIsNumeric($response['body']['buildsMbSecondsTotal']); - $this->assertIsNumeric($response['body']['executionsMbSecondsTotal']); - $this->assertIsArray($response['body']['builds']); - $this->assertIsArray($response['body']['buildsTime']); - $this->assertIsArray($response['body']['buildsMbSeconds']); - $this->assertIsArray($response['body']['executions']); - $this->assertIsArray($response['body']['executionsTime']); - $this->assertIsArray($response['body']['executionsMbSeconds']); - $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); - $this->validateDates($response['body']['executions']); - $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); - $this->validateDates($response['body']['executionsTime']); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(24, count($response['body'])); + $this->assertEquals('30d', $response['body']['range']); + $this->assertIsArray($response['body']['deployments']); + $this->assertIsArray($response['body']['deploymentsStorage']); + $this->assertIsNumeric($response['body']['deploymentsStorageTotal']); + $this->assertIsNumeric($response['body']['buildsMbSecondsTotal']); + $this->assertIsNumeric($response['body']['executionsMbSecondsTotal']); + $this->assertIsArray($response['body']['builds']); + $this->assertIsArray($response['body']['buildsTime']); + $this->assertIsArray($response['body']['buildsMbSeconds']); + $this->assertIsArray($response['body']['executions']); + $this->assertIsArray($response['body']['executionsTime']); + $this->assertIsArray($response['body']['executionsMbSeconds']); + $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); + $this->validateDates($response['body']['executions']); + $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); + $this->validateDates($response['body']['executionsTime']); + }); - $response = $this->client->call( - Client::METHOD_GET, - '/functions/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () use ($executions, $executionTime) { + $response = $this->client->call( + Client::METHOD_GET, + '/functions/usage?range=30d', + $this->getConsoleHeaders() + ); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(25, count($response['body'])); - $this->assertEquals($response['body']['range'], '30d'); - $this->assertIsArray($response['body']['functions']); - $this->assertIsArray($response['body']['deployments']); - $this->assertIsArray($response['body']['deploymentsStorage']); - $this->assertIsArray($response['body']['builds']); - $this->assertIsArray($response['body']['buildsTime']); - $this->assertIsArray($response['body']['buildsMbSeconds']); - $this->assertIsArray($response['body']['executions']); - $this->assertIsArray($response['body']['executionsTime']); - $this->assertIsArray($response['body']['executionsMbSeconds']); - $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); - $this->validateDates($response['body']['executions']); - $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); - $this->validateDates($response['body']['executionsTime']); - $this->assertGreaterThan(0, $response['body']['buildsTime'][array_key_last($response['body']['buildsTime'])]['value']); - $this->validateDates($response['body']['buildsTime']); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(25, count($response['body'])); + $this->assertEquals($response['body']['range'], '30d'); + $this->assertIsArray($response['body']['functions']); + $this->assertIsArray($response['body']['deployments']); + $this->assertIsArray($response['body']['deploymentsStorage']); + $this->assertIsArray($response['body']['builds']); + $this->assertIsArray($response['body']['buildsTime']); + $this->assertIsArray($response['body']['buildsMbSeconds']); + $this->assertIsArray($response['body']['executions']); + $this->assertIsArray($response['body']['executionsTime']); + $this->assertIsArray($response['body']['executionsMbSeconds']); + $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); + $this->validateDates($response['body']['executions']); + $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); + $this->validateDates($response['body']['executionsTime']); + $this->assertGreaterThan(0, $response['body']['buildsTime'][array_key_last($response['body']['buildsTime'])]['value']); + $this->validateDates($response['body']['buildsTime']); + }); return $data; } - public function testPrepareSitesStats(): array { $siteId = $this->setupSite([ @@ -927,7 +1192,6 @@ class UsageTest extends Scope } /** @depends testPrepareSitesStats */ - #[Retry(count: 1)] public function testSitesStats(array $data) { $siteId = $data['siteId']; @@ -935,67 +1199,72 @@ class UsageTest extends Scope $executions = $data['executions'] ?? 0; $deploymentsSuccess = $data['deploymentsSuccess']; $deploymentsFailed = $data['deploymentsFailed']; - $response = $this->client->call( - Client::METHOD_GET, - '/sites/' . $siteId . '/usage?range=30d', - $this->getConsoleHeaders() - ); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(30, count($response['body'])); - $this->assertEquals('30d', $response['body']['range']); - $this->assertIsArray($response['body']['deployments']); - $this->assertEquals($deploymentsSuccess, $response['body']['buildsSuccessTotal']); - $this->assertEquals($deploymentsFailed, $response['body']['buildsFailedTotal']); - $this->assertIsArray($response['body']['deploymentsStorage']); - $this->assertIsNumeric($response['body']['deploymentsStorageTotal']); - $this->assertIsNumeric($response['body']['buildsMbSecondsTotal']); - $this->assertIsNumeric($response['body']['executionsMbSecondsTotal']); - $this->assertIsArray($response['body']['builds']); - $this->assertIsArray($response['body']['buildsTime']); - $this->assertIsArray($response['body']['buildsMbSeconds']); - $this->assertIsArray($response['body']['executions']); - $this->assertIsArray($response['body']['executionsTime']); - $this->assertIsArray($response['body']['executionsMbSeconds']); - $this->assertIsArray($response['body']['buildsSuccess']); - $this->assertIsArray($response['body']['buildsFailed']); - $this->assertIsArray($response['body']['requests']); - $this->assertIsArray($response['body']['inbound']); - $this->assertIsArray($response['body']['outbound']); - $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); - $this->validateDates($response['body']['executions']); - $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); - $this->validateDates($response['body']['executionsTime']); + $this->assertEventually(function () use ($siteId, $deploymentsSuccess, $deploymentsFailed, $executions, $executionTime) { + $response = $this->client->call( + Client::METHOD_GET, + '/sites/' . $siteId . '/usage?range=30d', + $this->getConsoleHeaders() + ); - $response = $this->client->call( - Client::METHOD_GET, - '/sites/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(30, count($response['body'])); + $this->assertEquals('30d', $response['body']['range']); + $this->assertIsArray($response['body']['deployments']); + $this->assertEquals($deploymentsSuccess, $response['body']['buildsSuccessTotal']); + $this->assertEquals($deploymentsFailed, $response['body']['buildsFailedTotal']); + $this->assertIsArray($response['body']['deploymentsStorage']); + $this->assertIsNumeric($response['body']['deploymentsStorageTotal']); + $this->assertIsNumeric($response['body']['buildsMbSecondsTotal']); + $this->assertIsNumeric($response['body']['executionsMbSecondsTotal']); + $this->assertIsArray($response['body']['builds']); + $this->assertIsArray($response['body']['buildsTime']); + $this->assertIsArray($response['body']['buildsMbSeconds']); + $this->assertIsArray($response['body']['executions']); + $this->assertIsArray($response['body']['executionsTime']); + $this->assertIsArray($response['body']['executionsMbSeconds']); + $this->assertIsArray($response['body']['buildsSuccess']); + $this->assertIsArray($response['body']['buildsFailed']); + $this->assertIsArray($response['body']['requests']); + $this->assertIsArray($response['body']['inbound']); + $this->assertIsArray($response['body']['outbound']); + $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); + $this->validateDates($response['body']['executions']); + $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); + $this->validateDates($response['body']['executionsTime']); + }); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(31, count($response['body'])); - $this->assertEquals($response['body']['range'], '30d'); - $this->assertIsArray($response['body']['sites']); - $this->assertIsArray($response['body']['deployments']); - $this->assertIsArray($response['body']['deploymentsStorage']); - $this->assertIsArray($response['body']['builds']); - $this->assertIsArray($response['body']['buildsTime']); - $this->assertIsArray($response['body']['buildsMbSeconds']); - $this->assertIsArray($response['body']['executions']); - $this->assertIsArray($response['body']['executionsTime']); - $this->assertIsArray($response['body']['executionsMbSeconds']); - $this->assertIsArray($response['body']['buildsSuccess']); - $this->assertIsArray($response['body']['buildsFailed']); - $this->assertIsArray($response['body']['requests']); - $this->assertIsArray($response['body']['inbound']); - $this->assertIsArray($response['body']['outbound']); - $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); - $this->validateDates($response['body']['executions']); - $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); - $this->validateDates($response['body']['executionsTime']); - $this->assertGreaterThan(0, $response['body']['buildsTime'][array_key_last($response['body']['buildsTime'])]['value']); - $this->validateDates($response['body']['buildsTime']); + $this->assertEventually(function () use ($executions, $executionTime) { + $response = $this->client->call( + Client::METHOD_GET, + '/sites/usage?range=30d', + $this->getConsoleHeaders() + ); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(31, count($response['body'])); + $this->assertEquals($response['body']['range'], '30d'); + $this->assertIsArray($response['body']['sites']); + $this->assertIsArray($response['body']['deployments']); + $this->assertIsArray($response['body']['deploymentsStorage']); + $this->assertIsArray($response['body']['builds']); + $this->assertIsArray($response['body']['buildsTime']); + $this->assertIsArray($response['body']['buildsMbSeconds']); + $this->assertIsArray($response['body']['executions']); + $this->assertIsArray($response['body']['executionsTime']); + $this->assertIsArray($response['body']['executionsMbSeconds']); + $this->assertIsArray($response['body']['buildsSuccess']); + $this->assertIsArray($response['body']['buildsFailed']); + $this->assertIsArray($response['body']['requests']); + $this->assertIsArray($response['body']['inbound']); + $this->assertIsArray($response['body']['outbound']); + $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); + $this->validateDates($response['body']['executions']); + $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); + $this->validateDates($response['body']['executionsTime']); + $this->assertGreaterThan(0, $response['body']['buildsTime'][array_key_last($response['body']['buildsTime'])]['value']); + $this->validateDates($response['body']['buildsTime']); + }); } /** @depends testFunctionsStats */ @@ -1021,7 +1290,7 @@ class UsageTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'domain' => 'test-' . ID::unique() . System::getEnv('_APP_DOMAIN_FUNCTIONS'), + 'domain' => 'test-' . ID::unique() . '.' . System::getEnv('_APP_DOMAIN_FUNCTIONS'), 'functionId' => $functionId, ], ); @@ -1032,30 +1301,33 @@ class UsageTest extends Scope $domain = $rule['body']['domain']; - $response = $this->client->call( - Client::METHOD_GET, - '/functions/' . $functionId . '/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () use (&$response, $functionId) { + $response = $this->client->call( + Client::METHOD_GET, + '/functions/' . $functionId . '/usage?range=30d', + $this->getConsoleHeaders() + ); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(24, count($response['body'])); - $this->assertEquals('30d', $response['body']['range']); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(24, count($response['body'])); + $this->assertEquals('30d', $response['body']['range']); + }); $functionsMetrics = $response['body']; - $response = $this->client->call( - Client::METHOD_GET, - '/project/usage', - $this->getConsoleHeaders(), - [ - 'period' => '1h', - 'startDate' => self::getToday(), - 'endDate' => self::getTomorrow(), - ] - ); - - $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEventually(function () use (&$response) { + $response = $this->client->call( + Client::METHOD_GET, + '/project/usage', + $this->getConsoleHeaders(), + [ + 'period' => '1h', + 'startDate' => self::getToday(), + 'endDate' => self::getTomorrow(), + ] + ); + $this->assertEquals(200, $response['headers']['status-code']); + }); $projectMetrics = $response['body']; @@ -1070,8 +1342,6 @@ class UsageTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); - $tries = 0; - $this->assertEventually(function () use ($functionId, $functionsMetrics, $projectMetrics) { // Compare new values with old values $response = $this->client->call( diff --git a/tests/e2e/Scopes/ProjectCustom.php b/tests/e2e/Scopes/ProjectCustom.php index a354696f53..c2b4896814 100644 --- a/tests/e2e/Scopes/ProjectCustom.php +++ b/tests/e2e/Scopes/ProjectCustom.php @@ -70,8 +70,12 @@ trait ProjectCustom 'databases.write', 'collections.read', 'collections.write', + 'tables.read', + 'tables.write', 'documents.read', 'documents.write', + 'rows.read', + 'rows.write', 'files.read', 'files.write', 'buckets.read', @@ -140,7 +144,7 @@ trait ProjectCustom 'teams.*', 'users.*' ], - 'url' => 'http://request-catcher:5000/webhook', + 'url' => 'http://request-catcher-webhook:5000/', 'security' => false, ]); @@ -200,4 +204,17 @@ trait ProjectCustom return $key['body']['secret']; } + public function updateProjectinvalidateSessionsProperty(bool $value) + { + $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . self::$project['$id'] . '/auth/session-invalidation', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + 'x-appwrite-project' => 'console', + ]), [ + 'enabled' => $value, + ]); + + return $response['headers']['status-code']; + } } diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index 6deaa62c05..5b7f1a8771 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -2,14 +2,20 @@ namespace Tests\E2E\Scopes; +use Appwrite\Tests\Async; use Appwrite\Tests\Retryable; use PHPUnit\Framework\TestCase; use Tests\E2E\Client; use Utopia\Database\Helpers\ID; +use Utopia\System\System; abstract class Scope extends TestCase { use Retryable; + use Async; + + public const REQUEST_TYPE_WEBHOOK = 'webhook'; + public const REQUEST_TYPE_SMS = 'sms'; protected ?Client $client = null; protected string $endpoint = 'http://localhost/v1'; @@ -18,6 +24,17 @@ abstract class Scope extends TestCase { $this->client = new Client(); $this->client->setEndpoint($this->endpoint); + + $format = System::getEnv('_APP_E2E_RESPONSE_FORMAT'); + if (!empty($format)) { + if ( + !\preg_match('/^\d+\.\d+\.\d+$/', $format) || + !\version_compare($format, APP_VERSION_STABLE, '<=') + ) { + throw new \Exception('E2E response format must be ' . APP_VERSION_STABLE . ' or lower.'); + } + $this->client->setResponseFormat($format); + } } protected function tearDown(): void @@ -35,19 +52,88 @@ abstract class Scope extends TestCase if ($limit === 1) { return end($emails); } else { - $lastEmails = array_slice($emails, -1 * $limit); - return $lastEmails; + return array_slice($emails, -1 * $limit); } } return []; } + protected function extractQueryParamsFromEmailLink(string $html): array + { + foreach (['/join-us?', '/verification?', '/recovery?'] as $prefix) { + $linkStart = strpos($html, $prefix); + if ($linkStart !== false) { + $hrefStart = strrpos(substr($html, 0, $linkStart), 'href="'); + if ($hrefStart === false) { + continue; + } + + $hrefStart += 6; + $hrefEnd = strpos($html, '"', $hrefStart); + if ($hrefEnd === false || $hrefStart >= $hrefEnd) { + continue; + } + + $link = substr($html, $hrefStart, $hrefEnd - $hrefStart); + $link = strtok($link, '#'); // Remove `#title` + $queryStart = strpos($link, '?'); + if ($queryStart === false) { + continue; + } + + $queryString = substr($link, $queryStart + 1); + parse_str(html_entity_decode($queryString), $queryParams); + return $queryParams; + } + } + + return []; + } + + protected function assertLastRequest(callable $probe, string $type, $timeoutMs = 20_000, $waitMs = 500): array + { + $hostname = match ($type) { + 'webhook' => 'request-catcher-webhook', + 'sms' => 'request-catcher-sms', + default => throw new \Exception('Invalid request catcher type.'), + }; + + $this->assertEventually(function () use (&$request, $probe, $hostname) { + $request = json_decode(file_get_contents('http://' . $hostname . ':5000/__last_request__'), true); + $request['data'] = json_decode($request['data'], true); + + call_user_func($probe, $request); + }, $timeoutMs, $waitMs); + + return $request; + } + + protected function assertSamePixels(string $expectedImagePath, string $actualImageBlob): void + { + $expected = new \Imagick($expectedImagePath); + $actual = new \Imagick(); + $actual->readImageBlob($actualImageBlob); + + foreach ([$expected, $actual] as $image) { + $image->setImageFormat('PNG'); + $image->stripImage(); + $image->setOption('png:exclude-chunks', 'date,time,iCCP,sRGB,gAMA,cHRM'); + } + + $this->assertSame($expected->getImageSignature(), $actual->getImageSignature()); + } + + /** + * @deprecated Use assertLastRequest instead. Used only historically in webhook tests + */ protected function getLastRequest(): array { + $hostname = 'request-catcher-webhook'; + sleep(2); - $request = json_decode(file_get_contents('http://request-catcher:5000/__last_request__'), true); + $request = json_decode(file_get_contents('http://' . $hostname . ':5000/__last_request__'), true); $request['data'] = json_decode($request['data'], true); return $request; @@ -123,9 +209,9 @@ abstract class Scope extends TestCase /** * @return array */ - public function getUser(): array + public function getUser(bool $fresh = false): array { - if (isset(self::$user[$this->getProject()['$id']])) { + if (!$fresh && isset(self::$user[$this->getProject()['$id']])) { return self::$user[$this->getProject()['$id']]; } diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 1a77cccb18..8813e2784f 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -39,6 +39,8 @@ trait AccountBase $this->assertEquals($response['body']['labels'], []); $this->assertArrayHasKey('accessedAt', $response['body']); $this->assertNotEmpty($response['body']['accessedAt']); + $this->assertArrayHasKey('targets', $response['body']); + $this->assertEquals($email, $response['body']['targets'][0]['identifier']); /** * Test for FAILURE @@ -159,7 +161,7 @@ trait AccountBase 'email' => 'otpuser@appwrite.io' ]); - $this->assertEquals(201, $response['headers']['status-code'], ); + $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertNotEmpty($response['body']['$createdAt']); $this->assertNotEmpty($response['body']['userId']); @@ -170,6 +172,7 @@ trait AccountBase $userId = $response['body']['userId']; $lastEmail = $this->getLastEmail(); + $this->assertEquals('otpuser@appwrite.io', $lastEmail['to'][0]['address']); $this->assertEquals('OTP for ' . $this->getProject()['name'] . ' Login', $lastEmail['subject']); @@ -178,6 +181,7 @@ trait AccountBase $code = ($matches[0] ?? [])[0] ?? ''; $this->assertNotEmpty($code); + $this->assertStringContainsStringIgnoringCase('Use OTP ' . $code . ' to sign in to '. $this->getProject()['name'] . '. Expires in 15 minutes.', $lastEmail['text']); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/token', array_merge([ 'origin' => 'http://localhost', @@ -207,6 +211,8 @@ trait AccountBase $this->assertEquals($userId, $response['body']['$id']); $this->assertEquals($userId, $response['body']['$id']); $this->assertTrue($response['body']['emailVerification']); + $this->assertArrayHasKey('targets', $response['body']); + $this->assertEquals('otpuser@appwrite.io', $response['body']['targets'][0]['identifier']); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/token', array_merge([ 'origin' => 'http://localhost', diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index 452b725c11..bd3fec8439 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -480,6 +480,29 @@ class AccountCustomClientTest extends Scope $password = $data['password'] ?? ''; $session = $data['session'] ?? ''; + for ($i = 0; $i < 5; $i++) { + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'email' => $email, + 'password' => $password, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + sleep(1); + } + + $response = $this->client->call(Client::METHOD_GET, '/account/sessions', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ])); + + $allSessions = array_map(fn ($sessionDetails) => $sessionDetails['$id'], $response['body']['sessions']); + /** * Test for SUCCESS */ @@ -500,17 +523,140 @@ class AccountCustomClientTest extends Scope $this->assertTrue((new DatetimeValidator())->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); + $currentSessionId = $data['sessionId'] ?? ''; + $response = $this->client->call(Client::METHOD_GET, '/account/sessions', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ])); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + // checking the current session or not + $this->assertEquals($currentSessionId, $response['body']['sessions'][0]['$id']); + $this->assertTrue($response['body']['sessions'][0]['current']); + + // checking for all non active sessions are cleared + foreach ($allSessions as $sessionId) { + if ($currentSessionId === $sessionId) { + $response = $this->client->call(Client::METHOD_GET, '/account/sessions/current', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ])); + + $this->assertEquals(200, $response['headers']['status-code']); + } else { + $response = $this->client->call(Client::METHOD_GET, '/account/sessions/'.$sessionId, array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ])); + + $this->assertEquals(404, $response['headers']['status-code']); + } + } + + $newPassword = 'new-password'; + // updating the invalidateSession to false to check sessions are not invalidated + $this->updateProjectinvalidateSessionsProperty(false); + for ($i = 0; $i < 5; $i++) { + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'email' => $email, + 'password' => $newPassword, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + sleep(1); + } + + $response = $this->client->call(Client::METHOD_GET, '/account/sessions', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ])); + + $allSessions = array_map(fn ($sessionDetails) => $sessionDetails['$id'], $response['body']['sessions']); + + $response = $this->client->call(Client::METHOD_PATCH, '/account/password', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ]), [ + 'password' => $newPassword, + 'oldPassword' => $newPassword, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + foreach ($allSessions as $sessionId) { + $response = $this->client->call(Client::METHOD_GET, '/account/sessions/'.$sessionId, headers: array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ])); + + $this->assertEquals(200, $response['headers']['status-code']); + } + + // setting invalidateSession to true to check the sessions are cleared or not + $this->updateProjectinvalidateSessionsProperty(true); + $response = $this->client->call(Client::METHOD_PATCH, '/account/password', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ]), [ + 'password' => $newPassword, + 'oldPassword' => $newPassword, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_GET, '/account/sessions', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ])); + + $allSessions = array_map(fn ($sessionDetails) => $sessionDetails['$id'], $response['body']['sessions']); + + foreach ($allSessions as $sessionId) { + if ($currentSessionId !== $sessionId) { + $response = $this->client->call(Client::METHOD_GET, '/account/sessions/'.$sessionId, array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ])); + + $this->assertEquals(404, $response['headers']['status-code']); + } + } + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ]), [ 'email' => $email, - 'password' => 'new-password', + 'password' => $newPassword, ]); $this->assertEquals(201, $response['headers']['status-code']); + /** * Test for FAILURE */ @@ -779,18 +925,20 @@ class AccountCustomClientTest extends Scope $this->assertEquals($email, $lastEmail['to'][0]['address']); $this->assertEquals($name, $lastEmail['to'][0]['name']); $this->assertEquals('Account Verification', $lastEmail['subject']); + $this->assertStringContainsStringIgnoringCase('Verify your email to activate your ' . $this->getProject()['name'] . ' account.', $lastEmail['text']); - $verification = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); - $expireTime = strpos($lastEmail['text'], 'expire=' . urlencode(DateTime::format(new \DateTime($response['body']['expire']))), 0); - $this->assertNotFalse($expireTime); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $verification = $tokens['secret']; + $expectedExpire = DateTime::formatTz($response['body']['expire']); + $this->assertEquals($expectedExpire, $tokens['expire']); - $secretTest = strpos($lastEmail['text'], 'secret=' . $response['body']['secret'], 0); + // Secret check + $this->assertArrayHasKey('secret', $tokens); + $this->assertNotEmpty($tokens['secret']); - $this->assertNotFalse($secretTest); - - $userIDTest = strpos($lastEmail['text'], 'userId=' . $response['body']['userId'], 0); - - $this->assertNotFalse($userIDTest); + // User ID check + $this->assertArrayHasKey('userId', $tokens); + $this->assertNotEmpty($tokens['userId']); /** * Test for FAILURE @@ -1081,20 +1229,28 @@ class AccountCustomClientTest extends Scope $this->assertEquals($email, $lastEmail['to'][0]['address']); $this->assertEquals($name, $lastEmail['to'][0]['name']); $this->assertEquals('Password Reset', $lastEmail['subject']); + $this->assertStringContainsStringIgnoringCase('Reset your ' . $this->getProject()['name'] . ' password using the link.', $lastEmail['text']); - $recovery = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); - $expireTime = strpos($lastEmail['text'], 'expire=' . urlencode(DateTime::format(new \DateTime($response['body']['expire']))), 0); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); - $this->assertNotFalse($expireTime); + // Secret check + $this->assertArrayHasKey('secret', $tokens); + $this->assertNotEmpty($tokens['secret']); + $this->assertNotFalse($response['body']['secret']); - $secretTest = strpos($lastEmail['text'], 'secret=' . $response['body']['secret'], 0); + // User ID check + $this->assertArrayHasKey('userId', $tokens); + $this->assertNotEmpty($tokens['userId']); + $this->assertNotFalse($response['body']['userId']); - $this->assertNotFalse($secretTest); - - $userIDTest = strpos($lastEmail['text'], 'userId=' . $response['body']['userId'], 0); - - $this->assertNotFalse($userIDTest); + // Expire check + $this->assertArrayHasKey('expire', $tokens); + $this->assertNotEmpty($tokens['expire']); + $this->assertEquals( + DateTime::formatTz($response['body']['expire']), + $tokens['expire'] + ); /** * Test for FAILURE @@ -1132,7 +1288,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(404, $response['headers']['status-code']); - $data['recovery'] = $recovery; + $data['recovery'] = $tokens['secret']; return $data; } @@ -1279,6 +1435,7 @@ class AccountCustomClientTest extends Scope $this->assertNotEmpty($response['body']['expire']); $this->assertEmpty($response['body']['secret']); $this->assertEmpty($response['body']['phrase']); + $this->assertStringContainsStringIgnoringCase('New login detected on '. $this->getProject()['name'], $lastEmail['text']); $userId = $response['body']['userId']; @@ -1287,7 +1444,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals('otpuser2@appwrite.io', $lastEmail['to'][0]['address']); $this->assertEquals('OTP for ' . $this->getProject()['name'] . ' Login', $lastEmail['subject']); - // FInd 6 concurrent digits in email text - OTP + // Find 6 concurrent digits in email text - OTP preg_match_all("/\b\d{6}\b/", $lastEmail['text'], $matches); $code = ($matches[0] ?? [])[0] ?? ''; @@ -2034,7 +2191,6 @@ class AccountCustomClientTest extends Scope $this->assertEquals($response['body']['users'][0]['email'], $email); } - #[Retry(count: 2)] public function testCreatePhone(): array { $number = '+123456789'; @@ -2058,17 +2214,14 @@ class AccountCustomClientTest extends Scope $userId = $response['body']['userId']; - \sleep(7); - - $smsRequest = $this->getLastRequest(); - - $this->assertEquals('http://request-catcher:5000/mock-sms', $smsRequest['url']); - $this->assertEquals('Appwrite Mock Message Sender', $smsRequest['headers']['User-Agent']); - $this->assertEquals('username', $smsRequest['headers']['X-Username']); - $this->assertEquals('password', $smsRequest['headers']['X-Key']); - $this->assertEquals('POST', $smsRequest['method']); - $this->assertEquals('+123456789', $smsRequest['data']['from']); - $this->assertEquals($number, $smsRequest['data']['to']); + $smsRequest = $this->assertLastRequest(function (array $request) use ($number) { + $this->assertEquals('Appwrite Mock Message Sender', $request['headers']['User-Agent']); + $this->assertEquals('username', $request['headers']['X-Username']); + $this->assertEquals('password', $request['headers']['X-Key']); + $this->assertEquals('POST', $request['method']); + $this->assertEquals('+123456789', $request['data']['from']); + $this->assertEquals($number, $request['data']['to']); + }, Scope::REQUEST_TYPE_SMS); $data['token'] = $smsRequest['data']['message']; $data['id'] = $userId; @@ -2396,7 +2549,6 @@ class AccountCustomClientTest extends Scope /** * @depends testUpdatePhone */ - #[Retry(count: 3)] public function testPhoneVerification(array $data): array { $session = $data['session'] ?? ''; @@ -2413,13 +2565,21 @@ class AccountCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); + $this->assertNotEmpty($response['body']['$createdAt']); $this->assertEmpty($response['body']['secret']); $this->assertTrue((new DatetimeValidator())->isValid($response['body']['expire'])); - $smsRequest = $this->getLastRequest(); + $tokenCreatedAt = $response['body']['$createdAt']; - $message = $smsRequest['data']['message']; - $token = substr($message, 0, 6); + $smsRequest = $this->assertLastRequest(function ($request) use ($tokenCreatedAt) { + $this->assertArrayHasKey('data', $request); + $this->assertArrayHasKey('time', $request); + $this->assertArrayHasKey('message', $request['data'], "Last request missing message: " . \json_encode($request)); + + // Ensure we are not using token from last sms login + $tokenRecievedAt = $request['time']; + $this->assertGreaterThan($tokenCreatedAt, $tokenRecievedAt); + }, Scope::REQUEST_TYPE_SMS); /** * Test for FAILURE @@ -2535,6 +2695,7 @@ class AccountCustomClientTest extends Scope $lastEmail = $this->getLastEmail(); $this->assertEquals($email, $lastEmail['to'][0]['address']); $this->assertEquals($this->getProject()['name'] . ' Login', $lastEmail['subject']); + $this->assertStringContainsStringIgnoringCase('Sign in to '. $this->getProject()['name'] . ' with your secure link. Expires in 1 hour.', $lastEmail['text']); $this->assertStringNotContainsStringIgnoringCase('security phrase', $lastEmail['text']); $token = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 64); diff --git a/tests/e2e/Services/Avatars/AvatarsBase.php b/tests/e2e/Services/Avatars/AvatarsBase.php index ba66920ed6..83f70b8978 100644 --- a/tests/e2e/Services/Avatars/AvatarsBase.php +++ b/tests/e2e/Services/Avatars/AvatarsBase.php @@ -284,7 +284,17 @@ trait AvatarsBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals('image/x-icon', $response['headers']['content-type']); + $this->assertEquals('image/svg+xml', $response['headers']['content-type']); + $this->assertNotEmpty($response['body']); + + $response = $this->client->call(Client::METHOD_GET, '/avatars/favicon', [ + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'url' => 'https://appwrite.io/', + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('image/svg+xml', $response['headers']['content-type']); $this->assertNotEmpty($response['body']); /** @@ -337,7 +347,7 @@ trait AvatarsBase $this->assertEquals(400, $image->getImageWidth()); $this->assertEquals(400, $image->getImageHeight()); $this->assertEquals('PNG', $image->getImageFormat()); - $this->assertEquals(strlen(\file_get_contents(__DIR__ . '/../../../resources/qr/qr-default.png')), strlen($response['body'])); + $this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-default.png', $response['body']); $response = $this->client->call(Client::METHOD_GET, '/avatars/qr', [ 'x-appwrite-project' => $this->getProject()['$id'], @@ -355,7 +365,7 @@ trait AvatarsBase $this->assertEquals(200, $image->getImageWidth()); $this->assertEquals(200, $image->getImageHeight()); $this->assertEquals('PNG', $image->getImageFormat()); - $this->assertEquals(strlen(\file_get_contents(__DIR__ . '/../../../resources/qr/qr-size-200.png')), strlen($response['body'])); + $this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-size-200.png', $response['body']); $response = $this->client->call(Client::METHOD_GET, '/avatars/qr', [ 'x-appwrite-project' => $this->getProject()['$id'], @@ -374,7 +384,7 @@ trait AvatarsBase $this->assertEquals(200, $image->getImageWidth()); $this->assertEquals(200, $image->getImageHeight()); $this->assertEquals('PNG', $image->getImageFormat()); - $this->assertEquals(strlen(\file_get_contents(__DIR__ . '/../../../resources/qr/qr-size-200-margin-10.png')), strlen($response['body'])); + $this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-size-200-margin-10.png', $response['body']); $response = $this->client->call(Client::METHOD_GET, '/avatars/qr', [ 'x-appwrite-project' => $this->getProject()['$id'], @@ -390,7 +400,7 @@ trait AvatarsBase $this->assertEquals(200, $image->getImageWidth()); $this->assertEquals(200, $image->getImageHeight()); $this->assertEquals('PNG', $image->getImageFormat()); - $this->assertEquals(strlen(\file_get_contents(__DIR__ . '/../../../resources/qr/qr-size-200-margin-10.png')), strlen($response['body'])); + $this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-size-200-margin-10.png', $response['body']); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals('attachment; filename="qr.png"', $response['headers']['content-disposition']); diff --git a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php index 6059cb2000..340cabc8c0 100644 --- a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php +++ b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php @@ -24,10 +24,11 @@ class ConsoleConsoleClientTest extends Scope ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(13, $response['body']); + $this->assertCount(14, $response['body']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_CNAME']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_A']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_AAAA']); + $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_CAA']); $this->assertIsInt($response['body']['_APP_STORAGE_LIMIT']); $this->assertIsInt($response['body']['_APP_COMPUTE_SIZE_LIMIT']); $this->assertIsBool($response['body']['_APP_DOMAIN_ENABLED']); diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php similarity index 65% rename from tests/e2e/Services/Databases/DatabasesBase.php rename to tests/e2e/Services/Databases/Legacy/DatabasesBase.php index 9c7e19c76c..a432bc0acd 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -1,6 +1,6 @@ <?php -namespace Tests\E2E\Services\Databases; +namespace Tests\E2E\Services\Databases\Legacy; use Appwrite\Extend\Exception; use Tests\E2E\Client; @@ -32,6 +32,7 @@ trait DatabasesBase $this->assertNotEmpty($database['body']['$id']); $this->assertEquals(201, $database['headers']['status-code']); $this->assertEquals('Test Database', $database['body']['name']); + $this->assertEquals('legacy', $database['body']['type']); return ['databaseId' => $database['body']['$id']]; } @@ -87,7 +88,7 @@ trait DatabasesBase /** * @depends testCreateCollection */ - public function testConsoleProject(array $data) + public function testConsoleProject(array $data): void { if ($this->getSide() === 'server') { // Server side can't get past the invalid key check anyway @@ -1358,8 +1359,6 @@ trait DatabasesBase ]); $this->assertEquals(202, $twoLevelsArray['headers']['status-code']); - $this->assertEquals('DESC', $twoLevelsArray['body']['orders'][0]); - $this->assertEquals(null, $twoLevelsArray['body']['orders'][1]); // Overwrite by API (array) $unknown = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/indexes', array_merge([ 'content-type' => 'application/json', @@ -1384,6 +1383,7 @@ trait DatabasesBase 'attributes' => ['integers'], // array attribute 'orders' => ['DESC'], // Check order is removed in API ]); + $this->assertEquals(202, $index1['headers']['status-code']); $index2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/indexes', array_merge([ @@ -1395,6 +1395,7 @@ trait DatabasesBase 'type' => 'key', 'attributes' => ['integers'], // array attribute ]); + $this->assertEquals(202, $index2['headers']['status-code']); /** @@ -1414,17 +1415,27 @@ trait DatabasesBase $this->assertEquals($releaseYearIndex['body']['key'], $movies['body']['indexes'][1]['key']); $this->assertEquals($releaseWithDate1['body']['key'], $movies['body']['indexes'][2]['key']); $this->assertEquals($releaseWithDate2['body']['key'], $movies['body']['indexes'][3]['key']); - foreach ($movies['body']['indexes'] as $index) { - $this->assertEquals('available', $index['status']); - } + + $this->assertEventually(function () use ($databaseId, $data) { + $movies = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $data['moviesId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + foreach ($movies['body']['indexes'] as $index) { + $this->assertEquals('available', $index['status']); + } + + return true; + }, 60000, 500); return $data; } - /** - * @depends testCreateAttributes - */ + * @depends testCreateAttributes + */ public function testGetIndexByKeyWithLengths(array $data): void { $databaseId = $data['databaseId']; @@ -1515,8 +1526,8 @@ trait DatabasesBase $this->assertEquals(400, $create['headers']['status-code']); } /** - * @depends testCreateIndexes - */ + * @depends testCreateIndexes + */ public function testListIndexes(array $data): void { $databaseId = $data['databaseId']; @@ -1645,6 +1656,8 @@ trait DatabasesBase $this->assertEquals($document1['body']['actors'][0], 'Chris Evans'); $this->assertEquals($document1['body']['actors'][1], 'Samuel Jackson'); $this->assertEquals($document1['body']['birthDay'], '1975-06-12T12:12:55.000+00:00'); + $this->assertTrue(array_key_exists('$sequence', $document1['body'])); + $this->assertIsInt($document1['body']['$sequence']); $this->assertEquals(201, $document2['headers']['status-code']); $this->assertEquals($data['moviesId'], $document2['body']['$collectionId']); @@ -1662,6 +1675,7 @@ trait DatabasesBase $this->assertEquals($document2['body']['birthDay'], null); $this->assertEquals($document2['body']['integers'][0], 50); $this->assertEquals($document2['body']['integers'][1], 60); + $this->assertTrue(array_key_exists('$sequence', $document2['body'])); $this->assertEquals(201, $document3['headers']['status-code']); $this->assertEquals($data['moviesId'], $document3['body']['$collectionId']); @@ -1676,12 +1690,14 @@ trait DatabasesBase $this->assertEquals($document3['body']['actors'][0], 'Tom Holland'); $this->assertEquals($document3['body']['actors'][1], 'Zendaya Maree Stoermer'); $this->assertEquals($document3['body']['birthDay'], '1975-06-12T18:12:55.000+00:00'); // UTC for NY + $this->assertTrue(array_key_exists('$sequence', $document3['body'])); $this->assertEquals(400, $document4['headers']['status-code']); return $data; } + /** * @depends testCreateIndexes */ @@ -1689,6 +1705,7 @@ trait DatabasesBase { $databaseId = $data['databaseId']; $documentId = ID::unique(); + $document = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -1706,6 +1723,7 @@ trait DatabasesBase $this->assertEquals(200, $document['headers']['status-code']); $this->assertCount(3, $document['body']['$permissions']); + $document = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -1713,6 +1731,35 @@ trait DatabasesBase $this->assertEquals('Thor: Ragnarok', $document['body']['title']); + /** + * Resubmit same document, nothing to update + */ + $document = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2000, + 'integers' => [], + 'birthDay' => null, + 'duration' => null, + 'starringActors' => [], + 'actors' => [], + 'tagline' => '', + 'description' => '', + ], + 'permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + ]); + + $this->assertEquals(200, $document['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $document['body']['title']); + $this->assertCount(3, $document['body']['$permissions']); + $document = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -1982,6 +2029,239 @@ trait DatabasesBase ], ]); $this->assertEquals(2, $documents['body']['total']); + + // test without passing permissions + $document = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2000 + ] + ]); + + $this->assertEquals(200, $document['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $document['body']['title']); + + $document = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $document['headers']['status-code']); + + $deleteResponse = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $deleteResponse['headers']['status-code']); + + if ($this->getSide() === 'client') { + // Skipped on server side: Creating a document with no permissions results in an empty permissions array, whereas on client side it assigns permissions to the current user + + // test without passing permissions + $document = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2000 + ] + ]); + + $this->assertEquals(200, $document['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $document['body']['title']); + $this->assertCount(3, $document['body']['$permissions']); + $permissionsCreated = $document['body']['$permissions']; + // checking the default created permission + $defaultPermission = [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])) + ]; + // ignoring the order of the permission and checking the permissions + $this->assertEqualsCanonicalizing($defaultPermission, $permissionsCreated); + + $document = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(200, $document['headers']['status-code']); + + // updating the created doc + $document = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2002 + ] + ]); + $this->assertEquals(200, $document['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $document['body']['title']); + $this->assertEquals(2002, $document['body']['releaseYear']); + $this->assertCount(3, $document['body']['$permissions']); + $this->assertEquals($permissionsCreated, $document['body']['$permissions']); + + // removing the delete permission + $document = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2002 + ], + 'permissions' => [ + Permission::update(Role::user($this->getUser()['$id'])) + ] + ]); + $this->assertEquals(200, $document['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $document['body']['title']); + $this->assertEquals(2002, $document['body']['releaseYear']); + $this->assertCount(1, $document['body']['$permissions']); + + $deleteResponse = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(401, $deleteResponse['headers']['status-code']); + + // giving the delete permission + $document = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2002 + ], + 'permissions' => [ + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])) + ] + ]); + $this->assertEquals(200, $document['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $document['body']['title']); + $this->assertEquals(2002, $document['body']['releaseYear']); + $this->assertCount(2, $document['body']['$permissions']); + + $deleteResponse = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(204, $deleteResponse['headers']['status-code']); + + // upsertion for the related document without passing permissions + // data should get added + $newPersonId = ID::unique(); + $personNoPerm = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $person['body']['$id'] . '/documents/' . $newPersonId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'library' => [ + '$id' => 'library3', + 'libraryName' => 'Library 3', + ], + ], + ]); + + $this->assertEquals('Library 3', $personNoPerm['body']['library']['libraryName']); + $this->assertCount(3, $personNoPerm['body']['library']['$permissions']); + $this->assertCount(3, $personNoPerm['body']['$permissions']); + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $person['body']['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['fullName', 'library.*'])->toString() + ], + ]); + $this->assertGreaterThanOrEqual(1, $documents['body']['total']); + $documentsDetails = $documents['body']['documents']; + foreach ($documentsDetails as $doc) { + $this->assertCount(3, $doc['$permissions']); + } + $found = false; + foreach ($documents['body']['documents'] as $doc) { + if (isset($doc['library']['libraryName']) && $doc['library']['libraryName'] === 'Library 3') { + $found = true; + break; + } + } + $this->assertTrue($found, 'Library 3 should be present in the upserted documents.'); + + // Fetch the related library and assert on its permissions (should be default/inherited) + $library3 = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $library['body']['$id'] . '/documents/library3', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $library3['headers']['status-code']); + $this->assertEquals('Library 3', $library3['body']['libraryName']); + $this->assertArrayHasKey('$permissions', $library3['body']); + $this->assertCount(3, $library3['body']['$permissions']); + $this->assertNotEmpty($library3['body']['$permissions']); + + // Readonly attributes are ignored + $personNoPerm = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $person['body']['$id'] . '/documents/' . $newPersonId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + '$id' => 'some-other-id', + '$collectionId' => 'some-other-collection', + '$databaseId' => 'some-other-database', + '$createdAt' => '2024-01-01T00:00:00Z', + '$updatedAt' => '2024-01-01T00:00:00Z', + 'library' => [ + '$id' => 'library3', + 'libraryName' => 'Library 3', + '$createdAt' => '2024-01-01T00:00:00Z', + '$updatedAt' => '2024-01-01T00:00:00Z', + ], + ], + ]); + + $update = $personNoPerm; + $update['body']['$id'] = 'random'; + $update['body']['$sequence'] = 123; + $update['body']['$databaseId'] = 'random'; + $update['body']['$collectionId'] = 'random'; + $update['body']['$createdAt'] = '2024-01-01T00:00:00.000+00:00'; + $update['body']['$updatedAt'] = '2024-01-01T00:00:00.000+00:00'; + + $upserted = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $person['body']['$id'] . '/documents/' . $newPersonId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => $update['body'] + ]); + + $this->assertEquals(200, $upserted['headers']['status-code']); + $this->assertEquals($personNoPerm['body']['$id'], $upserted['body']['$id']); + $this->assertEquals($personNoPerm['body']['$collectionId'], $upserted['body']['$collectionId']); + $this->assertEquals($personNoPerm['body']['$databaseId'], $upserted['body']['$databaseId']); + $this->assertEquals($personNoPerm['body']['$sequence'], $upserted['body']['$sequence']); + + if ($this->getSide() === 'client') { + $this->assertEquals($personNoPerm['body']['$createdAt'], $upserted['body']['$createdAt']); + $this->assertNotEquals('2024-01-01T00:00:00.000+00:00', $upserted['body']['$updatedAt']); + } else { + $this->assertEquals('2024-01-01T00:00:00.000+00:00', $upserted['body']['$createdAt']); + $this->assertEquals('2024-01-01T00:00:00.000+00:00', $upserted['body']['$updatedAt']); + } + } } /** @@ -2003,9 +2283,9 @@ trait DatabasesBase $this->assertEquals(1944, $documents['body']['documents'][0]['releaseYear']); $this->assertEquals(2017, $documents['body']['documents'][1]['releaseYear']); $this->assertEquals(2019, $documents['body']['documents'][2]['releaseYear']); - $this->assertFalse(array_key_exists('$sequence', $documents['body']['documents'][0])); - $this->assertFalse(array_key_exists('$sequence', $documents['body']['documents'][1])); - $this->assertFalse(array_key_exists('$sequence', $documents['body']['documents'][2])); + $this->assertTrue(array_key_exists('$sequence', $documents['body']['documents'][0])); + $this->assertTrue(array_key_exists('$sequence', $documents['body']['documents'][1])); + $this->assertTrue(array_key_exists('$sequence', $documents['body']['documents'][2])); $this->assertCount(3, $documents['body']['documents']); foreach ($documents['body']['documents'] as $document) { @@ -2076,7 +2356,6 @@ trait DatabasesBase return ['documents' => $documents['body']['documents'], 'databaseId' => $databaseId]; } - /** * @depends testListDocuments */ @@ -2098,7 +2377,7 @@ trait DatabasesBase $this->assertEquals($response['body']['releaseYear'], $document['releaseYear']); $this->assertEquals($response['body']['$permissions'], $document['$permissions']); $this->assertEquals($response['body']['birthDay'], $document['birthDay']); - $this->assertFalse(array_key_exists('$sequence', $response['body'])); + $this->assertTrue(array_key_exists('$sequence', $response['body'])); $this->assertFalse(array_key_exists('$tenant', $response['body'])); } } @@ -2124,6 +2403,22 @@ trait DatabasesBase $this->assertEquals($document['title'], $response['body']['title']); $this->assertEquals($document['releaseYear'], $response['body']['releaseYear']); $this->assertArrayNotHasKey('birthDay', $response['body']); + $sequence = $response['body']['$sequence']; + + // Query by sequence + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $document['$collectionId'] . '/documents/' . $document['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('$sequence', [$sequence]) + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals($document['title'], $response['body']['title']); + $this->assertEquals($document['releaseYear'], $response['body']['releaseYear']); + $this->assertTrue(array_key_exists('$sequence', $response['body'])); } /** @@ -2681,7 +2976,6 @@ trait DatabasesBase 'releaseYear' => 2017, 'birthDay' => '1976-06-12 14:12:55', 'actors' => [], - '$createdAt' => 5 // Should be ignored ], 'permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), @@ -2756,6 +3050,37 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); + // Test readonly attributes are ignored + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-timestamp' => DateTime::formatTz(DateTime::now()), + ], $this->getHeaders()), [ + 'data' => [ + '$id' => 'newId', + '$sequence' => 9999, + '$collectionId' => 'newCollectionId', + '$databaseId' => 'newDatabaseId', + '$createdAt' => '2024-01-01T00:00:00.000+00:00', + '$updatedAt' => '2024-01-01T00:00:00.000+00:00', + 'title' => 'Thor: Ragnarok', + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals($id, $response['body']['$id']); + $this->assertEquals($data['moviesId'], $response['body']['$collectionId']); + $this->assertEquals($databaseId, $response['body']['$databaseId']); + $this->assertNotEquals(9999, $response['body']['$sequence']); + + if ($this->getSide() === 'client') { + $this->assertNotEquals('2024-01-01T00:00:00.000+00:00', $response['body']['$createdAt']); + $this->assertNotEquals('2024-01-01T00:00:00.000+00:00', $response['body']['$updatedAt']); + } else { + $this->assertEquals('2024-01-01T00:00:00.000+00:00', $response['body']['$createdAt']); + $this->assertEquals('2024-01-01T00:00:00.000+00:00', $response['body']['$updatedAt']); + } + return []; } @@ -2811,7 +3136,7 @@ trait DatabasesBase return $data; } - public function testInvalidDocumentStructure() + public function testInvalidDocumentStructure(): void { $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ 'content-type' => 'application/json', @@ -3674,7 +3999,7 @@ trait DatabasesBase $this->assertCount(1, $documentsUser2['body']['documents']); } - public function testEnforceCollectionPermissions() + public function testEnforceCollectionPermissions(): void { $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ 'content-type' => 'application/json', @@ -3967,7 +4292,7 @@ trait DatabasesBase /** * @depends testUniqueIndexDuplicate */ - public function testPersistantCreatedAt(array $data): array + public function testPersistentCreatedAt(array $data): array { $headers = $this->getSide() === 'client' ? array_merge([ 'content-type' => 'application/json', @@ -4011,17 +4336,20 @@ trait DatabasesBase $document = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, $headers, [ 'data' => [ 'title' => 'Again Updated Date Test', - '$createdAt' => '2022-08-01 13:09:23.040', // $createdAt is not updatable - '$updatedAt' => '2022-08-01 13:09:23.050' // system will update it not api + '$createdAt' => '2022-08-01 13:09:23.040', + '$updatedAt' => '2022-08-01 13:09:23.050' ] ]); + if ($this->getSide() === 'client') { + $this->assertEquals($document['body']['title'], 'Again Updated Date Test'); + $this->assertNotEquals($document['body']['$createdAt'], DateTime::formatTz('2022-08-01 13:09:23.040')); + $this->assertNotEquals($document['body']['$updatedAt'], DateTime::formatTz('2022-08-01 13:09:23.050')); + } else { + $this->assertEquals($document['body']['title'], 'Again Updated Date Test'); + $this->assertEquals($document['body']['$createdAt'], DateTime::formatTz('2022-08-01 13:09:23.040')); + $this->assertEquals($document['body']['$updatedAt'], DateTime::formatTz('2022-08-01 13:09:23.050')); - $this->assertEquals($document['body']['title'], 'Again Updated Date Test'); - $this->assertEquals($document['body']['$createdAt'], $createdAt); - $this->assertNotEquals($document['body']['$createdAt'], '2022-08-01 13:09:23.040'); - $this->assertNotEquals($document['body']['$updatedAt'], $updatedAt); - $this->assertNotEquals($document['body']['$updatedAt'], $updatedAtSecond); - $this->assertNotEquals($document['body']['$updatedAt'], '2022-08-01 13:09:23.050'); + } return $data; } @@ -4361,8 +4689,8 @@ trait DatabasesBase $this->assertArrayNotHasKey('$collection', $person1['body']); $this->assertArrayNotHasKey('$collection', $person1['body']['library']); - $this->assertArrayNotHasKey('$sequence', $person1['body']); - $this->assertArrayNotHasKey('$sequence', $person1['body']['library']); + $this->assertArrayHasKey('$sequence', $person1['body']); + $this->assertArrayHasKey('$sequence', $person1['body']['library']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $person['body']['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -4535,7 +4863,11 @@ trait DatabasesBase $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $personCollection . '/documents/' . $person2['body']['$id'], array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['*', 'libraries.*'])->toString() + ] + ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertArrayNotHasKey('$collection', $response['body']); @@ -4545,7 +4877,11 @@ trait DatabasesBase $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $libraryCollection . '/documents/library11', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['person_one_to_many.$id'])->toString() + ] + ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertArrayHasKey('person_one_to_many', $response['body']); @@ -4695,7 +5031,11 @@ trait DatabasesBase $album = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $albums['body']['$id'] . '/documents/album1', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['*', 'artist.name', 'artist.$permissions'])->toString() + ] + ]); $this->assertEquals(200, $album['headers']['status-code']); $this->assertEquals('album1', $album['body']['$id']); @@ -4707,7 +5047,11 @@ trait DatabasesBase $artist = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $artists['body']['$id'] . '/documents/' . $album['body']['artist']['$id'], array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['*', 'albums.$id', 'albums.name', 'albums.$permissions'])->toString() + ] + ]); $this->assertEquals(200, $artist['headers']['status-code']); $this->assertEquals('Artist 1', $artist['body']['name']); @@ -4848,7 +5192,11 @@ trait DatabasesBase $sport = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $sports['body']['$id'] . '/documents/sport1', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['*', 'players.name', 'players.$permissions'])->toString() + ] + ]); $this->assertEquals(200, $sport['headers']['status-code']); $this->assertEquals('sport1', $sport['body']['$id']); @@ -4862,7 +5210,11 @@ trait DatabasesBase $player = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $players['body']['$id'] . '/documents/' . $sport['body']['players'][0]['$id'], array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['*', 'sports.$id', 'sports.name', 'sports.$permissions'])->toString() + ] + ]); $this->assertEquals(200, $player['headers']['status-code']); $this->assertEquals('Player 1', $player['body']['name']); @@ -4890,6 +5242,7 @@ trait DatabasesBase ], $this->getHeaders()), [ 'queries' => [ Query::isNotNull('$id')->toString(), + Query::select(['*', 'libraries.*'])->toString(), Query::startsWith('fullName', 'Stevie')->toString(), Query::endsWith('fullName', 'Wonder')->toString(), Query::between('$createdAt', '1975-12-06', '2050-12-01')->toString(), @@ -4917,8 +5270,8 @@ trait DatabasesBase $this->assertEquals(2, count($response['body']['documents'])); $this->assertEquals(null, $response['body']['documents'][0]['fullName']); $this->assertArrayNotHasKey("libraries", $response['body']['documents'][0]); - $this->assertArrayNotHasKey('$databaseId', $response['body']['documents'][0]); - $this->assertArrayNotHasKey('$collectionId', $response['body']['documents'][0]); + $this->assertArrayHasKey('$databaseId', $response['body']['documents'][0]); + $this->assertArrayHasKey('$collectionId', $response['body']['documents'][0]); } /** @@ -4938,8 +5291,8 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertArrayNotHasKey('libraries', $response['body']['documents'][0]); - $this->assertArrayNotHasKey('$databaseId', $response['body']['documents'][0]); - $this->assertArrayNotHasKey('$collectionId', $response['body']['documents'][0]); + $this->assertArrayHasKey('$databaseId', $response['body']['documents'][0]); + $this->assertArrayHasKey('$collectionId', $response['body']['documents'][0]); $response = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['personCollection'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -4952,8 +5305,8 @@ trait DatabasesBase $document = $response['body']['documents'][0]; $this->assertEquals(200, $response['headers']['status-code']); $this->assertArrayHasKey('libraries', $document); - $this->assertArrayNotHasKey('$databaseId', $document); - $this->assertArrayNotHasKey('$collectionId', $document); + $this->assertArrayHasKey('$databaseId', $document); + $this->assertArrayHasKey('$collectionId', $document); $response = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['personCollection'] . '/documents/' . $document['$id'], array_merge([ 'content-type' => 'application/json', @@ -5251,7 +5604,7 @@ trait DatabasesBase ], $this->getHeaders()), [ 'documentId' => ID::unique(), 'data' => [ - 'longtext' => file_get_contents(__DIR__ . '/../../../resources/longtext.txt'), + 'longtext' => file_get_contents(__DIR__ . '../../../../../resources/longtext.txt'), ], 'permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), @@ -5279,4 +5632,2435 @@ trait DatabasesBase 'x-appwrite-key' => $this->getProject()['apiKey'] ])); } + + /** + * @throws \Exception + */ + public function testIncrementAttribute(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'CounterDatabase' + ]); + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'CounterCollection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + $collectionId = $collection['body']['$id']; + + // Add integer attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'count', + 'required' => true, + ]); + + \sleep(3); + + // Create document with initial count = 5 + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'count' => 5 + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + ], + ]); + $this->assertEquals(201, $doc['headers']['status-code']); + + $docId = $doc['body']['$id']; + + // Increment by default 1 + $inc = $this->client->call(Client::METHOD_PATCH, "/databases/$databaseId/collections/$collectionId/documents/$docId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + $this->assertEquals(200, $inc['headers']['status-code']); + $this->assertEquals(6, $inc['body']['count']); + + // Verify count = 6 + $get = $this->client->call(Client::METHOD_GET, "/databases/$databaseId/collections/$collectionId/documents/$docId", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(6, $get['body']['count']); + + // Increment by custom value 4 + $inc2 = $this->client->call(Client::METHOD_PATCH, "/databases/$databaseId/collections/$collectionId/documents/$docId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 4 + ]); + $this->assertEquals(200, $inc2['headers']['status-code']); + $this->assertEquals(10, $inc2['body']['count']); + + $get2 = $this->client->call(Client::METHOD_GET, "/databases/$databaseId/collections/$collectionId/documents/$docId", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(10, $get2['body']['count']); + + // Test max limit exceeded + $err = $this->client->call(Client::METHOD_PATCH, "/databases/$databaseId/collections/$collectionId/documents/$docId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), ['max' => 8]); + $this->assertEquals(400, $err['headers']['status-code']); + + // Test attribute not found + $notFound = $this->client->call(Client::METHOD_PATCH, "/databases/$databaseId/collections/$collectionId/documents/$docId/unknown/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + $this->assertEquals(404, $notFound['headers']['status-code']); + + // Test increment with value 0 + $inc3 = $this->client->call(Client::METHOD_PATCH, "/databases/$databaseId/collections/$collectionId/documents/$docId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 0 + ]); + $this->assertEquals(400, $inc3['headers']['status-code']); + } + + public function testDecrementAttribute(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'CounterDatabase' + ]); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'CounterCollection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Add integer attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'count', + 'required' => true, + ]); + + \sleep(2); + + // Create document with initial count = 10 + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => ['count' => 10], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $documentId = $doc['body']['$id']; + + // Decrement by default 1 (count = 10 -> 9) + $dec = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + $this->assertEquals(200, $dec['headers']['status-code']); + $this->assertEquals(9, $dec['body']['count']); + + $get = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(9, $get['body']['count']); + + // Decrement by custom value 3 (count 9 -> 6) + $dec2 = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 3 + ]); + $this->assertEquals(200, $dec2['headers']['status-code']); + $this->assertEquals(6, $dec2['body']['count']); + + $get2 = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(6, $get2['body']['count']); + + // Test min limit exceeded + $err = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), ['min' => 7]); + $this->assertEquals(400, $err['headers']['status-code']); + + // Test min limit exceeded with custom value + $err = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 3, + 'min' => 5, + ]); + $this->assertEquals(400, $err['headers']['status-code']); + + // Test min limit 0 + $err = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 10, + 'min' => 0, + ]); + $this->assertEquals(400, $err['headers']['status-code']); + + // Test type error on non-numeric attribute + $typeErr = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), ['value' => 'not-a-number']); + $this->assertEquals(400, $typeErr['headers']['status-code']); + + // Test decrement with value 0 + $inc3 = $this->client->call(Client::METHOD_PATCH, "/databases/$databaseId/collections/$collectionId/documents/$documentId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 0 + ]); + $this->assertEquals(400, $inc3['headers']['status-code']); + } + + public function testSpatialPointAttributes(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Point Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial and non-spatial attributes + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Spatial Point Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create string attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + // Create point attribute - handle both 201 (created) and 200 (already exists) + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(2); + + // Test 1: Create document with point attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Test Location', + 'location' => [40.7128, -74.0060] // New York coordinates + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([40.7128, -74.0060], $response['body']['location']); + $documentId = $response['body']['$id']; + + // Test 2: Read document with point attribute + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7128, -74.0060], $response['body']['location']); + + // Test 3: Update document with new point coordinates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'location' => [40.7589, -73.9851] // Times Square coordinates + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7589, -73.9851], $response['body']['location']); + + // Test 4: Upsert document with point attribute + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Upserted Location', + 'location' => [34.0522, -80] // Los Angeles coordinates + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([34.0522, -80], $response['body']['location']); + + // Test 5: Create document without permissions (should fail) + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Unauthorized Location', + 'location' => [0, 0] + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialLineAttributes(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Line Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial and non-spatial attributes + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Spatial Line Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create integer attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'distance', + 'required' => true, + ]); + + // Create line attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => true, + ]); + + sleep(2); + + // Test 1: Create document with line attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'distance' => 100, + 'route' => [[40.7128, -74.0060], [40.7589, -73.9851]] // Line from Downtown to Times Square + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); + $documentId = $response['body']['$id']; + + // Test 2: Read document with line attribute + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); + + // Test 3: Update document with new line coordinates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'route' => [[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]] // Extended route + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]], $response['body']['route']); + + // Test 4: Upsert document with line attribute + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'distance' => 200, + 'route' => [[34.0522, -80], [34.0736, -90]] // LA route + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[34.0522, -80], [34.0736, -90]], $response['body']['route']); + + // Test 5: Delete document + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(204, $response['headers']['status-code']); + + // Test 6: Verify document is deleted + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(404, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialPolygonAttributes(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Polygon Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial and non-spatial attributes + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Spatial Polygon Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create boolean attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/boolean', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'active', + 'required' => true, + ]); + + // Create polygon attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + sleep(2); + + // Test 1: Create document with polygon attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'active' => true, + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]] // Manhattan area + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); + $documentId = $response['body']['$id']; + + // Test 2: Read document with polygon attribute + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); + + // Test 3: Update document with new polygon coordinates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]] // Extended area + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]], $response['body']['area']); + + // Test 4: Upsert document with polygon attribute + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'active' => false, + 'area' => [[[34.0522, -80], [34.0736, -80], [34.0736, -90], [34.0522, -90], [34.0522, -80]]] // LA area + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[34.0522, -80], [34.0736, -80], [34.0736, -90], [34.0522, -90], [34.0522, -80]]], $response['body']['area']); + + // Test 5: Create document without required polygon attribute (should fail) + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'active' => true + // Missing required 'area' attribute + ] + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialAttributesMixedCollection(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Mixed Spatial Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with multiple spatial and non-spatial attributes + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Mixed Spatial Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create multiple attributes + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'center', + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'boundary', + 'required' => false, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'coverage', + 'required' => true, + ]); + + sleep(3); + + // Test 1: Create document with all spatial attributes + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Central Park', + 'center' => [40.7829, -73.9654], + 'boundary' => [[40.7649, -73.9814], [40.8009, -73.9494]], + 'coverage' => [[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([40.7829, -73.9654], $response['body']['center']); + $this->assertEquals([[40.7649, -73.9814], [40.8009, -73.9494]], $response['body']['boundary']); + $this->assertEquals([[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]], $response['body']['coverage']); + $documentId = $response['body']['$id']; + + // Test 2: Update document with new spatial data + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'center' => [40.7505, -73.9934], + 'boundary' => [[40.7305, -74.0134], [40.7705, -73.9734]], + 'coverage' => [[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7505, -73.9934], $response['body']['center']); + $this->assertEquals([[40.7305, -74.0134], [40.7705, -73.9734]], $response['body']['boundary']); + $this->assertEquals([[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]], $response['body']['coverage']); + + // Test 3: Create document with minimal required attributes + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Minimal Location', + 'center' => [0, 0], + 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['center']); + + // Test 4: Test permission validation - create without user context + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Unauthorized Location', + 'center' => [0, 0], + 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testUpdateSpatialAttributes(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Update Spatial Attributes Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial attributes + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Update Spatial Attributes Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create string attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + // Create point attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + // Create line attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => false, + ]); + + // Create polygon attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + sleep(2); + + // Test 1: Update point attribute - change required status + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point/location', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(false, $response['body']['required']); + + // Test 2: Update line attribute - change required status and add default value + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line/route', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => [[0, 0], [1, 1]], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(false, $response['body']['required']); + $this->assertEquals([[0, 0], [1, 1]], $response['body']['default']); + + // Test 3: Update polygon attribute - change key name + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon/area', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'newKey' => 'coverage', + 'default' => null, + 'required' => false + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('coverage', $response['body']['key']); + + // Test 4: Update point attribute - add default value + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point/location', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => [0, 0], + 'required' => false + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['default']); + + // Test 5: Verify attribute updates by creating a document + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Test Location', + 'coverage' => [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['location']); // Should use default value + $this->assertEquals([[0, 0], [1, 1]], $response['body']['route']); // Should use default value + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialQuery(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Query Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create collection with spatial attributes + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Spatial Query Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create string attribute + $nameAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $nameAttribute['headers']['status-code']); + + // Create point attribute + $pointAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pointAttr', + 'required' => true, + ]); + + $this->assertEquals(202, $pointAttribute['headers']['status-code']); + + // Create line attribute + $lineAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'lineAttr', + 'required' => true, + ]); + + $this->assertEquals(202, $lineAttribute['headers']['status-code']); + + // Create polygon attribute + $polygonAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'polyAttr', + 'required' => true, + ]); + + $this->assertEquals(202, $polygonAttribute['headers']['status-code']); + + // Wait for attributes to be created + sleep(2); + + // Create test documents with spatial data + $documents = [ + [ + '$id' => 'doc1', + 'name' => 'Test Document 1', + 'pointAttr' => [6.0, 6.0], + 'lineAttr' => [[1.0, 1.0], [1.1,1.1] , [2.0, 2.0]], + 'polyAttr' => [[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]] + ], + [ + '$id' => 'doc2', + 'name' => 'Test Document 2', + 'pointAttr' => [7.0, 6.0], + 'lineAttr' => [[10.0, 10.0], [20.0, 20.0]], + 'polyAttr' => [[[20.0, 20.0], [30.0, 20.0], [30.0, 30.0], [20.0, 30.0], [20.0, 20.0]]] + ], + [ + '$id' => 'doc3', + 'name' => 'Test Document 3', + 'pointAttr' => [25.0, 25.0], + 'lineAttr' => [[25.0, 25.0], [35.0, 35.0]], + 'polyAttr' => [[[40.0, 40.0], [50.0, 40.0], [50.0, 50.0], [40.0, 50.0], [40.0, 40.0]]] + ] + ]; + + foreach ($documents as $doc) { + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => $doc['$id'], + 'data' => [ + 'name' => $doc['name'], + 'pointAttr' => $doc['pointAttr'], + 'lineAttr' => $doc['lineAttr'], + 'polyAttr' => $doc['polyAttr'] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + } + + // Test 1: Equality on non-spatial attribute (name) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('name', ['Test Document 1'])->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 3: Polygon attribute queries + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('polyAttr', [[[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]]])->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 4: Not equal queries + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notEqual('pointAttr', [[6.0, 6.0]])->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + + // Test 4.1: contains on line (point on line) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::contains('lineAttr', [[1.1, 1.1]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + + // Test 4.2: notContains on polygon (point outside all polygons) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notContains('polyAttr', [[15.0, 15.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Test 4.3: intersects on polygon (point inside doc1 polygon) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::intersects('polyAttr', [5.0, 5.0])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 4.4: notIntersects on polygon (point outside all polygons) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notIntersects('polyAttr', [60.0, 60.0])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Test 4.5: overlaps on polygon (polygon overlapping doc1) + $overlapPoly = [[[5.0, 5.0], [12.0, 5.0], [12.0, 12.0], [5.0, 12.0], [5.0, 5.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::overlaps('polyAttr', $overlapPoly)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 4.6: notOverlaps on polygon (polygon that overlaps none) + $noOverlapPoly = [[[60.0, 60.0], [70.0, 60.0], [70.0, 70.0], [60.0, 70.0], [60.0, 60.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notOverlaps('polyAttr', $noOverlapPoly)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Test 4.7: distance (equals) on point + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceEqual('pointAttr', [6.0, 6.0], 1.0)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('doc2', $response['body']['documents'][0]['$id']); + + // Test 4.8: notDistance (outside radius) on point + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceNotEqual('pointAttr', [6.0, 6.0], 1.0)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + + // Test 4.9: distanceGreaterThan + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceGreaterThan('pointAttr', [6.0, 6.0], 5.0)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + + // Test 4.10: distanceLessThan + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceLessThan('pointAttr', [6.0, 6.0], 0.5)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + + // Test 4.11: crosses on line (query line crosses doc1 line) + $crossLine = [[1.0, 2.0], [2.0, 1.0]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::crosses('lineAttr', $crossLine)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 4.12: notCrosses on line (query line does not cross any stored lines) + $nonCrossLine = [[0.0, 1.0], [0.0, 2.0]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notCrosses('lineAttr', $nonCrossLine)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Test 4.13: touches on polygon (query polygon touches doc1 polygon at corner) + $touchPoly = [[[10.0, 10.0], [20.0, 10.0], [20.0, 20.0], [10.0, 20.0], [10.0, 10.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::touches('polyAttr', $touchPoly)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 4.14: notTouches on polygon (polygon far away should not touch) + $farPoly = [[[60.0, 60.0], [70.0, 60.0], [70.0, 70.0], [60.0, 70.0], [60.0, 60.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notTouches('polyAttr', $farPoly)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Test 5: Select specific attributes + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::select(['name', 'pointAttr'])->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + + foreach ($response['body']['documents'] as $doc) { + $this->assertArrayHasKey('name', $doc); + $this->assertArrayHasKey('pointAttr', $doc); + $this->assertArrayNotHasKey('lineAttr', $doc); + $this->assertArrayNotHasKey('polyAttr', $doc); + } + + // Test 6: Order by name + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::orderAsc('name')->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + $this->assertEquals('Test Document 1', $response['body']['documents'][0]['name']); + $this->assertEquals('Test Document 2', $response['body']['documents'][1]['name']); + $this->assertEquals('Test Document 3', $response['body']['documents'][2]['name']); + + // Test 7: Limit results + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::limit(2)->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + + // Test 8: Offset results + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::offset(1)->toString(), Query::limit(2)->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + + // Test 9: Complex query with multiple conditions + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['name', 'pointAttr'])->toString(), + Query::orderAsc('name')->toString(), + Query::limit(1)->toString() + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('Test Document 1', $response['body']['documents'][0]['name']); + + // Test 11: Query with no results + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('name', ['Non-existent Document'])->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(0, $response['body']['documents']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialRelationshipOneToOne(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial OneToOne Test DB' + ]); + + $databaseId = $database['body']['$id']; + + $place = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Place', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + $placeId = $place['body']['$id']; + + $location = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Location', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + $locationId = $location['body']['$id']; + + // attributes + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $placeId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 255, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $locationId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'coordinates', + 'required' => true, + ]); + + sleep(2); + + // relationship: place.oneToOne -> location + $relation = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $placeId . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $locationId, + 'type' => Database::RELATION_ONE_TO_ONE, + 'key' => 'location', + 'twoWay' => true, + 'twoWayKey' => 'place', + 'onDelete' => Database::RELATION_MUTATE_CASCADE, + ]); + $this->assertEquals(202, $relation['headers']['status-code']); + + sleep(2); + + // create doc with nested spatial related doc + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $placeId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Museum', + 'location' => [ + '$id' => ID::unique(), + 'coordinates' => [40.7794, -73.9632], + ], + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $doc['headers']['status-code']); + $this->assertEquals([40.7794, -73.9632], $doc['body']['location']['coordinates']); + + // fetch with select to ensure relationship shape + $fetched = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $placeId . '/documents/' . $doc['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['name', 'location.coordinates'])->toString() + ] + ]); + $this->assertEquals(200, $fetched['headers']['status-code']); + $this->assertEquals([40.7794, -73.9632], $fetched['body']['location']['coordinates']); + + // cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $placeId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $locationId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialRelationshipOneToMany(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial OneToMany Test DB' + ]); + $databaseId = $database['body']['$id']; + + $person = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Person', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + $personId = $person['body']['$id']; + + $visit = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Visit', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + $visitId = $visit['body']['$id']; + + // attributes + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $personId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'fullName', + 'size' => 255, + 'required' => true, + ]); + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $visitId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'point', + 'required' => true, + ]); + + sleep(2); + + // relationship person.oneToMany -> visit + $rel = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $personId . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $visitId, + 'type' => Database::RELATION_ONE_TO_MANY, + 'key' => 'visits', + 'twoWay' => true, + 'twoWayKey' => 'person', + ]); + $this->assertEquals(202, $rel['headers']['status-code']); + + sleep(2); + + $personDoc = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $personId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'person-spatial-1', + 'data' => [ + 'fullName' => 'Alice', + 'visits' => [ + [ '$id' => 'visit-1', 'point' => [40.7589, -73.9851] ], + [ '$id' => 'visit-2', 'point' => [40.7505, -73.9934] ], + ], + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $personDoc['headers']['status-code']); + $this->assertCount(2, $personDoc['body']['visits']); + $this->assertEquals([40.7589, -73.9851], $personDoc['body']['visits'][0]['point']); + + $visitDoc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $visitId . '/documents/visit-2', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['point', 'person.$id'])->toString() + ] + ]); + $this->assertEquals(200, $visitDoc['headers']['status-code']); + $this->assertEquals('person-spatial-1', $visitDoc['body']['person']['$id']); + + // cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $personId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $visitId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialRelationshipManyToOne(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial ManyToOne Test DB' + ]); + $databaseId = $database['body']['$id']; + + $cities = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'City', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + $citiesId = $cities['body']['$id']; + + $stores = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Store', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + $storesId = $stores['body']['$id']; + + // attributes + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $citiesId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $storesId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 255, + 'required' => true, + ]); + + sleep(2); + + // relationship stores.manyToOne -> cities + $rel = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $storesId . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $citiesId, + 'type' => Database::RELATION_MANY_TO_ONE, + 'key' => 'city', + 'twoWay' => true, + 'twoWayKey' => 'stores', + ]); + $this->assertEquals(202, $rel['headers']['status-code']); + + sleep(2); + + $store = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $storesId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'store-1', + 'data' => [ + 'name' => 'Main Store', + 'city' => [ + '$id' => ID::unique(), + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]] + ], + ] + ]); + $this->assertEquals(201, $store['headers']['status-code']); + $this->assertEquals('Main Store', $store['body']['name']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $store['body']['city']['area']); + + $city = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $citiesId . '/documents/' . $store['body']['city']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['stores.$id'])->toString() + ] + ]); + $this->assertEquals(200, $city['headers']['status-code']); + $this->assertEquals('store-1', $city['body']['stores'][0]['$id']); + + // cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $storesId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $citiesId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialRelationshipManyToMany(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial ManyToMany Test DB' + ]); + $databaseId = $database['body']['$id']; + + $drivers = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Drivers', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + $driversId = $drivers['body']['$id']; + + $zones = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Zones', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + $zonesId = $zones['body']['$id']; + + // attributes + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $driversId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'home', + 'required' => true, + ]); + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $zonesId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + sleep(2); + + // relationship drivers.manyToMany <-> zones + $rel = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $driversId . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $zonesId, + 'type' => Database::RELATION_MANY_TO_MANY, + 'key' => 'zones', + 'twoWay' => true, + 'twoWayKey' => 'drivers', + ]); + $this->assertEquals(202, $rel['headers']['status-code']); + + sleep(2); + + // create driver with two zones containing spatial polygons + $driver = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $driversId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'driver-1', + 'data' => [ + 'home' => [40.7128, -74.0060], + 'zones' => [ + [ '$id' => 'zone-1', 'area' => [[[0,0],[10,0],[10,10],[0,10],[0,0]]]], + [ '$id' => 'zone-2', 'area' => [[[20,20],[30,20],[30,30],[20,30],[20,20]]]], + ], + ] + ]); + $this->assertEquals(201, $driver['headers']['status-code']); + $this->assertCount(2, $driver['body']['zones']); + $this->assertEquals([40.7128, -74.0060], $driver['body']['home']); + + $zone = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $zonesId . '/documents/zone-1', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['drivers.$id'])->toString() + ] + ]); + $this->assertEquals(200, $zone['headers']['status-code']); + $this->assertEquals('driver-1', $zone['body']['drivers'][0]['$id']); + + // cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $driversId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $zonesId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialIndex(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Index Test DB' + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'SpatialIdx', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create spatial attributes: one required, one optional + $reqPoint = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pRequired', + 'required' => true, + ]); + $this->assertEquals(202, $reqPoint['headers']['status-code']); + + $optPoint = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pOptional', + 'required' => false, + ]); + $this->assertEquals(202, $optPoint['headers']['status-code']); + + // Ensure attributes are available + sleep(2); + + // Create index on required spatial attribute (should succeed) + $okIndex = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_required_point', + 'type' => Database::INDEX_SPATIAL, + 'attributes' => ['pRequired'], + ]); + $this->assertEquals(202, $okIndex['headers']['status-code']); + + // Create index on optional spatial attribute (should fail in case of mariadb) + $badIndex = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_optional_point', + 'type' => Database::INDEX_SPATIAL, + 'attributes' => ['pOptional'], + ]); + $this->assertEquals(400, $badIndex['headers']['status-code']); + + // updating the attribute to required to create index + $updated = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point/'.'pOptional', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => null + ]); + $this->assertEquals(200, $updated['headers']['status-code']); + + sleep(2); + $retriedIndex = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_optional_point', + 'type' => Database::INDEX_SPATIAL, + 'attributes' => ['pOptional'], + ]); + $this->assertEquals(202, $retriedIndex['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialDistanceInMeter(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Distance Meters Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial attribute + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Spatial Distance Meters Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create point attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'loc', + 'required' => true, + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + sleep(2); + + // Create spatial index + $indexResponse = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_loc', + 'type' => Database::INDEX_SPATIAL, + 'attributes' => ['loc'], + ]); + + sleep(2); + $this->assertEquals(202, $indexResponse['headers']['status-code']); + + + // Two points roughly ~1000 meters apart by latitude delta (~0.009 deg ≈ 1km) + $p0 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'p0', + 'data' => [ + 'loc' => [0.0000, 0.0000] + ] + ]); + + $p1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'p1', + 'data' => [ + 'loc' => [0.0090, 0.0000] + ] + ]); + + $this->assertEquals(201, $p0['headers']['status-code']); + $this->assertEquals(201, $p1['headers']['status-code']); + + // distanceLessThan with meters=true: within 1500m should include both + $within1_5km = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceLessThan('loc', [0.0000, 0.0000], 1500, true)->toString()] + ]); + + $this->assertEquals(200, $within1_5km['headers']['status-code']); + $this->assertCount(2, $within1_5km['body']['documents']); + + // Within 500m should include only p0 (exact point) + $within500m = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceLessThan('loc', [0.0000, 0.0000], 500, true)->toString()] + ]); + + $this->assertEquals(200, $within500m['headers']['status-code']); + $this->assertCount(1, $within500m['body']['documents']); + $this->assertEquals('p0', $within500m['body']['documents'][0]['$id']); + + // distanceGreaterThan 500m should include only p1 + $greater500m = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceGreaterThan('loc', [0.0000, 0.0000], 500, true)->toString()] + ]); + + $this->assertEquals(200, $greater500m['headers']['status-code']); + $this->assertCount(1, $greater500m['body']['documents']); + $this->assertEquals('p1', $greater500m['body']['documents'][0]['$id']); + + // distanceEqual with 0m should return exact match p0 + $equalZero = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceEqual('loc', [0.0000, 0.0000], 0, true)->toString()] + ]); + + $this->assertEquals(200, $equalZero['headers']['status-code']); + $this->assertEquals('p0', $equalZero['body']['documents'][0]['$id']); + + // distanceNotEqual with 0m should return p1 + $notEqualZero = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceNotEqual('loc', [0.0000, 0.0000], 0, true)->toString()] + ]); + + $this->assertEquals(200, $notEqualZero['headers']['status-code']); + $this->assertEquals('p1', $notEqualZero['body']['documents'][0]['$id']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialColCreateOnExistingData(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Distance Meters Database' + ]); + + $databaseId = $database['body']['$id']; + + $colId = ID::unique(); + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => $colId, + 'name' => 'spatial-test', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $description = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'description', + 'size' => 512, + 'required' => false, + 'default' => '', + ]); + + $this->assertEquals(202, $description['headers']['status-code']); + sleep(2); + + $document = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'description' => 'description' + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $document['headers']['status-code']); + + $point = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'loc', + 'required' => true, + ]); + + $this->assertEquals(400, $point['headers']['status-code']); + + $point = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'loc', + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(202, $point['headers']['status-code']); + + $line = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => true, + ]); + + $this->assertEquals(400, $line['headers']['status-code']); + + $line = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(202, $line['headers']['status-code']); + + $poly = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + $this->assertEquals(400, $poly['headers']['status-code']); + + $poly = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(202, $poly['headers']['status-code']); + } + + public function testSpatialColCreateOnExistingDataWithDefaults(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial With Defaults Database' + ]); + + $databaseId = $database['body']['$id']; + + $colId = ID::unique(); + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => $colId, + 'name' => 'spatial-test-defaults', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $description = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'description', + 'size' => 512, + 'required' => false, + 'default' => '', + ]); + + $this->assertEquals(202, $description['headers']['status-code']); + sleep(2); + + $document = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'description' => 'description' + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $document['headers']['status-code']); + + // Test point with default value + $point = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'loc', + 'required' => false, + 'default' => [0.0, 0.0] + ]); + + $this->assertEquals(202, $point['headers']['status-code']); + + // Test line with default value + $line = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => false, + 'default' => [[0.0, 0.0], [1.0, 1.0]] + ]); + + $this->assertEquals(202, $line['headers']['status-code']); + + // Test polygon with default value + $poly = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => false, + 'default' => [[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]]] + ]); + + $this->assertEquals(202, $poly['headers']['status-code']); + + // Wait for attributes to be available + sleep(2); + + // Create a new document without spatial data to test default values + $newDocument = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $colId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'description' => 'test default values' + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $newDocument['headers']['status-code']); + + $newDocumentId = $newDocument['body']['$id']; + + // Fetch the document to verify default values are applied + $fetchedDocument = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $colId . '/documents/' . $newDocumentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $fetchedDocument['headers']['status-code']); + + // Verify default values are applied + $this->assertEquals([0.0, 0.0], $fetchedDocument['body']['loc']); + $this->assertEquals([[0.0, 0.0], [1.0, 1.0]], $fetchedDocument['body']['route']); + $this->assertEquals([[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]]], $fetchedDocument['body']['area']); + } } diff --git a/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php b/tests/e2e/Services/Databases/Legacy/DatabasesConsoleClientTest.php similarity index 99% rename from tests/e2e/Services/Databases/DatabasesConsoleClientTest.php rename to tests/e2e/Services/Databases/Legacy/DatabasesConsoleClientTest.php index 2266c91afe..e81730411b 100644 --- a/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesConsoleClientTest.php @@ -1,6 +1,6 @@ <?php -namespace Tests\E2E\Services\Databases; +namespace Tests\E2E\Services\Databases\Legacy; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; @@ -224,7 +224,7 @@ class DatabasesConsoleClientTest extends Scope ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(11, count($response['body'])); + $this->assertEquals(15, count($response['body'])); $this->assertEquals('24h', $response['body']['range']); $this->assertIsNumeric($response['body']['documentsTotal']); $this->assertIsNumeric($response['body']['collectionsTotal']); diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php similarity index 99% rename from tests/e2e/Services/Databases/DatabasesCustomClientTest.php rename to tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php index 320508a114..699a2b8f25 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php @@ -1,6 +1,6 @@ <?php -namespace Tests\E2E\Services\Databases; +namespace Tests\E2E\Services\Databases\Legacy; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; diff --git a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php similarity index 77% rename from tests/e2e/Services/Databases/DatabasesCustomServerTest.php rename to tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php index e66207b215..c1ce75c38d 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php @@ -1,6 +1,6 @@ <?php -namespace Tests\E2E\Services\Databases; +namespace Tests\E2E\Services\Databases\Legacy; use Appwrite\Extend\Exception as AppwriteException; use Tests\E2E\Client; @@ -644,7 +644,6 @@ class DatabasesCustomServerTest extends Scope */ public function testCreateEncryptedAttribute(array $data): void { - $databaseId = $data['databaseId']; /** @@ -674,7 +673,6 @@ class DatabasesCustomServerTest extends Scope /** * Test for creating encrypted attributes */ - $attributesPath = '/databases/' . $databaseId . '/collections/' . $actors['body']['$id'] . '/attributes'; $firstName = $this->client->call(Client::METHOD_POST, $attributesPath . '/string', array_merge([ @@ -686,6 +684,7 @@ class DatabasesCustomServerTest extends Scope 'size' => 256, 'required' => true, ]); + // checking size test $lastName = $this->client->call(Client::METHOD_POST, $attributesPath . '/string', array_merge([ 'content-type' => 'application/json', @@ -710,12 +709,15 @@ class DatabasesCustomServerTest extends Scope 'encrypt' => true ]); $this->assertTrue($lastName['body']['encrypt']); + sleep(1); + $response = $this->client->call(Client::METHOD_GET, $attributesPath . '/lastName', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], ])); + $this->assertTrue($response['body']['encrypt']); /** @@ -1468,9 +1470,24 @@ class DatabasesCustomServerTest extends Scope $this->assertCount(64, $collection['body']['attributes']); $this->assertCount(0, $collection['body']['indexes']); - foreach ($collection['body']['attributes'] as $attribute) { - $this->assertEquals('available', $attribute['status'], 'attribute: ' . $attribute['key']); - } + $this->assertEventually(function () use ($databaseId, $collectionId) { + $collection = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + foreach ($collection['body']['attributes'] ?? [] as $attribute) { + $this->assertEquals( + 'available', + $attribute['status'], + 'attribute: ' . $attribute['key'] + ); + } + + return true; + }, 60000, 500); + // Test indexLimit = 64 // MariaDB, MySQL, and MongoDB create 6 indexes per new collection @@ -3648,7 +3665,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(400, $doc3['headers']['status-code']); } - public function createRelationshipCollections() + public function createRelationshipCollections(): void { // Prepare the database with collections and relationships $database = $this->client->call(Client::METHOD_POST, '/databases', [ @@ -3697,7 +3714,7 @@ class DatabasesCustomServerTest extends Scope \sleep(2); } - public function cleanupRelationshipCollection() + public function cleanupRelationshipCollection(): void { $this->client->call(Client::METHOD_DELETE, '/databases/database1', [ 'content-type' => 'application/json', @@ -3777,7 +3794,11 @@ class DatabasesCustomServerTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); + ]), [ + 'queries' => [ + Query::select(['new_level_2.*'])->toString() + ] + ]); $this->assertArrayHasKey('new_level_2', $newDocument['body']); $this->assertEquals(1, count($newDocument['body']['new_level_2'])); @@ -3887,7 +3908,11 @@ class DatabasesCustomServerTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); + ]), [ + 'queries' => [ + Query::select(['new_level_2.*'])->toString() + ] + ]); $this->assertArrayHasKey('new_level_2', $newDocument['body']); $this->assertNotEmpty($newDocument['body']['new_level_2']); @@ -3997,7 +4022,11 @@ class DatabasesCustomServerTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); + ]), [ + 'queries' => [ + Query::select(['new_level_2.*'])->toString() + ] + ]); $this->assertArrayHasKey('new_level_2', $newDocument['body']); $this->assertNotEmpty($newDocument['body']['new_level_2']); @@ -4008,7 +4037,11 @@ class DatabasesCustomServerTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); + ]), [ + 'queries' => [ + Query::select(['*', 'level1.*'])->toString() + ] + ]); $this->assertArrayHasKey('level1', $level2Document['body']); $this->assertNotEmpty($level2Document['body']['level1']); @@ -4107,7 +4140,11 @@ class DatabasesCustomServerTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); + ]), [ + 'queries' => [ + Query::select(['new_level_2.*'])->toString() + ] + ]); $this->assertArrayHasKey('new_level_2', $newDocument['body']); $this->assertNotEmpty($newDocument['body']['new_level_2']); @@ -4118,7 +4155,11 @@ class DatabasesCustomServerTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); + ]), [ + 'queries' => [ + Query::select(['*', 'level1.*'])->toString() + ] + ]); $this->assertArrayHasKey('level1', $level2Document['body']); $this->assertNotEmpty($level2Document['body']['level1']); @@ -4463,6 +4504,14 @@ class DatabasesCustomServerTest extends Scope $createBulkDocuments(); + /** + * Wait for database to purge cache... + * + * This test specifically failed on 1.6.x response format, + * could be due to the slow or overworked machine, but being safe here! + */ + sleep(5); + // TEST: Update all documents $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -4481,6 +4530,14 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertCount(10, $response['body']['documents']); + /** + * Wait for database to purge cache... + * + * This test specifically failed on 1.6.x response format, + * could be due to the slow or overworked machine, but being safe here! + */ + sleep(5); + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -5186,4 +5243,1490 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); } + + public function testDateTimeDocument(): void + { + $databaseId = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'DateTime Test Database', + ]); + + $this->assertEquals(201, $databaseId['headers']['status-code']); + $databaseId = $databaseId['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'create_modify_dates', + 'documentSecurity' => true, + 'permissions' => [], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create string attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'string', + 'size' => 128, + 'required' => false, + ]); + + // Create datetime attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/datetime', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'datetime', + 'required' => false, + 'format' => 'datetime', + ]); + + sleep(1); + + $date = '2000-01-01T10:00:00.000+00:00'; + + // Test - default behaviour of external datetime attribute not changed + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documentId' => 'doc1', + 'data' => [ + 'datetime' => '' + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + $this->assertNotEmpty($doc['body']['datetime']); + $this->assertNotEmpty($doc['body']['$createdAt']); + $this->assertNotEmpty($doc['body']['$updatedAt']); + + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/doc1', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertNotEmpty($doc['body']['datetime']); + $this->assertNotEmpty($doc['body']['$createdAt']); + $this->assertNotEmpty($doc['body']['$updatedAt']); + + // Test - modifying $createdAt and $updatedAt + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documentId' => 'doc2', + 'data' => [ + '$createdAt' => $date + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + $this->assertEquals($doc['body']['$createdAt'], $date); + $this->assertNotEmpty($doc['body']['$updatedAt']); + $this->assertNotEquals($doc['body']['$updatedAt'], $date); + + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/doc2', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertEquals($doc['body']['$createdAt'], $date); + $this->assertNotEmpty($doc['body']['$updatedAt']); + $this->assertNotEquals($doc['body']['$updatedAt'], $date); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSingleDocumentDateOperations(): void + { + $databaseId = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'Single Date Operations Database', + ]); + + $this->assertEquals(201, $databaseId['headers']['status-code']); + $databaseId = $databaseId['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'normal_date_operations', + 'documentSecurity' => true, + 'permissions' => [], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create string attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'string', + 'size' => 128, + 'required' => false, + ]); + + sleep(1); + + $createDate = '2000-01-01T10:00:00.000+00:00'; + $updateDate = '2000-02-01T15:30:00.000+00:00'; + $date1 = '2000-01-01T10:00:00.000+00:00'; + $date2 = '2000-02-01T15:30:00.000+00:00'; + $date3 = '2000-03-01T20:45:00.000+00:00'; + + // Test 1: Create with custom createdAt, then update with custom updatedAt + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documentId' => 'doc1', + 'data' => [ + 'string' => 'initial', + '$createdAt' => $createDate + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + $this->assertEquals($createDate, $doc['body']['$createdAt']); + $this->assertNotEquals($createDate, $doc['body']['$updatedAt']); + + // Update with custom updatedAt + $updatedDoc = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/doc1', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'updated', + '$updatedAt' => $updateDate + ] + ]); + + $this->assertEquals(200, $updatedDoc['headers']['status-code']); + $this->assertEquals($createDate, $updatedDoc['body']['$createdAt']); + $this->assertEquals($updateDate, $updatedDoc['body']['$updatedAt']); + + // Test 2: Create with both custom dates + $doc2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documentId' => 'doc2', + 'data' => [ + 'string' => 'both_dates', + '$createdAt' => $createDate, + '$updatedAt' => $updateDate + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $doc2['headers']['status-code']); + $this->assertEquals($createDate, $doc2['body']['$createdAt']); + $this->assertEquals($updateDate, $doc2['body']['$updatedAt']); + + // Test 3: Create without dates, then update with custom dates + $doc3 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documentId' => 'doc3', + 'data' => [ + 'string' => 'no_dates' + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $doc3['headers']['status-code']); + + $updatedDoc3 = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/doc3', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'updated_no_dates', + '$createdAt' => $createDate, + '$updatedAt' => $updateDate + ] + ]); + + $this->assertEquals(200, $updatedDoc3['headers']['status-code']); + $this->assertEquals($createDate, $updatedDoc3['body']['$createdAt']); + $this->assertEquals($updateDate, $updatedDoc3['body']['$updatedAt']); + + // Test 4: Update only createdAt + $doc4 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documentId' => 'doc4', + 'data' => [ + 'string' => 'initial' + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $doc4['headers']['status-code']); + $originalCreatedAt4 = $doc4['body']['$createdAt']; + $originalUpdatedAt4 = $doc4['body']['$updatedAt']; + + $updatedDoc4 = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/doc4', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'updated', + '$updatedAt' => null, + '$createdAt' => null + ], + ]); + + $this->assertEquals(200, $updatedDoc4['headers']['status-code']); + $this->assertEquals($originalCreatedAt4, $updatedDoc4['body']['$createdAt']); + $this->assertNotEquals($originalUpdatedAt4, $updatedDoc4['body']['$updatedAt']); + + // Test 5: Update only updatedAt + $finalDoc4 = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/doc4', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'final', + '$updatedAt' => $updateDate, + '$createdAt' => $createDate + ] + ]); + + $this->assertEquals(200, $finalDoc4['headers']['status-code']); + $this->assertEquals($createDate, $finalDoc4['body']['$createdAt']); + $this->assertEquals($updateDate, $finalDoc4['body']['$updatedAt']); + + // Test 6: Create with updatedAt, update with createdAt + $doc5 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documentId' => 'doc5', + 'data' => [ + 'string' => 'doc5', + '$updatedAt' => $date2 + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $doc5['headers']['status-code']); + $this->assertNotEquals($date2, $doc5['body']['$createdAt']); + $this->assertEquals($date2, $doc5['body']['$updatedAt']); + + $updatedDoc5 = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/doc5', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'doc5_updated', + '$createdAt' => $date1 + ] + ]); + + $this->assertEquals(200, $updatedDoc5['headers']['status-code']); + $this->assertEquals($date1, $updatedDoc5['body']['$createdAt']); + $this->assertNotEquals($date2, $updatedDoc5['body']['$updatedAt']); + + // Test 7: Create with both dates, update with different dates + $doc6 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documentId' => 'doc6', + 'data' => [ + 'string' => 'doc6', + '$createdAt' => $date1, + '$updatedAt' => $date2 + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $doc6['headers']['status-code']); + $this->assertEquals($date1, $doc6['body']['$createdAt']); + $this->assertEquals($date2, $doc6['body']['$updatedAt']); + + $updatedDoc6 = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/doc6', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'doc6_updated', + '$createdAt' => $date3, + '$updatedAt' => $date3 + ] + ]); + + $this->assertEquals(200, $updatedDoc6['headers']['status-code']); + $this->assertEquals($date3, $updatedDoc6['body']['$createdAt']); + $this->assertEquals($date3, $updatedDoc6['body']['$updatedAt']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testBulkDocumentDateOperations(): void + { + $databaseId = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Date Operations Database', + ]); + + $this->assertEquals(201, $databaseId['headers']['status-code']); + $databaseId = $databaseId['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'bulk_date_operations', + 'documentSecurity' => true, + 'permissions' => [], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create string attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'string', + 'size' => 128, + 'required' => false, + ]); + + sleep(1); + + $createDate = '2000-01-01T10:00:00.000+00:00'; + $updateDate = '2000-02-01T15:30:00.000+00:00'; + + // Test 1: Bulk create with different date configurations + $documents = [ + [ + '$id' => 'doc1', + 'string' => 'doc1', + '$createdAt' => $createDate, + '$permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])),] + ], + [ + '$id' => 'doc2', + 'string' => 'doc2', + '$updatedAt' => $updateDate, + '$permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])),] + ], + [ + '$id' => 'doc3', + 'string' => 'doc3', + '$createdAt' => $createDate, + '$updatedAt' => $updateDate, + '$permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])),] + ], + [ + '$id' => 'doc4', + 'string' => 'doc4', + '$permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])),] + ], + [ + '$id' => 'doc5', + 'string' => 'doc5', + '$createdAt' => null, + '$permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])),] + ], + [ + '$id' => 'doc6', + 'string' => 'doc6', + '$updatedAt' => null, + '$permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])),] + ] + ]; + + // Create all documents in one bulk operation + $bulkCreateResponse = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documents' => $documents + ]); + + $this->assertEquals(201, $bulkCreateResponse['headers']['status-code']); + $this->assertCount(count($documents), $bulkCreateResponse['body']['documents']); + + // Verify initial state + foreach (['doc1', 'doc3'] as $id) { + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertEquals($createDate, $doc['body']['$createdAt'], "createdAt mismatch for $id"); + } + + foreach (['doc2', 'doc3'] as $id) { + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertEquals($updateDate, $doc['body']['$updatedAt'], "updatedAt mismatch for $id"); + } + + foreach (['doc4', 'doc5', 'doc6'] as $id) { + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertNotEmpty($doc['body']['$createdAt'], "createdAt missing for $id"); + $this->assertNotEmpty($doc['body']['$updatedAt'], "updatedAt missing for $id"); + } + + // Test 2: Bulk update with custom dates + $updateData = [ + 'data' => [ + 'string' => 'updated', + '$createdAt' => $createDate, + '$updatedAt' => $updateDate, + '$permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])),] + ], + ]; + + // Use bulk update instead of individual updates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), $updateData); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(6, $response['body']['documents']); + + // Verify updated state + foreach (['doc1', 'doc3'] as $id) { + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertEquals($createDate, $doc['body']['$createdAt'], "createdAt mismatch for $id"); + $this->assertEquals($updateDate, $doc['body']['$updatedAt'], "updatedAt mismatch for $id"); + $this->assertEquals('updated', $doc['body']['string'], "string mismatch for $id"); + } + + foreach (['doc2', 'doc4', 'doc5', 'doc6'] as $id) { + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertEquals($updateDate, $doc['body']['$updatedAt'], "updatedAt mismatch for $id"); + $this->assertEquals('updated', $doc['body']['string'], "string mismatch for $id"); + } + + $newDate = '2000-03-01T20:45:00.000+00:00'; + $updateDataEnabled = [ + 'data' => [ + 'string' => 'enabled_update', + '$createdAt' => $newDate, + '$updatedAt' => $newDate + ], + ]; + + // Use bulk update instead of individual updates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), $updateDataEnabled); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(6, $response['body']['documents']); + + // Verify final state + foreach (['doc1', 'doc2', 'doc3', 'doc4', 'doc5', 'doc6'] as $id) { + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertEquals($newDate, $doc['body']['$createdAt'], "createdAt mismatch for $id"); + $this->assertEquals($newDate, $doc['body']['$updatedAt'], "updatedAt mismatch for $id"); + $this->assertEquals('enabled_update', $doc['body']['string'], "string mismatch for $id"); + } + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testUpsertDateOperations(): void + { + $databaseId = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'Upsert Date Operations Database', + ]); + + $this->assertEquals(201, $databaseId['headers']['status-code']); + $databaseId = $databaseId['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'upsert_date_operations', + 'documentSecurity' => true, + 'permissions' => [], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create string attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'string', + 'size' => 128, + 'required' => false, + ]); + + sleep(1); + + $createDate = '2000-01-01T10:00:00.000+00:00'; + $updateDate = '2000-02-01T15:30:00.000+00:00'; + $date1 = '2000-01-01T10:00:00.000+00:00'; + $date2 = '2000-02-01T15:30:00.000+00:00'; + $date3 = '2000-03-01T20:45:00.000+00:00'; + + // Test 1: Upsert new document with custom createdAt + $upsertDoc1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documentId' => 'upsert1', + 'data' => [ + 'string' => 'upsert1_initial', + '$permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ], + '$createdAt' => $createDate + ], + ]); + + $this->assertEquals(201, $upsertDoc1['headers']['status-code']); + $this->assertEquals($createDate, $upsertDoc1['body']['$createdAt']); + $this->assertNotEquals($createDate, $upsertDoc1['body']['$updatedAt']); + + // Test 2: Upsert existing document with custom updatedAt + $updatedUpsertDoc1 = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/upsert1', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'upsert1_updated', + '$updatedAt' => $updateDate + ], + ]); + + $this->assertEquals(200, $updatedUpsertDoc1['headers']['status-code']); + $this->assertEquals($createDate, $updatedUpsertDoc1['body']['$createdAt']); + $this->assertEquals($updateDate, $updatedUpsertDoc1['body']['$updatedAt']); + + // Test 3: Upsert new document with both custom dates + $upsertDoc2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documentId' => 'upsert2', + 'data' => [ + 'string' => 'upsert2_both_dates', + '$permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ], + '$createdAt' => $createDate, + '$updatedAt' => $updateDate + ], + ]); + + $this->assertEquals(201, $upsertDoc2['headers']['status-code']); + $this->assertEquals($createDate, $upsertDoc2['body']['$createdAt']); + $this->assertEquals($updateDate, $upsertDoc2['body']['$updatedAt']); + + // Test 4: Upsert existing document with different dates + $updatedUpsertDoc2 = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/upsert2', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'upsert2_updated', + '$createdAt' => $date3, + '$updatedAt' => $date3, + '$permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ], + ] + ]); + + $this->assertEquals(200, $updatedUpsertDoc2['headers']['status-code']); + $this->assertEquals($date3, $updatedUpsertDoc2['body']['$createdAt']); + $this->assertEquals($date3, $updatedUpsertDoc2['body']['$updatedAt']); + + // Test 5: Bulk upsert operations with custom dates + $upsertDocuments = [ + [ + '$id' => 'bulk_upsert1', + 'string' => 'bulk_upsert1_initial', + '$createdAt' => $createDate + ], + [ + '$id' => 'bulk_upsert2', + 'string' => 'bulk_upsert2_initial', + '$updatedAt' => $updateDate + ], + [ + '$id' => 'bulk_upsert3', + 'string' => 'bulk_upsert3_initial', + '$createdAt' => $createDate, + '$updatedAt' => $updateDate + ], + [ + '$id' => 'bulk_upsert4', + 'string' => 'bulk_upsert4_initial' + ] + ]; + + // Create documents using bulk upsert + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documents' => $upsertDocuments + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(4, $response['body']['documents']); + + // Test 7: Verify initial bulk upsert state + foreach (['bulk_upsert1', 'bulk_upsert3'] as $id) { + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertEquals($createDate, $doc['body']['$createdAt'], "createdAt mismatch for $id"); + } + + foreach (['bulk_upsert2', 'bulk_upsert3'] as $id) { + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertEquals($updateDate, $doc['body']['$updatedAt'], "updatedAt mismatch for $id"); + } + + foreach (['bulk_upsert4'] as $id) { + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertNotEmpty($doc['body']['$createdAt'], "createdAt missing for $id"); + $this->assertNotEmpty($doc['body']['$updatedAt'], "updatedAt missing for $id"); + } + + // Test 8: Bulk upsert update with custom dates + $newDate = '2000-04-01T12:00:00.000+00:00'; + $updateUpsertData = [ + 'data' => [ + 'string' => 'bulk_upsert_updated', + '$createdAt' => $newDate, + '$updatedAt' => $newDate + ], + 'queries' => [Query::equal('$id', ['bulk_upsert1','bulk_upsert2','bulk_upsert3','bulk_upsert4'])->toString()] + ]; + + $upsertIds = ['bulk_upsert1', 'bulk_upsert2', 'bulk_upsert3', 'bulk_upsert4']; + + // Use bulk update instead of individual updates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), $updateUpsertData); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(4, $response['body']['documents']); + + // Verify updated state + foreach ($upsertIds as $id) { + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertEquals($newDate, $doc['body']['$createdAt'], "createdAt mismatch for $id"); + $this->assertEquals($newDate, $doc['body']['$updatedAt'], "updatedAt mismatch for $id"); + $this->assertEquals('bulk_upsert_updated', $doc['body']['string'], "string mismatch for $id"); + } + + // Test 9: checking by passing null to each + $updateUpsertDataNull = [ + 'data' => [ + 'string' => 'bulk_upsert_null_test', + '$createdAt' => null, + '$updatedAt' => null + ], + 'queries' => [Query::equal('$id', ['bulk_upsert1','bulk_upsert2','bulk_upsert3','bulk_upsert4'])->toString()] + ]; + + // Use bulk update instead of individual updates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), $updateUpsertDataNull); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(4, $response['body']['documents']); + + // Verify null handling + foreach ($upsertIds as $id) { + $doc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $doc['headers']['status-code']); + $this->assertNotEmpty($doc['body']['$createdAt'], "createdAt missing for $id"); + $this->assertNotEmpty($doc['body']['$updatedAt'], "updatedAt missing for $id"); + } + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialBulkOperations(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Bulk Operations Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create collection with spatial attributes + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Spatial Bulk Operations Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create string attribute + $nameAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $nameAttribute['headers']['status-code']); + + // Create point attribute + $pointAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + $this->assertEquals(202, $pointAttribute['headers']['status-code']); + + // Create polygon attribute + $polygonAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => false, + ]); + + $this->assertEquals(202, $polygonAttribute['headers']['status-code']); + + // Wait for attributes to be created + sleep(2); + + // Test 1: Bulk create with spatial data + $spatialDocuments = []; + for ($i = 0; $i < 5; $i++) { + $spatialDocuments[] = [ + '$id' => ID::unique(), + 'name' => 'Location ' . $i, + 'location' => [10.0 + $i, 20.0 + $i], // POINT + 'area' => [ + [10.0 + $i, 20.0 + $i], + [11.0 + $i, 20.0 + $i], + [11.0 + $i, 21.0 + $i], + [10.0 + $i, 21.0 + $i], + [10.0 + $i, 20.0 + $i] + ] // POLYGON + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $spatialDocuments, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['documents']); + + // Verify created documents have proper spatial data + foreach ($response['body']['documents'] as $index => $document) { + $this->assertNotEmpty($document['$id']); + $this->assertNotEmpty($document['name']); + $this->assertIsArray($document['location']); + $this->assertIsArray($document['area']); + $this->assertCount(2, $document['location']); // POINT has 2 coordinates + + // Check polygon structure - it might be stored as an array of arrays + if (is_array($document['area'][0])) { + $this->assertGreaterThan(1, count($document['area'][0])); // POLYGON has multiple points + } else { + $this->assertGreaterThan(1, count($document['area'])); // POLYGON has multiple points + } + + $this->assertEquals('Location ' . $index, $document['name']); + $this->assertEquals([10.0 + $index, 20.0 + $index], $document['location']); + } + + // Test 2: Bulk update with spatial data + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Updated Location', + 'location' => [15.0, 25.0], // New POINT + 'area' => [ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ] // New POLYGON + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['documents']); + + // Verify updated documents + foreach ($response['body']['documents'] as $document) { + $this->assertEquals('Updated Location', $document['name']); + $this->assertEquals([15.0, 25.0], $document['location']); + // The area might be stored as an array of arrays, so check the first element + $this->assertIsArray($document['area']); + if (is_array($document['area'][0])) { + // If it's an array of arrays, check the first polygon + $this->assertEquals([ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ], $document['area'][0]); + } else { + // If it's a direct array, check the whole thing + $this->assertEquals([ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ], $document['area']); + } + } + + // Test 3: Bulk upsert with spatial data + $upsertDocuments = [ + [ + '$id' => 'upsert1', + 'name' => 'Upsert Location 1', + 'location' => [30.0, 40.0], + 'area' => [ + [30.0, 40.0], + [31.0, 40.0], + [31.0, 41.0], + [30.0, 41.0], + [30.0, 40.0] + ] + ], + [ + '$id' => 'upsert2', + 'name' => 'Upsert Location 2', + 'location' => [35.0, 45.0], + 'area' => [ + [35.0, 45.0], + [36.0, 45.0], + [36.0, 46.0], + [35.0, 46.0], + [35.0, 45.0] + ] + ] + ]; + + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $upsertDocuments, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + + // Verify upserted documents + foreach ($response['body']['documents'] as $document) { + $this->assertNotEmpty($document['$id']); + $this->assertIsArray($document['location']); + $this->assertIsArray($document['area']); + + // Verify the spatial data structure + $this->assertCount(2, $document['location']); // POINT has 2 coordinates + if (is_array($document['area'][0])) { + $this->assertGreaterThan(1, count($document['area'][0])); // POLYGON has multiple points + } else { + $this->assertGreaterThan(1, count($document['area'])); // POLYGON has multiple points + } + } + + // Test 4: Edge cases for spatial bulk operations + + // Test 4a: Invalid point coordinates (should fail) + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Point', + 'location' => [1000.0, 2000.0], + 'area' => [10.0 , 10.0] + ] + ], + ]); + + // invalid polygon + $this->assertEquals(400, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Polygon', + 'location' => [10.0, 20.0], + 'area' => [ + [10.0, 20.0], + [11.0, 20.0] + ] + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Missing Location', + // Missing required 'location' attribute + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ] + ], + ]); + + // This should fail due to missing required attribute + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4e: Mixed valid and invalid documents in bulk (should fail) + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Valid Document', + 'location' => [10.0, 20.0], + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ], + [ + '$id' => ID::unique(), + 'name' => 'Invalid Document', + // Missing required 'location' attribute + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ] + ], + ]); + + // This should fail due to mixed valid/invalid documents + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4f: Very large spatial data (stress test) + $largePolygon = []; + for ($i = 0; $i < 1000; $i++) { + $largePolygon[] = [$i * 0.001, $i * 0.001]; + } + $largePolygon[] = [0, 0]; // Close the polygon + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Large Polygon Test', + 'location' => [0.0, 0.0], + 'area' => $largePolygon + ] + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // Test 4g: Null values in spatial attributes (should fail) + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Null Values Test', + 'location' => null, // Null point + 'area' => null // Null polygon + ] + ], + ]); + + // This should fail due to null values + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4h: Bulk operations with spatial data exceeding limits + $largeBulkDocuments = []; + for ($i = 0; $i < 100; $i++) { + $largeBulkDocuments[] = [ + '$id' => ID::unique(), + 'name' => 'Bulk Test ' . $i, + 'location' => [$i * 0.1, $i * 0.1], + 'area' => [ + [$i * 0.1, $i * 0.1], + [($i + 1) * 0.1, $i * 0.1], + [($i + 1) * 0.1, ($i + 1) * 0.1], + [$i * 0.1, ($i + 1) * 0.1], + [$i * 0.1, $i * 0.1] + ] + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $largeBulkDocuments, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialBulkOperationsWithLineStrings(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial LineString Bulk Operations Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create collection with line string attributes + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Spatial LineString Bulk Operations Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create string attribute + $nameAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $nameAttribute['headers']['status-code']); + + // Create line string attribute + $lineAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'path', + 'required' => true, + ]); + + // Handle both 201 (created) and 202 (accepted) status codes + $this->assertEquals(202, $lineAttribute['headers']['status-code']); + + // Wait for attributes to be created + sleep(2); + + // Test bulk create with line string data + $lineStringDocuments = []; + for ($i = 0; $i < 3; $i++) { + $lineStringDocuments[] = [ + '$id' => ID::unique(), + 'name' => 'Path ' . $i, + 'path' => [ + [$i * 10, $i * 10], + [($i + 1) * 10, ($i + 1) * 10], + [($i + 2) * 10, ($i + 2) * 10] + ] // LINE STRING with 3 points + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $lineStringDocuments, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + + // Verify created documents have proper line string data + foreach ($response['body']['documents'] as $index => $document) { + $this->assertNotEmpty($document['$id']); + $this->assertNotEmpty($document['name']); + $this->assertIsArray($document['path']); + $this->assertGreaterThan(1, count($document['path'])); // LINE STRING has multiple points + $this->assertEquals('Path ' . $index, $document['name']); + $this->assertCount(3, $document['path']); // Each line string has 3 points + } + + // Test bulk update with line string data + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Updated Path', + 'path' => [ + [0, 0], + [50, 50], + [80, 80] + ] // New LINE STRING + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + + // Verify updated documents + foreach ($response['body']['documents'] as $document) { + $this->assertEquals('Updated Path', $document['name']); + $this->assertEquals([ + [0, 0], + [50, 50], + [80, 80] + ], $document['path']); + } + + // Test: Invalid line string (single point - should fail) + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Line String', + 'path' => [[10, 20]] // Single point - invalid line string + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } } diff --git a/tests/e2e/Services/Databases/DatabasesPermissionsGuestTest.php b/tests/e2e/Services/Databases/Legacy/DatabasesPermissionsGuestTest.php similarity index 99% rename from tests/e2e/Services/Databases/DatabasesPermissionsGuestTest.php rename to tests/e2e/Services/Databases/Legacy/DatabasesPermissionsGuestTest.php index ca8753f374..abeef6c222 100644 --- a/tests/e2e/Services/Databases/DatabasesPermissionsGuestTest.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesPermissionsGuestTest.php @@ -1,6 +1,6 @@ <?php -namespace Tests\E2E\Services\Databases; +namespace Tests\E2E\Services\Databases\Legacy; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; diff --git a/tests/e2e/Services/Databases/DatabasesPermissionsMemberTest.php b/tests/e2e/Services/Databases/Legacy/DatabasesPermissionsMemberTest.php similarity index 99% rename from tests/e2e/Services/Databases/DatabasesPermissionsMemberTest.php rename to tests/e2e/Services/Databases/Legacy/DatabasesPermissionsMemberTest.php index 860fb7fb12..2e37da867f 100644 --- a/tests/e2e/Services/Databases/DatabasesPermissionsMemberTest.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesPermissionsMemberTest.php @@ -1,6 +1,6 @@ <?php -namespace Tests\E2E\Services\Databases; +namespace Tests\E2E\Services\Databases\Legacy; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; diff --git a/tests/e2e/Services/Databases/DatabasesPermissionsScope.php b/tests/e2e/Services/Databases/Legacy/DatabasesPermissionsScope.php similarity index 98% rename from tests/e2e/Services/Databases/DatabasesPermissionsScope.php rename to tests/e2e/Services/Databases/Legacy/DatabasesPermissionsScope.php index 0042d253ac..597562dab8 100644 --- a/tests/e2e/Services/Databases/DatabasesPermissionsScope.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesPermissionsScope.php @@ -1,6 +1,6 @@ <?php -namespace Tests\E2E\Services\Databases; +namespace Tests\E2E\Services\Databases\Legacy; use Tests\E2E\Client; diff --git a/tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php b/tests/e2e/Services/Databases/Legacy/DatabasesPermissionsTeamTest.php similarity index 99% rename from tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php rename to tests/e2e/Services/Databases/Legacy/DatabasesPermissionsTeamTest.php index 066d83a7ee..bc8b4f9a5e 100644 --- a/tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesPermissionsTeamTest.php @@ -1,6 +1,6 @@ <?php -namespace Tests\E2E\Services\Databases; +namespace Tests\E2E\Services\Databases\Legacy; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php new file mode 100644 index 0000000000..336193f5d9 --- /dev/null +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php @@ -0,0 +1,9096 @@ +<?php + +namespace Tests\E2E\Services\Databases\TablesDB; + +use Appwrite\Extend\Exception; +use Tests\E2E\Client; +use Utopia\Database\Database; +use Utopia\Database\DateTime; +use Utopia\Database\Document; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; +use Utopia\Database\Query; +use Utopia\Database\Validator\Datetime as DatetimeValidator; + +trait DatabasesBase +{ + public function testCreateDatabase(): array + { + /** + * Test for SUCCESS + */ + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('Test Database', $database['body']['name']); + $this->assertEquals('tablesdb', $database['body']['type']); + + return ['databaseId' => $database['body']['$id']]; + } + + /** + * @depends testCreateDatabase + */ + public function testCreateTable(array $data): array + { + $databaseId = $data['databaseId']; + /** + * Test for SUCCESS + */ + $movies = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Movies', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $movies['headers']['status-code']); + $this->assertEquals($movies['body']['name'], 'Movies'); + + $actors = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Actors', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $actors['headers']['status-code']); + $this->assertEquals($actors['body']['name'], 'Actors'); + + return [ + 'databaseId' => $databaseId, + 'moviesId' => $movies['body']['$id'], + 'actorsId' => $actors['body']['$id'], + ]; + } + + /** + * @depends testCreateTable + */ + public function testConsoleProject(array $data): void + { + if ($this->getSide() === 'server') { + // Server side can't get past the invalid key check anyway + $this->expectNotToPerformAssertions(); + return; + } + + $response = $this->client->call( + Client::METHOD_GET, + '/tablesdb/console/tables/' . $data['moviesId'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => 'console', + ], $this->getHeaders()) + ); + + $this->assertEquals(401, $response['headers']['status-code']); + $this->assertEquals('general_access_forbidden', $response['body']['type']); + $this->assertEquals('This endpoint is not available for the console project. The Appwrite Console is a reserved project ID and cannot be used with the Appwrite SDKs and APIs. Please check if your project ID is correct.', $response['body']['message']); + + $response = $this->client->call( + Client::METHOD_GET, + '/tablesdb/console/tables/' . $data['moviesId'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + // 'x-appwrite-project' => '', empty header + ], $this->getHeaders()) + ); + $this->assertEquals(401, $response['headers']['status-code']); + $this->assertEquals('No Appwrite project was specified. Please specify your project ID when initializing your Appwrite SDK.', $response['body']['message']); + } + + /** + * @depends testCreateTable + */ + public function testDisableTable(array $data): void + { + $databaseId = $data['databaseId']; + /** + * Test for SUCCESS + */ + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Movies', + 'enabled' => false, + 'rowSecurity' => true, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertFalse($response['body']['enabled']); + + if ($this->getSide() === 'client') { + $responseCreateRow = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Captain America', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(404, $responseCreateRow['headers']['status-code']); + + $responseListRow = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(404, $responseListRow['headers']['status-code']); + + $responseGetRow = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/someID', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(404, $responseGetRow['headers']['status-code']); + } + + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Movies', + 'enabled' => true, + 'rowSecurity' => true, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertTrue($response['body']['enabled']); + } + + /** + * @depends testCreateTable + */ + public function testCreateColumns(array $data): array + { + $databaseId = $data['databaseId']; + + $title = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + + $description = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'description', + 'size' => 512, + 'required' => false, + 'default' => '', + ]); + + $tagline = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'tagline', + 'size' => 512, + 'required' => false, + 'default' => '', + ]); + + $releaseYear = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'releaseYear', + 'required' => true, + 'min' => 1900, + 'max' => 2200, + ]); + + $duration = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'duration', + 'required' => false, + 'min' => 60, + ]); + + $actors = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'actors', + 'size' => 256, + 'required' => false, + 'array' => true, + ]); + + $datetime = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns/datetime', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'birthDay', + 'required' => false, + ]); + + $relationship = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $data['actorsId'], + 'type' => 'oneToMany', + 'twoWay' => true, + 'key' => 'starringActors', + 'twoWayKey' => 'movie' + ]); + + $integers = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'integers', + 'required' => false, + 'array' => true, + 'min' => 10, + 'max' => 99, + ]); + + $this->assertEquals(202, $title['headers']['status-code']); + $this->assertEquals($title['body']['key'], 'title'); + $this->assertEquals($title['body']['type'], 'string'); + $this->assertEquals($title['body']['size'], 256); + $this->assertEquals($title['body']['required'], true); + + $this->assertEquals(202, $description['headers']['status-code']); + $this->assertEquals($description['body']['key'], 'description'); + $this->assertEquals($description['body']['type'], 'string'); + $this->assertEquals($description['body']['size'], 512); + $this->assertEquals($description['body']['required'], false); + $this->assertEquals($description['body']['default'], ''); + + $this->assertEquals(202, $tagline['headers']['status-code']); + $this->assertEquals($tagline['body']['key'], 'tagline'); + $this->assertEquals($tagline['body']['type'], 'string'); + $this->assertEquals($tagline['body']['size'], 512); + $this->assertEquals($tagline['body']['required'], false); + $this->assertEquals($tagline['body']['default'], ''); + + $this->assertEquals(202, $releaseYear['headers']['status-code']); + $this->assertEquals($releaseYear['body']['key'], 'releaseYear'); + $this->assertEquals($releaseYear['body']['type'], 'integer'); + $this->assertEquals($releaseYear['body']['required'], true); + + $this->assertEquals(202, $duration['headers']['status-code']); + $this->assertEquals($duration['body']['key'], 'duration'); + $this->assertEquals($duration['body']['type'], 'integer'); + $this->assertEquals($duration['body']['required'], false); + + $this->assertEquals(202, $actors['headers']['status-code']); + $this->assertEquals($actors['body']['key'], 'actors'); + $this->assertEquals($actors['body']['type'], 'string'); + $this->assertEquals($actors['body']['size'], 256); + $this->assertEquals($actors['body']['required'], false); + $this->assertEquals($actors['body']['array'], true); + + $this->assertEquals($datetime['headers']['status-code'], 202); + $this->assertEquals($datetime['body']['key'], 'birthDay'); + $this->assertEquals($datetime['body']['type'], 'datetime'); + $this->assertEquals($datetime['body']['required'], false); + + $this->assertEquals($relationship['headers']['status-code'], 202); + $this->assertEquals($relationship['body']['key'], 'starringActors'); + $this->assertEquals($relationship['body']['type'], 'relationship'); + $this->assertEquals($relationship['body']['relatedTable'], $data['actorsId']); + $this->assertEquals($relationship['body']['relationType'], 'oneToMany'); + $this->assertEquals($relationship['body']['twoWay'], true); + $this->assertEquals($relationship['body']['twoWayKey'], 'movie'); + + $this->assertEquals(202, $integers['headers']['status-code']); + $this->assertEquals($integers['body']['key'], 'integers'); + $this->assertEquals($integers['body']['type'], 'integer'); + $this->assertArrayNotHasKey('size', $integers['body']); + $this->assertEquals($integers['body']['required'], false); + $this->assertEquals($integers['body']['array'], true); + + // wait for database worker to create attributes + sleep(2); + + $movies = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertIsArray($movies['body']['columns']); + $this->assertCount(9, $movies['body']['columns']); + $this->assertEquals($movies['body']['columns'][0]['key'], $title['body']['key']); + $this->assertEquals($movies['body']['columns'][1]['key'], $description['body']['key']); + $this->assertEquals($movies['body']['columns'][2]['key'], $tagline['body']['key']); + $this->assertEquals($movies['body']['columns'][3]['key'], $releaseYear['body']['key']); + $this->assertEquals($movies['body']['columns'][4]['key'], $duration['body']['key']); + $this->assertEquals($movies['body']['columns'][5]['key'], $actors['body']['key']); + $this->assertEquals($movies['body']['columns'][6]['key'], $datetime['body']['key']); + $this->assertEquals($movies['body']['columns'][7]['key'], $relationship['body']['key']); + $this->assertEquals($movies['body']['columns'][8]['key'], $integers['body']['key']); + + return $data; + } + + /** + * @depends testCreateColumns + */ + public function testListColumns(array $data): void + { + $databaseId = $data['databaseId']; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'queries' => [ + Query::equal('type', ['string'])->toString(), + Query::limit(2)->toString(), + Query::cursorAfter(new Document(['$id' => 'title']))->toString() + ], + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, \count($response['body']['columns'])); + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'queries' => [Query::select(['key'])->toString()], + ]); + $this->assertEquals(Exception::GENERAL_ARGUMENT_INVALID, $response['body']['type']); + $this->assertEquals(400, $response['headers']['status-code']); + } + + /** + * @depends testCreateDatabase + */ + public function testPatchColumn(array $data): void + { + $databaseId = $data['databaseId']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'patch', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $this->assertEquals($table['body']['name'], 'patch'); + + $attribute = $this->client->call(Client::METHOD_POST, '/tablesdb/'.$databaseId.'/tables/'.$table['body']['$id'].'/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'title', + 'required' => true, + 'size' => 100, + ]); + $this->assertEquals(202, $attribute['headers']['status-code']); + $this->assertEquals($attribute['body']['size'], 100); + + sleep(1); + + $index = $this->client->call(Client::METHOD_POST, '/tablesdb/'.$databaseId.'/tables/'.$table['body']['$id'].'/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'titleIndex', + 'type' => 'key', + 'columns' => ['title'], + ]); + $this->assertEquals(202, $index['headers']['status-code']); + + sleep(1); + + /** + * Update column size to exceed Index maximum length + */ + $attribute = $this->client->call(Client::METHOD_PATCH, '/tablesdb/'.$databaseId.'/tables/'.$table['body']['$id'].'/columns/string/'.$attribute['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'size' => 1000, + 'required' => true, + 'default' => null, + ]); + + $this->assertEquals(400, $attribute['headers']['status-code']); + $this->assertStringContainsString('Index length is longer than the maximum: 76', $attribute['body']['message']); + } + + public function testUpdateColumnEnum(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Test Database 2' + ]); + + $players = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $database['body']['$id'] . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Players', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + // Create enum column + $attribute = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $database['body']['$id'] . '/tables/' . $players['body']['$id'] . '/columns/enum', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'key' => 'position', + 'elements' => ['goalkeeper', 'defender', 'midfielder', 'forward'], + 'required' => true, + 'array' => false, + ]); + + $this->assertEquals(202, $attribute['headers']['status-code']); + $this->assertEquals($attribute['body']['key'], 'position'); + $this->assertEquals($attribute['body']['elements'], ['goalkeeper', 'defender', 'midfielder', 'forward']); + + \sleep(2); + + // Update enum column + $attribute = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $database['body']['$id'] . '/tables/' . $players['body']['$id'] . '/columns/enum/' . $attribute['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'elements' => ['goalkeeper', 'defender', 'midfielder', 'forward', 'coach'], + 'required' => true, + 'default' => null + ]); + + $this->assertEquals(200, $attribute['headers']['status-code']); + $this->assertEquals($attribute['body']['elements'], ['goalkeeper', 'defender', 'midfielder', 'forward', 'coach']); + } + + /** + * @depends testCreateColumns + */ + public function testColumnResponseModels(array $data): array + { + $databaseId = $data['databaseId']; + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Response Models', + // 'permissions' missing on purpose to make sure it's optional + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $this->assertEquals($table['body']['name'], 'Response Models'); + + $tableId = $table['body']['$id']; + + $columnsPath = "/tablesdb/" . $databaseId . "/tables/{$tableId}/columns"; + + $string = $this->client->call(Client::METHOD_POST, $columnsPath . '/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'string', + 'size' => 16, + 'required' => false, + 'default' => 'default', + ]); + + $email = $this->client->call(Client::METHOD_POST, $columnsPath . '/email', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'email', + 'required' => false, + 'default' => 'default@example.com', + ]); + + $enum = $this->client->call(Client::METHOD_POST, $columnsPath . '/enum', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'enum', + 'elements' => ['yes', 'no', 'maybe'], + 'required' => false, + 'default' => 'maybe', + ]); + + $ip = $this->client->call(Client::METHOD_POST, $columnsPath . '/ip', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'ip', + 'required' => false, + 'default' => '192.0.2.0', + ]); + + $url = $this->client->call(Client::METHOD_POST, $columnsPath . '/url', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'url', + 'required' => false, + 'default' => 'http://example.com', + ]); + + $integer = $this->client->call(Client::METHOD_POST, $columnsPath . '/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'integer', + 'required' => false, + 'min' => 1, + 'max' => 5, + 'default' => 3 + ]); + + $float = $this->client->call(Client::METHOD_POST, $columnsPath . '/float', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'float', + 'required' => false, + 'min' => 1.5, + 'max' => 5.5, + 'default' => 3.5 + ]); + + $boolean = $this->client->call(Client::METHOD_POST, $columnsPath . '/boolean', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'boolean', + 'required' => false, + 'default' => true, + ]); + + $datetime = $this->client->call(Client::METHOD_POST, $columnsPath . '/datetime', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'datetime', + 'required' => false, + 'default' => null, + ]); + + $relationship = $this->client->call(Client::METHOD_POST, $columnsPath . '/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $data['actorsId'], + 'type' => 'oneToMany', + 'twoWay' => true, + 'key' => 'relationship', + 'twoWayKey' => 'twoWayKey' + ]); + + $strings = $this->client->call(Client::METHOD_POST, $columnsPath . '/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'names', + 'size' => 512, + 'required' => false, + 'array' => true, + ]); + + $integers = $this->client->call(Client::METHOD_POST, $columnsPath . '/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'numbers', + 'required' => false, + 'array' => true, + 'min' => 1, + 'max' => 999, + ]); + + $this->assertEquals(202, $string['headers']['status-code']); + $this->assertEquals('string', $string['body']['key']); + $this->assertEquals('string', $string['body']['type']); + $this->assertEquals(false, $string['body']['required']); + $this->assertEquals(false, $string['body']['array']); + $this->assertEquals(16, $string['body']['size']); + $this->assertEquals('default', $string['body']['default']); + + $this->assertEquals(202, $email['headers']['status-code']); + $this->assertEquals('email', $email['body']['key']); + $this->assertEquals('string', $email['body']['type']); + $this->assertEquals(false, $email['body']['required']); + $this->assertEquals(false, $email['body']['array']); + $this->assertEquals('email', $email['body']['format']); + $this->assertEquals('default@example.com', $email['body']['default']); + + $this->assertEquals(202, $enum['headers']['status-code']); + $this->assertEquals('enum', $enum['body']['key']); + $this->assertEquals('string', $enum['body']['type']); + $this->assertEquals(false, $enum['body']['required']); + $this->assertEquals(false, $enum['body']['array']); + $this->assertEquals('enum', $enum['body']['format']); + $this->assertEquals('maybe', $enum['body']['default']); + $this->assertIsArray($enum['body']['elements']); + $this->assertEquals(['yes', 'no', 'maybe'], $enum['body']['elements']); + + $this->assertEquals(202, $ip['headers']['status-code']); + $this->assertEquals('ip', $ip['body']['key']); + $this->assertEquals('string', $ip['body']['type']); + $this->assertEquals(false, $ip['body']['required']); + $this->assertEquals(false, $ip['body']['array']); + $this->assertEquals('ip', $ip['body']['format']); + $this->assertEquals('192.0.2.0', $ip['body']['default']); + + $this->assertEquals(202, $url['headers']['status-code']); + $this->assertEquals('url', $url['body']['key']); + $this->assertEquals('string', $url['body']['type']); + $this->assertEquals(false, $url['body']['required']); + $this->assertEquals(false, $url['body']['array']); + $this->assertEquals('url', $url['body']['format']); + $this->assertEquals('http://example.com', $url['body']['default']); + + $this->assertEquals(202, $integer['headers']['status-code']); + $this->assertEquals('integer', $integer['body']['key']); + $this->assertEquals('integer', $integer['body']['type']); + $this->assertEquals(false, $integer['body']['required']); + $this->assertEquals(false, $integer['body']['array']); + $this->assertEquals(1, $integer['body']['min']); + $this->assertEquals(5, $integer['body']['max']); + $this->assertEquals(3, $integer['body']['default']); + + $this->assertEquals(202, $float['headers']['status-code']); + $this->assertEquals('float', $float['body']['key']); + $this->assertEquals('double', $float['body']['type']); + $this->assertEquals(false, $float['body']['required']); + $this->assertEquals(false, $float['body']['array']); + $this->assertEquals(1.5, $float['body']['min']); + $this->assertEquals(5.5, $float['body']['max']); + $this->assertEquals(3.5, $float['body']['default']); + + $this->assertEquals(202, $boolean['headers']['status-code']); + $this->assertEquals('boolean', $boolean['body']['key']); + $this->assertEquals('boolean', $boolean['body']['type']); + $this->assertEquals(false, $boolean['body']['required']); + $this->assertEquals(false, $boolean['body']['array']); + $this->assertEquals(true, $boolean['body']['default']); + + $this->assertEquals(202, $datetime['headers']['status-code']); + $this->assertEquals('datetime', $datetime['body']['key']); + $this->assertEquals('datetime', $datetime['body']['type']); + $this->assertEquals(false, $datetime['body']['required']); + $this->assertEquals(false, $datetime['body']['array']); + $this->assertEquals(null, $datetime['body']['default']); + + $this->assertEquals(202, $relationship['headers']['status-code']); + $this->assertEquals('relationship', $relationship['body']['key']); + $this->assertEquals('relationship', $relationship['body']['type']); + $this->assertEquals(false, $relationship['body']['required']); + $this->assertEquals(false, $relationship['body']['array']); + $this->assertEquals($data['actorsId'], $relationship['body']['relatedTable']); + $this->assertEquals('oneToMany', $relationship['body']['relationType']); + $this->assertEquals(true, $relationship['body']['twoWay']); + $this->assertEquals('twoWayKey', $relationship['body']['twoWayKey']); + + $this->assertEquals(202, $strings['headers']['status-code']); + $this->assertEquals('names', $strings['body']['key']); + $this->assertEquals('string', $strings['body']['type']); + $this->assertEquals(false, $strings['body']['required']); + $this->assertEquals(true, $strings['body']['array']); + $this->assertEquals(null, $strings['body']['default']); + + $this->assertEquals(202, $integers['headers']['status-code']); + $this->assertEquals('numbers', $integers['body']['key']); + $this->assertEquals('integer', $integers['body']['type']); + $this->assertEquals(false, $integers['body']['required']); + $this->assertEquals(true, $integers['body']['array']); + $this->assertEquals(1, $integers['body']['min']); + $this->assertEquals(999, $integers['body']['max']); + $this->assertEquals(null, $integers['body']['default']); + + // Wait for database worker to create attributes + sleep(5); + + $stringResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $string['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $emailResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $email['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $enumResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $enum['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $ipResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $ip['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $urlResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $url['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $integerResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $integer['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $floatResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $float['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $booleanResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $boolean['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $datetimeResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $datetime['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $relationshipResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $relationship['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $stringsResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $strings['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $integersResponse = $this->client->call(Client::METHOD_GET, $columnsPath . '/' . $integers['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $stringResponse['headers']['status-code']); + $this->assertEquals($string['body']['key'], $stringResponse['body']['key']); + $this->assertEquals($string['body']['type'], $stringResponse['body']['type']); + $this->assertEquals('available', $stringResponse['body']['status']); + $this->assertEquals($string['body']['required'], $stringResponse['body']['required']); + $this->assertEquals($string['body']['array'], $stringResponse['body']['array']); + $this->assertEquals(16, $stringResponse['body']['size']); + $this->assertEquals($string['body']['default'], $stringResponse['body']['default']); + + $this->assertEquals(200, $emailResponse['headers']['status-code']); + $this->assertEquals($email['body']['key'], $emailResponse['body']['key']); + $this->assertEquals($email['body']['type'], $emailResponse['body']['type']); + $this->assertEquals('available', $emailResponse['body']['status']); + $this->assertEquals($email['body']['required'], $emailResponse['body']['required']); + $this->assertEquals($email['body']['array'], $emailResponse['body']['array']); + $this->assertEquals($email['body']['format'], $emailResponse['body']['format']); + $this->assertEquals($email['body']['default'], $emailResponse['body']['default']); + + $this->assertEquals(200, $enumResponse['headers']['status-code']); + $this->assertEquals($enum['body']['key'], $enumResponse['body']['key']); + $this->assertEquals($enum['body']['type'], $enumResponse['body']['type']); + $this->assertEquals('available', $enumResponse['body']['status']); + $this->assertEquals($enum['body']['required'], $enumResponse['body']['required']); + $this->assertEquals($enum['body']['array'], $enumResponse['body']['array']); + $this->assertEquals($enum['body']['format'], $enumResponse['body']['format']); + $this->assertEquals($enum['body']['default'], $enumResponse['body']['default']); + $this->assertEquals($enum['body']['elements'], $enumResponse['body']['elements']); + + $this->assertEquals(200, $ipResponse['headers']['status-code']); + $this->assertEquals($ip['body']['key'], $ipResponse['body']['key']); + $this->assertEquals($ip['body']['type'], $ipResponse['body']['type']); + $this->assertEquals('available', $ipResponse['body']['status']); + $this->assertEquals($ip['body']['required'], $ipResponse['body']['required']); + $this->assertEquals($ip['body']['array'], $ipResponse['body']['array']); + $this->assertEquals($ip['body']['format'], $ipResponse['body']['format']); + $this->assertEquals($ip['body']['default'], $ipResponse['body']['default']); + + $this->assertEquals(200, $urlResponse['headers']['status-code']); + $this->assertEquals($url['body']['key'], $urlResponse['body']['key']); + $this->assertEquals($url['body']['type'], $urlResponse['body']['type']); + $this->assertEquals('available', $urlResponse['body']['status']); + $this->assertEquals($url['body']['required'], $urlResponse['body']['required']); + $this->assertEquals($url['body']['array'], $urlResponse['body']['array']); + $this->assertEquals($url['body']['format'], $urlResponse['body']['format']); + $this->assertEquals($url['body']['default'], $urlResponse['body']['default']); + + $this->assertEquals(200, $integerResponse['headers']['status-code']); + $this->assertEquals($integer['body']['key'], $integerResponse['body']['key']); + $this->assertEquals($integer['body']['type'], $integerResponse['body']['type']); + $this->assertEquals('available', $integerResponse['body']['status']); + $this->assertEquals($integer['body']['required'], $integerResponse['body']['required']); + $this->assertEquals($integer['body']['array'], $integerResponse['body']['array']); + $this->assertEquals($integer['body']['min'], $integerResponse['body']['min']); + $this->assertEquals($integer['body']['max'], $integerResponse['body']['max']); + $this->assertEquals($integer['body']['default'], $integerResponse['body']['default']); + + $this->assertEquals(200, $floatResponse['headers']['status-code']); + $this->assertEquals($float['body']['key'], $floatResponse['body']['key']); + $this->assertEquals($float['body']['type'], $floatResponse['body']['type']); + $this->assertEquals('available', $floatResponse['body']['status']); + $this->assertEquals($float['body']['required'], $floatResponse['body']['required']); + $this->assertEquals($float['body']['array'], $floatResponse['body']['array']); + $this->assertEquals($float['body']['min'], $floatResponse['body']['min']); + $this->assertEquals($float['body']['max'], $floatResponse['body']['max']); + $this->assertEquals($float['body']['default'], $floatResponse['body']['default']); + + $this->assertEquals(200, $booleanResponse['headers']['status-code']); + $this->assertEquals($boolean['body']['key'], $booleanResponse['body']['key']); + $this->assertEquals($boolean['body']['type'], $booleanResponse['body']['type']); + $this->assertEquals('available', $booleanResponse['body']['status']); + $this->assertEquals($boolean['body']['required'], $booleanResponse['body']['required']); + $this->assertEquals($boolean['body']['array'], $booleanResponse['body']['array']); + $this->assertEquals($boolean['body']['default'], $booleanResponse['body']['default']); + + $this->assertEquals(200, $datetimeResponse['headers']['status-code']); + $this->assertEquals($datetime['body']['key'], $datetimeResponse['body']['key']); + $this->assertEquals($datetime['body']['type'], $datetimeResponse['body']['type']); + $this->assertEquals('available', $datetimeResponse['body']['status']); + $this->assertEquals($datetime['body']['required'], $datetimeResponse['body']['required']); + $this->assertEquals($datetime['body']['array'], $datetimeResponse['body']['array']); + $this->assertEquals($datetime['body']['default'], $datetimeResponse['body']['default']); + + $this->assertEquals(200, $relationshipResponse['headers']['status-code']); + $this->assertEquals($relationship['body']['key'], $relationshipResponse['body']['key']); + $this->assertEquals($relationship['body']['type'], $relationshipResponse['body']['type']); + $this->assertEquals('available', $relationshipResponse['body']['status']); + $this->assertEquals($relationship['body']['required'], $relationshipResponse['body']['required']); + $this->assertEquals($relationship['body']['array'], $relationshipResponse['body']['array']); + $this->assertEquals($relationship['body']['relatedTable'], $relationshipResponse['body']['relatedTable']); + $this->assertEquals($relationship['body']['relationType'], $relationshipResponse['body']['relationType']); + $this->assertEquals($relationship['body']['twoWay'], $relationshipResponse['body']['twoWay']); + $this->assertEquals($relationship['body']['twoWayKey'], $relationshipResponse['body']['twoWayKey']); + + $columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $columns['headers']['status-code']); + $this->assertEquals(12, $columns['body']['total']); + + $columns = $columns['body']['columns']; + $this->assertIsArray($columns); + $this->assertCount(12, $columns); + + $this->assertEquals($stringResponse['body']['key'], $columns[0]['key']); + $this->assertEquals($stringResponse['body']['type'], $columns[0]['type']); + $this->assertEquals($stringResponse['body']['status'], $columns[0]['status']); + $this->assertEquals($stringResponse['body']['required'], $columns[0]['required']); + $this->assertEquals($stringResponse['body']['array'], $columns[0]['array']); + $this->assertEquals($stringResponse['body']['size'], $columns[0]['size']); + $this->assertEquals($stringResponse['body']['default'], $columns[0]['default']); + + $this->assertEquals($emailResponse['body']['key'], $columns[1]['key']); + $this->assertEquals($emailResponse['body']['type'], $columns[1]['type']); + $this->assertEquals($emailResponse['body']['status'], $columns[1]['status']); + $this->assertEquals($emailResponse['body']['required'], $columns[1]['required']); + $this->assertEquals($emailResponse['body']['array'], $columns[1]['array']); + $this->assertEquals($emailResponse['body']['default'], $columns[1]['default']); + $this->assertEquals($emailResponse['body']['format'], $columns[1]['format']); + + $this->assertEquals($enumResponse['body']['key'], $columns[2]['key']); + $this->assertEquals($enumResponse['body']['type'], $columns[2]['type']); + $this->assertEquals($enumResponse['body']['status'], $columns[2]['status']); + $this->assertEquals($enumResponse['body']['required'], $columns[2]['required']); + $this->assertEquals($enumResponse['body']['array'], $columns[2]['array']); + $this->assertEquals($enumResponse['body']['default'], $columns[2]['default']); + $this->assertEquals($enumResponse['body']['format'], $columns[2]['format']); + $this->assertEquals($enumResponse['body']['elements'], $columns[2]['elements']); + + $this->assertEquals($ipResponse['body']['key'], $columns[3]['key']); + $this->assertEquals($ipResponse['body']['type'], $columns[3]['type']); + $this->assertEquals($ipResponse['body']['status'], $columns[3]['status']); + $this->assertEquals($ipResponse['body']['required'], $columns[3]['required']); + $this->assertEquals($ipResponse['body']['array'], $columns[3]['array']); + $this->assertEquals($ipResponse['body']['default'], $columns[3]['default']); + $this->assertEquals($ipResponse['body']['format'], $columns[3]['format']); + + $this->assertEquals($urlResponse['body']['key'], $columns[4]['key']); + $this->assertEquals($urlResponse['body']['type'], $columns[4]['type']); + $this->assertEquals($urlResponse['body']['status'], $columns[4]['status']); + $this->assertEquals($urlResponse['body']['required'], $columns[4]['required']); + $this->assertEquals($urlResponse['body']['array'], $columns[4]['array']); + $this->assertEquals($urlResponse['body']['default'], $columns[4]['default']); + $this->assertEquals($urlResponse['body']['format'], $columns[4]['format']); + + $this->assertEquals($integerResponse['body']['key'], $columns[5]['key']); + $this->assertEquals($integerResponse['body']['type'], $columns[5]['type']); + $this->assertEquals($integerResponse['body']['status'], $columns[5]['status']); + $this->assertEquals($integerResponse['body']['required'], $columns[5]['required']); + $this->assertEquals($integerResponse['body']['array'], $columns[5]['array']); + $this->assertEquals($integerResponse['body']['default'], $columns[5]['default']); + $this->assertEquals($integerResponse['body']['min'], $columns[5]['min']); + $this->assertEquals($integerResponse['body']['max'], $columns[5]['max']); + + $this->assertEquals($floatResponse['body']['key'], $columns[6]['key']); + $this->assertEquals($floatResponse['body']['type'], $columns[6]['type']); + $this->assertEquals($floatResponse['body']['status'], $columns[6]['status']); + $this->assertEquals($floatResponse['body']['required'], $columns[6]['required']); + $this->assertEquals($floatResponse['body']['array'], $columns[6]['array']); + $this->assertEquals($floatResponse['body']['default'], $columns[6]['default']); + $this->assertEquals($floatResponse['body']['min'], $columns[6]['min']); + $this->assertEquals($floatResponse['body']['max'], $columns[6]['max']); + + $this->assertEquals($booleanResponse['body']['key'], $columns[7]['key']); + $this->assertEquals($booleanResponse['body']['type'], $columns[7]['type']); + $this->assertEquals($booleanResponse['body']['status'], $columns[7]['status']); + $this->assertEquals($booleanResponse['body']['required'], $columns[7]['required']); + $this->assertEquals($booleanResponse['body']['array'], $columns[7]['array']); + $this->assertEquals($booleanResponse['body']['default'], $columns[7]['default']); + + $this->assertEquals($datetimeResponse['body']['key'], $columns[8]['key']); + $this->assertEquals($datetimeResponse['body']['type'], $columns[8]['type']); + $this->assertEquals($datetimeResponse['body']['status'], $columns[8]['status']); + $this->assertEquals($datetimeResponse['body']['required'], $columns[8]['required']); + $this->assertEquals($datetimeResponse['body']['array'], $columns[8]['array']); + $this->assertEquals($datetimeResponse['body']['default'], $columns[8]['default']); + + $this->assertEquals($relationshipResponse['body']['key'], $columns[9]['key']); + $this->assertEquals($relationshipResponse['body']['type'], $columns[9]['type']); + $this->assertEquals($relationshipResponse['body']['status'], $columns[9]['status']); + $this->assertEquals($relationshipResponse['body']['required'], $columns[9]['required']); + $this->assertEquals($relationshipResponse['body']['array'], $columns[9]['array']); + $this->assertEquals($relationshipResponse['body']['relatedTable'], $columns[9]['relatedTable']); + $this->assertEquals($relationshipResponse['body']['relationType'], $columns[9]['relationType']); + $this->assertEquals($relationshipResponse['body']['twoWay'], $columns[9]['twoWay']); + $this->assertEquals($relationshipResponse['body']['twoWayKey'], $columns[9]['twoWayKey']); + + $this->assertEquals($stringsResponse['body']['key'], $columns[10]['key']); + $this->assertEquals($stringsResponse['body']['type'], $columns[10]['type']); + $this->assertEquals($stringsResponse['body']['status'], $columns[10]['status']); + $this->assertEquals($stringsResponse['body']['required'], $columns[10]['required']); + $this->assertEquals($stringsResponse['body']['array'], $columns[10]['array']); + $this->assertEquals($stringsResponse['body']['default'], $columns[10]['default']); + + $this->assertEquals($integersResponse['body']['key'], $columns[11]['key']); + $this->assertEquals($integersResponse['body']['type'], $columns[11]['type']); + $this->assertEquals($integersResponse['body']['status'], $columns[11]['status']); + $this->assertEquals($integersResponse['body']['required'], $columns[11]['required']); + $this->assertEquals($integersResponse['body']['array'], $columns[11]['array']); + $this->assertEquals($integersResponse['body']['default'], $columns[11]['default']); + $this->assertEquals($integersResponse['body']['min'], $columns[11]['min']); + $this->assertEquals($integersResponse['body']['max'], $columns[11]['max']); + + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $table['headers']['status-code']); + + $columns = $table['body']['columns']; + + $this->assertIsArray($columns); + $this->assertCount(12, $columns); + + $this->assertEquals($stringResponse['body']['key'], $columns[0]['key']); + $this->assertEquals($stringResponse['body']['type'], $columns[0]['type']); + $this->assertEquals($stringResponse['body']['status'], $columns[0]['status']); + $this->assertEquals($stringResponse['body']['required'], $columns[0]['required']); + $this->assertEquals($stringResponse['body']['array'], $columns[0]['array']); + $this->assertEquals($stringResponse['body']['size'], $columns[0]['size']); + $this->assertEquals($stringResponse['body']['default'], $columns[0]['default']); + + $this->assertEquals($emailResponse['body']['key'], $columns[1]['key']); + $this->assertEquals($emailResponse['body']['type'], $columns[1]['type']); + $this->assertEquals($emailResponse['body']['status'], $columns[1]['status']); + $this->assertEquals($emailResponse['body']['required'], $columns[1]['required']); + $this->assertEquals($emailResponse['body']['array'], $columns[1]['array']); + $this->assertEquals($emailResponse['body']['default'], $columns[1]['default']); + $this->assertEquals($emailResponse['body']['format'], $columns[1]['format']); + + $this->assertEquals($enumResponse['body']['key'], $columns[2]['key']); + $this->assertEquals($enumResponse['body']['type'], $columns[2]['type']); + $this->assertEquals($enumResponse['body']['status'], $columns[2]['status']); + $this->assertEquals($enumResponse['body']['required'], $columns[2]['required']); + $this->assertEquals($enumResponse['body']['array'], $columns[2]['array']); + $this->assertEquals($enumResponse['body']['default'], $columns[2]['default']); + $this->assertEquals($enumResponse['body']['format'], $columns[2]['format']); + $this->assertEquals($enumResponse['body']['elements'], $columns[2]['elements']); + + $this->assertEquals($ipResponse['body']['key'], $columns[3]['key']); + $this->assertEquals($ipResponse['body']['type'], $columns[3]['type']); + $this->assertEquals($ipResponse['body']['status'], $columns[3]['status']); + $this->assertEquals($ipResponse['body']['required'], $columns[3]['required']); + $this->assertEquals($ipResponse['body']['array'], $columns[3]['array']); + $this->assertEquals($ipResponse['body']['default'], $columns[3]['default']); + $this->assertEquals($ipResponse['body']['format'], $columns[3]['format']); + + $this->assertEquals($urlResponse['body']['key'], $columns[4]['key']); + $this->assertEquals($urlResponse['body']['type'], $columns[4]['type']); + $this->assertEquals($urlResponse['body']['status'], $columns[4]['status']); + $this->assertEquals($urlResponse['body']['required'], $columns[4]['required']); + $this->assertEquals($urlResponse['body']['array'], $columns[4]['array']); + $this->assertEquals($urlResponse['body']['default'], $columns[4]['default']); + $this->assertEquals($urlResponse['body']['format'], $columns[4]['format']); + + $this->assertEquals($integerResponse['body']['key'], $columns[5]['key']); + $this->assertEquals($integerResponse['body']['type'], $columns[5]['type']); + $this->assertEquals($integerResponse['body']['status'], $columns[5]['status']); + $this->assertEquals($integerResponse['body']['required'], $columns[5]['required']); + $this->assertEquals($integerResponse['body']['array'], $columns[5]['array']); + $this->assertEquals($integerResponse['body']['default'], $columns[5]['default']); + $this->assertEquals($integerResponse['body']['min'], $columns[5]['min']); + $this->assertEquals($integerResponse['body']['max'], $columns[5]['max']); + + $this->assertEquals($floatResponse['body']['key'], $columns[6]['key']); + $this->assertEquals($floatResponse['body']['type'], $columns[6]['type']); + $this->assertEquals($floatResponse['body']['status'], $columns[6]['status']); + $this->assertEquals($floatResponse['body']['required'], $columns[6]['required']); + $this->assertEquals($floatResponse['body']['array'], $columns[6]['array']); + $this->assertEquals($floatResponse['body']['default'], $columns[6]['default']); + $this->assertEquals($floatResponse['body']['min'], $columns[6]['min']); + $this->assertEquals($floatResponse['body']['max'], $columns[6]['max']); + + $this->assertEquals($booleanResponse['body']['key'], $columns[7]['key']); + $this->assertEquals($booleanResponse['body']['type'], $columns[7]['type']); + $this->assertEquals($booleanResponse['body']['status'], $columns[7]['status']); + $this->assertEquals($booleanResponse['body']['required'], $columns[7]['required']); + $this->assertEquals($booleanResponse['body']['array'], $columns[7]['array']); + $this->assertEquals($booleanResponse['body']['default'], $columns[7]['default']); + + $this->assertEquals($datetimeResponse['body']['key'], $columns[8]['key']); + $this->assertEquals($datetimeResponse['body']['type'], $columns[8]['type']); + $this->assertEquals($datetimeResponse['body']['status'], $columns[8]['status']); + $this->assertEquals($datetimeResponse['body']['required'], $columns[8]['required']); + $this->assertEquals($datetimeResponse['body']['array'], $columns[8]['array']); + $this->assertEquals($datetimeResponse['body']['default'], $columns[8]['default']); + + $this->assertEquals($relationshipResponse['body']['key'], $columns[9]['key']); + $this->assertEquals($relationshipResponse['body']['type'], $columns[9]['type']); + $this->assertEquals($relationshipResponse['body']['status'], $columns[9]['status']); + $this->assertEquals($relationshipResponse['body']['required'], $columns[9]['required']); + $this->assertEquals($relationshipResponse['body']['array'], $columns[9]['array']); + $this->assertEquals($relationshipResponse['body']['relatedTable'], $columns[9]['relatedTable']); + $this->assertEquals($relationshipResponse['body']['relationType'], $columns[9]['relationType']); + $this->assertEquals($relationshipResponse['body']['twoWay'], $columns[9]['twoWay']); + $this->assertEquals($relationshipResponse['body']['twoWayKey'], $columns[9]['twoWayKey']); + + $this->assertEquals($stringsResponse['body']['key'], $columns[10]['key']); + $this->assertEquals($stringsResponse['body']['type'], $columns[10]['type']); + $this->assertEquals($stringsResponse['body']['status'], $columns[10]['status']); + $this->assertEquals($stringsResponse['body']['required'], $columns[10]['required']); + $this->assertEquals($stringsResponse['body']['array'], $columns[10]['array']); + $this->assertEquals($stringsResponse['body']['default'], $columns[10]['default']); + + $this->assertEquals($integersResponse['body']['key'], $columns[11]['key']); + $this->assertEquals($integersResponse['body']['type'], $columns[11]['type']); + $this->assertEquals($integersResponse['body']['status'], $columns[11]['status']); + $this->assertEquals($integersResponse['body']['required'], $columns[11]['required']); + $this->assertEquals($integersResponse['body']['array'], $columns[11]['array']); + $this->assertEquals($integersResponse['body']['default'], $columns[11]['default']); + $this->assertEquals($integersResponse['body']['min'], $columns[11]['min']); + $this->assertEquals($integersResponse['body']['max'], $columns[11]['max']); + + /** + * Test for FAILURE + */ + $badEnum = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'enum', + 'elements' => ['yes', 'no', ''], + 'required' => false, + 'default' => 'maybe', + ]); + + $this->assertEquals(400, $badEnum['headers']['status-code']); + $this->assertEquals('Invalid `elements` param: Value must a valid array no longer than 100 items and Value must be a valid string and at least 1 chars and no longer than 255 chars', $badEnum['body']['message']); + + return $data; + } + + /** + * @depends testCreateColumns + */ + public function testCreateIndexes(array $data): array + { + $databaseId = $data['databaseId']; + + $titleIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'titleIndex', + 'type' => 'fulltext', + 'columns' => ['title'], + ]); + + $this->assertEquals(202, $titleIndex['headers']['status-code']); + $this->assertEquals('titleIndex', $titleIndex['body']['key']); + $this->assertEquals('fulltext', $titleIndex['body']['type']); + $this->assertCount(1, $titleIndex['body']['columns']); + $this->assertEquals('title', $titleIndex['body']['columns'][0]); + + $releaseYearIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'releaseYear', + 'type' => 'key', + 'columns' => ['releaseYear'], + ]); + + $this->assertEquals(202, $releaseYearIndex['headers']['status-code']); + $this->assertEquals('releaseYear', $releaseYearIndex['body']['key']); + $this->assertEquals('key', $releaseYearIndex['body']['type']); + $this->assertCount(1, $releaseYearIndex['body']['columns']); + $this->assertEquals('releaseYear', $releaseYearIndex['body']['columns'][0]); + + $releaseWithDate1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'releaseYearDated', + 'type' => 'key', + 'columns' => ['releaseYear', '$createdAt', '$updatedAt'], + ]); + + $this->assertEquals(202, $releaseWithDate1['headers']['status-code']); + $this->assertEquals('releaseYearDated', $releaseWithDate1['body']['key']); + $this->assertEquals('key', $releaseWithDate1['body']['type']); + $this->assertCount(3, $releaseWithDate1['body']['columns']); + $this->assertEquals('releaseYear', $releaseWithDate1['body']['columns'][0]); + $this->assertEquals('$createdAt', $releaseWithDate1['body']['columns'][1]); + $this->assertEquals('$updatedAt', $releaseWithDate1['body']['columns'][2]); + + $releaseWithDate2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'birthDay', + 'type' => 'key', + 'columns' => ['birthDay'], + ]); + + $this->assertEquals(202, $releaseWithDate2['headers']['status-code']); + $this->assertEquals('birthDay', $releaseWithDate2['body']['key']); + $this->assertEquals('key', $releaseWithDate2['body']['type']); + $this->assertCount(1, $releaseWithDate2['body']['columns']); + $this->assertEquals('birthDay', $releaseWithDate2['body']['columns'][0]); + + // Test for failure + $fulltextReleaseYear = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'releaseYearDated', + 'type' => 'fulltext', + 'columns' => ['releaseYear'], + ]); + + $this->assertEquals(400, $fulltextReleaseYear['headers']['status-code']); + $this->assertEquals($fulltextReleaseYear['body']['message'], 'Attribute "releaseYear" cannot be part of a FULLTEXT index, must be of type string'); + + $noAttributes = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'none', + 'type' => 'key', + 'columns' => [], + ]); + + $this->assertEquals(400, $noAttributes['headers']['status-code']); + $this->assertEquals($noAttributes['body']['message'], 'No attributes provided for index'); + + $duplicates = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'duplicate', + 'type' => 'fulltext', + 'columns' => ['releaseYear', 'releaseYear'], + ]); + + $this->assertEquals(400, $duplicates['headers']['status-code']); + $this->assertEquals($duplicates['body']['message'], 'Duplicate attributes provided'); + + $tooLong = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'key' => 'tooLong', + 'type' => 'key', + 'columns' => ['description', 'tagline'], + ]); + + $this->assertEquals(400, $tooLong['headers']['status-code']); + $this->assertStringContainsString('Index length is longer than the maximum', $tooLong['body']['message']); + + $fulltextArray = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'key' => 'ft', + 'type' => 'fulltext', + 'columns' => ['actors'], + ]); + + $this->assertEquals(400, $fulltextArray['headers']['status-code']); + $this->assertEquals('"Fulltext" index is forbidden on array attributes', $fulltextArray['body']['message']); + + $actorsArray = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'key' => 'index-actors', + 'type' => 'key', + 'columns' => ['actors'], + ]); + + $this->assertEquals(202, $actorsArray['headers']['status-code']); + + $twoLevelsArray = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'key' => 'index-ip-actors', + 'type' => 'key', + 'columns' => ['releaseYear', 'actors'], // 2 levels + 'orders' => ['DESC', 'DESC'], + ]); + + $this->assertEquals(202, $twoLevelsArray['headers']['status-code']); + + $unknown = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'key' => 'index-unknown', + 'type' => 'key', + 'columns' => ['Unknown'], + ]); + + $this->assertEquals(400, $unknown['headers']['status-code']); + $this->assertEquals('Unknown column: Unknown. Verify the column name or create the column.', $unknown['body']['message']); + + $index1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'key' => 'integers-order', + 'type' => 'key', + 'columns' => ['integers'], // array column + 'orders' => ['DESC'], // Check order is removed in API + ]); + + $this->assertEquals(202, $index1['headers']['status-code']); + + $index2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'key' => 'integers-size', + 'type' => 'key', + 'columns' => ['integers'], // array column + ]); + + $this->assertEquals(202, $index2['headers']['status-code']); + + /** + * Create Indexes by worker + */ + sleep(2); + + $movies = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), []); + + $this->assertIsArray($movies['body']['indexes']); + $this->assertCount(8, $movies['body']['indexes']); + $this->assertEquals($titleIndex['body']['key'], $movies['body']['indexes'][0]['key']); + $this->assertEquals($releaseYearIndex['body']['key'], $movies['body']['indexes'][1]['key']); + $this->assertEquals($releaseWithDate1['body']['key'], $movies['body']['indexes'][2]['key']); + $this->assertEquals($releaseWithDate2['body']['key'], $movies['body']['indexes'][3]['key']); + foreach ($movies['body']['indexes'] as $index) { + $this->assertEquals('available', $index['status']); + } + + return $data; + } + + /** + * @depends testCreateColumns + */ + public function testGetIndexByKeyWithLengths(array $data): void + { + $databaseId = $data['databaseId']; + $tableId = $data['moviesId']; + + // Test case for valid lengths + $create = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/indexes", [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'key' => 'lengthTestIndex', + 'type' => 'key', + 'columns' => ['title','description'], + 'lengths' => [128,200] + ]); + $this->assertEquals(202, $create['headers']['status-code']); + + // Fetch index and check correct lengths + $index = $this->client->call(Client::METHOD_GET, "/tablesdb/{$databaseId}/tables/{$tableId}/indexes/lengthTestIndex", [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + $this->assertEquals(200, $index['headers']['status-code']); + $this->assertEquals('lengthTestIndex', $index['body']['key']); + $this->assertEquals([128, 200], $index['body']['lengths']); + + // Test case for count of lengths greater than attributes (should throw 400) + $create = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/indexes", [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'key' => 'lengthCountExceededIndex', + 'type' => 'key', + 'columns' => ['title'], + 'lengths' => [128, 128] + ]); + $this->assertEquals(400, $create['headers']['status-code']); + + // Test case for lengths exceeding total of 768 + $create = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/indexes", [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'key' => 'lengthTooLargeIndex', + 'type' => 'key', + 'columns' => ['title','description','tagline','actors'], + 'lengths' => [256,256,256,20] + ]); + + $this->assertEquals(400, $create['headers']['status-code']); + + // Test case for negative length values + $create = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/indexes", [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'key' => 'negativeLengthIndex', + 'type' => 'key', + 'columns' => ['title'], + 'lengths' => [-1] + ]); + $this->assertEquals(400, $create['headers']['status-code']); + } + + /** + * @depends testCreateIndexes + */ + public function testListIndexes(array $data): void + { + $databaseId = $data['databaseId']; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'queries' => [ + Query::equal('type', ['key'])->toString(), + Query::limit(2)->toString() + ], + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, \count($response['body']['indexes'])); + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'queries' => [ + Query::select(['key'])->toString(), + ], + ]); + $this->assertEquals(Exception::GENERAL_ARGUMENT_INVALID, $response['body']['type']); + $this->assertEquals(400, $response['headers']['status-code']); + } + + /** + * @depends testCreateIndexes + */ + public function testCreateRow(array $data): array + { + $databaseId = $data['databaseId']; + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Captain America', + 'releaseYear' => 1944, + 'birthDay' => '1975-06-12 14:12:55+02:00', + 'actors' => [ + 'Chris Evans', + 'Samuel Jackson', + ] + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Spider-Man: Far From Home', + 'releaseYear' => 2019, + 'birthDay' => null, + 'actors' => [ + 'Tom Holland', + 'Zendaya Maree Stoermer', + 'Samuel Jackson', + ], + 'integers' => [50,60] + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Spider-Man: Homecoming', + 'releaseYear' => 2017, + 'birthDay' => '1975-06-12 14:12:55 America/New_York', + 'duration' => 65, + 'actors' => [ + 'Tom Holland', + 'Zendaya Maree Stoermer', + ], + 'integers' => [50] + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $row4 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'releaseYear' => 2020, // Missing title, expect an 400 error + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(201, $row1['headers']['status-code']); + $this->assertEquals($data['moviesId'], $row1['body']['$tableId']); + $this->assertArrayNotHasKey('$table', $row1['body']); + $this->assertEquals($databaseId, $row1['body']['$databaseId']); + $this->assertEquals($row1['body']['title'], 'Captain America'); + $this->assertEquals($row1['body']['releaseYear'], 1944); + $this->assertIsArray($row1['body']['$permissions']); + $this->assertCount(3, $row1['body']['$permissions']); + $this->assertCount(2, $row1['body']['actors']); + $this->assertEquals($row1['body']['actors'][0], 'Chris Evans'); + $this->assertEquals($row1['body']['actors'][1], 'Samuel Jackson'); + $this->assertEquals($row1['body']['birthDay'], '1975-06-12T12:12:55.000+00:00'); + $this->assertTrue(array_key_exists('$sequence', $row1['body'])); + $this->assertIsInt($row1['body']['$sequence']); + + $this->assertEquals(201, $row2['headers']['status-code']); + $this->assertEquals($data['moviesId'], $row2['body']['$tableId']); + $this->assertArrayNotHasKey('$table', $row2['body']); + $this->assertEquals($databaseId, $row2['body']['$databaseId']); + $this->assertEquals($row2['body']['title'], 'Spider-Man: Far From Home'); + $this->assertEquals($row2['body']['releaseYear'], 2019); + $this->assertEquals($row2['body']['duration'], null); + $this->assertIsArray($row2['body']['$permissions']); + $this->assertCount(3, $row2['body']['$permissions']); + $this->assertCount(3, $row2['body']['actors']); + $this->assertEquals($row2['body']['actors'][0], 'Tom Holland'); + $this->assertEquals($row2['body']['actors'][1], 'Zendaya Maree Stoermer'); + $this->assertEquals($row2['body']['actors'][2], 'Samuel Jackson'); + $this->assertEquals($row2['body']['birthDay'], null); + $this->assertEquals($row2['body']['integers'][0], 50); + $this->assertEquals($row2['body']['integers'][1], 60); + + $this->assertEquals(201, $row3['headers']['status-code']); + $this->assertEquals($data['moviesId'], $row3['body']['$tableId']); + $this->assertArrayNotHasKey('$table', $row3['body']); + $this->assertEquals($databaseId, $row3['body']['$databaseId']); + $this->assertEquals($row3['body']['title'], 'Spider-Man: Homecoming'); + $this->assertEquals($row3['body']['releaseYear'], 2017); + $this->assertEquals($row3['body']['duration'], 65); + $this->assertIsArray($row3['body']['$permissions']); + $this->assertCount(3, $row3['body']['$permissions']); + $this->assertCount(2, $row3['body']['actors']); + $this->assertEquals($row3['body']['actors'][0], 'Tom Holland'); + $this->assertEquals($row3['body']['actors'][1], 'Zendaya Maree Stoermer'); + $this->assertEquals($row3['body']['birthDay'], '1975-06-12T18:12:55.000+00:00'); // UTC for NY + + $this->assertEquals(400, $row4['headers']['status-code']); + + return $data; + } + + /** + * @depends testCreateIndexes + */ + public function testUpsertRow(array $data): void + { + $databaseId = $data['databaseId']; + $rowId = ID::unique(); + $row = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2000 + ], + 'permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertCount(3, $row['body']['$permissions']); + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals('Thor: Ragnarok', $row['body']['title']); + + /** + * Resubmit same document, nothing to update + */ + $row = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2000, + 'integers' => [], + 'birthDay' => null, + 'duration' => null, + 'starringActors' => [], + 'actors' => [], + 'tagline' => '', + 'description' => '', + ], + 'permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $row['body']['title']); + $this->assertCount(3, $row['body']['$permissions']); + + /** + * Do not allow array list + */ + $row = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + [ + 'title' => 'Thor: Ragnarok 1', + ], + [ + 'title' => 'Thor: Ragnarok 2', + ] + ], + 'permissions' => [ + Permission::read(Role::users()), + ], + ]); + $this->assertEquals(400, $row['headers']['status-code']); + + $row = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Love and Thunder', + 'releaseYear' => 2000 + ], + 'permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals('Thor: Love and Thunder', $row['body']['title']); + + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals('Thor: Love and Thunder', $row['body']['title']); + + // removing permission to read and delete + $row = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Love and Thunder', + 'releaseYear' => 2000 + ], + 'permissions' => [ + Permission::update(Role::users()) + ], + ]); + // shouldn't be able to read as no read permission + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + switch ($this->getSide()) { + case 'client': + $this->assertEquals(404, $row['headers']['status-code']); + break; + case 'server': + $this->assertEquals(200, $row['headers']['status-code']); + break; + } + // shouldn't be able to delete as no delete permission + $row = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + // simulating for the client + // the row should not be allowed to be deleted as needed downward + if ($this->getSide() === 'client') { + $this->assertEquals(401, $row['headers']['status-code']); + } + // giving the delete permission + $row = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Love and Thunder', + 'releaseYear' => 2000 + ], + 'permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()) + ], + ]); + + $row = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(204, $row['headers']['status-code']); + + // relationship behaviour + $person = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => 'person-upsert', + 'name' => 'person', + 'permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + Permission::create(Role::users()), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $person['headers']['status-code']); + + $library = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => 'library-upsert', + 'name' => 'library', + 'permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::create(Role::users()), + Permission::delete(Role::users()), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $library['headers']['status-code']); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'fullName', + 'size' => 255, + 'required' => false, + ]); + + sleep(1); // Wait for worker + + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => 'library-upsert', + 'type' => Database::RELATION_ONE_TO_ONE, + 'key' => 'library', + 'twoWay' => true, + 'onDelete' => Database::RELATION_MUTATE_CASCADE, + ]); + + sleep(1); // Wait for worker + + $libraryName = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $library['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'libraryName', + 'size' => 255, + 'required' => true, + ]); + + sleep(1); // Wait for worker + + $this->assertEquals(202, $libraryName['headers']['status-code']); + + // upserting values + $rowId = ID::unique(); + $person1 = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows/'.$rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'library' => [ + '$id' => 'library1', + '$permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + 'libraryName' => 'Library 1', + ], + ], + 'permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ] + ]); + + $this->assertEquals('Library 1', $person1['body']['library']['libraryName']); + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['fullName', 'library.*'])->toString(), + Query::equal('library', ['library1'])->toString(), + ], + ]); + + $this->assertEquals(1, $rows['body']['total']); + $this->assertEquals('Library 1', $rows['body']['rows'][0]['library']['libraryName']); + + + $person1 = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows/'.$rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'library' => [ + '$id' => 'library1', + '$permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + 'libraryName' => 'Library 2', + ], + ], + 'permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ] + ]); + + // data should get updated + $this->assertEquals('Library 2', $person1['body']['library']['libraryName']); + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['fullName', 'library.*'])->toString(), + Query::equal('library', ['library1'])->toString(), + ], + ]); + + $this->assertEquals(1, $rows['body']['total']); + $this->assertEquals('Library 2', $rows['body']['rows'][0]['library']['libraryName']); + + // data should get added + $person1 = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows/'.ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'library' => [ + '$id' => 'library2', + '$permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + 'libraryName' => 'Library 2', + ], + ], + 'permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ] + ]); + + $this->assertEquals('Library 2', $person1['body']['library']['libraryName']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['fullName', 'library.*'])->toString() + ], + ]); + + $this->assertEquals(2, $rows['body']['total']); + + // test without passing permissions + $row = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2000 + ] + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $row['body']['title']); + + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $row['headers']['status-code']); + + $deleteResponse = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $deleteResponse['headers']['status-code']); + + if ($this->getSide() === 'client') { + // Skipped on server side: Creating a row with no permissions results in an empty permissions array, whereas on client side it assigns permissions to the current user + + // test without passing permissions + $row = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2000 + ] + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $row['body']['title']); + $this->assertCount(3, $row['body']['$permissions']); + $permissionsCreated = $row['body']['$permissions']; + // checking the default created permission + $defaultPermission = [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])) + ]; + // ignoring the order of the permission and checking the permissions + $this->assertEqualsCanonicalizing($defaultPermission, $permissionsCreated); + + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + + // updating the created doc + $row = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2002 + ] + ]); + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $row['body']['title']); + $this->assertEquals(2002, $row['body']['releaseYear']); + $this->assertCount(3, $row['body']['$permissions']); + $this->assertEquals($permissionsCreated, $row['body']['$permissions']); + + // removing the delete permission + $row = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2002 + ], + 'permissions' => [ + Permission::update(Role::user($this->getUser()['$id'])) + ] + ]); + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $row['body']['title']); + $this->assertEquals(2002, $row['body']['releaseYear']); + $this->assertCount(1, $row['body']['$permissions']); + + $deleteResponse = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(401, $deleteResponse['headers']['status-code']); + + // giving the delete permission + $row = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2002 + ], + 'permissions' => [ + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])) + ] + ]); + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $row['body']['title']); + $this->assertEquals(2002, $row['body']['releaseYear']); + $this->assertCount(2, $row['body']['$permissions']); + + $deleteResponse = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(204, $deleteResponse['headers']['status-code']); + + // upsert for the related row without passing permissions + // data should get added + $newPersonId = ID::unique(); + $personNoPerm = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows/' . $newPersonId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'library' => [ + '$id' => 'library3', + 'libraryName' => 'Library 3', + ], + ], + ]); + + $this->assertEquals('Library 3', $personNoPerm['body']['library']['libraryName']); + $this->assertCount(3, $personNoPerm['body']['library']['$permissions']); + $this->assertCount(3, $personNoPerm['body']['$permissions']); + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['fullName', 'library.*'])->toString() + ], + ]); + $this->assertGreaterThanOrEqual(1, $rows['body']['total']); + $rowsDetails = $rows['body']['rows']; + foreach ($rowsDetails as $doc) { + $this->assertCount(3, $doc['$permissions']); + } + $found = false; + foreach ($rows['body']['rows'] as $doc) { + if (isset($doc['library']['libraryName']) && $doc['library']['libraryName'] === 'Library 3') { + $found = true; + break; + } + } + $this->assertTrue($found, 'Library 3 should be present in the upserted rows.'); + + // Fetch the related library and assert on its permissions (should be default/inherited) + $library3 = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $library['body']['$id'] . '/rows/library3', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $library3['headers']['status-code']); + $this->assertEquals('Library 3', $library3['body']['libraryName']); + $this->assertArrayHasKey('$permissions', $library3['body']); + $this->assertCount(3, $library3['body']['$permissions']); + $this->assertNotEmpty($library3['body']['$permissions']); + } + } + + /** + * @depends testCreateRow + */ + public function testListRows(array $data): array + { + $databaseId = $data['databaseId']; + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::orderAsc('releaseYear')->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(1944, $rows['body']['rows'][0]['releaseYear']); + $this->assertEquals(2017, $rows['body']['rows'][1]['releaseYear']); + $this->assertEquals(2019, $rows['body']['rows'][2]['releaseYear']); + $this->assertFalse(array_key_exists('$internalId', $rows['body']['rows'][0])); + $this->assertFalse(array_key_exists('$internalId', $rows['body']['rows'][1])); + $this->assertFalse(array_key_exists('$internalId', $rows['body']['rows'][2])); + $this->assertCount(3, $rows['body']['rows']); + + foreach ($rows['body']['rows'] as $row) { + $this->assertArrayNotHasKey('$table', $row); + $this->assertEquals($databaseId, $row['$databaseId']); + $this->assertEquals($data['moviesId'], $row['$tableId']); + } + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::orderDesc('releaseYear')->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(1944, $rows['body']['rows'][2]['releaseYear']); + $this->assertEquals(2017, $rows['body']['rows'][1]['releaseYear']); + $this->assertEquals(2019, $rows['body']['rows'][0]['releaseYear']); + $this->assertCount(3, $rows['body']['rows']); + + // changing description column to be null by default instead of empty string + $patchNull = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/columns/string/description', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => null, + 'required' => false, + ]); + + // creating a dummy doc with null description + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Dummy', + 'releaseYear' => 1944, + 'birthDay' => '1975-06-12 14:12:55+02:00', + 'actors' => [ + 'Dummy', + ], + ] + ]); + + $this->assertEquals(201, $row1['headers']['status-code']); + // fetching docs with cursor after the dummy doc with order attr description which is null + $rowsPaginated = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::orderAsc('dummy')->toString(), + Query::cursorAfter(new Document(['$id' => $row1['body']['$id']]))->toString() + ], + ]); + // should throw 400 as the order attr description of the selected doc is null + $this->assertEquals(400, $rowsPaginated['headers']['status-code']); + + // deleting the dummy doc created + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $row1['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + return ['rows' => $rows['body']['rows'], 'databaseId' => $databaseId]; + } + + /** + * @depends testListRows + */ + public function testGetRow(array $data): void + { + $databaseId = $data['databaseId']; + foreach ($data['rows'] as $row) { + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $row['$tableId'] . '/rows/' . $row['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals($response['body']['$id'], $row['$id']); + $this->assertEquals($row['$tableId'], $response['body']['$tableId']); + $this->assertArrayNotHasKey('$table', $response['body']); + $this->assertEquals($row['$databaseId'], $response['body']['$databaseId']); + $this->assertEquals($response['body']['title'], $row['title']); + $this->assertEquals($response['body']['releaseYear'], $row['releaseYear']); + $this->assertEquals($response['body']['$permissions'], $row['$permissions']); + $this->assertEquals($response['body']['birthDay'], $row['birthDay']); + $this->assertFalse(array_key_exists('$internalId', $response['body'])); + $this->assertFalse(array_key_exists('$tenant', $response['body'])); + } + } + + /** + * @depends testListRows + */ + public function testGetRowWithQueries(array $data): void + { + $databaseId = $data['databaseId']; + $row = $data['rows'][0]; + + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $row['$tableId'] . '/rows/' . $row['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['title', 'releaseYear', '$id'])->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals($row['title'], $response['body']['title']); + $this->assertEquals($row['releaseYear'], $response['body']['releaseYear']); + $this->assertArrayNotHasKey('birthDay', $response['body']); + } + + /** + * @depends testCreateRow + */ + public function testListRowsAfterPagination(array $data): array + { + $databaseId = $data['databaseId']; + /** + * Test after without order. + */ + $base = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $base['headers']['status-code']); + $this->assertEquals('Captain America', $base['body']['rows'][0]['title']); + $this->assertEquals('Spider-Man: Far From Home', $base['body']['rows'][1]['title']); + $this->assertEquals('Spider-Man: Homecoming', $base['body']['rows'][2]['title']); + $this->assertCount(3, $base['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorAfter(new Document(['$id' => $base['body']['rows'][0]['$id']]))->toString() + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals($base['body']['rows'][1]['$id'], $rows['body']['rows'][0]['$id']); + $this->assertEquals($base['body']['rows'][2]['$id'], $rows['body']['rows'][1]['$id']); + $this->assertCount(2, $rows['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorAfter(new Document(['$id' => $base['body']['rows'][2]['$id']]))->toString() + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEmpty($rows['body']['rows']); + + /** + * Test with ASC order and after. + */ + $base = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::orderAsc('releaseYear')->toString() + ], + ]); + + $this->assertEquals(200, $base['headers']['status-code']); + $this->assertEquals(1944, $base['body']['rows'][0]['releaseYear']); + $this->assertEquals(2017, $base['body']['rows'][1]['releaseYear']); + $this->assertEquals(2019, $base['body']['rows'][2]['releaseYear']); + $this->assertCount(3, $base['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorAfter(new Document(['$id' => $base['body']['rows'][1]['$id']]))->toString(), + Query::orderAsc('releaseYear')->toString() + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals($base['body']['rows'][2]['$id'], $rows['body']['rows'][0]['$id']); + $this->assertCount(1, $rows['body']['rows']); + + /** + * Test with DESC order and after. + */ + $base = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::orderDesc('releaseYear')->toString() + ], + ]); + + $this->assertEquals(200, $base['headers']['status-code']); + $this->assertEquals(1944, $base['body']['rows'][2]['releaseYear']); + $this->assertEquals(2017, $base['body']['rows'][1]['releaseYear']); + $this->assertEquals(2019, $base['body']['rows'][0]['releaseYear']); + $this->assertCount(3, $base['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorAfter(new Document(['$id' => $base['body']['rows'][1]['$id']]))->toString(), + Query::orderDesc('releaseYear')->toString() + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals($base['body']['rows'][2]['$id'], $rows['body']['rows'][0]['$id']); + $this->assertCount(1, $rows['body']['rows']); + + /** + * Test after with unknown row. + */ + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorAfter(new Document(['$id' => 'unknown']))->toString(), + ], + ]); + + $this->assertEquals(400, $rows['headers']['status-code']); + + /** + * Test null value for cursor + */ + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + '{"method":"cursorAfter","values":[null]}', + ], + ]); + + $this->assertEquals(400, $rows['headers']['status-code']); + + return []; + } + + /** + * @depends testCreateRow + */ + public function testListRowsBeforePagination(array $data): array + { + $databaseId = $data['databaseId']; + /** + * Test before without order. + */ + $base = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $base['headers']['status-code']); + $this->assertEquals('Captain America', $base['body']['rows'][0]['title']); + $this->assertEquals('Spider-Man: Far From Home', $base['body']['rows'][1]['title']); + $this->assertEquals('Spider-Man: Homecoming', $base['body']['rows'][2]['title']); + $this->assertCount(3, $base['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorBefore(new Document(['$id' => $base['body']['rows'][2]['$id']]))->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals($base['body']['rows'][0]['$id'], $rows['body']['rows'][0]['$id']); + $this->assertEquals($base['body']['rows'][1]['$id'], $rows['body']['rows'][1]['$id']); + $this->assertCount(2, $rows['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorBefore(new Document(['$id' => $base['body']['rows'][0]['$id']]))->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEmpty($rows['body']['rows']); + + /** + * Test with ASC order and after. + */ + $base = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::orderAsc('releaseYear')->toString(), + ], + ]); + + $this->assertEquals(200, $base['headers']['status-code']); + $this->assertEquals(1944, $base['body']['rows'][0]['releaseYear']); + $this->assertEquals(2017, $base['body']['rows'][1]['releaseYear']); + $this->assertEquals(2019, $base['body']['rows'][2]['releaseYear']); + $this->assertCount(3, $base['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorBefore(new Document(['$id' => $base['body']['rows'][1]['$id']]))->toString(), + Query::orderAsc('releaseYear')->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals($base['body']['rows'][0]['$id'], $rows['body']['rows'][0]['$id']); + $this->assertCount(1, $rows['body']['rows']); + + /** + * Test with DESC order and after. + */ + $base = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::orderDesc('releaseYear')->toString(), + ], + ]); + + $this->assertEquals(200, $base['headers']['status-code']); + $this->assertEquals(1944, $base['body']['rows'][2]['releaseYear']); + $this->assertEquals(2017, $base['body']['rows'][1]['releaseYear']); + $this->assertEquals(2019, $base['body']['rows'][0]['releaseYear']); + $this->assertCount(3, $base['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorBefore(new Document(['$id' => $base['body']['rows'][1]['$id']]))->toString(), + Query::orderDesc('releaseYear')->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals($base['body']['rows'][0]['$id'], $rows['body']['rows'][0]['$id']); + $this->assertCount(1, $rows['body']['rows']); + + return []; + } + + /** + * @depends testCreateRow + */ + public function testListRowsLimitAndOffset(array $data): array + { + $databaseId = $data['databaseId']; + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::orderAsc('releaseYear')->toString(), + Query::limit(1)->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(1944, $rows['body']['rows'][0]['releaseYear']); + $this->assertCount(1, $rows['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::orderAsc('releaseYear')->toString(), + Query::limit(2)->toString(), + Query::offset(1)->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(2017, $rows['body']['rows'][0]['releaseYear']); + $this->assertEquals(2019, $rows['body']['rows'][1]['releaseYear']); + $this->assertCount(2, $rows['body']['rows']); + + return []; + } + + /** + * @depends testCreateRow + */ + public function testRowsListQueries(array $data): array + { + $databaseId = $data['databaseId']; + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::search('title', 'Captain America')->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(1944, $rows['body']['rows'][0]['releaseYear']); + $this->assertCount(1, $rows['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('$id', [$rows['body']['rows'][0]['$id']])->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(1944, $rows['body']['rows'][0]['releaseYear']); + $this->assertCount(1, $rows['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::search('title', 'Homecoming')->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(2017, $rows['body']['rows'][0]['releaseYear']); + $this->assertCount(1, $rows['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::search('title', 'spider')->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(2019, $rows['body']['rows'][0]['releaseYear']); + $this->assertEquals(2017, $rows['body']['rows'][1]['releaseYear']); + $this->assertCount(2, $rows['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + '{"method":"contains","attribute":"title","values":[bad]}' + ], + ]); + + $this->assertEquals(400, $rows['headers']['status-code']); + $this->assertEquals('Invalid query: Syntax error', $rows['body']['message']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::contains('title', ['spi'])->toString(), // like query + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(2, $rows['body']['total']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('releaseYear', [1944])->toString(), + ], + ]); + + $this->assertCount(1, $rows['body']['rows']); + $this->assertEquals('Captain America', $rows['body']['rows'][0]['title']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::notEqual('releaseYear', 1944)->toString(), + ], + ]); + + $this->assertCount(2, $rows['body']['rows']); + $this->assertEquals('Spider-Man: Far From Home', $rows['body']['rows'][0]['title']); + $this->assertEquals('Spider-Man: Homecoming', $rows['body']['rows'][1]['title']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::greaterThan('$createdAt', '1976-06-12')->toString(), + ], + ]); + + $this->assertCount(3, $rows['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::lessThan('$createdAt', '1976-06-12')->toString(), + ], + ]); + + $this->assertCount(0, $rows['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::contains('actors', ['Tom Holland', 'Samuel Jackson'])->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(3, $rows['body']['total']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::contains('actors', ['Tom'])->toString(), // Full-match not like + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(0, $rows['body']['total']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::greaterThan('birthDay', '16/01/2024 12:00:00AM')->toString(), + ], + ]); + + $this->assertEquals(400, $rows['headers']['status-code']); + $this->assertEquals('Invalid query: Query value is invalid for attribute "birthDay"', $rows['body']['message']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::greaterThan('birthDay', '1960-01-01 10:10:10+02:30')->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals('1975-06-12T12:12:55.000+00:00', $rows['body']['rows'][0]['birthDay']); + $this->assertEquals('1975-06-12T18:12:55.000+00:00', $rows['body']['rows'][1]['birthDay']); + $this->assertCount(2, $rows['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::isNull('integers')->toString(), + ], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(1, $rows['body']['total']); + + /** + * Test for Failure + */ + $conditions = []; + + for ($i = 0; $i < APP_DATABASE_QUERY_MAX_VALUES + 1; $i++) { + $conditions[] = $i; + } + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('releaseYear', $conditions)->toString(), + ], + ]); + $this->assertEquals(400, $rows['headers']['status-code']); + $this->assertEquals('Invalid query: Query on attribute has greater than '.APP_DATABASE_QUERY_MAX_VALUES.' values: releaseYear', $rows['body']['message']); + + $value = ''; + + for ($i = 0; $i < 101; $i++) { + $value .= "[" . $i . "] Too long title to cross 2k chars query limit "; + } + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::search('title', $value)->toString(), + ], + ]); + + // Todo: Not sure what to do we with Query length Test VS old? JSON validator will fails if query string will be truncated? + //$this->assertEquals(400, $rows['headers']['status-code']); + + // Todo: Disabled for CL - Uncomment after ProxyDatabase cleanup for find method + // $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + // 'content-type' => 'application/json', + // 'x-appwrite-project' => $this->getProject()['$id'], + // ], $this->getHeaders()), [ + // 'queries' => [ + // Query::search('actors', 'Tom')->toString(), + // ], + // ]); + // $this->assertEquals(400, $rows['headers']['status-code']); + // $this->assertEquals('Invalid query: Cannot query search on attribute "actors" because it is an array.', $rows['body']['message']); + + return []; + } + + /** + * @depends testCreateRow + */ + public function testUpdateRow(array $data): array + { + $databaseId = $data['databaseId']; + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Thor: Ragnaroc', + 'releaseYear' => 2017, + 'birthDay' => '1976-06-12 14:12:55', + 'actors' => [], + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $id = $row['body']['$id']; + + $this->assertEquals(201, $row['headers']['status-code']); + $this->assertEquals($data['moviesId'], $row['body']['$tableId']); + $this->assertArrayNotHasKey('$table', $row['body']); + $this->assertEquals($databaseId, $row['body']['$databaseId']); + $this->assertEquals($row['body']['title'], 'Thor: Ragnaroc'); + $this->assertEquals($row['body']['releaseYear'], 2017); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($row['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($row['body']['birthDay'])); + $this->assertContains(Permission::read(Role::user($this->getUser()['$id'])), $row['body']['$permissions']); + $this->assertContains(Permission::update(Role::user($this->getUser()['$id'])), $row['body']['$permissions']); + $this->assertContains(Permission::delete(Role::user($this->getUser()['$id'])), $row['body']['$permissions']); + + $row = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + ], + 'permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($row['body']['$id'], $id); + $this->assertEquals($data['moviesId'], $row['body']['$tableId']); + $this->assertArrayNotHasKey('$table', $row['body']); + $this->assertEquals($databaseId, $row['body']['$databaseId']); + $this->assertEquals($row['body']['title'], 'Thor: Ragnarok'); + $this->assertEquals($row['body']['releaseYear'], 2017); + $this->assertContains(Permission::read(Role::users()), $row['body']['$permissions']); + $this->assertContains(Permission::update(Role::users()), $row['body']['$permissions']); + $this->assertContains(Permission::delete(Role::users()), $row['body']['$permissions']); + + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $id = $row['body']['$id']; + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($data['moviesId'], $row['body']['$tableId']); + $this->assertArrayNotHasKey('$table', $row['body']); + $this->assertEquals($databaseId, $row['body']['$databaseId']); + $this->assertEquals($row['body']['title'], 'Thor: Ragnarok'); + $this->assertEquals($row['body']['releaseYear'], 2017); + + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-timestamp' => DateTime::formatTz(DateTime::now()), + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + /** + * Test for failure + */ + + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-timestamp' => 'invalid', + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('Invalid X-Appwrite-Timestamp header value', $response['body']['message']); + $this->assertEquals(Exception::GENERAL_ARGUMENT_INVALID, $response['body']['type']); + + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-timestamp' => DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -1000)), + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + ], + ]); + + $this->assertEquals(409, $response['headers']['status-code']); + $this->assertEquals('Remote row is newer than local.', $response['body']['message']); + $this->assertEquals(Exception::ROW_UPDATE_CONFLICT, $response['body']['type']); + + return []; + } + + /** + * @depends testCreateRow + */ + public function testDeleteRow(array $data): array + { + $databaseId = $data['databaseId']; + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2017, + 'birthDay' => '1975-06-12 14:12:55', + 'actors' => [], + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $id = $row['body']['$id']; + + $this->assertEquals(201, $row['headers']['status-code']); + + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + + $row = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(204, $row['headers']['status-code']); + + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(404, $row['headers']['status-code']); + + return $data; + } + + public function testInvalidRowStructure(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'InvalidRowDatabase', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('InvalidRowDatabase', $database['body']['name']); + + $databaseId = $database['body']['$id']; + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'invalidRowStructure', + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $this->assertEquals('invalidRowStructure', $table['body']['name']); + + $tableId = $table['body']['$id']; + + $email = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/email', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'email', + 'required' => false, + ]); + + $enum = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'enum', + 'elements' => ['yes', 'no', 'maybe'], + 'required' => false, + ]); + + $ip = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/ip', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'ip', + 'required' => false, + ]); + + $url = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/url', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'url', + 'size' => 256, + 'required' => false, + ]); + + $range = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'range', + 'required' => false, + 'min' => 1, + 'max' => 10, + ]); + + // TODO@kodumbeats min and max are rounded in error message + $floatRange = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'floatRange', + 'required' => false, + 'min' => 1.1, + 'max' => 1.4, + ]); + + $probability = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'probability', + 'required' => false, + 'default' => 0, + 'min' => 0, + 'max' => 1, + ]); + + $upperBound = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'upperBound', + 'required' => false, + 'max' => 10, + ]); + + $lowerBound = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'lowerBound', + 'required' => false, + 'min' => 5, + ]); + + /** + * Test for failure + */ + + $invalidRange = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ + 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'invalidRange', + 'required' => false, + 'min' => 4, + 'max' => 3, + ]); + + $defaultArray = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ + 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'defaultArray', + 'required' => false, + 'default' => 42, + 'array' => true, + ]); + + $defaultRequired = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'attributeId' => ID::custom('defaultRequired'), + 'required' => true, + 'default' => 12 + ]); + + $enumDefault = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'attributeId' => ID::custom('enumDefault'), + 'elements' => ['north', 'west'], + 'default' => 'south' + ]); + + $enumDefaultStrict = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'attributeId' => ID::custom('enumDefault'), + 'elements' => ['north', 'west'], + 'default' => 'NORTH' + ]); + + $goodDatetime = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'birthDay', + 'required' => false, + 'default' => null + ]); + + $datetimeDefault = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'badBirthDay', + 'required' => false, + 'default' => 'bad' + ]); + + $this->assertEquals(202, $email['headers']['status-code']); + $this->assertEquals(202, $ip['headers']['status-code']); + $this->assertEquals(202, $url['headers']['status-code']); + $this->assertEquals(202, $range['headers']['status-code']); + $this->assertEquals(202, $floatRange['headers']['status-code']); + $this->assertEquals(202, $probability['headers']['status-code']); + $this->assertEquals(202, $upperBound['headers']['status-code']); + $this->assertEquals(202, $lowerBound['headers']['status-code']); + $this->assertEquals(202, $enum['headers']['status-code']); + $this->assertEquals(202, $goodDatetime['headers']['status-code']); + $this->assertEquals(400, $invalidRange['headers']['status-code']); + $this->assertEquals(400, $defaultArray['headers']['status-code']); + $this->assertEquals(400, $defaultRequired['headers']['status-code']); + $this->assertEquals(400, $enumDefault['headers']['status-code']); + $this->assertEquals(400, $enumDefaultStrict['headers']['status-code']); + $this->assertEquals('Minimum value must be lesser than maximum value', $invalidRange['body']['message']); + $this->assertEquals('Cannot set default value for array columns', $defaultArray['body']['message']); + $this->assertEquals(400, $datetimeDefault['headers']['status-code']); + + // wait for worker to add attributes + sleep(3); + + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ])); + + $this->assertCount(10, $table['body']['columns']); + + /** + * Test for successful validation + */ + + $goodEmail = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'email' => 'user@example.com', + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $goodEnum = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'enum' => 'yes', + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $goodIp = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'ip' => '1.1.1.1', + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $goodUrl = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'url' => 'http://www.example.com', + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $goodRange = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'range' => 3, + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $goodFloatRange = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'floatRange' => 1.4, + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $goodProbability = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'probability' => 0.99999, + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $notTooHigh = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'upperBound' => 8, + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $notTooLow = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'lowerBound' => 8, + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $this->assertEquals(201, $goodEmail['headers']['status-code']); + $this->assertEquals(201, $goodEnum['headers']['status-code']); + $this->assertEquals(201, $goodIp['headers']['status-code']); + $this->assertEquals(201, $goodUrl['headers']['status-code']); + $this->assertEquals(201, $goodRange['headers']['status-code']); + $this->assertEquals(201, $goodFloatRange['headers']['status-code']); + $this->assertEquals(201, $goodProbability['headers']['status-code']); + $this->assertEquals(201, $notTooHigh['headers']['status-code']); + $this->assertEquals(201, $notTooLow['headers']['status-code']); + + /* + * Test that custom validators reject rows + */ + + $badEmail = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'email' => 'user@@example.com', + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $badEnum = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'enum' => 'badEnum', + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $badIp = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'ip' => '1.1.1.1.1', + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $badUrl = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'url' => 'example...com', + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $badRange = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'range' => 11, + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $badFloatRange = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'floatRange' => 2.5, + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $badProbability = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'probability' => 1.1, + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $tooHigh = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'upperBound' => 11, + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $tooLow = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'lowerBound' => 3, + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $badTime = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => 'unique()', + 'data' => [ + 'birthDay' => '2020-10-10 27:30:10+01:00', + ], + 'read' => ['user:' . $this->getUser()['$id']], + 'write' => ['user:' . $this->getUser()['$id']], + ]); + + $this->assertEquals(400, $badEmail['headers']['status-code']); + $this->assertEquals(400, $badEnum['headers']['status-code']); + $this->assertEquals(400, $badIp['headers']['status-code']); + $this->assertEquals(400, $badUrl['headers']['status-code']); + $this->assertEquals(400, $badRange['headers']['status-code']); + $this->assertEquals(400, $badFloatRange['headers']['status-code']); + $this->assertEquals(400, $badProbability['headers']['status-code']); + $this->assertEquals(400, $tooHigh['headers']['status-code']); + $this->assertEquals(400, $tooLow['headers']['status-code']); + $this->assertEquals(400, $badTime['headers']['status-code']); + + // TODO: @itznotabug - database library needs to throw error based on context! + $this->assertEquals('Invalid document structure: Attribute "email" has invalid format. Value must be a valid email address', $badEmail['body']['message']); + $this->assertEquals('Invalid document structure: Attribute "enum" has invalid format. Value must be one of (yes, no, maybe)', $badEnum['body']['message']); + $this->assertEquals('Invalid document structure: Attribute "ip" has invalid format. Value must be a valid IP address', $badIp['body']['message']); + $this->assertEquals('Invalid document structure: Attribute "url" has invalid format. Value must be a valid URL', $badUrl['body']['message']); + $this->assertEquals('Invalid document structure: Attribute "range" has invalid format. Value must be a valid range between 1 and 10', $badRange['body']['message']); + $this->assertEquals('Invalid document structure: Attribute "floatRange" has invalid format. Value must be a valid range between 1 and 1', $badFloatRange['body']['message']); + $this->assertEquals('Invalid document structure: Attribute "probability" has invalid format. Value must be a valid range between 0 and 1', $badProbability['body']['message']); + $this->assertEquals('Invalid document structure: Attribute "upperBound" has invalid format. Value must be a valid range between -9,223,372,036,854,775,808 and 10', $tooHigh['body']['message']); + $this->assertEquals('Invalid document structure: Attribute "lowerBound" has invalid format. Value must be a valid range between 5 and 9,223,372,036,854,775,807', $tooLow['body']['message']); + } + + /** + * @depends testDeleteRow + */ + public function testDefaultPermissions(array $data): array + { + $databaseId = $data['databaseId']; + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Captain America', + 'releaseYear' => 1944, + 'actors' => [], + ], + ]); + + $id = $row['body']['$id']; + + $this->assertEquals(201, $row['headers']['status-code']); + $this->assertEquals($row['body']['title'], 'Captain America'); + $this->assertEquals($row['body']['releaseYear'], 1944); + $this->assertIsArray($row['body']['$permissions']); + + if ($this->getSide() == 'client') { + $this->assertCount(3, $row['body']['$permissions']); + $this->assertContains(Permission::read(Role::user($this->getUser()['$id'])), $row['body']['$permissions']); + $this->assertContains(Permission::update(Role::user($this->getUser()['$id'])), $row['body']['$permissions']); + $this->assertContains(Permission::delete(Role::user($this->getUser()['$id'])), $row['body']['$permissions']); + } + + if ($this->getSide() == 'server') { + $this->assertCount(0, $row['body']['$permissions']); + $this->assertEquals([], $row['body']['$permissions']); + } + + // Updated Permissions + + $row = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Captain America 2', + 'releaseYear' => 1945, + 'actors' => [], + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])) + ], + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($row['body']['title'], 'Captain America 2'); + $this->assertEquals($row['body']['releaseYear'], 1945); + + // This differs from the old permissions model because we don't inherit + // existing row permissions on update, unless none were supplied, + // so that specific types can be removed if wanted. + $this->assertCount(2, $row['body']['$permissions']); + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ], $row['body']['$permissions']); + + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($row['body']['title'], 'Captain America 2'); + $this->assertEquals($row['body']['releaseYear'], 1945); + + $this->assertCount(2, $row['body']['$permissions']); + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ], $row['body']['$permissions']); + + // Reset Permissions + + $row = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Captain America 3', + 'releaseYear' => 1946, + 'actors' => [], + ], + 'permissions' => [], + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($row['body']['title'], 'Captain America 3'); + $this->assertEquals($row['body']['releaseYear'], 1946); + $this->assertCount(0, $row['body']['$permissions']); + $this->assertEquals([], $row['body']['$permissions']); + + // Check client side can no longer read the row. + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + switch ($this->getSide()) { + case 'client': + $this->assertEquals(404, $row['headers']['status-code']); + break; + case 'server': + $this->assertEquals(200, $row['headers']['status-code']); + break; + } + + return $data; + } + + public function testEnforceTableAndRowPermissions(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'EnforceCollectionAndRowPermissions', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('EnforceCollectionAndRowPermissions', $database['body']['name']); + + $databaseId = $database['body']['$id']; + $user = $this->getUser()['$id']; + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'enforceCollectionAndRowPermissions', + 'rowSecurity' => true, + 'permissions' => [ + Permission::read(Role::user($user)), + Permission::create(Role::user($user)), + Permission::update(Role::user($user)), + Permission::delete(Role::user($user)), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $this->assertEquals($table['body']['name'], 'enforceCollectionAndRowPermissions'); + $this->assertEquals($table['body']['rowSecurity'], true); + + $tableId = $table['body']['$id']; + + sleep(2); + + $attribute = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'column', + 'size' => 64, + 'required' => true, + ]); + + $this->assertEquals(202, $attribute['headers']['status-code'], 202); + $this->assertEquals('column', $attribute['body']['key']); + + // wait for db to add column + sleep(2); + + $index = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'key_attribute', + 'type' => 'key', + 'columns' => [$attribute['body']['key']], + ]); + + $this->assertEquals(202, $index['headers']['status-code']); + $this->assertEquals('key_attribute', $index['body']['key']); + + // wait for db to add column + sleep(2); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'column' => 'one', + ], + 'permissions' => [ + Permission::read(Role::user($user)), + Permission::update(Role::user($user)), + Permission::delete(Role::user($user)), + ] + ]); + + $this->assertEquals(201, $row1['headers']['status-code']); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'column' => 'one', + ], + 'permissions' => [ + Permission::update(Role::user($user)), + Permission::delete(Role::user($user)), + ] + ]); + + $this->assertEquals(201, $row2['headers']['status-code']); + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'column' => 'one', + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom('other'))), + Permission::update(Role::user(ID::custom('other'))), + ], + ]); + + $this->assertEquals(201, $row3['headers']['status-code']); + + $rowsUser1 = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + // Current user has read permission on the table so can get any row + $this->assertEquals(3, $rowsUser1['body']['total']); + $this->assertCount(3, $rowsUser1['body']['rows']); + + $row3GetWithCollectionRead = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $row3['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + // Current user has read permission on the table so can get any row + $this->assertEquals(200, $row3GetWithCollectionRead['headers']['status-code']); + + $email = uniqid() . 'user@localhost.test'; + $password = 'password'; + $name = 'User Name'; + $this->client->call(Client::METHOD_POST, '/account', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'userId' => ID::custom('other'), + 'email' => $email, + 'password' => $password, + 'name' => $name, + ]); + $session2 = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'email' => $email, + 'password' => $password, + ]); + $session2 = $session2['cookies']['a_session_' . $this->getProject()['$id']]; + + $row3GetWithRowRead = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $row3['body']['$id'], [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session2, + ]); + + // Current user has no table permissions but has read permission for this row + $this->assertEquals(200, $row3GetWithRowRead['headers']['status-code']); + + $row2GetFailure = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $row2['body']['$id'], [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session2, + ]); + + // Current user has no table or row permissions for this row + $this->assertEquals(404, $row2GetFailure['headers']['status-code']); + + $rowsUser2 = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session2, + ]); + + // Current user has no table permissions but has read permission for one row + $this->assertEquals(1, $rowsUser2['body']['total']); + $this->assertCount(1, $rowsUser2['body']['rows']); + } + + public function testEnforceTablePermissions(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'EnforceCollectionPermissions', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('EnforceCollectionPermissions', $database['body']['name']); + + $databaseId = $database['body']['$id']; + $user = $this->getUser()['$id']; + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'enforceCollectionPermissions', + 'permissions' => [ + Permission::read(Role::user($user)), + Permission::create(Role::user($user)), + Permission::update(Role::user($user)), + Permission::delete(Role::user($user)), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $this->assertEquals($table['body']['name'], 'enforceCollectionPermissions'); + $this->assertEquals($table['body']['rowSecurity'], false); + + $tableId = $table['body']['$id']; + + $attribute = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'column', + 'size' => 64, + 'required' => true, + ]); + + $this->assertEquals(202, $attribute['headers']['status-code'], 202); + $this->assertEquals('column', $attribute['body']['key']); + + \sleep(2); + + $index = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'key_attribute', + 'type' => 'key', + 'columns' => [$attribute['body']['key']], + ]); + + $this->assertEquals(202, $index['headers']['status-code']); + $this->assertEquals('key_attribute', $index['body']['key']); + + \sleep(2); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'column' => 'one', + ], + 'permissions' => [ + Permission::read(Role::user($user)), + Permission::update(Role::user($user)), + Permission::delete(Role::user($user)), + ] + ]); + + $this->assertEquals(201, $row1['headers']['status-code']); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'column' => 'one', + ], + 'permissions' => [ + Permission::update(Role::user($user)), + Permission::delete(Role::user($user)), + ] + ]); + + $this->assertEquals(201, $row2['headers']['status-code']); + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'column' => 'one', + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom('other2'))), + Permission::update(Role::user(ID::custom('other2'))), + ], + ]); + + $this->assertEquals(201, $row3['headers']['status-code']); + + $rowsUser1 = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + // Current user has read permission on the table so can get any row + $this->assertEquals(3, $rowsUser1['body']['total']); + $this->assertCount(3, $rowsUser1['body']['rows']); + + $row3GetWithCollectionRead = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $row3['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + // Current user has read permission on the table so can get any row + $this->assertEquals(200, $row3GetWithCollectionRead['headers']['status-code']); + + $email = uniqid() . 'user2@localhost.test'; + $password = 'password'; + $name = 'User Name'; + $this->client->call(Client::METHOD_POST, '/account', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'userId' => ID::custom('other2'), + 'email' => $email, + 'password' => $password, + 'name' => $name, + ]); + $session2 = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'email' => $email, + 'password' => $password, + ]); + $session2 = $session2['cookies']['a_session_' . $this->getProject()['$id']]; + + $row3GetWithRowRead = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $row3['body']['$id'], [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session2, + ]); + + // other2 has no table permissions and row permissions are disabled + $this->assertEquals(404, $row3GetWithRowRead['headers']['status-code']); + + $rowsUser2 = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session2, + ]); + + // other2 has no table permissions and row permissions are disabled + $this->assertEquals(401, $rowsUser2['headers']['status-code']); + + // Enable row permissions + $this->client->call(CLient::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $tableId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'name' => $table['body']['name'], + 'rowSecurity' => true, + ]); + + $rowsUser2 = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session2, + ]); + + // Current user has no table permissions read access to one row + $this->assertEquals(1, $rowsUser2['body']['total']); + $this->assertCount(1, $rowsUser2['body']['rows']); + } + + /** + * @depends testDefaultPermissions + */ + public function testUniqueIndexDuplicate(array $data): array + { + $databaseId = $data['databaseId']; + $uniqueIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'unique_title', + 'type' => 'unique', + 'columns' => ['title'], + ]); + + $this->assertEquals(202, $uniqueIndex['headers']['status-code']); + + sleep(2); + + // test for failure + $duplicate = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Captain America', + 'releaseYear' => 1944, + 'actors' => [ + 'Chris Evans', + 'Samuel Jackson', + ] + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $this->assertEquals(409, $duplicate['headers']['status-code']); + + // Test for exception when updating row to conflict + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Captain America 5', + 'releaseYear' => 1944, + 'actors' => [ + 'Chris Evans', + 'Samuel Jackson', + ] + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $this->assertEquals(201, $row['headers']['status-code']); + + // Test for exception when updating row to conflict + $duplicate = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/rows/' . $row['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Captain America', + 'releaseYear' => 1944, + 'actors' => [ + 'Chris Evans', + 'Samuel Jackson', + ] + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $this->assertEquals(409, $duplicate['headers']['status-code']); + + return $data; + } + + /** + * @depends testUniqueIndexDuplicate + */ + public function testPersistentCreatedAt(array $data): array + { + $headers = $this->getSide() === 'client' ? array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()) : [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]; + + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['moviesId'] . '/rows', $headers, [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Creation Date Test', + 'releaseYear' => 2000 + ] + ]); + + $this->assertEquals($row['body']['title'], 'Creation Date Test'); + + $rowId = $row['body']['$id']; + $createdAt = $row['body']['$createdAt']; + $updatedAt = $row['body']['$updatedAt']; + + \sleep(1); + + $row = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, $headers, [ + 'data' => [ + 'title' => 'Updated Date Test', + ] + ]); + + $updatedAtSecond = $row['body']['$updatedAt']; + + $this->assertEquals($row['body']['title'], 'Updated Date Test'); + $this->assertEquals($row['body']['$createdAt'], $createdAt); + $this->assertNotEquals($row['body']['$updatedAt'], $updatedAt); + + \sleep(1); + + $row = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['moviesId'] . '/rows/' . $rowId, $headers, [ + 'data' => [ + 'title' => 'Again Updated Date Test', + '$createdAt' => '2022-08-01 13:09:23.040', + '$updatedAt' => '2022-08-01 13:09:23.050' + ] + ]); + + if ($this->getSide() === 'client') { + $this->assertEquals($row['body']['title'], 'Again Updated Date Test'); + $this->assertNotEquals($row['body']['$createdAt'], DateTime::formatTz('2022-08-01 13:09:23.040')); + $this->assertNotEquals($row['body']['$updatedAt'], DateTime::formatTz('2022-08-01 13:09:23.050')); + } else { + $this->assertEquals($row['body']['$createdAt'], DateTime::formatTz('2022-08-01 13:09:23.040')); + $this->assertEquals($row['body']['$updatedAt'], DateTime::formatTz('2022-08-01 13:09:23.050')); + + } + + return $data; + } + + public function testUpdatePermissionsWithEmptyPayload(): array + { + // Create Database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'Empty Permissions', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + + $databaseId = $database['body']['$id']; + + // Create table + $movies = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Movies', + 'permissions' => [ + Permission::create(Role::user(ID::custom($this->getUser()['$id']))), + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $movies['headers']['status-code']); + $this->assertEquals($movies['body']['name'], 'Movies'); + + $moviesId = $movies['body']['$id']; + + // create column + $title = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $moviesId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $title['headers']['status-code']); + + // wait for database worker to create attributes + sleep(2); + + // add row + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $moviesId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Captain America', + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $id = $row['body']['$id']; + + $this->assertEquals(201, $row['headers']['status-code']); + $this->assertCount(3, $row['body']['$permissions']); + $this->assertContains(Permission::read(Role::any()), $row['body']['$permissions']); + $this->assertContains(Permission::update(Role::any()), $row['body']['$permissions']); + $this->assertContains(Permission::delete(Role::any()), $row['body']['$permissions']); + + // Send only read permission + $row = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $moviesId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'permissions' => [ + Permission::read(Role::user(ID::custom($this->getUser()['$id']))), + ] + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertCount(1, $row['body']['$permissions']); + + // Send only mutation permissions + $row = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $moviesId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'permissions' => [ + Permission::update(Role::user(ID::custom($this->getUser()['$id']))), + Permission::delete(Role::user(ID::custom($this->getUser()['$id']))), + ], + ]); + + if ($this->getSide() == 'server') { + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertCount(2, $row['body']['$permissions']); + $this->assertContains(Permission::update(Role::user($this->getUser()['$id'])), $row['body']['$permissions']); + $this->assertContains(Permission::delete(Role::user($this->getUser()['$id'])), $row['body']['$permissions']); + } + + // remove table + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $moviesId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + return []; + } + + /** + * @depends testCreateDatabase + */ + public function testColumnBooleanDefault(array $data): void + { + $databaseId = $data['databaseId']; + + /** + * Test for SUCCESS + */ + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Boolean' + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + + $tableId = $table['body']['$id']; + + $true = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'true', + 'required' => false, + 'default' => true + ]); + + $this->assertEquals(202, $true['headers']['status-code']); + + $false = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'false', + 'required' => false, + 'default' => false + ]); + + $this->assertEquals(202, $false['headers']['status-code']); + } + + /** + * @depends testCreateDatabase + */ + public function testOneToOneRelationship(array $data): array + { + $databaseId = $data['databaseId']; + + $person = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => 'person', + 'name' => 'person', + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + Permission::create(Role::user($this->getUser()['$id'])), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $person['headers']['status-code']); + + $library = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => 'library', + 'name' => 'library', + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::create(Role::user($this->getUser()['$id'])), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $library['headers']['status-code']); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'fullName', + 'size' => 255, + 'required' => false, + ]); + + sleep(1); // Wait for worker + + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => 'library', + 'type' => Database::RELATION_ONE_TO_ONE, + 'key' => 'library', + 'twoWay' => true, + 'onDelete' => Database::RELATION_MUTATE_CASCADE, + ]); + + sleep(1); // Wait for worker + + $libraryName = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $library['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'libraryName', + 'size' => 255, + 'required' => true, + ]); + + sleep(1); // Wait for worker + + $this->assertEquals(202, $libraryName['headers']['status-code']); + $this->assertEquals(202, $relation['headers']['status-code']); + $this->assertEquals('library', $relation['body']['key']); + $this->assertEquals('relationship', $relation['body']['type']); + $this->assertEquals('processing', $relation['body']['status']); + + $columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/columns', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $columns['headers']['status-code']); + $this->assertEquals(2, $columns['body']['total']); + $columns = $columns['body']['columns']; + $this->assertEquals('library', $columns[1]['relatedTable']); + $this->assertEquals('oneToOne', $columns[1]['relationType']); + $this->assertEquals(true, $columns[1]['twoWay']); + $this->assertEquals('person', $columns[1]['twoWayKey']); + $this->assertEquals(Database::RELATION_MUTATE_CASCADE, $columns[1]['onDelete']); + + $attribute = $this->client->call(Client::METHOD_GET, "/tablesdb/{$databaseId}/tables/{$person['body']['$id']}/columns/library", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $attribute['headers']['status-code']); + $this->assertEquals('available', $attribute['body']['status']); + $this->assertEquals('library', $attribute['body']['key']); + $this->assertEquals('relationship', $attribute['body']['type']); + $this->assertEquals(false, $attribute['body']['required']); + $this->assertEquals(false, $attribute['body']['array']); + $this->assertEquals('oneToOne', $attribute['body']['relationType']); + $this->assertEquals(true, $attribute['body']['twoWay']); + $this->assertEquals('person', $attribute['body']['twoWayKey']); + $this->assertEquals(Database::RELATION_MUTATE_CASCADE, $attribute['body']['onDelete']); + + $person1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'library' => [ + '$id' => 'library1', + '$permissions' => [ + Permission::read(Role::any()), + ], + 'libraryName' => 'Library 1', + ], + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals('Library 1', $person1['body']['library']['libraryName']); + + // Create without nested ID + $person2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'library' => [ + 'libraryName' => 'Library 2', + ], + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals('Library 2', $person2['body']['library']['libraryName']); + + // Ensure IDs were set and internal IDs removed + $this->assertEquals($databaseId, $person1['body']['$databaseId']); + $this->assertEquals($databaseId, $person1['body']['library']['$databaseId']); + + $this->assertEquals($person['body']['$id'], $person1['body']['$tableId']); + $this->assertEquals($library['body']['$id'], $person1['body']['library']['$tableId']); + + $this->assertArrayNotHasKey('$table', $person1['body']); + $this->assertArrayNotHasKey('$table', $person1['body']['library']); + $this->assertArrayNotHasKey('$internalId', $person1['body']); + $this->assertArrayNotHasKey('$internalId', $person1['body']['library']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['fullName', 'library.*'])->toString(), + Query::equal('library', ['library1'])->toString(), + ], + ]); + + $this->assertEquals(1, $rows['body']['total']); + $this->assertEquals('Library 1', $rows['body']['rows'][0]['library']['libraryName']); + $this->assertArrayHasKey('fullName', $rows['body']['rows'][0]); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('library.libraryName', ['Library 1'])->toString(), + ], + ]); + + $this->assertEquals(400, $rows['headers']['status-code']); + $this->assertEquals('Invalid query: Cannot query nested attribute on: library', $rows['body']['message']); + + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/columns/library', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + sleep(2); + + $this->assertEquals(204, $response['headers']['status-code']); + + $attribute = $this->client->call(Client::METHOD_GET, "/tablesdb/{$databaseId}/tables/{$person['body']['$id']}/columns/library", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(404, $attribute['headers']['status-code']); + + $person1 = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $person['body']['$id'] . '/rows/' . $person1['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertArrayNotHasKey('library', $person1['body']); + + //Test Deletion of related twoKey + $columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $library['body']['$id'] . '/columns', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $columns['headers']['status-code']); + $this->assertEquals(1, $columns['body']['total']); + $this->assertEquals('libraryName', $columns['body']['columns'][0]['key']); + + return [ + 'databaseId' => $databaseId, + 'personCollection' => $person['body']['$id'], + 'libraryCollection' => $library['body']['$id'], + ]; + } + + /** + * @depends testOneToOneRelationship + */ + public function testOneToManyRelationship(array $data): array + { + $databaseId = $data['databaseId']; + $personCollection = $data['personCollection']; + $libraryCollection = $data['libraryCollection']; + + // One person can own several libraries + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $personCollection . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => 'library', + 'type' => Database::RELATION_ONE_TO_MANY, + 'twoWay' => true, + 'key' => 'libraries', + 'twoWayKey' => 'person_one_to_many', + ]); + + sleep(1); + + $libraryAttributesResponse = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $libraryCollection . '/columns', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertIsArray($libraryAttributesResponse['body']['columns']); + $this->assertEquals(2, $libraryAttributesResponse['body']['total']); + $this->assertEquals('person_one_to_many', $libraryAttributesResponse['body']['columns'][1]['key']); + + $libraryCollectionResponse = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $libraryCollection, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertIsArray($libraryCollectionResponse['body']['columns']); + $this->assertCount(2, $libraryCollectionResponse['body']['columns']); + + $attribute = $this->client->call(Client::METHOD_GET, "/tablesdb/{$databaseId}/tables/{$personCollection}/columns/libraries", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $attribute['headers']['status-code']); + $this->assertEquals('available', $attribute['body']['status']); + $this->assertEquals('libraries', $attribute['body']['key']); + $this->assertEquals('relationship', $attribute['body']['type']); + $this->assertEquals(false, $attribute['body']['required']); + $this->assertEquals(false, $attribute['body']['array']); + $this->assertEquals('oneToMany', $attribute['body']['relationType']); + $this->assertEquals(true, $attribute['body']['twoWay']); + $this->assertEquals('person_one_to_many', $attribute['body']['twoWayKey']); + $this->assertEquals('restrict', $attribute['body']['onDelete']); + + $person2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $personCollection . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => 'person10', + 'data' => [ + 'fullName' => 'Stevie Wonder', + 'libraries' => [ + [ + '$id' => 'library10', + '$permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'libraryName' => 'Library 10', + ], + [ + '$id' => 'library11', + '$permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'libraryName' => 'Library 11', + ] + ], + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ] + ]); + + $this->assertEquals(201, $person2['headers']['status-code']); + $this->assertArrayHasKey('libraries', $person2['body']); + $this->assertEquals(2, count($person2['body']['libraries'])); + + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $personCollection . '/rows/' . $person2['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['*', 'libraries.*'])->toString() + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertArrayNotHasKey('$table', $response['body']); + $this->assertArrayHasKey('libraries', $response['body']); + $this->assertEquals(2, count($response['body']['libraries'])); + + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $libraryCollection . '/rows/library11', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['person_one_to_many.$id'])->toString() + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertArrayHasKey('person_one_to_many', $response['body']); + $this->assertEquals('person10', $response['body']['person_one_to_many']['$id']); + + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $personCollection . '/columns/libraries/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'onDelete' => Database::RELATION_MUTATE_CASCADE, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + $attribute = $this->client->call(Client::METHOD_GET, "/tablesdb/{$databaseId}/tables/{$personCollection}/columns/libraries", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $attribute['headers']['status-code']); + $this->assertEquals('available', $attribute['body']['status']); + $this->assertEquals('libraries', $attribute['body']['key']); + $this->assertEquals('relationship', $attribute['body']['type']); + $this->assertEquals(false, $attribute['body']['required']); + $this->assertEquals(false, $attribute['body']['array']); + $this->assertEquals('oneToMany', $attribute['body']['relationType']); + $this->assertEquals(true, $attribute['body']['twoWay']); + $this->assertEquals(Database::RELATION_MUTATE_CASCADE, $attribute['body']['onDelete']); + + return ['databaseId' => $databaseId, 'personCollection' => $personCollection]; + } + + /** + * @depends testCreateDatabase + */ + public function testManyToOneRelationship(array $data): array + { + $databaseId = $data['databaseId']; + + // Create album table + $albums = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Albums', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + + // Create album name column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $albums['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 255, + 'required' => true, + ]); + + // Create artist table + $artists = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Artists', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + + // Create artist name column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $artists['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 255, + 'required' => true, + ]); + + // Create relationship + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $albums['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $artists['body']['$id'], + 'type' => Database::RELATION_MANY_TO_ONE, + 'twoWay' => true, + 'key' => 'artist', + 'twoWayKey' => 'albums', + ]); + $this->assertEquals(202, $response['headers']['status-code']); + $this->assertEquals('artist', $response['body']['key']); + $this->assertEquals('relationship', $response['body']['type']); + $this->assertEquals(false, $response['body']['required']); + $this->assertEquals(false, $response['body']['array']); + $this->assertEquals('manyToOne', $response['body']['relationType']); + $this->assertEquals(true, $response['body']['twoWay']); + $this->assertEquals('albums', $response['body']['twoWayKey']); + $this->assertEquals('restrict', $response['body']['onDelete']); + + sleep(1); // Wait for worker + + $permissions = [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ]; + + // Create album + $album = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $albums['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => 'album1', + 'permissions' => $permissions, + 'data' => [ + 'name' => 'Album 1', + 'artist' => [ + '$id' => ID::unique(), + 'name' => 'Artist 1', + ], + ], + ]); + + $this->assertEquals(201, $album['headers']['status-code']); + $this->assertEquals('album1', $album['body']['$id']); + $this->assertEquals('Album 1', $album['body']['name']); + $this->assertEquals('Artist 1', $album['body']['artist']['name']); + $this->assertEquals($permissions, $album['body']['$permissions']); + $this->assertEquals($permissions, $album['body']['artist']['$permissions']); + + $album = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $albums['body']['$id'] . '/rows/album1', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['*', 'artist.name', 'artist.$permissions'])->toString() + ] + ]); + + $this->assertEquals(200, $album['headers']['status-code']); + $this->assertEquals('album1', $album['body']['$id']); + $this->assertEquals('Album 1', $album['body']['name']); + $this->assertEquals('Artist 1', $album['body']['artist']['name']); + $this->assertEquals($permissions, $album['body']['$permissions']); + $this->assertEquals($permissions, $album['body']['artist']['$permissions']); + + $artist = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $artists['body']['$id'] . '/rows/' . $album['body']['artist']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['*', 'albums.$id', 'albums.name', 'albums.$permissions'])->toString() + ] + ]); + + $this->assertEquals(200, $artist['headers']['status-code']); + $this->assertEquals('Artist 1', $artist['body']['name']); + $this->assertEquals($permissions, $artist['body']['$permissions']); + $this->assertEquals(1, count($artist['body']['albums'])); + $this->assertEquals('album1', $artist['body']['albums'][0]['$id']); + $this->assertEquals('Album 1', $artist['body']['albums'][0]['name']); + $this->assertEquals($permissions, $artist['body']['albums'][0]['$permissions']); + + return [ + 'databaseId' => $databaseId, + 'albumsCollection' => $albums['body']['$id'], + 'artistsCollection' => $artists['body']['$id'], + ]; + } + + /** + * @depends testCreateDatabase + */ + public function testManyToManyRelationship(array $data): array + { + $databaseId = $data['databaseId']; + + // Create sports table + $sports = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Sports', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + + // Create sport name column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $sports['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 255, + 'required' => true, + ]); + + // Create player table + $players = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Players', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + + // Create player name column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $players['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 255, + 'required' => true, + ]); + + // Create relationship + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $sports['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $players['body']['$id'], + 'type' => Database::RELATION_MANY_TO_MANY, + 'twoWay' => true, + 'key' => 'players', + 'twoWayKey' => 'sports', + 'onDelete' => Database::RELATION_MUTATE_SET_NULL, + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + $this->assertEquals('players', $response['body']['key']); + $this->assertEquals('relationship', $response['body']['type']); + $this->assertEquals(false, $response['body']['required']); + $this->assertEquals(false, $response['body']['array']); + $this->assertEquals('manyToMany', $response['body']['relationType']); + $this->assertEquals(true, $response['body']['twoWay']); + $this->assertEquals('sports', $response['body']['twoWayKey']); + $this->assertEquals('setNull', $response['body']['onDelete']); + + sleep(1); // Wait for worker + + $permissions = [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ]; + + // Create sport + $sport = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $sports['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => 'sport1', + 'permissions' => $permissions, + 'data' => [ + 'name' => 'Sport 1', + 'players' => [ + [ + '$id' => 'player1', + 'name' => 'Player 1', + ], + [ + '$id' => 'player2', + 'name' => 'Player 2', + ] + ], + ], + ]); + + $this->assertEquals(201, $sport['headers']['status-code']); + $this->assertEquals('sport1', $sport['body']['$id']); + $this->assertEquals('Sport 1', $sport['body']['name']); + $this->assertEquals('Player 1', $sport['body']['players'][0]['name']); + $this->assertEquals('Player 2', $sport['body']['players'][1]['name']); + $this->assertEquals($permissions, $sport['body']['$permissions']); + $this->assertEquals($permissions, $sport['body']['players'][0]['$permissions']); + $this->assertEquals($permissions, $sport['body']['players'][1]['$permissions']); + + $sport = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $sports['body']['$id'] . '/rows/sport1', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['*', 'players.name', 'players.$permissions'])->toString() + ] + ]); + + $this->assertEquals(200, $sport['headers']['status-code']); + $this->assertEquals('sport1', $sport['body']['$id']); + $this->assertEquals('Sport 1', $sport['body']['name']); + $this->assertEquals('Player 1', $sport['body']['players'][0]['name']); + $this->assertEquals('Player 2', $sport['body']['players'][1]['name']); + $this->assertEquals($permissions, $sport['body']['$permissions']); + $this->assertEquals($permissions, $sport['body']['players'][0]['$permissions']); + $this->assertEquals($permissions, $sport['body']['players'][1]['$permissions']); + + $player = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $players['body']['$id'] . '/rows/' . $sport['body']['players'][0]['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['*', 'sports.$id', 'sports.name', 'sports.$permissions'])->toString() + ] + ]); + + $this->assertEquals(200, $player['headers']['status-code']); + $this->assertEquals('Player 1', $player['body']['name']); + $this->assertEquals($permissions, $player['body']['$permissions']); + $this->assertEquals(1, count($player['body']['sports'])); + $this->assertEquals('sport1', $player['body']['sports'][0]['$id']); + $this->assertEquals('Sport 1', $player['body']['sports'][0]['name']); + $this->assertEquals($permissions, $player['body']['sports'][0]['$permissions']); + + return [ + 'databaseId' => $databaseId, + 'sportsCollection' => $sports['body']['$id'], + 'playersCollection' => $players['body']['$id'], + ]; + } + + /** + * @depends testOneToManyRelationship + */ + public function testValidateOperators(array $data): void + { + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['personCollection'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::isNotNull('$id')->toString(), + Query::select(['*', 'libraries.*'])->toString(), + Query::startsWith('fullName', 'Stevie')->toString(), + Query::endsWith('fullName', 'Wonder')->toString(), + Query::between('$createdAt', '1975-12-06', '2050-12-01')->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, count($response['body']['rows'])); + $this->assertEquals('person10', $response['body']['rows'][0]['$id']); + $this->assertEquals('Stevie Wonder', $response['body']['rows'][0]['fullName']); + $this->assertEquals(2, count($response['body']['rows'][0]['libraries'])); + + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['personCollection'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::isNotNull('$id')->toString(), + Query::isNull('fullName')->toString(), + Query::select(['fullName'])->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, count($response['body']['rows'])); + $this->assertEquals(null, $response['body']['rows'][0]['fullName']); + $this->assertArrayNotHasKey("libraries", $response['body']['rows'][0]); + $this->assertArrayHasKey('$databaseId', $response['body']['rows'][0]); + $this->assertArrayHasKey('$tableId', $response['body']['rows'][0]); + } + + /** + * @depends testOneToManyRelationship + */ + public function testSelectQueries(array $data): void + { + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['personCollection'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('fullName', ['Stevie Wonder'])->toString(), + Query::select(['fullName'])->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertArrayNotHasKey('libraries', $response['body']['rows'][0]); + $this->assertArrayHasKey('$databaseId', $response['body']['rows'][0]); + $this->assertArrayHasKey('$tableId', $response['body']['rows'][0]); + + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['personCollection'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['libraries.*', '$id'])->toString(), + ], + ]); + $row = $response['body']['rows'][0]; + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertArrayHasKey('libraries', $row); + $this->assertArrayHasKey('$databaseId', $row); + $this->assertArrayHasKey('$tableId', $row); + + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['personCollection'] . '/rows/' . $row['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['fullName', '$id'])->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertArrayHasKey('fullName', $response['body']); + $this->assertArrayNotHasKey('libraries', $response['body']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testOrQueries(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Or queries' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('Or queries', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $presidents = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'USA Presidents', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $presidents['headers']['status-code']); + $this->assertEquals($presidents['body']['name'], 'USA Presidents'); + + // Create Attributes + $firstName = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $presidents['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'first_name', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $firstName['headers']['status-code']); + + $lastName = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $presidents['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'last_name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $lastName['headers']['status-code']); + + // Wait for worker + sleep(2); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $presidents['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'first_name' => 'Donald', + 'last_name' => 'Trump', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $presidents['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'first_name' => 'George', + 'last_name' => 'Bush', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $presidents['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'first_name' => 'Joe', + 'last_name' => 'Biden', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(201, $row3['headers']['status-code']); + + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $presidents['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::select(['first_name', 'last_name'])->toString(), + Query::or([ + Query::equal('first_name', ['Donald']), + Query::equal('last_name', ['Bush']) + ])->toString(), + Query::limit(999)->toString(), + Query::offset(0)->toString() + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(2, $rows['body']['rows']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testNotContains(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'NotContains test' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('NotContains test', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $movies = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Movies', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $movies['headers']['status-code']); + $this->assertEquals($movies['body']['name'], 'Movies'); + + // Create Attributes + $title = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $movies['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $title['headers']['status-code']); + + $genre = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $movies['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'genre', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $genre['headers']['status-code']); + + // Wait for worker + sleep(2); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $movies['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Spider-Man: Homecoming', + 'genre' => 'Action', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $movies['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'The Avengers', + 'genre' => 'Action', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $movies['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Romantic Comedy', + 'genre' => 'Romance', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(201, $row3['headers']['status-code']); + + // Test notContains query - should return movies that don't contain "Spider" in title + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $movies['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::select(['title', 'genre'])->toString(), + Query::notContains('title', ['Spider'])->toString(), + Query::limit(999)->toString(), + Query::offset(0)->toString() + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(2, $rows['body']['rows']); + $this->assertEquals('The Avengers', $rows['body']['rows'][0]['title']); + $this->assertEquals('Romantic Comedy', $rows['body']['rows'][1]['title']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testNotSearch(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'NotSearch test' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('NotSearch test', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $books = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Books', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $books['headers']['status-code']); + $this->assertEquals($books['body']['name'], 'Books'); + + // Create Attributes + $title = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $books['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $title['headers']['status-code']); + + $description = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $books['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'description', + 'size' => 2048, + 'required' => true, + ]); + + $this->assertEquals(202, $description['headers']['status-code']); + + \sleep(2); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $books['body']['$id'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'fts_description', + 'type' => Database::INDEX_FULLTEXT, + 'columns' => ['description'], + ]); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $books['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Science Fiction Adventures', + 'description' => 'A thrilling journey through space and time', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $books['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Romance Novel', + 'description' => 'A love story set in modern times', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $books['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Mystery Thriller', + 'description' => 'A detective solves complex crimes', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(201, $row3['headers']['status-code']); + + // Test notSearch query - should return books that don't have "space" in the description + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $books['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::notSearch('description', 'space')->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(2, $rows['body']['rows']); + $this->assertEquals('Romance Novel', $rows['body']['rows'][0]['title']); + $this->assertEquals('Mystery Thriller', $rows['body']['rows'][1]['title']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testNotBetween(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'NotBetween test' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('NotBetween test', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $products = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Products', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $products['headers']['status-code']); + $this->assertEquals($products['body']['name'], 'Products'); + + // Create Attributes + $name = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $name['headers']['status-code']); + + $price = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/columns/float', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'price', + 'required' => true, + ]); + + $this->assertEquals(202, $price['headers']['status-code']); + + // Wait for worker + sleep(2); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Cheap Product', + 'price' => 5.99, + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Mid Product', + 'price' => 25.00, + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Expensive Product', + 'price' => 150.00, + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(201, $row3['headers']['status-code']); + + // Test notBetween query - should return products NOT priced between 10 and 50 + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::notBetween('price', 10, 50)->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(2, $rows['body']['rows']); + $this->assertEquals('Cheap Product', $rows['body']['rows'][0]['name']); + $this->assertEquals('Expensive Product', $rows['body']['rows'][1]['name']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testNotStartsWith(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'NotStartsWith test' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('NotStartsWith test', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $employees = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Employees', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $employees['headers']['status-code']); + $this->assertEquals($employees['body']['name'], 'Employees'); + + // Create Attributes + $name = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $employees['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $name['headers']['status-code']); + + $department = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $employees['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'department', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $department['headers']['status-code']); + + // Wait for worker + sleep(2); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $employees['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'John Smith', + 'department' => 'Engineering', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $employees['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Jane Doe', + 'department' => 'Marketing', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $employees['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Bob Johnson', + 'department' => 'Sales', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(201, $row3['headers']['status-code']); + + // Test notStartsWith query - should return employees whose names don't start with "John" + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $employees['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::notStartsWith('name', 'John')->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(2, $rows['body']['rows']); + $this->assertEquals('Jane Doe', $rows['body']['rows'][0]['name']); + $this->assertEquals('Bob Johnson', $rows['body']['rows'][1]['name']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testNotEndsWith(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'NotEndsWith test' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('NotEndsWith test', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $files = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Files', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $files['headers']['status-code']); + $this->assertEquals($files['body']['name'], 'Files'); + + // Create Attributes + $filename = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $files['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'filename', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $filename['headers']['status-code']); + + $type = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $files['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'type', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $type['headers']['status-code']); + + // Wait for worker + sleep(2); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $files['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'filename' => 'row.pdf', + 'type' => 'PDF', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $files['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'filename' => 'image.jpg', + 'type' => 'Image', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $files['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'filename' => 'presentation.pptx', + 'type' => 'Presentation', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(201, $row3['headers']['status-code']); + + // Test notEndsWith query - should return files that don't end with ".pdf" + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $files['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::notEndsWith('filename', '.pdf')->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(2, $rows['body']['rows']); + $this->assertEquals('image.jpg', $rows['body']['rows'][0]['filename']); + $this->assertEquals('presentation.pptx', $rows['body']['rows'][1]['filename']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testCreatedBefore(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'CreatedBefore test' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('CreatedBefore test', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $posts = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Posts', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $posts['headers']['status-code']); + $this->assertEquals($posts['body']['name'], 'Posts'); + + // Create Attributes + $title = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $posts['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $title['headers']['status-code']); + + $content = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $posts['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'content', + 'size' => 512, + 'required' => true, + ]); + + $this->assertEquals(202, $content['headers']['status-code']); + + // Wait for worker + sleep(2); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $posts['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Old Post', + 'content' => 'This is an old post content', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + + // Sleep to ensure different creation times + sleep(1); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $posts['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Recent Post', + 'content' => 'This is a recent post content', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + + // Get the creation time of the second post to use as boundary + $secondPostCreatedAt = $row2['body']['$createdAt']; + + // Sleep again + sleep(1); + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $posts['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Newest Post', + 'content' => 'This is the newest post content', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(201, $row3['headers']['status-code']); + + // Test createdBefore query - should return posts created before the second post + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $posts['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::createdBefore($secondPostCreatedAt)->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(1, $rows['body']['rows']); + $this->assertEquals('Old Post', $rows['body']['rows'][0]['title']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testCreatedAfter(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'CreatedAfter test' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('CreatedAfter test', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $events = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Events', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $events['headers']['status-code']); + $this->assertEquals($events['body']['name'], 'Events'); + + // Create Attributes + $name = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $events['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $name['headers']['status-code']); + + $description = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $events['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'description', + 'size' => 512, + 'required' => true, + ]); + + $this->assertEquals(202, $description['headers']['status-code']); + + // Wait for worker + sleep(2); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $events['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Early Event', + 'description' => 'This is an early event', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + + // Sleep to ensure different creation times + sleep(1); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $events['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Middle Event', + 'description' => 'This is a middle event', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + + // Get the creation time of the second event to use as boundary + $secondEventCreatedAt = $row2['body']['$createdAt']; + + // Sleep again + sleep(1); + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $events['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Latest Event', + 'description' => 'This is the latest event', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(201, $row3['headers']['status-code']); + + // Test createdAfter query - should return events created after the second event + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $events['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::createdAfter($secondEventCreatedAt)->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(1, $rows['body']['rows']); + $this->assertEquals('Latest Event', $rows['body']['rows'][0]['name']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testCreatedBetween(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'CreatedBetween test' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('CreatedBetween test', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $articles = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Articles', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $articles['headers']['status-code']); + $this->assertEquals($articles['body']['name'], 'Articles'); + + // Create Attributes + $title = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $articles['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $title['headers']['status-code']); + + $content = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $articles['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'content', + 'size' => 5000, + 'required' => true, + ]); + $this->assertEquals(202, $content['headers']['status-code']); + + // Wait for attributes to be available + sleep(2); + + // Create first article + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $articles['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'First Article', + 'content' => 'This is the first article content', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + $firstArticleCreatedAt = $row1['body']['$createdAt']; + + // Sleep to ensure different timestamps + sleep(1); + + // Create second article + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $articles['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Second Article', + 'content' => 'This is the second article content', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + $secondArticleCreatedAt = $row2['body']['$createdAt']; + + // Sleep again + sleep(1); + + // Create third article + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $articles['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Third Article', + 'content' => 'This is the third article content', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row3['headers']['status-code']); + $thirdArticleCreatedAt = $row3['body']['$createdAt']; + + // Sleep again + sleep(1); + + // Create fourth article + $row4 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $articles['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Fourth Article', + 'content' => 'This is the fourth article content', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row4['headers']['status-code']); + + // Test createdBetween query - should return articles created between first and third (inclusive) + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $articles['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::createdBetween($firstArticleCreatedAt, $thirdArticleCreatedAt)->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(3, $rows['body']['rows']); + + // Verify the returned articles are the correct ones + $titles = array_column($rows['body']['rows'], 'title'); + $this->assertContains('First Article', $titles); + $this->assertContains('Second Article', $titles); + $this->assertContains('Third Article', $titles); + $this->assertNotContains('Fourth Article', $titles); + + // Test createdBetween query - should return only the second article when using its timestamp for both bounds + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $articles['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::createdBetween($secondArticleCreatedAt, $secondArticleCreatedAt)->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(1, $rows['body']['rows']); + $this->assertEquals('Second Article', $rows['body']['rows'][0]['title']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testUpdatedBefore(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'UpdatedBefore test' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('UpdatedBefore test', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $tasks = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Tasks', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $tasks['headers']['status-code']); + $this->assertEquals($tasks['body']['name'], 'Tasks'); + + // Create Attributes + $title = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tasks['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $title['headers']['status-code']); + + $status = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tasks['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'status', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $status['headers']['status-code']); + + // Wait for worker + sleep(2); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tasks['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Task One', + 'status' => 'pending', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + $taskOneId = $row1['body']['$id']; + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tasks['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Task Two', + 'status' => 'pending', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + $taskTwoId = $row2['body']['$id']; + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tasks['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Task Three', + 'status' => 'pending', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row3['headers']['status-code']); + $taskThreeId = $row3['body']['$id']; + + // Update first task + sleep(1); + $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tasks['body']['$id'] . '/rows/' . $taskOneId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'status' => 'completed', + ] + ]); + + // Update second task and get its updated time + sleep(1); + $updatedTaskTwo = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tasks['body']['$id'] . '/rows/' . $taskTwoId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'status' => 'in_progress', + ] + ]); + $secondTaskUpdatedAt = $updatedTaskTwo['body']['$updatedAt']; + + // Update third task + sleep(1); + $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tasks['body']['$id'] . '/rows/' . $taskThreeId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'status' => 'review', + ] + ]); + + // Test updatedBefore query - should return tasks updated before the second task's update time + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $tasks['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::updatedBefore($secondTaskUpdatedAt)->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(1, $rows['body']['rows']); + $this->assertEquals('Task One', $rows['body']['rows'][0]['title']); + $this->assertEquals('completed', $rows['body']['rows'][0]['status']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testUpdatedAfter(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'UpdatedAfter test' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('UpdatedAfter test', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $orders = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Orders', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $orders['headers']['status-code']); + $this->assertEquals($orders['body']['name'], 'Orders'); + + // Create Attributes + $orderNumber = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $orders['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'orderNumber', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $orderNumber['headers']['status-code']); + + $status = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $orders['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'status', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $status['headers']['status-code']); + + // Wait for worker + sleep(2); + + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $orders['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'orderNumber' => 'ORD-001', + 'status' => 'pending', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + $orderOneId = $row1['body']['$id']; + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $orders['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'orderNumber' => 'ORD-002', + 'status' => 'pending', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + $orderTwoId = $row2['body']['$id']; + + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $orders['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'orderNumber' => 'ORD-003', + 'status' => 'pending', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row3['headers']['status-code']); + $orderThreeId = $row3['body']['$id']; + + // Update first order + sleep(1); + $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $orders['body']['$id'] . '/rows/' . $orderOneId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'status' => 'processing', + ] + ]); + + // Update second order and get its updated time + sleep(1); + $updatedOrderTwo = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $orders['body']['$id'] . '/rows/' . $orderTwoId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'status' => 'shipped', + ] + ]); + $secondOrderUpdatedAt = $updatedOrderTwo['body']['$updatedAt']; + + // Update third order + sleep(1); + $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $orders['body']['$id'] . '/rows/' . $orderThreeId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'status' => 'delivered', + ] + ]); + + // Test updatedAfter query - should return orders updated after the second order's update time + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $orders['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::updatedAfter($secondOrderUpdatedAt)->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(1, $rows['body']['rows']); + $this->assertEquals('ORD-003', $rows['body']['rows'][0]['orderNumber']); + $this->assertEquals('delivered', $rows['body']['rows'][0]['status']); + } + + /** + * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query + */ + public function testUpdatedBetween(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'UpdatedBetween test' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('UpdatedBetween test', $database['body']['name']); + + $databaseId = $database['body']['$id']; + + // Create Collection + $products = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Products', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $products['headers']['status-code']); + $this->assertEquals($products['body']['name'], 'Products'); + + // Create Attributes + $name = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $name['headers']['status-code']); + + $price = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/columns/float', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'price', + 'required' => true, + ]); + $this->assertEquals(202, $price['headers']['status-code']); + + // Wait for attributes to be available + sleep(2); + + // Create first product + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Product A', + 'price' => 99.99, + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row1['headers']['status-code']); + + // Sleep to ensure different timestamps + sleep(1); + + // Create second product + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Product B', + 'price' => 149.99, + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row2['headers']['status-code']); + + // Sleep again + sleep(1); + + // Create third product + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Product C', + 'price' => 199.99, + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row3['headers']['status-code']); + + // Sleep again + sleep(1); + + // Create fourth product + $row4 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Product D', + 'price' => 249.99, + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row4['headers']['status-code']); + + // Now update products in sequence to get different updatedAt timestamps + sleep(1); + + // Update first product + $update1 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows/' . $row1['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'price' => 89.99, + ] + ]); + $this->assertEquals(200, $update1['headers']['status-code']); + $firstProductUpdatedAt = $update1['body']['$updatedAt']; + + sleep(1); + + // Update second product + $update2 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows/' . $row2['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'price' => 139.99, + ] + ]); + $this->assertEquals(200, $update2['headers']['status-code']); + $secondProductUpdatedAt = $update2['body']['$updatedAt']; + + sleep(1); + + // Update third product + $update3 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows/' . $row3['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'price' => 189.99, + ] + ]); + $this->assertEquals(200, $update3['headers']['status-code']); + $thirdProductUpdatedAt = $update3['body']['$updatedAt']; + + sleep(1); + + // Update fourth product + $update4 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows/' . $row4['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'price' => 239.99, + ] + ]); + $this->assertEquals(200, $update4['headers']['status-code']); + + // Test updatedBetween query - should return products updated between first and third (inclusive) + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::updatedBetween($firstProductUpdatedAt, $thirdProductUpdatedAt)->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(3, $rows['body']['rows']); + + // Verify the returned products are the correct ones + $names = array_column($rows['body']['rows'], 'name'); + $this->assertContains('Product A', $names); + $this->assertContains('Product B', $names); + $this->assertContains('Product C', $names); + $this->assertNotContains('Product D', $names); + + // Test updatedBetween query - should return only the second product when using its timestamp for both bounds + $rows = $this->client->call( + Client::METHOD_GET, + '/tablesdb/' . $databaseId . '/tables/' . $products['body']['$id'] . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'queries' => [ + Query::updatedBetween($secondProductUpdatedAt, $secondProductUpdatedAt)->toString(), + ], + ] + ); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertCount(1, $rows['body']['rows']); + $this->assertEquals('Product B', $rows['body']['rows'][0]['name']); + $this->assertEquals(139.99, $rows['body']['rows'][0]['price']); + } + + /** + * @depends testCreateDatabase + * @param array $data + * @return void + * @throws \Exception + */ + public function testUpdateWithExistingRelationships(array $data): void + { + $databaseId = $data['databaseId']; + + $table1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Collection1', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + + $table2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Collection2', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + + $table1 = $table1['body']['$id']; + $table2 = $table2['body']['$id']; + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1 . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => '49', + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table2 . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => '49', + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1 . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2, + 'type' => Database::RELATION_ONE_TO_MANY, + 'twoWay' => true, + 'key' => 'collection2' + ]); + + sleep(1); + + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1 . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Row 1', + 'collection2' => [ + [ + 'name' => 'Row 2', + ], + ], + ], + ]); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table1 . '/rows/' . $row['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Row 1 Updated', + ], + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + } + + /** + * @depends testCreateDatabase + */ + public function testTimeout(array $data): void + { + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $data['databaseId'] . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Slow Queries', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + + $data = [ + '$id' => $table['body']['$id'], + 'databaseId' => $table['body']['databaseId'] + ]; + + $longtext = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'longtext', + 'size' => 100000000, + 'required' => false, + 'default' => null, + ]); + + $this->assertEquals($longtext['headers']['status-code'], 202); + + for ($i = 0; $i < 10; $i++) { + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'longtext' => file_get_contents(__DIR__ . '../../../../../resources/longtext.txt'), + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + } + + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-timeout' => 1, + ], $this->getHeaders()), [ + 'queries' => [ + Query::notEqual('longtext', 'appwrite')->toString(), + ], + ]); + + $this->assertEquals(408, $response['headers']['status-code']); + } + + /** + * @throws \Exception + */ + public function testIncrementColumn(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'CounterDatabase' + ]); + $databaseId = $database['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'CounterCollection', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + $tableId = $table['body']['$id']; + + // Add integer column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'count', + 'required' => true, + ]); + + \sleep(3); + + // Create row with initial count = 5 + $doc = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'count' => 5 + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + ], + ]); + $this->assertEquals(201, $doc['headers']['status-code']); + + $rowId = $doc['body']['$id']; + + // Increment by default 1 + $inc = $this->client->call(Client::METHOD_PATCH, "/tablesdb/$databaseId/tables/$tableId/rows/$rowId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + $this->assertEquals(200, $inc['headers']['status-code']); + $this->assertEquals(6, $inc['body']['count']); + + // Verify count = 6 + $get = $this->client->call(Client::METHOD_GET, "/tablesdb/$databaseId/tables/$tableId/rows/$rowId", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(6, $get['body']['count']); + + // Increment by custom value 4 + $inc2 = $this->client->call(Client::METHOD_PATCH, "/tablesdb/$databaseId/tables/$tableId/rows/$rowId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 4 + ]); + $this->assertEquals(200, $inc2['headers']['status-code']); + $this->assertEquals(10, $inc2['body']['count']); + + $get2 = $this->client->call(Client::METHOD_GET, "/tablesdb/$databaseId/tables/$tableId/rows/$rowId", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(10, $get2['body']['count']); + + // Test max limit exceeded + $err = $this->client->call(Client::METHOD_PATCH, "/tablesdb/$databaseId/tables/$tableId/rows/$rowId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), ['max' => 8]); + $this->assertEquals(400, $err['headers']['status-code']); + + // Test column not found + $notFound = $this->client->call(Client::METHOD_PATCH, "/tablesdb/$databaseId/tables/$tableId/rows/$rowId/unknown/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + $this->assertEquals(404, $notFound['headers']['status-code']); + + // Test decrement with value 0 + $inc3 = $this->client->call(Client::METHOD_PATCH, "/tablesdb/$databaseId/tables/$tableId/rows/$rowId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 0 + ]); + $this->assertEquals(400, $inc3['headers']['status-code']); + } + + public function testDecrementColumn(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'CounterDatabase' + ]); + + $databaseId = $database['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'CounterCollection', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + + $tableId = $table['body']['$id']; + + // Add integer column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'count', + 'required' => true, + ]); + + \sleep(2); + + // Create row with initial count = 10 + $doc = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => ['count' => 10], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $rowId = $doc['body']['$id']; + + // Decrement by default 1 (count = 10 -> 9) + $dec = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + $this->assertEquals(200, $dec['headers']['status-code']); + $this->assertEquals(9, $dec['body']['count']); + + $get = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(9, $get['body']['count']); + + // Decrement by custom value 3 (count 9 -> 6) + $dec2 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 3 + ]); + $this->assertEquals(200, $dec2['headers']['status-code']); + $this->assertEquals(6, $dec2['body']['count']); + + $get2 = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(6, $get2['body']['count']); + + // Test min limit exceeded + $err = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), ['min' => 7]); + $this->assertEquals(400, $err['headers']['status-code']); + + // Test type error on non-numeric column + $typeErr = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), ['value' => 'not-a-number']); + $this->assertEquals(400, $typeErr['headers']['status-code']); + + // Test decrement with value 0 + $inc3 = $this->client->call(Client::METHOD_PATCH, "/tablesdb/$databaseId/tables/$tableId/rows/$rowId/count/decrement", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 0 + ]); + $this->assertEquals(400, $inc3['headers']['status-code']); + } + + public function testSpatialPointColumns(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Point Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create table with spatial and non-spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Point Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $tableId = $table['body']['$id']; + + // Create string column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + // Create point column + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(2); + + // Create row with point column + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Test Location', + 'location' => [40.7128, -74.0060] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([40.7128, -74.0060], $response['body']['location']); + $rowId = $response['body']['$id']; + + // Read row with point column + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7128, -74.0060], $response['body']['location']); + + // Update row with new point coordinates + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'location' => [40.7589, -73.9851] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7589, -73.9851], $response['body']['location']); + + // Upsert row with point column + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Upserted Location', + 'location' => [34.0522, -80] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([34.0522, -80], $response['body']['location']); + + // Create row without permissions (should fail) + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Unauthorized Location', + 'location' => [0, 0] + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialLineColumns(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Line Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create table with spatial and non-spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Line Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $tableId = $table['body']['$id']; + + // Create integer column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'distance', + 'required' => true, + ]); + + // Create line column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => true, + ]); + + sleep(2); + + // Create row with line column + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'distance' => 100, + 'route' => [[40.7128, -74.0060], [40.7589, -73.9851]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); + $rowId = $response['body']['$id']; + + // Read row + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); + + // Update row + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'route' => [[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]], $response['body']['route']); + + // Upsert row with line column + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'distance' => 200, + 'route' => [[34.0522, -80], [34.0736, -80]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[34.0522, -80], [34.0736, -80]], $response['body']['route']); + + // Delete row + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(204, $response['headers']['status-code']); + + // Verify row is deleted + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(404, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialPolygonColumns(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Polygon Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create table with spatial and non-spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Polygon Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $tableId = $table['body']['$id']; + + // Create boolean column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'active', + 'required' => true, + ]); + + // Create polygon column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + sleep(2); + + // Create row with polygon column + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'active' => true, + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); + $rowId = $response['body']['$id']; + + // Read row + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); + + // Update row with new polygon + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]], $response['body']['area']); + + // Upsert row with polygon column + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'active' => false, + 'area' => [[[34.0522, -80], [34.0736, -80], [34.0736, -80], [34.0522, -80], [34.0522, -80]]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[34.0522, -80], [34.0736, -80], [34.0736, -80], [34.0522, -80], [34.0522, -80]]], $response['body']['area']); + + // Create row missing required polygon (should fail) + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'active' => true + ] + ]); + $this->assertEquals(400, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialColumnsMixedTable(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Mixed Spatial Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create table with multiple spatial and non-spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Mixed Spatial Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $tableId = $table['body']['$id']; + + // Create multiple columns + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'center', + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'boundary', + 'required' => false, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'coverage', + 'required' => true, + ]); + + sleep(3); + + // Create row with all spatial columns + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Central Park', + 'center' => [40.7829, -73.9654], + 'boundary' => [[40.7649, -73.9814], [40.8009, -73.9494]], + 'coverage' => [[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([40.7829, -73.9654], $response['body']['center']); + $this->assertEquals([[40.7649, -73.9814], [40.8009, -73.9494]], $response['body']['boundary']); + $this->assertEquals([[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]], $response['body']['coverage']); + $rowId = $response['body']['$id']; + + // Update row with new spatial data + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'center' => [40.7505, -73.9934], + 'boundary' => [[40.7305, -74.0134], [40.7705, -73.9734]], + 'coverage' => [[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7505, -73.9934], $response['body']['center']); + $this->assertEquals([[40.7305, -74.0134], [40.7705, -73.9734]], $response['body']['boundary']); + $this->assertEquals([[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]], $response['body']['coverage']); + + // Create row with minimal required columns + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Minimal Location', + 'center' => [0, 0], + 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['center']); + + // Permission validation - create without user context + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Unauthorized Location', + 'center' => [0, 0], + 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialQuery(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Query Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create table with spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Query Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create string column + $nameColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $nameColumn['headers']['status-code']); + + // Create point column + $pointColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pointAttr', + 'required' => true, + ]); + $this->assertEquals(202, $pointColumn['headers']['status-code']); + + // Create line column + $lineColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'lineAttr', + 'required' => true, + ]); + $this->assertEquals(202, $lineColumn['headers']['status-code']); + + // Create polygon column + $polygonColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'polyAttr', + 'required' => true, + ]); + $this->assertEquals(202, $polygonColumn['headers']['status-code']); + + // Wait for columns to be created + sleep(2); + + // Create test rows with spatial data + $rows = [ + [ + '$id' => 'row1', + 'name' => 'Test Row 1', + 'pointAttr' => [6.0, 6.0], + 'lineAttr' => [[1.0, 1.0], [1.1,1.1] , [2.0, 2.0]], + 'polyAttr' => [[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]] + ], + [ + '$id' => 'row2', + 'name' => 'Test Row 2', + 'pointAttr' => [7.0, 6.0], + 'lineAttr' => [[10.0, 10.0], [20.0, 20.0]], + 'polyAttr' => [[[20.0, 20.0], [30.0, 20.0], [30.0, 30.0], [20.0, 30.0], [20.0, 20.0]]] + ], + [ + '$id' => 'row3', + 'name' => 'Test Row 3', + 'pointAttr' => [25.0, 25.0], + 'lineAttr' => [[25.0, 25.0], [35.0, 35.0]], + 'polyAttr' => [[[40.0, 40.0], [50.0, 40.0], [50.0, 50.0], [40.0, 50.0], [40.0, 40.0]]] + ] + ]; + + foreach ($rows as $r) { + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => $r['$id'], + 'data' => [ + 'name' => $r['name'], + 'pointAttr' => $r['pointAttr'], + 'lineAttr' => $r['lineAttr'], + 'polyAttr' => $r['polyAttr'] + ] + ]); + $this->assertEquals(201, $response['headers']['status-code']); + } + + // Equality on non-spatial column (name) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('name', ['Test Row 1'])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['rows']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); + + // Polygon column queries + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('polyAttr', [[[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['rows']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); + + // Not equal queries + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notEqual('pointAttr', [[6.0, 6.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['rows']); + + // contains on line (point on line) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::contains('lineAttr', [[1.1, 1.1]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['rows']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); + + // notContains on polygon (point outside all polygons) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notContains('polyAttr', [[15.0, 15.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // intersects on polygon (point inside row1 polygon) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::intersects('polyAttr', [5.0, 5.0])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); + + // notIntersects on polygon (point outside all polygons) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notIntersects('polyAttr', [60.0, 60.0])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // overlaps on polygon (polygon overlapping row1) + $overlapPoly = [[[5.0, 5.0], [12.0, 5.0], [12.0, 12.0], [5.0, 12.0], [5.0, 5.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::overlaps('polyAttr', $overlapPoly)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); + + // notOverlaps on polygon (polygon that overlaps none) + $noOverlapPoly = [[[60.0, 60.0], [70.0, 60.0], [70.0, 70.0], [60.0, 70.0], [60.0, 60.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notOverlaps('polyAttr', $noOverlapPoly)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // distance (equals) on point + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceEqual('pointAttr', [6.0, 6.0], 1.0)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('row2', $response['body']['rows'][0]['$id']); + + // notDistance (outside radius) on point + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceNotEqual('pointAttr', [6.0, 6.0], 1.0)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + + // distanceGreaterThan + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceGreaterThan('pointAttr', [6.0, 6.0], 5.0)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + + // distanceLessThan + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceLessThan('pointAttr', [6.0, 6.0], 0.5)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + + // crosses on line (query line crosses row1 line) + $crossLine = [[1.0, 2.0], [2.0, 1.0]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::crosses('lineAttr', $crossLine)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); + + // notCrosses on line (query line does not cross any stored lines) + $nonCrossLine = [[0.0, 1.0], [0.0, 2.0]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notCrosses('lineAttr', $nonCrossLine)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // touches on polygon (query polygon touches row1 polygon at corner) + $touchPoly = [[[10.0, 10.0], [20.0, 10.0], [20.0, 20.0], [10.0, 20.0], [10.0, 10.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::touches('polyAttr', $touchPoly)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); + + // notTouches on polygon (polygon far away should not touch) + $farPoly = [[[60.0, 60.0], [70.0, 60.0], [70.0, 70.0], [60.0, 70.0], [60.0, 60.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notTouches('polyAttr', $farPoly)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Select specific columns + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::select(['name', 'pointAttr'])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['rows']); + foreach ($response['body']['rows'] as $doc) { + $this->assertArrayHasKey('name', $doc); + $this->assertArrayHasKey('pointAttr', $doc); + $this->assertArrayNotHasKey('lineAttr', $doc); + $this->assertArrayNotHasKey('polyAttr', $doc); + } + + // Order by name + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::orderAsc('name')->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['rows']); + $this->assertEquals('Test Row 1', $response['body']['rows'][0]['name']); + $this->assertEquals('Test Row 2', $response['body']['rows'][1]['name']); + $this->assertEquals('Test Row 3', $response['body']['rows'][2]['name']); + + // Limit results + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::limit(2)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['rows']); + + // Offset results + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::offset(1)->toString(), Query::limit(2)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['rows']); + + // Complex query with multiple conditions + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['name', 'pointAttr'])->toString(), + Query::orderAsc('name')->toString(), + Query::limit(1)->toString() + ] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['rows']); + $this->assertEquals('Test Row 1', $response['body']['rows'][0]['name']); + + // Query with no results + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('name', ['Non-existent Row'])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(0, $response['body']['rows']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialIndex(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Index Test DB' + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $databaseId = $database['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'SpatialIdx', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create spatial columns: one required, one optional + $reqPoint = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pRequired', + 'required' => true, + ]); + $this->assertEquals(202, $reqPoint['headers']['status-code']); + + $optPoint = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pOptional', + 'required' => false, + ]); + $this->assertEquals(202, $optPoint['headers']['status-code']); + + // Ensure columns are available + sleep(2); + + // Create index on required spatial column (should succeed) + $okIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_required_point', + 'type' => Database::INDEX_SPATIAL, + 'columns' => ['pRequired'], + ]); + $this->assertEquals(202, $okIndex['headers']['status-code']); + + // Create index on optional spatial column (should fail in case of mariadb) + $badIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_optional_point', + 'type' => Database::INDEX_SPATIAL, + 'columns' => ['pOptional'], + ]); + $this->assertEquals(400, $badIndex['headers']['status-code']); + + // making it required to create index on it + $updated = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point/'.'pOptional', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => null + ]); + $this->assertEquals(200, $updated['headers']['status-code']); + + sleep(2); + + $retriedIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_optional_point', + 'type' => Database::INDEX_SPATIAL, + 'columns' => ['pOptional'], + ]); + $this->assertEquals(202, $retriedIndex['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testUpdateSpatialColumns(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Update Spatial Columns Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create table with spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Update Spatial Columns Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $tableId = $table['body']['$id']; + + // Create string column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + // Create point column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + // Create line column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => false, + ]); + + // Create polygon column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + sleep(2); + + // Test 1: Update point column - change required status + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point/location', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(false, $response['body']['required']); + + // Test 2: Update line column - change required status and add default value + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line/route', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => [[0, 0], [1, 1]], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(false, $response['body']['required']); + $this->assertEquals([[0, 0], [1, 1]], $response['body']['default']); + + // Test 3: Update polygon column - change key name + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon/area', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'newKey' => 'coverage', + 'default' => null, + 'required' => false + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('coverage', $response['body']['key']); + + // Test 4: Update point column - add default value + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point/location', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => [0, 0], + 'required' => false + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['default']); + + // Test 5: Verify column updates by creating a row + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Test Location', + 'coverage' => [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['location']); // Should use default value + $this->assertEquals([[0, 0], [1, 1]], $response['body']['route']); // Should use default value + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + public function testSpatialDistanceInMeter(): void + { + $headers = [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]; + + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', $headers, [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Distance Meters Database' + ]); + $databaseId = $database['body']['$id']; + + // Create table + $table = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables", $headers, [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Distance Meters Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $tableId = $table['body']['$id']; + + // Create point column + $resp = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/columns/point", $headers, [ + 'key' => 'loc', + 'required' => true, + ]); + $this->assertEquals(202, $resp['headers']['status-code']); + + sleep(2); + + // Create spatial index + $indexResp = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/indexes", $headers, [ + 'key' => 'idx_loc', + 'type' => Database::INDEX_SPATIAL, + 'columns' => ['loc'], + ]); + $this->assertEquals(202, $indexResp['headers']['status-code']); + + + // Insert two points ~1km apart + $points = [ + 'p0' => [0.0000, 0.0000], + 'p1' => [0.0090, 0.0000] + ]; + + foreach ($points as $id => $loc) { + $rowResp = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", $headers, [ + 'rowId' => $id, + 'data' => ['loc' => $loc] + ]); + $this->assertEquals(201, $rowResp['headers']['status-code']); + } + + // Queries + $queries = [ + 'within1_5km' => Query::distanceLessThan('loc', [0.0, 0.0], 1500, true), + 'within500m' => Query::distanceLessThan('loc', [0.0, 0.0], 500, true), + 'greater500m' => Query::distanceGreaterThan('loc', [0.0, 0.0], 500, true), + 'equal0m' => Query::distanceEqual('loc', [0.0, 0.0], 0, true), + 'notEqual0m' => Query::distanceNotEqual('loc', [0.0, 0.0], 0, true), + ]; + + // Assertions + $results = [ + 'within1_5km' => 2, + 'within500m' => 1, + 'greater500m' => 1, + 'equal0m' => 'p0', + 'notEqual0m' => 'p1' + ]; + + foreach ($queries as $key => $query) { + $resp = $this->client->call(Client::METHOD_GET, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", $headers, [ + 'queries' => [$query->toString()] + ]); + $this->assertEquals(200, $resp['headers']['status-code']); + if (is_int($results[$key])) { + $this->assertCount($results[$key], $resp['body']['rows']); + } else { + $this->assertEquals($results[$key], $resp['body']['rows'][0]['$id']); + } + } + + // Cleanup + $this->client->call(Client::METHOD_DELETE, "/tablesdb/{$databaseId}/tables/{$tableId}", $headers); + $this->client->call(Client::METHOD_DELETE, "/tablesdb/{$databaseId}", $headers); + } + + public function testSpatialColCreateOnExistingData(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Distance Meters Database' + ]); + + $databaseId = $database['body']['$id']; + + $tableId = ID::unique(); + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => $tableId, + 'name' => 'spatial-test', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + + $description = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'description', + 'size' => 512, + 'required' => false, + 'default' => '', + ]); + + $this->assertEquals(202, $description['headers']['status-code']); + sleep(2); + + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'description' => 'description' + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row['headers']['status-code']); + + $point = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'loc', + 'required' => true, + ]); + + $this->assertEquals(400, $point['headers']['status-code']); + + $point = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'loc', + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(202, $point['headers']['status-code']); + + $line = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => true, + ]); + + $this->assertEquals(400, $line['headers']['status-code']); + + $line = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(202, $line['headers']['status-code']); + + $poly = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + $this->assertEquals(400, $poly['headers']['status-code']); + + $poly = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(202, $poly['headers']['status-code']); + } + + public function testSpatialColCreateOnExistingDataWithDefaults(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial With Defaults Database' + ]); + + $databaseId = $database['body']['$id']; + + $tableId = ID::unique(); + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => $tableId, + 'name' => 'spatial-test-defaults', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + + $description = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'description', + 'size' => 512, + 'required' => false, + 'default' => '', + ]); + + $this->assertEquals(202, $description['headers']['status-code']); + sleep(2); + + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'description' => 'description' + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $row['headers']['status-code']); + + // Test point with default value + $point = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'loc', + 'required' => false, + 'default' => [0.0, 0.0] + ]); + + $this->assertEquals(202, $point['headers']['status-code']); + + // Test line with default value + $line = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => false, + 'default' => [[0.0, 0.0], [1.0, 1.0]] + ]); + + $this->assertEquals(202, $line['headers']['status-code']); + + // Test polygon with default value + $poly = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => false, + 'default' => [[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]]] + ]); + + $this->assertEquals(202, $poly['headers']['status-code']); + + // Wait for columns to be available + sleep(2); + + // Create a new row without spatial data to test default values + $newRow = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'description' => 'test default values' + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $newRow['headers']['status-code']); + + $newRowId = $newRow['body']['$id']; + + // Fetch the row to verify default values are applied + $fetchedRow = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $newRowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $fetchedRow['headers']['status-code']); + + // Verify default values are applied + $this->assertEquals([0.0, 0.0], $fetchedRow['body']['loc']); + $this->assertEquals([[0.0, 0.0], [1.0, 1.0]], $fetchedRow['body']['route']); + $this->assertEquals([[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]]], $fetchedRow['body']['area']); + } + +} diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesConsoleClientTest.php b/tests/e2e/Services/Databases/TablesDB/DatabasesConsoleClientTest.php new file mode 100644 index 0000000000..3cde767d50 --- /dev/null +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesConsoleClientTest.php @@ -0,0 +1,336 @@ +<?php + +namespace Tests\E2E\Services\Databases\TablesDB; + +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideConsole; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; +use Utopia\Database\Query; + +class DatabasesConsoleClientTest extends Scope +{ + use ProjectCustom; + use SideConsole; + + public function testCreateTable(): array + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'databaseId' => ID::unique(), + 'name' => 'invalidDocumentDatabase', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('invalidDocumentDatabase', $database['body']['name']); + $this->assertTrue($database['body']['enabled']); + + $databaseId = $database['body']['$id']; + + /** + * Test for SUCCESS + */ + $movies = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'tableId' => ID::unique(), + 'name' => 'Movies', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $movies['headers']['status-code']); + $this->assertEquals('Movies', $movies['body']['name']); + + /** + * Test when database is disabled but can still create tables + */ + $database = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'invalidDocumentDatabase Updated', + 'enabled' => false, + ]); + + $this->assertFalse($database['body']['enabled']); + + $tvShows = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'tableId' => ID::unique(), + 'name' => 'TvShows', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + /** + * Test when table is disabled but can still modify tables + */ + $database = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $movies['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Movies', + 'enabled' => false, + ]); + + $this->assertEquals(201, $tvShows['headers']['status-code']); + $this->assertEquals('TvShows', $tvShows['body']['name']); + + return ['moviesId' => $movies['body']['$id'], 'databaseId' => $databaseId, 'tvShowsId' => $tvShows['body']['$id']]; + } + + /** + * @depends testCreateTable + * @param array $data + * @throws \Exception + */ + public function testListTable(array $data) + { + /** + * Test when database is disabled but can still call list tables + */ + $databaseId = $data['databaseId']; + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(200, $tables['headers']['status-code']); + $this->assertEquals(2, $tables['body']['total']); + } + + /** + * @depends testCreateTable + * @param array $data + * @throws \Exception + */ + public function testGetTable(array $data) + { + $databaseId = $data['databaseId']; + $moviesCollectionId = $data['moviesId']; + + /** + * Test when database and table are disabled but can still call get table + */ + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $moviesCollectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $table['headers']['status-code']); + $this->assertEquals('Movies', $table['body']['name']); + $this->assertEquals($moviesCollectionId, $table['body']['$id']); + $this->assertFalse($table['body']['enabled']); + } + + /** + * @depends testCreateTable + * @param array $data + * @throws \Exception + * @throws \Exception + */ + public function testUpdateTable(array $data) + { + $databaseId = $data['databaseId']; + $moviesCollectionId = $data['moviesId']; + + /** + * Test When database and table are disabled but can still call update table + */ + $table = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $moviesCollectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Movies Updated', + 'enabled' => false + ]); + + $this->assertEquals(200, $table['headers']['status-code']); + $this->assertEquals('Movies Updated', $table['body']['name']); + $this->assertEquals($moviesCollectionId, $table['body']['$id']); + $this->assertFalse($table['body']['enabled']); + } + + /** + * @depends testCreateTable + * @param array $data + * @throws \Exception + * @throws \Exception + */ + public function testDeleteTable(array $data) + { + $databaseId = $data['databaseId']; + $tvShowsId = $data['tvShowsId']; + + /** + * Test when database and table are disabled but can still call delete table + */ + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tvShowsId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(204, $response['headers']['status-code']); + $this->assertEquals("", $response['body']); + } + + /** + * @depends testCreateTable + */ + public function testGetDatabaseUsage(array $data) + { + $databaseId = $data['databaseId']; + /** + * Test for FAILURE + */ + + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/usage', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'range' => '32h' + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + /** + * Test for SUCCESS + */ + + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/usage', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'range' => '24h' + ]); + + + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(15, $response['body']); + $this->assertEquals('24h', $response['body']['range']); + $this->assertIsNumeric($response['body']['rowsTotal']); + $this->assertIsNumeric($response['body']['tablesTotal']); + $this->assertIsArray($response['body']['tables']); + $this->assertIsArray($response['body']['rows']); + } + + + /** + * @depends testCreateTable + */ + public function testGetTableUsage(array $data) + { + $databaseId = $data['databaseId']; + /** + * Test for FAILURE + */ + + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/usage', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'range' => '32h' + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/randomCollectionId/usage', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'range' => '24h' + ]); + + $this->assertEquals(404, $response['headers']['status-code']); + + /** + * Test for SUCCESS + */ + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/usage', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'range' => '24h' + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, count($response['body'])); + $this->assertEquals('24h', $response['body']['range']); + $this->assertIsNumeric($response['body']['rowsTotal']); + $this->assertIsArray($response['body']['rows']); + } + + /** + * @depends testCreateTable + * @throws \Utopia\Database\Exception\Query + */ + public function testGetTableLogs(array $data) + { + $databaseId = $data['databaseId']; + /** + * Test for SUCCESS + */ + $logs = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/logs', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $logs['headers']['status-code']); + $this->assertIsArray($logs['body']['logs']); + $this->assertIsNumeric($logs['body']['total']); + + $logs = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/logs', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::limit(1)->toString()] + ]); + + $this->assertEquals(200, $logs['headers']['status-code']); + $this->assertIsArray($logs['body']['logs']); + $this->assertLessThanOrEqual(1, count($logs['body']['logs'])); + $this->assertIsNumeric($logs['body']['total']); + + $logs = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/logs', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::offset(1)->toString()] + ]); + + $this->assertEquals(200, $logs['headers']['status-code']); + $this->assertIsArray($logs['body']['logs']); + $this->assertIsNumeric($logs['body']['total']); + + $logs = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['moviesId'] . '/logs', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::offset(1)->toString(), Query::limit(1)->toString()] + ]); + + $this->assertEquals(200, $logs['headers']['status-code']); + $this->assertIsArray($logs['body']['logs']); + $this->assertLessThanOrEqual(1, count($logs['body']['logs'])); + $this->assertIsNumeric($logs['body']['total']); + } +} diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/TablesDB/DatabasesCustomClientTest.php new file mode 100644 index 0000000000..f986b5dd03 --- /dev/null +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesCustomClientTest.php @@ -0,0 +1,893 @@ +<?php + +namespace Tests\E2E\Services\Databases\TablesDB; + +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideClient; +use Utopia\Database\Database; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; + +class DatabasesCustomClientTest extends Scope +{ + use DatabasesBase; + use ProjectCustom; + use SideClient; + + public function testAllowedPermissions(): void + { + /** + * Test for SUCCESS + */ + + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // table aliases write to create, update, delete + $movies = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Movies', + 'rowSecurity' => true, + 'permissions' => [ + Permission::write(Role::user($this->getUser()['$id'])), + ], + ]); + + $moviesId = $movies['body']['$id']; + + $this->assertContains(Permission::create(Role::user($this->getUser()['$id'])), $movies['body']['$permissions']); + $this->assertContains(Permission::update(Role::user($this->getUser()['$id'])), $movies['body']['$permissions']); + $this->assertContains(Permission::delete(Role::user($this->getUser()['$id'])), $movies['body']['$permissions']); + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $moviesId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + + sleep(1); + + $this->assertEquals(202, $response['headers']['status-code']); + + // Document aliases write to update, delete + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $moviesId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Captain America', + ], + 'permissions' => [ + Permission::write(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertNotContains(Permission::create(Role::user($this->getUser()['$id'])), $row1['body']['$permissions']); + $this->assertContains(Permission::update(Role::user($this->getUser()['$id'])), $row1['body']['$permissions']); + $this->assertContains(Permission::delete(Role::user($this->getUser()['$id'])), $row1['body']['$permissions']); + + /** + * Test for FAILURE + */ + + // Document does not allow create permission + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $moviesId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Captain America', + ], + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(400, $row2['headers']['status-code']); + } + + public function testUpdateWithoutPermission(): array + { + // If row has been created by server and client tried to update it without adjusting permissions, permission validation should be skipped + + // As a part of preparation, we get ID of currently logged-in user + $response = $this->client->call(Client::METHOD_GET, '/account', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(200, $response['headers']['status-code']); + + $userId = $response['body']['$id']; + + $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::custom('permissionCheckDatabase'), + 'name' => 'Test Database', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('Test Database', $database['body']['name']); + + $databaseId = $database['body']['$id']; + // Create table + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('permissionCheck'), + 'name' => 'permissionCheck', + 'permissions' => [], + 'rowSecurity' => true, + ]); + $this->assertEquals(201, $response['headers']['status-code']); + + // Add column to table + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/permissionCheck/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 255, + 'required' => true, + ]); + $this->assertEquals(202, $response['headers']['status-code']); + + // Wait for database worker to finish creating attributes + sleep(2); + + // Creating row by server, give read permission to our user + some other user + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/permissionCheck/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => ID::custom('permissionCheckDocument'), + 'data' => [ + 'name' => 'AppwriteBeginner', + ], + 'permissions' => [ + Permission::read(Role::user(ID::custom('user2'))), + Permission::read(Role::user($userId)), + Permission::update(Role::user($userId)), + Permission::delete(Role::user($userId)), + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // Update row + // This is the point of this test. We should be allowed to do this action, and it should not fail on permission check + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/permissionCheck/rows/permissionCheckDocument', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'AppwriteExpert', + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + // Get name of the row, should be the new one + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/permissionCheck/rows/permissionCheckDocument', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals("AppwriteExpert", $response['body']['name']); + + // Cleanup to prevent collision with other tests + // Delete table + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/permissionCheck', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $response['headers']['status-code']); + + + // Wait for database worker to finish deleting table + sleep(2); + + // Make sure table has been deleted + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/permissionCheck', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->assertEquals(404, $response['headers']['status-code']); + + return []; + } + + public function testUpdateTwoWayRelationship(): void + { + + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Test Database' + ]); + + $databaseId = $database['body']['$id']; + + + // Creating table 1 + $table1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'level1', + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + // Creating table 2 + $table2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'level2', + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + \sleep(2); + + // Creating two way relationship between table 1 and table 2 from table 1 + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => 'oneToMany', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => $table2['body']['$id'], + 'twoWayKey' => $table1['body']['$id'] + ]); + + \sleep(3); + + // Update relation from table 2 to on delete restrict + $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table2['body']['$id'] . '/columns/' . $table1['body']['$id'] . '/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'onDelete' => 'restrict', + ]); + + // Fetching attributes after updating relation to compare + $table1Attributes = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $table1RelationAttribute = $table1Attributes['body']['columns'][0]; + + $this->assertEquals($relation['body']['side'], $table1RelationAttribute['side']); + $this->assertEquals($relation['body']['twoWayKey'], $table1RelationAttribute['twoWayKey']); + $this->assertEquals($relation['body']['relatedTable'], $table1RelationAttribute['relatedTable']); + $this->assertEquals('restrict', $table1RelationAttribute['onDelete']); + } + + public function testRelationshipSameTwoWayKey(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Same two way key' + ]); + + $databaseId = $database['body']['$id']; + + $table1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'c1', + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $table2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'c2', + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + \sleep(2); + + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => Database::RELATION_ONE_TO_ONE, + 'twoWay' => false, + 'onDelete' => 'cascade', + 'key' => 'attr1', + 'twoWayKey' => 'same_key' + ]); + + \sleep(2); + + $this->assertEquals(202, $relation['headers']['status-code']); + $this->assertEquals('same_key', $relation['body']['twoWayKey']); + + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => Database::RELATION_ONE_TO_MANY, + 'twoWay' => false, + 'onDelete' => 'cascade', + 'key' => 'attr2', + 'twoWayKey' => 'same_key' + ]); + + \sleep(2); + + $this->assertEquals(409, $relation['body']['code']); + $this->assertEquals('Attribute with the requested key already exists. Attribute keys must be unique, try again with a different key.', $relation['body']['message']); + + // twoWayKey is null TwoWayKey is default + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => Database::RELATION_ONE_TO_MANY, + 'twoWay' => false, + 'onDelete' => 'cascade', + 'key' => 'attr3', + ]); + + \sleep(2); + + $this->assertEquals(202, $relation['headers']['status-code']); + $this->assertArrayHasKey('twoWayKey', $relation['body']); + + // twoWayKey is null, TwoWayKey is default, second POST + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => Database::RELATION_ONE_TO_MANY, + 'twoWay' => false, + 'onDelete' => 'cascade', + 'key' => 'attr4', + ]); + + \sleep(2); + + $this->assertEquals('Attribute with the requested key already exists. Attribute keys must be unique, try again with a different key.', $relation['body']['message']); + $this->assertEquals(409, $relation['body']['code']); + + // RelationshipManyToMany + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => Database::RELATION_MANY_TO_MANY, + 'twoWay' => true, + 'onDelete' => 'setNull', + 'key' => 'songs', + 'twoWayKey' => 'playlist', + ]); + + \sleep(2); + + $this->assertEquals(202, $relation['headers']['status-code']); + $this->assertArrayHasKey('twoWayKey', $relation['body']); + + // Second RelationshipManyToMany on Same tables + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => Database::RELATION_MANY_TO_MANY, + 'twoWay' => true, + 'onDelete' => 'setNull', + 'key' => 'songs2', + 'twoWayKey' => 'playlist2', + ]); + + \sleep(2); + + $this->assertEquals(409, $relation['body']['code']); + $this->assertEquals('Creating more than one "manyToMany" relationship on the same table is currently not permitted.', $relation['body']['message']); + } + + public function testUpdateWithoutRelationPermission(): void + { + $userId = $this->getUser()['$id']; + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => ID::unique(), + ]); + + $databaseId = $database['body']['$id']; + + // Creating table 1 + $table1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('table1'), + 'name' => ID::custom('table1'), + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($userId)), + Permission::read(Role::user($userId)), + Permission::delete(Role::user($userId)), + ] + ]); + + // Creating table 2 + $table2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('table2'), + 'name' => ID::custom('table2'), + 'rowSecurity' => false, + 'permissions' => [ + Permission::read(Role::user($userId)), + ] + ]); + + $table3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('table3'), + 'name' => ID::custom('table3'), + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($userId)), + Permission::read(Role::user($userId)), + Permission::delete(Role::user($userId)), + ] + ]); + + $table4 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('table4'), + 'name' => ID::custom('table4'), + 'rowSecurity' => false, + 'permissions' => [ + Permission::read(Role::user($userId)), + ] + ]); + + $table5 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('table5'), + 'name' => ID::custom('table5'), + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($userId)), + Permission::read(Role::user($userId)), + Permission::delete(Role::user($userId)), + ] + ]); + + // Creating one to one relationship from table 1 to colletion 2 + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => 'oneToOne', + 'twoWay' => false, + 'onDelete' => 'setNull', + 'key' => $table2['body']['$id'] + ]); + + // Creating one to one relationship from table 2 to colletion 3 + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table2['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table3['body']['$id'], + 'type' => 'oneToOne', + 'twoWay' => false, + 'onDelete' => 'setNull', + 'key' => $table3['body']['$id'] + ]); + + // Creating one to one relationship from table 3 to colletion 4 + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table3['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table4['body']['$id'], + 'type' => 'oneToOne', + 'twoWay' => false, + 'onDelete' => 'setNull', + 'key' => $table4['body']['$id'] + ]); + + // Creating one to one relationship from table 4 to colletion 5 + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table4['body']['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table5['body']['$id'], + 'type' => 'oneToOne', + 'twoWay' => false, + 'onDelete' => 'setNull', + 'key' => $table5['body']['$id'] + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => "Title", + 'size' => 100, + 'required' => false, + 'array' => false, + 'default' => null, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table2['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => "Rating", + 'size' => 100, + 'required' => false, + 'array' => false, + 'default' => null, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table3['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => "Rating", + 'size' => 100, + 'required' => false, + 'array' => false, + 'default' => null, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table4['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => "Rating", + 'size' => 100, + 'required' => false, + 'array' => false, + 'default' => null, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table5['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => "Rating", + 'size' => 100, + 'required' => false, + 'array' => false, + 'default' => null, + ]); + + \sleep(2); + // Creating parent row with a child reference to test the permissions + $parentDocument = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => ID::custom($table1['body']['$id']), + 'data' => [ + 'Title' => 'Captain America', + $table2['body']['$id'] => [ + '$id' => ID::custom($table2['body']['$id']), + 'Rating' => '10', + $table3['body']['$id'] => [ + '$id' => ID::custom($table3['body']['$id']), + 'Rating' => '10', + $table4['body']['$id'] => [ + '$id' => ID::custom($table4['body']['$id']), + 'Rating' => '10', + $table5['body']['$id'] => [ + '$id' => ID::custom($table5['body']['$id']), + 'Rating' => '10' + ] + ] + ] + ] + ] + ]); + + $this->assertEquals(201, $parentDocument['headers']['status-code']); + // This is the point of the test. We should not need any authorization permission to update the row with same data. + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/rows/' . $table1['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::custom($table1['body']['$id']), + 'data' => [ + 'Title' => 'Captain America', + $table2['body']['$id'] => [ + '$id' => $table2['body']['$id'], + 'Rating' => '10', + $table3['body']['$id'] => [ + '$id' => $table3['body']['$id'], + 'Rating' => '10', + $table4['body']['$id'] => [ + '$id' => $table4['body']['$id'], + 'Rating' => '10', + $table5['body']['$id'] => [ + '$id' => $table5['body']['$id'], + 'Rating' => '10' + ] + ] + ] + ] + ] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals($parentDocument['body'], $response['body']); + + // Giving update permission of table 3 to user. + $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/table3', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('table3'), + 'name' => ID::custom('table3'), + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($userId)), + Permission::read(Role::user($userId)), + Permission::update(Role::user($userId)), + Permission::delete(Role::user($userId)), + ] + ]); + + // This is the point of this test. We should be allowed to do this action, and it should not fail on permission check + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/rows/' . $table1['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'Title' => 'Captain America', + $table2['body']['$id'] => [ + '$id' => ID::custom($table2['body']['$id']), + 'Rating' => '10', + $table3['body']['$id'] => [ + '$id' => ID::custom($table3['body']['$id']), + 'Rating' => '11', + $table4['body']['$id'] => [ + '$id' => ID::custom($table4['body']['$id']), + 'Rating' => '10', + $table5['body']['$id'] => [ + '$id' => ID::custom($table5['body']['$id']), + 'Rating' => '11' + ] + ] + ] + ] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(11, $response['body'][$table2['body']['$id']]['table3']['Rating']); + + // We should not be allowed to update the row as we do not have permission for table 2. + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/rows/' . $table1['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'Title' => 'Captain America', + $table2['body']['$id'] => [ + '$id' => ID::custom($table2['body']['$id']), + 'Rating' => '11', + $table3['body']['$id'] => null, + ] + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // We should not be allowed to update the row as we do not have permission for table 2. + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table2['body']['$id'] . '/rows/' . $table2['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'Rating' => '11', + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // Removing update permission from table 3. + $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/table3', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('table3'), + 'name' => ID::custom('table3'), + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($userId)), + Permission::read(Role::user($userId)), + Permission::delete(Role::user($userId)), + ] + ]); + + // Giving update permission to table 2. + $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/table2', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('table2'), + 'name' => ID::custom('table2'), + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($userId)), + Permission::update(Role::user($userId)), + Permission::read(Role::user($userId)), + Permission::delete(Role::user($userId)), + ] + ]); + + // Creating table 3 new row + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table3['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => ID::custom('table3Doc1'), + 'data' => [ + 'Rating' => '20' + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // We should be allowed to link a new row from table 3 to table 2. + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/rows/' . $table1['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'Title' => 'Captain America', + $table2['body']['$id'] => [ + '$id' => ID::custom($table2['body']['$id']), + $table3['body']['$id'] => 'table3Doc1', + ] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + + // We should be allowed to link and create a new row from table 3 to table 2. + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table1['body']['$id'] . '/rows/' . $table1['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'Title' => 'Captain America', + $table2['body']['$id'] => [ + '$id' => ID::custom($table2['body']['$id']), + $table3['body']['$id'] => [ + '$id' => ID::custom('table3Doc2') + ], + ] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + } +} diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php new file mode 100644 index 0000000000..5e35fa065d --- /dev/null +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php @@ -0,0 +1,6700 @@ +<?php + +namespace Tests\E2E\Services\Databases\TablesDB; + +use Appwrite\Extend\Exception as AppwriteException; +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideServer; +use Utopia\Database\Database; +use Utopia\Database\Document; +use Utopia\Database\Exception; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; +use Utopia\Database\Query; + +class DatabasesCustomServerTest extends Scope +{ + use DatabasesBase; + use ProjectCustom; + use SideServer; + + public function testListDatabases() + { + $test1 = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::custom('first'), + 'name' => 'Test 1', + ]); + + $this->assertEquals(201, $test1['headers']['status-code']); + $this->assertEquals('Test 1', $test1['body']['name']); + + $test2 = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::custom('second'), + 'name' => 'Test 2', + ]); + $this->assertEquals(201, $test2['headers']['status-code']); + $this->assertEquals('Test 2', $test2['body']['name']); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(2, $databases['body']['total']); + $this->assertEquals($test1['body']['$id'], $databases['body']['databases'][0]['$id']); + $this->assertEquals($test2['body']['$id'], $databases['body']['databases'][1]['$id']); + + $base = array_reverse($databases['body']['databases']); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::limit(1)->toString(), + ], + ]); + $this->assertEquals(200, $databases['headers']['status-code']); + $this->assertCount(1, $databases['body']['databases']); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::offset(1)->toString(), + ], + ]); + $this->assertEquals(200, $databases['headers']['status-code']); + $this->assertCount(1, $databases['body']['databases']); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('name', ['Test 1', 'Test 2'])->toString(), + ], + ]); + $this->assertEquals(200, $databases['headers']['status-code']); + $this->assertCount(2, $databases['body']['databases']); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('name', ['Test 2'])->toString(), + ], + ]); + $this->assertEquals(200, $databases['headers']['status-code']); + $this->assertCount(1, $databases['body']['databases']); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('$id', ['first'])->toString(), + ], + ]); + $this->assertEquals(200, $databases['headers']['status-code']); + $this->assertCount(1, $databases['body']['databases']); + + /** + * Test for Order + */ + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::orderDesc()->toString(), + ], + ]); + + $this->assertEquals(2, $databases['body']['total']); + $this->assertEquals($base[0]['$id'], $databases['body']['databases'][0]['$id']); + $this->assertEquals($base[1]['$id'], $databases['body']['databases'][1]['$id']); + + /** + * Test for After + */ + $base = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorAfter(new Document(['$id' => $base['body']['databases'][0]['$id']]))->toString(), + ], + ]); + + $this->assertCount(1, $databases['body']['databases']); + $this->assertEquals($base['body']['databases'][1]['$id'], $databases['body']['databases'][0]['$id']); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorAfter(new Document(['$id' => $base['body']['databases'][1]['$id']]))->toString(), + ], + ]); + + $this->assertCount(0, $databases['body']['databases']); + $this->assertEmpty($databases['body']['databases']); + + /** + * Test for Before + */ + $base = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorBefore(new Document(['$id' => $base['body']['databases'][1]['$id']]))->toString(), + ], + ]); + + $this->assertCount(1, $databases['body']['databases']); + $this->assertEquals($base['body']['databases'][0]['$id'], $databases['body']['databases'][0]['$id']); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorBefore(new Document(['$id' => $base['body']['databases'][0]['$id']]))->toString(), + ], + ]); + + $this->assertCount(0, $databases['body']['databases']); + $this->assertEmpty($databases['body']['databases']); + + /** + * Test for Search + */ + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'search' => 'first' + ]); + + $this->assertEquals(1, $databases['body']['total']); + $this->assertEquals('first', $databases['body']['databases'][0]['$id']); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'search' => 'Test' + ]); + + $this->assertEquals(2, $databases['body']['total']); + $this->assertEquals('Test 1', $databases['body']['databases'][0]['name']); + $this->assertEquals('Test 2', $databases['body']['databases'][1]['name']); + + $databases = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'search' => 'Nonexistent' + ]); + + $this->assertEquals(0, $databases['body']['total']); + + /** + * Test for FAILURE + */ + $response = $this->client->call(Client::METHOD_GET, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorAfter(new Document(['$id' => 'unknown']))->toString(), + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // This database already exists + $response = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Test 1', + 'databaseId' => ID::custom('first'), + ]); + + $this->assertEquals(409, $response['headers']['status-code']); + return ['databaseId' => $test1['body']['$id']]; + } + + /** + * @depends testListDatabases + */ + public function testGetDatabase(array $data): array + { + $databaseId = $data['databaseId']; + /** + * Test for SUCCESS + */ + $database = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $this->assertEquals(200, $database['headers']['status-code']); + $this->assertEquals($databaseId, $database['body']['$id']); + $this->assertEquals('Test 1', $database['body']['name']); + $this->assertEquals(true, $database['body']['enabled']); + return ['databaseId' => $database['body']['$id']]; + } + + /** + * @depends testListDatabases + */ + public function testUpdateDatabase(array $data) + { + $databaseId = $data['databaseId']; + + $database = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'name' => 'Test 1 Updated', + 'enabled' => false, + ]); + + $this->assertEquals(200, $database['headers']['status-code']); + $this->assertEquals('Test 1 Updated', $database['body']['name']); + $this->assertFalse($database['body']['enabled']); + + // Now update the database without the passing the enabled parameter + $database = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'name' => 'Test 1' + ]); + + $this->assertEquals(200, $database['headers']['status-code']); + $this->assertEquals('Test 1', $database['body']['name']); + $this->assertTrue($database['body']['enabled']); + } + + /** + * @depends testListDatabases + */ + public function testDeleteDatabase($data) + { + $databaseId = $data['databaseId']; + + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders())); + + $this->assertEquals(204, $response['headers']['status-code']); + $this->assertEquals("", $response['body']); + + // Try to get the database and check if it has been deleted + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(404, $response['headers']['status-code']); + } + + public function testListTables(): array + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'invalidRowDatabase', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('invalidRowDatabase', $database['body']['name']); + $this->assertTrue($database['body']['enabled']); + + $databaseId = $database['body']['$id']; + /** + * Test for SUCCESS + */ + $test1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Test 1', + 'tableId' => ID::custom('first'), + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $test2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Test 2', + 'tableId' => ID::custom('second'), + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(2, $tables['body']['total']); + $this->assertEquals($test1['body']['$id'], $tables['body']['tables'][0]['$id']); + $this->assertEquals($test1['body']['enabled'], $tables['body']['tables'][0]['enabled']); + $this->assertEquals($test2['body']['$id'], $tables['body']['tables'][1]['$id']); + $this->assertEquals($test1['body']['enabled'], $tables['body']['tables'][0]['enabled']); + + $base = array_reverse($tables['body']['tables']); + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::limit(1)->toString(), + ], + ]); + + $this->assertEquals(200, $tables['headers']['status-code']); + $this->assertCount(1, $tables['body']['tables']); + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::offset(1)->toString(), + ], + ]); + + $this->assertEquals(200, $tables['headers']['status-code']); + $this->assertCount(1, $tables['body']['tables']); + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('enabled', [true])->toString(), + ], + ]); + + $this->assertEquals(200, $tables['headers']['status-code']); + $this->assertCount(2, $tables['body']['tables']); + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('enabled', [false])->toString(), + ], + ]); + + $this->assertEquals(200, $tables['headers']['status-code']); + $this->assertCount(0, $tables['body']['tables']); + + /** + * Test for Order + */ + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::orderDesc()->toString(), + ], + ]); + + $this->assertEquals(2, $tables['body']['total']); + $this->assertEquals($base[0]['$id'], $tables['body']['tables'][0]['$id']); + $this->assertEquals($base[1]['$id'], $tables['body']['tables'][1]['$id']); + + /** + * Test for After + */ + $base = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorAfter(new Document(['$id' => $base['body']['tables'][0]['$id']]))->toString(), + ], + ]); + + $this->assertCount(1, $tables['body']['tables']); + $this->assertEquals($base['body']['tables'][1]['$id'], $tables['body']['tables'][0]['$id']); + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorAfter(new Document(['$id' => $base['body']['tables'][1]['$id']]))->toString(), + ], + ]); + + $this->assertCount(0, $tables['body']['tables']); + $this->assertEmpty($tables['body']['tables']); + + /** + * Test for Before + */ + $base = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorBefore(new Document(['$id' => $base['body']['tables'][1]['$id']]))->toString(), + ], + ]); + + $this->assertCount(1, $tables['body']['tables']); + $this->assertEquals($base['body']['tables'][0]['$id'], $tables['body']['tables'][0]['$id']); + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorBefore(new Document(['$id' => $base['body']['tables'][0]['$id']]))->toString(), + ], + ]); + + $this->assertCount(0, $tables['body']['tables']); + $this->assertEmpty($tables['body']['tables']); + + /** + * Test for Search + */ + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'search' => 'first' + ]); + + $this->assertEquals(1, $tables['body']['total']); + $this->assertEquals('first', $tables['body']['tables'][0]['$id']); + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'search' => 'Test' + ]); + + $this->assertEquals(2, $tables['body']['total']); + $this->assertEquals('Test 1', $tables['body']['tables'][0]['name']); + $this->assertEquals('Test 2', $tables['body']['tables'][1]['name']); + + $tables = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'search' => 'Nonexistent' + ]); + + $this->assertEquals(0, $tables['body']['total']); + + /** + * Test for FAILURE + */ + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::cursorAfter(new Document(['$id' => 'unknown']))->toString(), + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // This table already exists + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Test 1', + 'tableId' => ID::custom('first'), + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(409, $response['headers']['status-code']); + return [ + 'databaseId' => $databaseId, + 'tableId' => $test1['body']['$id'], + ]; + } + + /** + * @depends testListTables + */ + public function testGetTable(array $data): void + { + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders())); + + $this->assertEquals(200, $table['headers']['status-code']); + $this->assertEquals('Test 1', $table['body']['name']); + $this->assertEquals('first', $table['body']['$id']); + $this->assertTrue($table['body']['enabled']); + } + + /** + * @depends testListTables + */ + public function testUpdateTable(array $data) + { + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $table = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Test 1 Updated', + 'enabled' => false + ]); + + $this->assertEquals(200, $table['headers']['status-code']); + $this->assertEquals('Test 1 Updated', $table['body']['name']); + $this->assertEquals('first', $table['body']['$id']); + $this->assertFalse($table['body']['enabled']); + } + + /** + * @depends testListTables + */ + public function testCreateEncryptedColumn(array $data): void + { + + $databaseId = $data['databaseId']; + + /** + * Test for SUCCESS + */ + + // Create table + $actors = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Encrypted Actors Data', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $actors['headers']['status-code']); + $this->assertEquals('Encrypted Actors Data', $actors['body']['name']); + + /** + * Test for creating encrypted columns + */ + + $columnsPath = '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'] . '/columns'; + + $firstName = $this->client->call(Client::METHOD_POST, $columnsPath . '/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'firstName', + 'size' => 256, + 'required' => true, + ]); + + $lastName = $this->client->call(Client::METHOD_POST, $columnsPath . '/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'lastName', + 'size' => 256, + 'required' => true, + 'encrypt' => true, + ]); + + + /** + * Check status of every column + */ + $this->assertEquals(202, $firstName['headers']['status-code']); + $this->assertEquals('firstName', $firstName['body']['key']); + $this->assertEquals('string', $firstName['body']['type']); + + $this->assertEquals(202, $lastName['headers']['status-code']); + $this->assertEquals('lastName', $lastName['body']['key']); + $this->assertEquals('string', $lastName['body']['type']); + + // Wait for database worker to finish creating columns + sleep(2); + + // Creating row to ensure cache is purged on schema change + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => ID::unique(), + 'data' => [ + 'firstName' => 'Jonah', + 'lastName' => 'Jameson', + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + // Check row to ensure cache is purged on schema change + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'] . '/rows/' . $row['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals('Jonah', $row['body']['firstName']); + $this->assertEquals('Jameson', $row['body']['lastName']); + } + + public function testDeleteColumn(): array + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'invalidRowDatabase', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('invalidRowDatabase', $database['body']['name']); + + $databaseId = $database['body']['$id']; + /** + * Test for SUCCESS + */ + + // Create table + $actors = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Actors', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $actors['headers']['status-code']); + $this->assertEquals($actors['body']['name'], 'Actors'); + + $firstName = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'firstName', + 'size' => 256, + 'required' => true, + ]); + + $lastName = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'lastName', + 'size' => 256, + 'required' => true, + ]); + + $unneeded = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'unneeded', + 'size' => 256, + 'required' => true, + ]); + + // Wait for database worker to finish creating columns + sleep(2); + + // Creating row to ensure cache is purged on schema change + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => ID::unique(), + 'data' => [ + 'firstName' => 'lorem', + 'lastName' => 'ipsum', + 'unneeded' => 'dolor' + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $index = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'key_lastName', + 'type' => 'key', + 'columns' => [ + 'lastName', + ], + ]); + + // Wait for database worker to finish creating index + sleep(2); + + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), []); + + $unneededId = $unneeded['body']['key']; + + $this->assertEquals(200, $table['headers']['status-code']); + $this->assertIsArray($table['body']['columns']); + $this->assertCount(3, $table['body']['columns']); + $this->assertEquals($table['body']['columns'][0]['key'], $firstName['body']['key']); + $this->assertEquals($table['body']['columns'][1]['key'], $lastName['body']['key']); + $this->assertEquals($table['body']['columns'][2]['key'], $unneeded['body']['key']); + $this->assertCount(1, $table['body']['indexes']); + $this->assertEquals($table['body']['indexes'][0]['key'], $index['body']['key']); + + // Delete column + $column = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'] . '/columns/' . $unneededId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $column['headers']['status-code']); + + sleep(2); + + // Check row to ensure cache is purged on schema change + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'] . '/rows/' . $row['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertNotContains($unneededId, $row['body']); + + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), []); + + $this->assertEquals(200, $table['headers']['status-code']); + $this->assertIsArray($table['body']['columns']); + $this->assertCount(2, $table['body']['columns']); + $this->assertEquals($table['body']['columns'][0]['key'], $firstName['body']['key']); + $this->assertEquals($table['body']['columns'][1]['key'], $lastName['body']['key']); + + return [ + 'tableId' => $actors['body']['$id'], + 'key' => $index['body']['key'], + 'databaseId' => $databaseId + ]; + } + + /** + * @depends testDeleteColumn + */ + public function testDeleteIndex($data): array + { + $databaseId = $data['databaseId']; + $index = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['tableId'] . '/indexes/' . $data['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $index['headers']['status-code']); + + // Wait for database worker to finish deleting index + sleep(2); + + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['tableId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), []); + + $this->assertCount(0, $table['body']['indexes']); + + return $data; + } + + /** + * @depends testDeleteIndex + */ + public function testDeleteIndexOnDeleteColumn($data) + { + $databaseId = $data['databaseId']; + $column1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['tableId'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'column1', + 'size' => 16, + 'required' => true, + ]); + + $column2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['tableId'] . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'column2', + 'size' => 16, + 'required' => true, + ]); + + $this->assertEquals(202, $column1['headers']['status-code']); + $this->assertEquals(202, $column2['headers']['status-code']); + $this->assertEquals('column1', $column1['body']['key']); + $this->assertEquals('column2', $column2['body']['key']); + + sleep(2); + + $index1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['tableId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'index1', + 'type' => 'key', + 'columns' => ['column1', 'column2'], + 'orders' => ['ASC', 'ASC'], + ]); + + $index2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['tableId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'index2', + 'type' => 'key', + 'columns' => ['column2'], + ]); + + $this->assertEquals(202, $index1['headers']['status-code']); + $this->assertEquals(202, $index2['headers']['status-code']); + $this->assertEquals('index1', $index1['body']['key']); + $this->assertEquals('index2', $index2['body']['key']); + + sleep(2); + + // Expected behavior: deleting column2 will cause index2 to be dropped, and index1 rebuilt with a single key + $deleted = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['tableId'] . '/columns/' . $column2['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $deleted['headers']['status-code']); + + // wait for database worker to complete + sleep(2); + + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $data['tableId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $table['headers']['status-code']); + $this->assertIsArray($table['body']['indexes']); + $this->assertCount(1, $table['body']['indexes']); + $this->assertEquals($index1['body']['key'], $table['body']['indexes'][0]['key']); + $this->assertIsArray($table['body']['indexes'][0]['columns']); + $this->assertCount(1, $table['body']['indexes'][0]['columns']); + $this->assertEquals($column1['body']['key'], $table['body']['indexes'][0]['columns'][0]); + + // Delete column + $deleted = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['tableId'] . '/columns/' . $column1['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $deleted['headers']['status-code']); + + return $data; + } + + public function testCleanupDuplicateIndexOnDeleteColumn() + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'invalidRowDatabase', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('invalidRowDatabase', $database['body']['name']); + + $databaseId = $database['body']['$id']; + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'TestCleanupDuplicateIndexOnDeleteColumn', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $this->assertNotEmpty($table['body']['$id']); + + $tableId = $table['body']['$id']; + + $column1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'column1', + 'size' => 16, + 'required' => true, + ]); + + $column2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'column2', + 'size' => 16, + 'required' => true, + ]); + + $this->assertEquals(202, $column1['headers']['status-code']); + $this->assertEquals(202, $column2['headers']['status-code']); + $this->assertEquals('column1', $column1['body']['key']); + $this->assertEquals('column2', $column2['body']['key']); + + sleep(2); + + $index1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'index1', + 'type' => 'key', + 'columns' => ['column1', 'column2'], + 'orders' => ['ASC', 'ASC'], + ]); + + $index2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'index2', + 'type' => 'key', + 'columns' => ['column2'], + ]); + + $this->assertEquals(202, $index1['headers']['status-code']); + $this->assertEquals(202, $index2['headers']['status-code']); + $this->assertEquals('index1', $index1['body']['key']); + $this->assertEquals('index2', $index2['body']['key']); + + sleep(2); + + // Expected behavior: deleting column1 would cause index1 to be a duplicate of index2 and automatically removed + $deleted = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $column1['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $deleted['headers']['status-code']); + + // wait for database worker to complete + sleep(2); + + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $table['headers']['status-code']); + $this->assertIsArray($table['body']['indexes']); + $this->assertCount(1, $table['body']['indexes']); + $this->assertEquals($index2['body']['key'], $table['body']['indexes'][0]['key']); + $this->assertIsArray($table['body']['indexes'][0]['columns']); + $this->assertCount(1, $table['body']['indexes'][0]['columns']); + $this->assertEquals($column2['body']['key'], $table['body']['indexes'][0]['columns'][0]); + + // Delete column + $deleted = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $column2['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $deleted['headers']['status-code']); + } + + /** + * @depends testDeleteIndexOnDeleteColumn + */ + public function testDeleteTable($data) + { + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + // Add Rows to the table + $row1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'firstName' => 'Tom', + 'lastName' => 'Holland', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'firstName' => 'Samuel', + 'lastName' => 'Jackson', + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $this->assertEquals(201, $row1['headers']['status-code']); + $this->assertIsArray($row1['body']['$permissions']); + $this->assertCount(3, $row1['body']['$permissions']); + $this->assertEquals($row1['body']['firstName'], 'Tom'); + $this->assertEquals($row1['body']['lastName'], 'Holland'); + + $this->assertEquals(201, $row2['headers']['status-code']); + $this->assertIsArray($row2['body']['$permissions']); + $this->assertCount(3, $row2['body']['$permissions']); + $this->assertEquals('Samuel', $row2['body']['firstName']); + $this->assertEquals('Jackson', $row2['body']['lastName']); + + // Delete the actors table + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders())); + + $this->assertEquals(204, $response['headers']['status-code']); + $this->assertEquals($response['body'], ""); + + // Try to get the table and check if it has been deleted + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(404, $response['headers']['status-code']); + } + + /** + * @throws Exception + */ + public function testDeleteTableDeletesRelatedColumns(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'databaseId' => ID::unique(), + 'name' => 'TestDeleteTableDeletesRelatedColumns', + ]); + + $databaseId = $database['body']['$id']; + + $table1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Table1', + 'rowSecurity' => false, + 'permissions' => [], + ]); + + $table2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Table2', + 'rowSecurity' => false, + 'permissions' => [], + ]); + + $table1 = $table1['body']['$id']; + $table2 = $table2['body']['$id']; + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1 . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]), [ + 'relatedTableId' => $table2, + 'type' => Database::RELATION_MANY_TO_ONE, + 'twoWay' => false, + 'key' => 'table2' + ]); + + sleep(2); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $table2, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $this->getHeaders())); + + sleep(2); + + $columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1 . '/columns', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $this->getHeaders())); + + $this->assertEquals(0, $columns['body']['total']); + } + + public function testColumnRowWidthLimit() + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'invalidRowDatabase', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('invalidRowDatabase', $database['body']['name']); + + $databaseId = $database['body']['$id']; + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('columnRowWidthLimit'), + 'name' => 'columnRowWidthLimit', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $this->assertEquals('columnRowWidthLimit', $table['body']['name']); + + $tableId = $table['body']['$id']; + + // Add wide string columns to approach row width limit + for ($i = 0; $i < 15; $i++) { + $column = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => "column{$i}", + 'size' => 1024, + 'required' => true, + ]); + + $this->assertEquals(202, $column['headers']['status-code']); + } + + sleep(5); + + $tooWide = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'tooWide', + 'size' => 1024, + 'required' => true, + ]); + + $this->assertEquals(400, $tooWide['headers']['status-code']); + $this->assertEquals('column_limit_exceeded', $tooWide['body']['type']); + } + + public function testIndexLimitException() + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'invalidRowDatabase', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('invalidRowDatabase', $database['body']['name']); + + $databaseId = $database['body']['$id']; + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('testLimitException'), + 'name' => 'testLimitException', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $this->assertEquals('testLimitException', $table['body']['name']); + + $tableId = $table['body']['$id']; + + // add unique columns for indexing + for ($i = 0; $i < 64; $i++) { + // $this->assertEquals(true, static::getDatabase()->createColumn('indexLimit', "test{$i}", Database::VAR_STRING, 16, true)); + $column = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => "column{$i}", + 'size' => 64, + 'required' => true, + ]); + + $this->assertEquals(202, $column['headers']['status-code']); + } + + sleep(10); + + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $table['headers']['status-code']); + $this->assertEquals('testLimitException', $table['body']['name']); + $this->assertIsArray($table['body']['columns']); + $this->assertIsArray($table['body']['indexes']); + $this->assertCount(64, $table['body']['columns']); + $this->assertCount(0, $table['body']['indexes']); + + foreach ($table['body']['columns'] as $column) { + $this->assertEquals('available', $column['status'], 'column: ' . $column['key']); + } + + // Test indexLimit = 64 + // MariaDB, MySQL, and MongoDB create 6 indexes per new table + // Add up to the limit, then check if the next index throws IndexLimitException + for ($i = 0; $i < 58; $i++) { + $index = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => "key_column{$i}", + 'type' => 'key', + 'columns' => ["column{$i}"], + ]); + + $this->assertEquals(202, $index['headers']['status-code']); + $this->assertEquals("key_column{$i}", $index['body']['key']); + } + + sleep(5); + + $table = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $table['headers']['status-code']); + $this->assertEquals($table['body']['name'], 'testLimitException'); + $this->assertIsArray($table['body']['columns']); + $this->assertIsArray($table['body']['indexes']); + $this->assertCount(64, $table['body']['columns']); + $this->assertCount(58, $table['body']['indexes']); + + $tooMany = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'tooMany', + 'type' => 'key', + 'columns' => ['column61'], + ]); + + $this->assertEquals(400, $tooMany['headers']['status-code']); + $this->assertEquals('Index limit exceeded', $tooMany['body']['message']); + + $table = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $table['headers']['status-code']); + } + + public function testColumnUpdate(): array + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'updateColumns', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + + $databaseId = $database['body']['$id']; + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::custom('updateColumns'), + 'name' => 'updateColumns' + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + + $tableId = $table['body']['$id']; + + /** + * Create String Column + */ + $column = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'string', + 'size' => 1024, + 'required' => false + ]); + + $this->assertEquals(202, $column['headers']['status-code']); + + /** + * Create Email Column + */ + $column = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/email', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'email', + 'required' => false + ]); + + $this->assertEquals(202, $column['headers']['status-code']); + + /** + * Create IP Column + */ + $column = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/ip', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'ip', + 'required' => false + ]); + + $this->assertEquals(202, $column['headers']['status-code']); + + /** + * Create URL Column + */ + $column = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/url', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'url', + 'required' => false + ]); + + $this->assertEquals(202, $column['headers']['status-code']); + + /** + * Create Integer Column + */ + $column = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'integer', + 'required' => false + ]); + + $this->assertEquals(202, $column['headers']['status-code']); + + /** + * Create Float Column + */ + $column = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'float', + 'required' => false + ]); + + /** + * Create Boolean Column + */ + $column = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'boolean', + 'required' => false + ]); + + /** + * Create Datetime Column + */ + $column = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'datetime', + 'required' => false + ]); + + /** + * Create Enum Column + */ + $column = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'enum', + 'required' => false, + 'elements' => ['lorem', 'ipsum'] + ]); + + $this->assertEquals(202, $column['headers']['status-code']); + + sleep(5); + + return [ + 'databaseId' => $databaseId, + 'tableId' => $tableId + ]; + } + + /** + * @depends testColumnUpdate + */ + public function testColumnUpdateString(array $data) + { + $key = 'string'; + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'lorem' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('lorem', $new['body']['default']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $column = array_values(array_filter($new['body']['columns'], fn (array $a) => $a['key'] === $key))[0] ?? null; + $this->assertNotNull($column); + $this->assertFalse($column['required']); + $this->assertEquals('lorem', $column['default']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertNull($new['body']['default']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'ipsum' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('ipsum', $new['body']['default']); + + /** + * Test against failure + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => 'i am no boolean', + 'default' => 'dolor' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 123 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => 'ipsum' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => 'ipsum' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_DEFAULT_UNSUPPORTED, $update['body']['type']); + } + + /** + * @depends testColumnUpdate + */ + public function testColumnUpdateEmail(array $data) + { + $key = 'email'; + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/email/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'torsten@appwrite.io' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('torsten@appwrite.io', $new['body']['default']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $column = array_values(array_filter($new['body']['columns'], fn (array $a) => $a['key'] === $key))[0] ?? null; + $this->assertNotNull($column); + $this->assertFalse($column['required']); + $this->assertEquals('torsten@appwrite.io', $column['default']); + + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/email/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertNull($new['body']['default']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/email/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'eldad@appwrite.io' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('eldad@appwrite.io', $new['body']['default']); + + /** + * Test against failure + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/email/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => 'no boolean', + 'default' => 'torsten@appwrite.io' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/email/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'i am no email' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/email/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/email/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => 'ipsum' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/email/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => 'torsten@appwrite.io' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_DEFAULT_UNSUPPORTED, $update['body']['type']); + } + + /** + * @depends testColumnUpdate + */ + public function testColumnUpdateIp(array $data) + { + $key = 'ip'; + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/ip/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => '127.0.0.1' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('127.0.0.1', $new['body']['default']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $column = array_values(array_filter($new['body']['columns'], fn (array $a) => $a['key'] === $key))[0] ?? null; + $this->assertNotNull($column); + $this->assertFalse($column['required']); + $this->assertEquals('127.0.0.1', $column['default']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/ip/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertNull($new['body']['default']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/ip/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => '192.168.0.1' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('192.168.0.1', $new['body']['default']); + + /** + * Test against failure + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/ip/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => 'no boolean', + 'default' => '127.0.0.1' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/ip/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'i am no ip' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/ip/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/ip/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => '127.0.0.1' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/ip/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => '127.0.0.1' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_DEFAULT_UNSUPPORTED, $update['body']['type']); + } + + /** + * @depends testColumnUpdate + */ + public function testColumnUpdateUrl(array $data) + { + $key = 'url'; + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/url/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'http://appwrite.io' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('http://appwrite.io', $new['body']['default']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $column = array_values(array_filter($new['body']['columns'], fn (array $a) => $a['key'] === $key))[0] ?? null; + $this->assertNotNull($column); + $this->assertFalse($column['required']); + $this->assertEquals('http://appwrite.io', $column['default']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/url/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertNull($new['body']['default']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/url/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'https://appwrite.io' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('https://appwrite.io', $new['body']['default']); + + /** + * Test against failure + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/url/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => 'no boolean', + 'default' => 'https://appwrite.io' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/url/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'i am no url' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/url/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/url/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => 'https://appwrite.io' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/url/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => 'https://appwrite.io' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_DEFAULT_UNSUPPORTED, $update['body']['type']); + } + + /** + * @depends testColumnUpdate + */ + public function testColumnUpdateInteger(array $data) + { + $key = 'integer'; + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 123, + 'min' => 0, + 'max' => 1000 + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals(123, $new['body']['default']); + $this->assertEquals(0, $new['body']['min']); + $this->assertEquals(1000, $new['body']['max']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $column = array_values(array_filter($new['body']['columns'], fn (array $a) => $a['key'] === $key))[0] ?? null; + $this->assertNotNull($column); + $this->assertFalse($column['required']); + $this->assertEquals(123, $column['default']); + $this->assertEquals(0, $column['min']); + $this->assertEquals(1000, $column['max']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null, + 'min' => 0, + 'max' => 1000 + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertNull($new['body']['default']); + $this->assertEquals(0, $new['body']['min']); + $this->assertEquals(1000, $new['body']['max']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 456, + 'min' => 100, + 'max' => 2000 + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals(456, $new['body']['default']); + $this->assertEquals(100, $new['body']['min']); + $this->assertEquals(2000, $new['body']['max']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 100, + 'min' => 0, + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 10, + 'max' => 100, + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + /** + * Test against failure + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => 'no boolean', + 'default' => 123, + 'min' => 0, + 'max' => 500 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'i am no integer', + 'min' => 0, + 'max' => 500 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 100, + 'min' => 'i am no integer', + 'max' => 500 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 100, + 'min' => 0, + 'max' => 'i am no integer' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'min' => 0, + 'max' => 100, + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => 50, + 'min' => 0, + 'max' => 100, + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => 50, + 'min' => 0, + 'max' => 100 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_DEFAULT_UNSUPPORTED, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 50, + 'min' => 55, + 'max' => 100 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_VALUE_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 105, + 'min' => 50, + 'max' => 100 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_VALUE_INVALID, $update['body']['type']); + + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 50, + 'min' => 200, + 'max' => 100 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_VALUE_INVALID, $update['body']['type']); + } + + /** + * @depends testColumnUpdate + */ + public function testColumnUpdateFloat(array $data) + { + $key = 'float'; + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 123.456, + 'min' => 0.0, + 'max' => 1000.0 + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals(123.456, $new['body']['default']); + $this->assertEquals(0, $new['body']['min']); + $this->assertEquals(1000, $new['body']['max']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $column = array_values(array_filter($new['body']['columns'], fn (array $a) => $a['key'] === $key))[0] ?? null; + $this->assertNotNull($column); + $this->assertFalse($column['required']); + $this->assertEquals(123.456, $column['default']); + $this->assertEquals(0, $column['min']); + $this->assertEquals(1000, $column['max']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null, + 'min' => 0.0, + 'max' => 1000.0 + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertNull($new['body']['default']); + $this->assertEquals(0, $new['body']['min']); + $this->assertEquals(1000, $new['body']['max']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 456.789, + 'min' => 123.456, + 'max' => 2000.0 + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals(456.789, $new['body']['default']); + $this->assertEquals(123.456, $new['body']['min']); + $this->assertEquals(2000, $new['body']['max']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 123.456, + 'min' => 0.0, + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 23.456, + 'max' => 100.0, + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + /** + * Test against failure + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => 'no boolean', + 'default' => 123.456, + 'min' => 0.0, + 'max' => 1000.0 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'i am no integer', + 'min' => 0.0, + 'max' => 500.0 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 123.456, + 'min' => 'i am no integer', + 'max' => 500.0 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 123.456, + 'min' => 0.0, + 'max' => 'i am no integer' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'min' => 0.0, + 'max' => 100.0, + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => 123.456, + 'min' => 0.0, + 'max' => 100.0, + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => 123.456, + 'min' => 0.0, + 'max' => 100.0 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_DEFAULT_UNSUPPORTED, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 123.456, + 'min' => 200.0, + 'max' => 300.0 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_VALUE_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 123.456, + 'min' => 0.0, + 'max' => 100.0 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_VALUE_INVALID, $update['body']['type']); + + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/float/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 50.0, + 'min' => 200.0, + 'max' => 100.0 + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_VALUE_INVALID, $update['body']['type']); + } + + /** + * @depends testColumnUpdate + */ + public function testColumnUpdateBoolean(array $data) + { + $key = 'boolean'; + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => true + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals(true, $new['body']['default']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $column = array_values(array_filter($new['body']['columns'], fn (array $a) => $a['key'] === $key))[0] ?? null; + $this->assertNotNull($column); + $this->assertFalse($column['required']); + $this->assertEquals(true, $column['default']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertNull($new['body']['default']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => false + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals(false, $new['body']['default']); + + /** + * Test against failure + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => 'no boolean', + 'default' => true + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'i am no boolean' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => false + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => true + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_DEFAULT_UNSUPPORTED, $update['body']['type']); + } + + /** + * @depends testColumnUpdate + */ + public function testColumnUpdateDatetime(array $data) + { + $key = 'datetime'; + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => '1975-06-12 14:12:55+02:00' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('1975-06-12 14:12:55+02:00', $new['body']['default']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $column = array_values(array_filter($new['body']['columns'], fn (array $a) => $a['key'] === $key))[0] ?? null; + $this->assertNotNull($column); + $this->assertFalse($column['required']); + $this->assertEquals('1975-06-12 14:12:55+02:00', $column['default']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertNull($new['body']['default']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => '1965-06-12 14:12:55+02:00' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('1965-06-12 14:12:55+02:00', $new['body']['default']); + + /** + * Test against failure + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => 'no boolean', + 'default' => '1975-06-12 14:12:55+02:00' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'i am no datetime' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => '1975-06-12 14:12:55+02:00' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => '1975-06-12 14:12:55+02:00' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_DEFAULT_UNSUPPORTED, $update['body']['type']); + } + + /** + * @depends testColumnUpdate + */ + public function testColumnUpdateEnum(array $data) + { + $key = 'enum'; + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'elements' => ['lorem', 'ipsum', 'dolor'], + 'required' => false, + 'default' => 'lorem' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('lorem', $new['body']['default']); + $this->assertCount(3, $new['body']['elements']); + $this->assertContains('lorem', $new['body']['elements']); + $this->assertContains('ipsum', $new['body']['elements']); + $this->assertContains('dolor', $new['body']['elements']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $column = array_values(array_filter($new['body']['columns'], fn (array $a) => $a['key'] === $key))[0] ?? null; + $this->assertNotNull($column); + $this->assertFalse($column['required']); + $this->assertEquals('lorem', $column['default']); + $this->assertCount(3, $column['elements']); + $this->assertContains('lorem', $column['elements']); + $this->assertContains('ipsum', $column['elements']); + $this->assertContains('dolor', $column['elements']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'elements' => ['lorem', 'ipsum', 'dolor'], + 'required' => false, + 'default' => null + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertNull($new['body']['default']); + $this->assertCount(3, $new['body']['elements']); + $this->assertContains('lorem', $new['body']['elements']); + $this->assertContains('ipsum', $new['body']['elements']); + $this->assertContains('dolor', $new['body']['elements']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'elements' => ['ipsum', 'dolor'], + 'required' => false, + 'default' => 'dolor' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertFalse($new['body']['required']); + $this->assertEquals('dolor', $new['body']['default']); + $this->assertCount(2, $new['body']['elements']); + $this->assertContains('ipsum', $new['body']['elements']); + $this->assertContains('dolor', $new['body']['elements']); + + /** + * Test against failure + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'elements' => [], + 'required' => false, + 'default' => 'lorem' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_VALUE_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'elements' => ['ipsum', 'dolor'], + 'required' => false, + 'default' => 'lorem' + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_VALUE_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => 'no boolean', + 'default' => 'lorem', + 'elements' => ['lorem', 'ipsum', 'dolor'], + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 123, + 'elements' => ['lorem', 'ipsum', 'dolor'], + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'lorem', + 'elements' => 'i am no array', + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'lorem', + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'elements' => ['lorem', 'ipsum', 'dolor'], + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => 'lorem', + 'elements' => ['lorem', 'ipsum', 'dolor'], + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::GENERAL_ARGUMENT_INVALID, $update['body']['type']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/enum/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => 'lorem', + 'elements' => ['lorem', 'ipsum', 'dolor'], + ]); + + $this->assertEquals(400, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_DEFAULT_UNSUPPORTED, $update['body']['type']); + } + + /** + * @depends testColumnUpdate + */ + public function testColumnUpdateStringResize(array $data) + { + $key = 'string'; + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $row = $this->client->call( + Client::METHOD_POST, + '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), + [ + 'rowId' => 'unique()', + 'data' => [ + 'string' => 'string' + ], + "permissions" => ["read(\"any\")"] + ] + ); + + // Test Resize Up + $column = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'size' => 2048, + 'default' => '', + 'required' => false + ]); + + $this->assertEquals(200, $column['headers']['status-code']); + $this->assertEquals(2048, $column['body']['size']); + + // Test create new row with new size + $newDoc = $this->client->call( + Client::METHOD_POST, + '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), + [ + 'rowId' => 'unique()', + 'data' => [ + 'string' => str_repeat('a', 2048) + ], + "permissions" => ["read(\"any\")"] + ] + ); + + $this->assertEquals(201, $newDoc['headers']['status-code']); + $this->assertEquals(2048, strlen($newDoc['body']['string'])); + + // Test update row with new size + $row = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $row['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => str_repeat('a', 2048) + ] + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals(2048, strlen($row['body']['string'])); + + // Test Exception on resize down with data that is too large + $column = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'size' => 10, + 'default' => '', + 'required' => false + ]); + + $this->assertEquals(400, $column['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_INVALID_RESIZE, $column['body']['type']); + + // original rows to original size, remove new row + $row = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $row['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'string' + ] + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals('string', $row['body']['string']); + + $deleteDoc = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $newDoc['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $deleteDoc['headers']['status-code']); + + + // Test Resize Down + $column = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'size' => 10, + 'default' => '', + 'required' => false + ]); + + $this->assertEquals(200, $column['headers']['status-code']); + $this->assertEquals(10, $column['body']['size']); + + // Test create new row with new size + $newDoc = $this->client->call( + Client::METHOD_POST, + '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), + [ + 'rowId' => 'unique()', + 'data' => [ + 'string' => str_repeat('a', 10) + ], + "permissions" => ["read(\"any\")"] + ] + ); + + $this->assertEquals(201, $newDoc['headers']['status-code']); + $this->assertEquals(10, strlen($newDoc['body']['string'])); + + // Test update row with new size + $row = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $row['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => str_repeat('a', 10) + ] + ]); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals(10, strlen($row['body']['string'])); + + // Try create row with string that is too large + $newDoc = $this->client->call( + Client::METHOD_POST, + '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), + [ + 'rowId' => 'unique()', + 'data' => [ + 'string' => str_repeat('a', 11) + ], + "permissions" => ["read(\"any\")"] + ] + ); + + $this->assertEquals(400, $newDoc['headers']['status-code']); + $this->assertEquals(AppwriteException::ROW_INVALID_STRUCTURE, $newDoc['body']['type']); + } + + /** + * @depends testColumnUpdate + */ + public function testColumnUpdateNotFound(array $data) + { + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + $columns = [ + 'string' => [ + 'required' => false, + 'default' => 'ipsum' + ], + 'email' => [ + 'required' => false, + 'default' => 'eldad@appwrite.io' + ], + 'ip' => [ + 'required' => false, + 'default' => '127.0.0.1' + ], + 'url' => [ + 'required' => false, + 'default' => 'https://appwrite.io' + ], + 'integer' => [ + 'required' => false, + 'default' => 5, + 'min' => 0, + 'max' => 10 + ], + 'float' => [ + 'required' => false, + 'default' => 5.5, + 'min' => 0.0, + 'max' => 10.0 + ], + 'datetime' => [ + 'required' => false, + 'default' => '1975-06-12 14:12:55+02:00' + ], + 'enum' => [ + 'elements' => ['lorem', 'ipsum', 'dolor'], + 'required' => false, + 'default' => 'lorem' + ] + ]; + + foreach ($columns as $key => $payload) { + /** + * Check if Database exists + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/i_dont_exist/tables/' . $tableId . '/columns/' . $key . '/unknown_' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), $payload); + + $this->assertEquals(404, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::DATABASE_NOT_FOUND, $update['body']['type']); + + /** + * Check if Table exists + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/i_dont_exist/columns/' . $key . '/unknown_' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), $payload); + + $this->assertEquals(404, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::TABLE_NOT_FOUND, $update['body']['type']); + + /** + * Check if Column exists + */ + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key . '/unknown_' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), $payload); + + $this->assertEquals(404, $update['headers']['status-code']); + $this->assertEquals(AppwriteException::COLUMN_NOT_FOUND, $update['body']['type']); + } + } + + /** + * @depends testColumnUpdate + */ + public function testColumnRename(array $data) + { + $key = 'string'; + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + + // Create row to test against + $row = $this->client->call( + Client::METHOD_POST, + '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), + [ + 'rowId' => 'unique()', + 'data' => [ + 'string' => 'string' + ], + "permissions" => ["read(\"any\")"] + ] + ); + + $this->assertEquals(201, $row['headers']['status-code']); + + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => 'lorum', + 'newKey' => 'new_string', + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + $key = 'new_string'; + + $new = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/' . $key, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals('new_string', $new['body']['key']); + + $doc1 = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $row['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertArrayHasKey('new_string', $doc1['body']); + $this->assertEquals('string', $doc1['body']['new_string']); + $this->assertArrayNotHasKey('string', $doc1['body']); + + // Try and create a new row with the new column + $doc2 = $this->client->call( + Client::METHOD_POST, + '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), + [ + 'rowId' => 'unique()', + 'data' => [ + 'new_string' => 'string' + ], + "permissions" => ["read(\"any\")"] + ] + ); + + $this->assertEquals(201, $doc2['headers']['status-code']); + $this->assertArrayHasKey('new_string', $doc2['body']); + $this->assertEquals('string', $doc2['body']['new_string']); + + // Expect fail, try and create a new row with the old column + $doc3 = $this->client->call( + Client::METHOD_POST, + '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), + [ + 'rowId' => 'unique()', + 'data' => [ + 'string' => 'string' + ], + "permissions" => ["read(\"any\")"] + ] + ); + + $this->assertEquals(400, $doc3['headers']['status-code']); + } + + public function createRelationshipTables(): void + { + // Prepare the database with tables and relationships + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => 'database1', + 'name' => 'Test Database' + ]); + + $databaseId = $database['body']['$id']; + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => 'table1', + 'name' => 'level1', + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => 'table2', + 'name' => 'level2', + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + \sleep(2); + } + + public function cleanupRelationshipTable(): void + { + $this->client->call(Client::METHOD_DELETE, '/tablesdb/database1', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + \sleep(2); + } + + public function testColumnRenameRelationshipOneToMany() + { + $databaseId = 'database1'; + $table1Id = 'table1'; + $table2Id = 'table2'; + + $this->createRelationshipTables(); + + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2Id, + 'type' => 'oneToMany', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + \sleep(3); + + $table1Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $table1RelationColumn = $table1Columns['body']['columns'][0]; + + $this->assertEquals($relation['body']['side'], $table1RelationColumn['side']); + $this->assertEquals($relation['body']['twoWayKey'], $table1RelationColumn['twoWayKey']); + $this->assertEquals($relation['body']['relatedTable'], $table1RelationColumn['relatedTable']); + + // Create a row for checking later + $originalRow = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'unique()', + 'data' => [ + 'level2' => [[ + '$id' => 'unique()', + '$permissions' => ["read(\"any\")"] + ]], + ], + "permissions" => ["read(\"any\")"] + ]); + + $this->assertEquals(201, $originalRow['headers']['status-code']); + + // Rename the column + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/columns/level2' . '/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'newKey' => 'new_level_2' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + // Check the row's key has been renamed + $newRow = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/rows/' . $originalRow['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'queries' => [ + Query::select(['new_level_2.*'])->toString() + ] + ]); + + $this->assertArrayHasKey('new_level_2', $newRow['body']); + $this->assertEquals(1, count($newRow['body']['new_level_2'])); + $this->assertArrayNotHasKey('level2', $newRow['body']); + + // Check level2 row has been renamed + $level2Row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table2Id . '/rows/' . $newRow['body']['new_level_2'][0]['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertArrayHasKey('level1', $level2Row['body']); + $this->assertNotEmpty($level2Row['body']['level1']); + + // Check if column was renamed on the parent's side + $table1Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $this->assertEquals(200, $table1Columns['headers']['status-code']); + $this->assertEquals(1, count($table1Columns['body']['columns'])); + $this->assertEquals('new_level_2', $table1Columns['body']['columns'][0]['key']); + + // Check if column was renamed on the child's side + $table2Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table2Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $this->assertEquals(200, $table2Columns['headers']['status-code']); + $this->assertEquals(1, count($table2Columns['body']['columns'])); + $this->assertEquals('new_level_2', $table2Columns['body']['columns'][0]['twoWayKey']); + + $this->cleanupRelationshipTable(); + } + + public function testColumnRenameRelationshipOneToOne() + { + $databaseId = 'database1'; + $table1Id = 'table1'; + $table2Id = 'table2'; + + $this->createRelationshipTables(); + + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2Id, + 'type' => 'oneToOne', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + \sleep(3); + + $table1Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $table1RelationColumn = $table1Columns['body']['columns'][0]; + + $this->assertEquals($relation['body']['side'], $table1RelationColumn['side']); + $this->assertEquals($relation['body']['twoWayKey'], $table1RelationColumn['twoWayKey']); + $this->assertEquals($relation['body']['relatedTable'], $table1RelationColumn['relatedTable']); + + // Create a row for checking later + $originalRow = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'unique()', + 'data' => [ + 'level2' => [ + '$id' => 'unique()', + '$permissions' => ["read(\"any\")"] + ], + ], + "permissions" => ["read(\"any\")"] + ]); + + $this->assertEquals(201, $originalRow['headers']['status-code']); + + // Rename the column + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/columns/level2' . '/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'newKey' => 'new_level_2' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + // Check the row's key has been renamed + $newRow = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/rows/' . $originalRow['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'queries' => [ + Query::select(['new_level_2.*'])->toString() + ] + ]); + + $this->assertArrayHasKey('new_level_2', $newRow['body']); + $this->assertNotEmpty($newRow['body']['new_level_2']); + $this->assertArrayNotHasKey('level2', $newRow['body']); + + // Check level2 row has been renamed + $level2Row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table2Id . '/rows/' . $newRow['body']['new_level_2']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertArrayHasKey('level1', $level2Row['body']); + $this->assertNotEmpty($level2Row['body']['level1']); + + // Check if column was renamed on the parent's side + $table1Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $this->assertEquals(200, $table1Columns['headers']['status-code']); + $this->assertEquals(1, count($table1Columns['body']['columns'])); + $this->assertEquals('new_level_2', $table1Columns['body']['columns'][0]['key']); + + // Check if column was renamed on the child's side + $table2Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table2Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $this->assertEquals(200, $table2Columns['headers']['status-code']); + $this->assertEquals(1, count($table2Columns['body']['columns'])); + $this->assertEquals('new_level_2', $table2Columns['body']['columns'][0]['twoWayKey']); + + $this->cleanupRelationshipTable(); + } + + public function testColumnRenameRelationshipManyToOne() + { + $databaseId = 'database1'; + $table1Id = 'table1'; + $table2Id = 'table2'; + + $this->createRelationshipTables(); + + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2Id, + 'type' => 'manyToOne', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + \sleep(3); + + $table1Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $table1RelationColumn = $table1Columns['body']['columns'][0]; + + $this->assertEquals($relation['body']['side'], $table1RelationColumn['side']); + $this->assertEquals($relation['body']['twoWayKey'], $table1RelationColumn['twoWayKey']); + $this->assertEquals($relation['body']['relatedTable'], $table1RelationColumn['relatedTable']); + + // Create a row for checking later + $originalRow = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'unique()', + 'data' => [ + 'level2' => [ + '$id' => 'unique()', + '$permissions' => ["read(\"any\")"] + ], + ], + "permissions" => ["read(\"any\")"] + ]); + + $this->assertEquals(201, $originalRow['headers']['status-code']); + + // Rename the column + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/columns/level2' . '/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'newKey' => 'new_level_2' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + // Check the row's key has been renamed + $newRow = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/rows/' . $originalRow['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'queries' => [ + Query::select(['new_level_2.*'])->toString() + ] + ]); + + $this->assertArrayHasKey('new_level_2', $newRow['body']); + $this->assertNotEmpty($newRow['body']['new_level_2']); + $this->assertArrayNotHasKey('level2', $newRow['body']); + + // Check level2 row has been renamed + $level2Row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table2Id . '/rows/' . $newRow['body']['new_level_2']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'queries' => [ + Query::select(['*', 'level1.*'])->toString() + ] + ]); + + $this->assertArrayHasKey('level1', $level2Row['body']); + $this->assertNotEmpty($level2Row['body']['level1']); + + // Check if column was renamed on the parent's side + $table1Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $this->assertEquals(200, $table1Columns['headers']['status-code']); + $this->assertEquals(1, count($table1Columns['body']['columns'])); + $this->assertEquals('new_level_2', $table1Columns['body']['columns'][0]['key']); + + // Check if column was renamed on the child's side + $table2Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table2Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $this->assertEquals(200, $table2Columns['headers']['status-code']); + $this->assertEquals(1, count($table2Columns['body']['columns'])); + $this->assertEquals('new_level_2', $table2Columns['body']['columns'][0]['twoWayKey']); + + $this->cleanupRelationshipTable(); + } + + public function testColumnRenameRelationshipManyToMany() + { + $databaseId = 'database1'; + $table1Id = 'table1'; + $table2Id = 'table2'; + + $this->createRelationshipTables(); + + $relation = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedTableId' => $table2Id, + 'type' => 'manyToOne', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + \sleep(3); + + $table1Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $table1RelationColumn = $table1Columns['body']['columns'][0]; + + $this->assertEquals($relation['body']['side'], $table1RelationColumn['side']); + $this->assertEquals($relation['body']['twoWayKey'], $table1RelationColumn['twoWayKey']); + $this->assertEquals($relation['body']['relatedTable'], $table1RelationColumn['relatedTable']); + + // Create a row for checking later + $originalRow = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'unique()', + 'data' => [ + 'level2' => [ + '$id' => 'unique()', + '$permissions' => ["read(\"any\")"] + ], + ], + "permissions" => ["read(\"any\")"] + ]); + + $this->assertEquals(201, $originalRow['headers']['status-code']); + + // Rename the column + $update = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/columns/level2' . '/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'newKey' => 'new_level_2' + ]); + + $this->assertEquals(200, $update['headers']['status-code']); + + // Check the row's key has been renamed + $newRow = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id . '/rows/' . $originalRow['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'queries' => [ + Query::select(['new_level_2.*'])->toString() + ] + ]); + + $this->assertArrayHasKey('new_level_2', $newRow['body']); + $this->assertNotEmpty($newRow['body']['new_level_2']); + $this->assertArrayNotHasKey('level2', $newRow['body']); + + // Check level2 row has been renamed + $level2Row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table2Id . '/rows/' . $newRow['body']['new_level_2']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'queries' => [ + Query::select(['*', 'level1.*'])->toString() + ] + ]); + + $this->assertArrayHasKey('level1', $level2Row['body']); + $this->assertNotEmpty($level2Row['body']['level1']); + + // Check if column was renamed on the parent's side + $table1Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table1Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $this->assertEquals(200, $table1Columns['headers']['status-code']); + $this->assertEquals(1, count($table1Columns['body']['columns'])); + $this->assertEquals('new_level_2', $table1Columns['body']['columns'][0]['key']); + + // Check if column was renamed on the child's side + $table2Columns = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table2Id, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]); + + $this->assertEquals(200, $table2Columns['headers']['status-code']); + $this->assertEquals(1, count($table2Columns['body']['columns'])); + $this->assertEquals('new_level_2', $table2Columns['body']['columns'][0]['twoWayKey']); + + $this->cleanupRelationshipTable(); + } + + public function testBulkCreate(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Create Perms', + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Bulk Create Perms', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + + $data = [ + '$id' => $table['body']['$id'], + 'databaseId' => $table['body']['databaseId'] + ]; + + // Await column + $numberColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['$id'] . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberColumn['headers']['status-code']); + + sleep(1); + + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$data['$id']}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ], + [ + '$id' => ID::unique(), + 'number' => 2, + ], + [ + '$id' => ID::unique(), + 'number' => 3, + ], + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['rows']); + + $response = $this->client->call(Client::METHOD_GET, "/tablesdb/{$databaseId}/tables/{$data['$id']}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(1, $response['body']['rows'][0]['number']); + $this->assertEquals(2, $response['body']['rows'][1]['number']); + $this->assertEquals(3, $response['body']['rows'][2]['number']); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['rows']); + + // TEST SUCCESS - $id is auto-assigned if not included in bulk rows + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$data['$id']}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + 'number' => 1, + ] + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // TEST FAIL - Can't use data and row together + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$data['$id']}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 5 + ], + 'rows' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // TEST FAIL - Can't use $rowId and create bulk rows + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$data['$id']}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'rows' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // TEST FAIL - Can't include invalid ID in bulk rows + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$data['$id']}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => '$invalid', + 'number' => 1, + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // TEST FAIL - Can't miss number in bulk rows + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$data['$id']}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ], + [ + '$id' => ID::unique(), + ], + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // TEST FAIL - Can't push more than APP_LIMIT_DATABASE_BATCH rows + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$data['$id']}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => array_fill(0, APP_LIMIT_DATABASE_BATCH + 1, [ + '$id' => ID::unique(), + 'number' => 1, + ]), + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // TEST FAIL - Can't include invalid permissions in nested rows + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$data['$id']}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + '$permissions' => ['invalid'], + 'number' => 1, + ], + ], + ]); + + // TEST FAIL - Can't bulk create in a table with relationships + $table2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Bulk Related', + 'rowSecurity' => true, + 'permissions' => [], + ]); + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders()), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => 'manyToOne', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(1); + + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$data['$id']}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + ['$id' => ID::unique(), 'number' => 1,], + ['$id' => ID::unique(), 'number' => 2,], + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + } + + public function testBulkUpdate(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Updates' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Bulk Updates', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + + $data = [ + '$id' => $table['body']['$id'], + 'databaseId' => $table['body']['databaseId'] + ]; + + // Await column + $numberColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['$id'] . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberColumn['headers']['status-code']); + + // Wait for database worker to create columns + sleep(2); + + // Create rows + $createBulkRows = function ($amount = 10) use ($data) { + $rows = []; + + for ($x = 1; $x <= $amount; $x++) { + $rows[] = [ + '$id' => ID::unique(), + 'number' => $x, + ]; + } + + $doc = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $rows, + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + }; + + $createBulkRows(); + + /** + * Wait for database to purge cache... + * + * This test specifically failed on 1.6.x response format, + * could be due to the slow or overworked machine, but being safe here! + */ + sleep(5); + + // TEST: Update all rows + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 100, + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(10, $response['body']['rows']); + + /** + * Wait for database to purge cache... + * + * This test specifically failed on 1.6.x response format, + * could be due to the slow or overworked machine, but being safe here! + */ + sleep(5); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + Query::equal('number', [100])->toString(), + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(10, $rows['body']['total']); + + $returnedRows = $response['body']['rows']; + $refetchedRows = $rows['body']['rows']; + + $this->assertEquals($returnedRows, $refetchedRows); + + foreach ($rows['body']['rows'] as $row) { + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $row['$permissions']); + $this->assertEquals($table['body']['$id'], $row['$tableId']); + $this->assertEquals($data['databaseId'], $row['$databaseId']); + $this->assertEquals(100, $row['number']); + } + + // TEST: Check permissions persist + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 200 + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(10, $response['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + Query::equal('number', [200])->toString(), + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(10, $rows['body']['total']); + + foreach ($rows['body']['rows'] as $row) { + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $row['$permissions']); + } + + // TEST: Update rows with limit + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 300 + ], + 'queries' => [ + Query::limit(5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [200])->toString()] + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(5, $rows['body']['total']); + + // TEST: Update rows with offset + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 300 + ], + 'queries' => [ + Query::offset(5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [300])->toString()] + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(10, $rows['body']['total']); + + // TEST: Update rows with equals filter + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 400 + ], + 'queries' => [ + Query::equal('number', [300])->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(10, $response['body']['rows']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [400])->toString()] + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(10, $rows['body']['total']); + + // TEST: Fail - Can't bulk update in a table with relationships + $table2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Bulk Related', + 'rowSecurity' => true, + 'permissions' => [], + ]); + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders()), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => 'manyToOne', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(1); + + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 500 + ], + 'queries' => [ + Query::equal('number', [300])->toString(), + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + } + + public function testBulkUpsert(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Upserts' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Bulk Upserts', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + + $data = [ + '$id' => $table['body']['$id'], + 'databaseId' => $table['body']['databaseId'] + ]; + + // Await column + $numberColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['$id'] . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberColumn['headers']['status-code']); + + // Wait for database worker to create columns + sleep(2); + + // Create rows + $createBulkRows = function ($amount = 10) use ($data) { + $rows = []; + + for ($x = 1; $x <= $amount; $x++) { + $rows[] = [ + '$id' => "$x", + 'number' => $x, + ]; + } + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $rows, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + return $rows; + }; + + $rows = $createBulkRows(); + + // Update 1 row + $rows[\array_key_last($rows)]['number'] = 1000; + + // Add 1 row + $rows[] = ['number' => 11]; + + // TEST: Upsert all rows + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $rows, + ]); + + // Unchanged docs are skipped. 2 rows should be returned, 1 updated and 1 inserted. + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['rows']); + $this->assertEquals(1000, $response['body']['rows'][0]['number']); + $this->assertEquals(11, $response['body']['rows'][1]['number']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(11, $rows['body']['total']); + + foreach ($rows['body']['rows'] as $index => $row) { + $this->assertEquals($table['body']['$id'], $row['$tableId']); + $this->assertEquals($data['databaseId'], $row['$databaseId']); + switch ($index) { + case 9: + $this->assertEquals(1000, $row['number']); + break; + default: + $this->assertEquals($index + 1, $row['number']); + } + } + + // TEST: Upsert permissions + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => '1', + 'number' => 1000, + ], + [ + '$id' => '10', + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + 'number' => 10, + ], + ], + ]); + + $this->assertEquals(1000, $response['body']['rows'][0]['number']); + $this->assertEquals([], $response['body']['rows'][0]['$permissions']); + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $response['body']['rows'][1]['$permissions']); + + // TEST: Fail - Can't bulk upsert in a table with relationships + $table2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Bulk Related', + 'rowSecurity' => true, + 'permissions' => [], + ]); + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders()), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => 'manyToOne', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(1); + + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => '1', + 'number' => 1000, + ], + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + } + + public function testBulkDelete(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Deletes' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Bulk Deletes', + 'rowSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + + $data = [ + '$id' => $table['body']['$id'], + 'databaseId' => $table['body']['databaseId'] + ]; + + // Await column + $numberColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['$id'] . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberColumn['headers']['status-code']); + + // wait for database worker to create columns + sleep(2); + + // Create rows + $createBulkRows = function ($amount = 11) use ($data) { + $rows = []; + + for ($x = 0; $x < $amount; $x++) { + $rows[] = [ + '$id' => ID::unique(), + 'number' => $x, + ]; + } + + $doc = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $rows, + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + }; + + $createBulkRows(); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(11, $rows['body']['total']); + + // TEST: Delete all rows + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(11, $response['body']['total']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(0, $rows['body']['total']); + + // TEST: Delete rows with query + $createBulkRows(); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(11, $rows['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::lessThan('number', 5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(5, $response['body']['total']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(6, $rows['body']['total']); + + foreach ($rows['body']['rows'] as $row) { + $this->assertGreaterThanOrEqual(5, $row['number']); + } + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(6, $response['body']['total']); + + // SUCCESS: Delete rows with query + $createBulkRows(); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(11, $rows['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::lessThan('number', 5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(5, $response['body']['total']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(6, $rows['body']['total']); + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(6, $response['body']['total']); + + // SUCCESS: Delete Rows with limit query + $createBulkRows(); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(11, $rows['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::limit(2)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(9, $rows['body']['total']); + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(9, $response['body']['total']); + + // SUCCESS: Delete Rows with offset query + $createBulkRows(); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(11, $rows['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::offset(5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(6, $response['body']['total']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(5, $rows['body']['total']); + + $lastDoc = end($rows['body']['rows']); + + $this->assertNotEmpty($lastDoc); + $this->assertEquals(4, $lastDoc['number']); + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(5, $response['body']['total']); + + // SUCCESS: Delete 100 rows + $createBulkRows(100); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(100, $rows['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(100, $response['body']['total']); + + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals(0, $rows['body']['total']); + + // TEST: Fail - Can't bulk delete in a table with relationships + $table2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Bulk Related', + 'rowSecurity' => true, + 'permissions' => [], + ]); + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['$id'] . '/columns/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders()), [ + 'relatedTableId' => $table2['body']['$id'], + 'type' => 'manyToOne', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(1); + + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $data['databaseId'] . '/tables/' . $data['$id'] . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(400, $response['headers']['status-code']); + } + + public function testDateTimeRow(): void + { + $databaseId = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'DateTime Test Database', + ]); + + $this->assertEquals(201, $databaseId['headers']['status-code']); + $databaseId = $databaseId['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'create_modify_dates', + 'rowSecurity' => true, + 'permissions' => [], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create string column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'string', + 'size' => 128, + 'required' => false, + ]); + + // Create datetime column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/datetime', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'datetime', + 'required' => false, + 'format' => 'datetime', + ]); + + sleep(1); + + $date = '2000-01-01T10:00:00.000+00:00'; + + // Test - default behaviour of external datetime column not changed + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'row1', + 'data' => [ + 'datetime' => '' + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $row['headers']['status-code']); + $this->assertNotEmpty($row['body']['datetime']); + $this->assertNotEmpty($row['body']['$createdAt']); + $this->assertNotEmpty($row['body']['$updatedAt']); + + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/row1', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertNotEmpty($row['body']['datetime']); + $this->assertNotEmpty($row['body']['$createdAt']); + $this->assertNotEmpty($row['body']['$updatedAt']); + + // Test - modifying $createdAt and $updatedAt + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'row2', + 'data' => [ + '$createdAt' => $date + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $row['headers']['status-code']); + $this->assertEquals($row['body']['$createdAt'], $date); + $this->assertNotEmpty($row['body']['$updatedAt']); + $this->assertNotEquals($row['body']['$updatedAt'], $date); + + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/row2', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($row['body']['$createdAt'], $date); + $this->assertNotEmpty($row['body']['$updatedAt']); + $this->assertNotEquals($row['body']['$updatedAt'], $date); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSingleRowDateOperations(): void + { + $databaseId = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'Single Date Operations Database', + ]); + + $this->assertEquals(201, $databaseId['headers']['status-code']); + $databaseId = $databaseId['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'normal_date_operations', + 'rowSecurity' => true, + 'permissions' => [], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create string column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'string', + 'size' => 128, + 'required' => false, + ]); + + sleep(1); + + $createDate = '2000-01-01T10:00:00.000+00:00'; + $updateDate = '2000-02-01T15:30:00.000+00:00'; + $date1 = '2000-01-01T10:00:00.000+00:00'; + $date2 = '2000-02-01T15:30:00.000+00:00'; + $date3 = '2000-03-01T20:45:00.000+00:00'; + + // Test 1: Create with custom createdAt, then update with custom updatedAt + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'row1', + 'data' => [ + 'string' => 'initial', + '$createdAt' => $createDate + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $row['headers']['status-code']); + $this->assertEquals($createDate, $row['body']['$createdAt']); + $this->assertNotEquals($createDate, $row['body']['$updatedAt']); + + // Update with custom updatedAt + $updatedRow = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/row1', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'updated', + '$updatedAt' => $updateDate + ] + ]); + + $this->assertEquals(200, $updatedRow['headers']['status-code']); + $this->assertEquals($createDate, $updatedRow['body']['$createdAt']); + $this->assertEquals($updateDate, $updatedRow['body']['$updatedAt']); + + // Test 2: Create with both custom dates + $row2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'row2', + 'data' => [ + 'string' => 'both_dates', + '$createdAt' => $createDate, + '$updatedAt' => $updateDate + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $row2['headers']['status-code']); + $this->assertEquals($createDate, $row2['body']['$createdAt']); + $this->assertEquals($updateDate, $row2['body']['$updatedAt']); + + // Test 3: Create without dates, then update with custom dates + $row3 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'row3', + 'data' => [ + 'string' => 'no_dates' + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $row3['headers']['status-code']); + + $updatedRow3 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/row3', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'updated_no_dates', + '$createdAt' => $createDate, + '$updatedAt' => $updateDate + ] + ]); + + $this->assertEquals(200, $updatedRow3['headers']['status-code']); + $this->assertEquals($createDate, $updatedRow3['body']['$createdAt']); + $this->assertEquals($updateDate, $updatedRow3['body']['$updatedAt']); + + // Test 4: Update only createdAt + $row4 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'row4', + 'data' => [ + 'string' => 'initial' + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $row4['headers']['status-code']); + $originalCreatedAt4 = $row4['body']['$createdAt']; + $originalUpdatedAt4 = $row4['body']['$updatedAt']; + + $updatedRow4 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/row4', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'updated', + '$updatedAt' => null, + '$createdAt' => null + ], + ]); + + $this->assertEquals(200, $updatedRow4['headers']['status-code']); + $this->assertEquals($originalCreatedAt4, $updatedRow4['body']['$createdAt']); + $this->assertNotEquals($originalUpdatedAt4, $updatedRow4['body']['$updatedAt']); + + // Test 5: Update only updatedAt + $finalRow4 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/row4', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'final', + '$updatedAt' => $updateDate, + '$createdAt' => $createDate + ] + ]); + + $this->assertEquals(200, $finalRow4['headers']['status-code']); + $this->assertEquals($createDate, $finalRow4['body']['$createdAt']); + $this->assertEquals($updateDate, $finalRow4['body']['$updatedAt']); + + // Test 6: Create with updatedAt, update with createdAt + $row5 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'row5', + 'data' => [ + 'string' => 'row5', + '$updatedAt' => $date2 + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $row5['headers']['status-code']); + $this->assertNotEquals($date2, $row5['body']['$createdAt']); + $this->assertEquals($date2, $row5['body']['$updatedAt']); + + $updatedRow5 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/row5', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'row5_updated', + '$createdAt' => $date1 + ] + ]); + + $this->assertEquals(200, $updatedRow5['headers']['status-code']); + $this->assertEquals($date1, $updatedRow5['body']['$createdAt']); + $this->assertNotEquals($date2, $updatedRow5['body']['$updatedAt']); + + // Test 7: Create with both dates, update with different dates + $row6 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'row6', + 'data' => [ + 'string' => 'row6', + '$createdAt' => $date1, + '$updatedAt' => $date2 + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ] + ]); + + $this->assertEquals(201, $row6['headers']['status-code']); + $this->assertEquals($date1, $row6['body']['$createdAt']); + $this->assertEquals($date2, $row6['body']['$updatedAt']); + + $updatedRow6 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/row6', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'row6_updated', + '$createdAt' => $date3, + '$updatedAt' => $date3 + ] + ]); + + $this->assertEquals(200, $updatedRow6['headers']['status-code']); + $this->assertEquals($date3, $updatedRow6['body']['$createdAt']); + $this->assertEquals($date3, $updatedRow6['body']['$updatedAt']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testBulkRowDateOperations(): void + { + $databaseId = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Date Operations Database', + ]); + + $this->assertEquals(201, $databaseId['headers']['status-code']); + $databaseId = $databaseId['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'bulk_date_operations', + 'rowSecurity' => true, + 'permissions' => [], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create string column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'string', + 'size' => 128, + 'required' => false, + ]); + + sleep(1); + + $createDate = '2000-01-01T10:00:00.000+00:00'; + $updateDate = '2000-02-01T15:30:00.000+00:00'; + + // Test 1: Bulk create with different date configurations + $rows = [ + [ + '$id' => 'row1', + 'string' => 'row1', + '$createdAt' => $createDate, + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ], + [ + '$id' => 'row2', + 'string' => 'row2', + '$updatedAt' => $updateDate, + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ], + [ + '$id' => 'row3', + 'string' => 'row3', + '$createdAt' => $createDate, + '$updatedAt' => $updateDate, + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ], + [ + '$id' => 'row4', + 'string' => 'row4', + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ], + [ + '$id' => 'row5', + 'string' => 'row5', + '$createdAt' => null, + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ], + [ + '$id' => 'row6', + 'string' => 'row6', + '$updatedAt' => null, + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ] + ]; + + // Create all rows in one bulk operation + $bulkCreateResponse = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rows' => $rows + ]); + + $this->assertEquals(201, $bulkCreateResponse['headers']['status-code']); + $this->assertCount(count($rows), $bulkCreateResponse['body']['rows']); + + // Verify initial state + foreach (['row1', 'row3'] as $id) { + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($createDate, $row['body']['$createdAt'], "createdAt mismatch for $id"); + } + + foreach (['row2', 'row3'] as $id) { + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($updateDate, $row['body']['$updatedAt'], "updatedAt mismatch for $id"); + } + + foreach (['row4', 'row5', 'row6'] as $id) { + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertNotEmpty($row['body']['$createdAt'], "createdAt missing for $id"); + $this->assertNotEmpty($row['body']['$updatedAt'], "updatedAt missing for $id"); + } + + // Test 2: Bulk update with custom dates + $updateData = [ + 'data' => [ + 'string' => 'updated', + '$createdAt' => $createDate, + '$updatedAt' => $updateDate, + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ], + ]; + + // Use bulk update instead of individual updates + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), $updateData); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(6, $response['body']['rows']); + + // Verify updated state + foreach (['row1', 'row3'] as $id) { + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($createDate, $row['body']['$createdAt'], "createdAt mismatch for $id"); + $this->assertEquals($updateDate, $row['body']['$updatedAt'], "updatedAt mismatch for $id"); + $this->assertEquals('updated', $row['body']['string'], "string mismatch for $id"); + } + + foreach (['row2', 'row4', 'row5', 'row6'] as $id) { + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($updateDate, $row['body']['$updatedAt'], "updatedAt mismatch for $id"); + $this->assertEquals('updated', $row['body']['string'], "string mismatch for $id"); + } + + $newDate = '2000-03-01T20:45:00.000+00:00'; + $updateDataEnabled = [ + 'data' => [ + 'string' => 'enabled_update', + '$createdAt' => $newDate, + '$updatedAt' => $newDate + ], + ]; + + // Use bulk update instead of individual updates + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), $updateDataEnabled); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(6, $response['body']['rows']); + + // Verify final state + foreach (['row1', 'row2', 'row3', 'row4', 'row5', 'row6'] as $id) { + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($newDate, $row['body']['$createdAt'], "createdAt mismatch for $id"); + $this->assertEquals($newDate, $row['body']['$updatedAt'], "updatedAt mismatch for $id"); + $this->assertEquals('enabled_update', $row['body']['string'], "string mismatch for $id"); + } + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testUpsertRowDateOperations(): void + { + $databaseId = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'Upsert Date Operations Database', + ]); + + $this->assertEquals(201, $databaseId['headers']['status-code']); + $databaseId = $databaseId['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'upsert_date_operations', + 'rowSecurity' => true, + 'permissions' => [], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create string column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'string', + 'size' => 128, + 'required' => false, + ]); + + sleep(1); + + $createDate = '2000-01-01T10:00:00.000+00:00'; + $updateDate = '2000-02-01T15:30:00.000+00:00'; + $date1 = '2000-01-01T10:00:00.000+00:00'; + $date2 = '2000-02-01T15:30:00.000+00:00'; + $date3 = '2000-03-01T20:45:00.000+00:00'; + + // Test 1: Upsert new row with custom createdAt + $upsertRow1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'upsert1', + 'data' => [ + 'string' => 'upsert1_initial', + '$permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ], + '$createdAt' => $createDate + ], + ]); + + $this->assertEquals(201, $upsertRow1['headers']['status-code']); + $this->assertEquals($createDate, $upsertRow1['body']['$createdAt']); + $this->assertNotEquals($createDate, $upsertRow1['body']['$updatedAt']); + + // Test 2: Upsert existing row with custom updatedAt + $updatedUpsertRow1 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/upsert1', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'upsert1_updated', + '$updatedAt' => $updateDate + ], + ]); + + $this->assertEquals(200, $updatedUpsertRow1['headers']['status-code']); + $this->assertEquals($createDate, $updatedUpsertRow1['body']['$createdAt']); + $this->assertEquals($updateDate, $updatedUpsertRow1['body']['$updatedAt']); + + // Test 3: Upsert new row with both custom dates + $upsertRow2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rowId' => 'upsert2', + 'data' => [ + 'string' => 'upsert2_both_dates', + '$permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ], + '$createdAt' => $createDate, + '$updatedAt' => $updateDate + ], + ]); + + $this->assertEquals(201, $upsertRow2['headers']['status-code']); + $this->assertEquals($createDate, $upsertRow2['body']['$createdAt']); + $this->assertEquals($updateDate, $upsertRow2['body']['$updatedAt']); + + // Test 4: Upsert existing row with different dates + $updatedUpsertRow2 = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/upsert2', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'string' => 'upsert2_updated', + '$createdAt' => $date3, + '$updatedAt' => $date3, + '$permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + Permission::update(Role::any()), + ], + ] + ]); + + $this->assertEquals(200, $updatedUpsertRow2['headers']['status-code']); + $this->assertEquals($date3, $updatedUpsertRow2['body']['$createdAt']); + $this->assertEquals($date3, $updatedUpsertRow2['body']['$updatedAt']); + + // Test 5: Bulk upsert operations with custom dates + $upsertRows = [ + [ + '$id' => 'bulk_upsert1', + 'string' => 'bulk_upsert1_initial', + '$createdAt' => $createDate + ], + [ + '$id' => 'bulk_upsert2', + 'string' => 'bulk_upsert2_initial', + '$updatedAt' => $updateDate + ], + [ + '$id' => 'bulk_upsert3', + 'string' => 'bulk_upsert3_initial', + '$createdAt' => $createDate, + '$updatedAt' => $updateDate + ], + [ + '$id' => 'bulk_upsert4', + 'string' => 'bulk_upsert4_initial' + ] + ]; + + // Create rows using bulk upsert + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'rows' => $upsertRows + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(4, $response['body']['rows']); + + // Test 7: Verify initial bulk upsert state + foreach (['bulk_upsert1', 'bulk_upsert3'] as $id) { + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($createDate, $row['body']['$createdAt'], "createdAt mismatch for $id"); + } + + foreach (['bulk_upsert2', 'bulk_upsert3'] as $id) { + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($updateDate, $row['body']['$updatedAt'], "updatedAt mismatch for $id"); + } + + foreach (['bulk_upsert4'] as $id) { + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertNotEmpty($row['body']['$createdAt'], "createdAt missing for $id"); + $this->assertNotEmpty($row['body']['$updatedAt'], "updatedAt missing for $id"); + } + + // Test 8: Bulk upsert update with custom dates + $newDate = '2000-04-01T12:00:00.000+00:00'; + $updateUpsertData = [ + 'data' => [ + 'string' => 'bulk_upsert_updated', + '$createdAt' => $newDate, + '$updatedAt' => $newDate + ], + 'queries' => [Query::equal('$id', ['bulk_upsert1','bulk_upsert2','bulk_upsert3','bulk_upsert4'])->toString()] + ]; + + $upsertIds = ['bulk_upsert1', 'bulk_upsert2', 'bulk_upsert3', 'bulk_upsert4']; + + // Use bulk update instead of individual updates + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), $updateUpsertData); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(4, $response['body']['rows']); + + // Verify updated state + foreach ($upsertIds as $id) { + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertEquals($newDate, $row['body']['$createdAt'], "createdAt mismatch for $id"); + $this->assertEquals($newDate, $row['body']['$updatedAt'], "updatedAt mismatch for $id"); + $this->assertEquals('bulk_upsert_updated', $row['body']['string'], "string mismatch for $id"); + } + + // Test 9: checking by passing null to each + $updateUpsertDataNull = [ + 'data' => [ + 'string' => 'bulk_upsert_null_test', + '$createdAt' => null, + '$updatedAt' => null + ], + 'queries' => [Query::equal('$id', ['bulk_upsert1','bulk_upsert2','bulk_upsert3','bulk_upsert4'])->toString()] + ]; + + // Use bulk update instead of individual updates + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), $updateUpsertDataNull); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(4, $response['body']['rows']); + + // Verify null handling + foreach ($upsertIds as $id) { + $row = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $row['headers']['status-code']); + $this->assertNotEmpty($row['body']['$createdAt'], "createdAt missing for $id"); + $this->assertNotEmpty($row['body']['$updatedAt'], "updatedAt missing for $id"); + } + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialBulkOperations(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Bulk Operations Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create table with spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Bulk Operations Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create string column + $nameColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $nameColumn['headers']['status-code']); + + // Create point column + $pointColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + $this->assertEquals(202, $pointColumn['headers']['status-code']); + + // Create polygon column + $polygonColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => false, + ]); + + $this->assertEquals(202, $polygonColumn['headers']['status-code']); + + // Wait for columns to be created + sleep(2); + + // Test 1: Bulk create with spatial data + $spatialRows = []; + for ($i = 0; $i < 5; $i++) { + $spatialRows[] = [ + '$id' => ID::unique(), + 'name' => 'Location ' . $i, + 'location' => [10.0 + $i, 20.0 + $i], // POINT + 'area' => [ + [10.0 + $i, 20.0 + $i], + [11.0 + $i, 20.0 + $i], + [11.0 + $i, 21.0 + $i], + [10.0 + $i, 21.0 + $i], + [10.0 + $i, 20.0 + $i] + ] // POLYGON + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $spatialRows, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['rows']); + + // Verify created rows have proper spatial data + foreach ($response['body']['rows'] as $index => $row) { + $this->assertNotEmpty($row['$id']); + $this->assertNotEmpty($row['name']); + $this->assertIsArray($row['location']); + $this->assertIsArray($row['area']); + $this->assertCount(2, $row['location']); // POINT has 2 coordinates + + // Check polygon structure - it might be stored as an array of arrays + if (is_array($row['area'][0])) { + $this->assertGreaterThan(1, count($row['area'][0])); // POLYGON has multiple points + } else { + $this->assertGreaterThan(1, count($row['area'])); // POLYGON has multiple points + } + + $this->assertEquals('Location ' . $index, $row['name']); + $this->assertEquals([10.0 + $index, 20.0 + $index], $row['location']); + } + + // Test 2: Bulk update with spatial data + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Updated Location', + 'location' => [15.0, 25.0], // New POINT + 'area' => [ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ] // New POLYGON + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['rows']); + + // Verify updated rows + foreach ($response['body']['rows'] as $row) { + $this->assertEquals('Updated Location', $row['name']); + $this->assertEquals([15.0, 25.0], $row['location']); + // The area might be stored as an array of arrays, so check the first element + $this->assertIsArray($row['area']); + if (is_array($row['area'][0])) { + // If it's an array of arrays, check the first polygon + $this->assertEquals([ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ], $row['area'][0]); + } else { + // If it's a direct array, check the whole thing + $this->assertEquals([ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ], $row['area']); + } + } + + // Test 3: Bulk upsert with spatial data + $upsertRows = [ + [ + '$id' => 'upsert1', + 'name' => 'Upsert Location 1', + 'location' => [30.0, 40.0], + 'area' => [ + [30.0, 40.0], + [31.0, 40.0], + [31.0, 41.0], + [30.0, 41.0], + [30.0, 40.0] + ] + ], + [ + '$id' => 'upsert2', + 'name' => 'Upsert Location 2', + 'location' => [35.0, 45.0], + 'area' => [ + [35.0, 45.0], + [36.0, 45.0], + [36.0, 46.0], + [35.0, 46.0], + [35.0, 45.0] + ] + ] + ]; + + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $upsertRows, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['rows']); + + // Verify upserted rows + foreach ($response['body']['rows'] as $row) { + $this->assertNotEmpty($row['$id']); + $this->assertIsArray($row['location']); + $this->assertIsArray($row['area']); + + // Verify the spatial data structure + $this->assertCount(2, $row['location']); // POINT has 2 coordinates + if (is_array($row['area'][0])) { + $this->assertGreaterThan(1, count($row['area'][0])); // POLYGON has multiple points + } else { + $this->assertGreaterThan(1, count($row['area'])); // POLYGON has multiple points + } + } + + // Test 4: Edge cases for spatial bulk operations + + // Test 4a: Invalid point coordinates (should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Point', + 'location' => [1000.0, 2000.0], // Invalid coordinates + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ] + ], + ]); + + // Coordinates are not validated strictly; creation should succeed + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4b: Invalid polygon (insufficient points - should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Polygon', + 'location' => [10.0, 20.0], + 'area' => [ + [10.0, 20.0], + [11.0, 20.0] + ] + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4c: Missing required location (should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Missing Location', + // Missing required 'location' attribute + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ] + ], + ]); + + // This should fail due to missing required attribute + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4d: Mixed valid and invalid rows in bulk (should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Valid Row', + 'location' => [10.0, 20.0], + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ], + [ + '$id' => ID::unique(), + 'name' => 'Invalid Row', + // Missing required 'location' attribute + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ] + ], + ]); + + // This should fail due to mixed valid/invalid rows + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4e: Very large spatial data (stress test) + $largePolygon = []; + for ($i = 0; $i < 1000; $i++) { + $largePolygon[] = [$i * 0.001, $i * 0.001]; + } + $largePolygon[] = [0, 0]; // Close the polygon + + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Large Polygon Test', + 'location' => [0.0, 0.0], + 'area' => $largePolygon + ] + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // Test 4f: Null values in spatial attributes (should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Null Values Test', + 'location' => null, // Null point + 'area' => null // Null polygon + ] + ], + ]); + + // This should fail due to null values + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4g: Bulk operations with spatial data exceeding limits + $largeBulkRows = []; + for ($i = 0; $i < 100; $i++) { + $largeBulkRows[] = [ + '$id' => ID::unique(), + 'name' => 'Bulk Test ' . $i, + 'location' => [$i * 0.1, $i * 0.1], + 'area' => [ + [$i * 0.1, $i * 0.1], + [($i + 1) * 0.1, $i * 0.1], + [($i + 1) * 0.1, ($i + 1) * 0.1], + [$i * 0.1, ($i + 1) * 0.1], + [$i * 0.1, $i * 0.1] + ] + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $largeBulkRows, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialBulkOperationsWithLineStrings(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial LineString Bulk Operations Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create table with line string columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial LineString Bulk Operations Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create string column + $nameColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $nameColumn['headers']['status-code']); + + // Create line string column + $lineColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'path', + 'required' => true, + ]); + + // Handle both 201 (created) and 202 (accepted) status codes + $this->assertEquals(202, $lineColumn['headers']['status-code']); + + // Wait for columns to be created + sleep(2); + + // Test bulk create with line string data + $lineStringRows = []; + for ($i = 0; $i < 3; $i++) { + $lineStringRows[] = [ + '$id' => ID::unique(), + 'name' => 'Path ' . $i, + 'path' => [ + [$i * 10, $i * 10], + [($i + 1) * 10, ($i + 1) * 10], + [($i + 2) * 10, ($i + 2) * 10] + ] // LINE STRING with 3 points + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $lineStringRows, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['rows']); + + // Verify created rows have proper line string data + foreach ($response['body']['rows'] as $index => $row) { + $this->assertNotEmpty($row['$id']); + $this->assertNotEmpty($row['name']); + $this->assertIsArray($row['path']); + $this->assertGreaterThan(1, count($row['path'])); // LINE STRING has multiple points + $this->assertEquals('Path ' . $index, $row['name']); + $this->assertCount(3, $row['path']); // Each line string has 3 points + } + + // Test bulk update with line string data + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Updated Path', + 'path' => [ + [0, 0], + [50, 50], + [80, 80] + ] // New LINE STRING + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['rows']); + + // Verify updated rows + foreach ($response['body']['rows'] as $row) { + $this->assertEquals('Updated Path', $row['name']); + $this->assertEquals([ + [0, 0], + [50, 50], + [80, 80] + ], $row['path']); + } + + // Test: Invalid line string (single point - should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Line String', + 'path' => [[10, 20]] // Single point - invalid line string + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } +} diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsGuestTest.php b/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsGuestTest.php new file mode 100644 index 0000000000..71d033c89e --- /dev/null +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsGuestTest.php @@ -0,0 +1,278 @@ +<?php + +namespace Tests\E2E\Services\Databases\TablesDB; + +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideClient; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\Authorization; + +class DatabasesPermissionsGuestTest extends Scope +{ + use ProjectCustom; + use SideClient; + use DatabasesPermissionsScope; + + public function createTable(): array + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'InvalidRowDatabase', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('InvalidRowDatabase', $database['body']['name']); + + $databaseId = $database['body']['$id']; + $publicMovies = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', $this->getServerHeader(), [ + 'tableId' => ID::unique(), + 'name' => 'Movies', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $privateMovies = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', $this->getServerHeader(), [ + 'tableId' => ID::unique(), + 'name' => 'Movies', + 'permissions' => [], + 'rowSecurity' => true, + ]); + + $publicTable = ['id' => $publicMovies['body']['$id']]; + $privateTable = ['id' => $privateMovies['body']['$id']]; + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $publicTable['id'] . '/columns/string', $this->getServerHeader(), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $privateTable['id'] . '/columns/string', $this->getServerHeader(), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + + sleep(2); + + return [ + 'databaseId' => $databaseId, + 'publicTableId' => $publicTable['id'], + 'privateTableId' => $privateTable['id'], + ]; + } + + public function permissionsProvider(): array + { + return [ + [[Permission::read(Role::any())]], + [[Permission::read(Role::users())]], + [[Permission::update(Role::any()), Permission::delete(Role::any())]], + [[Permission::read(Role::any()), Permission::update(Role::any()), Permission::delete(Role::any())]], + [[Permission::read(Role::users()), Permission::update(Role::users()), Permission::delete(Role::users())]], + [[Permission::read(Role::any()), Permission::update(Role::users()), Permission::delete(Role::users())]], + ]; + } + + /** + * @dataProvider permissionsProvider + */ + public function testReadRows($permissions) + { + $data = $this->createTable(); + $publicTableId = $data['publicTableId']; + $privateTableId = $data['privateTableId']; + $databaseId = $data['databaseId']; + + $publicResponse = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $publicTableId . '/rows', $this->getServerHeader(), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Lorem', + ], + 'permissions' => $permissions, + ]); + $privateResponse = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $privateTableId . '/rows', $this->getServerHeader(), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Lorem', + ], + 'permissions' => $permissions, + ]); + + $this->assertEquals(201, $publicResponse['headers']['status-code']); + $this->assertEquals(201, $privateResponse['headers']['status-code']); + + $roles = Authorization::getRoles(); + Authorization::cleanRoles(); + + $publicRows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $publicTableId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]); + $privateRows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $privateTableId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]); + + $this->assertEquals(1, $publicRows['body']['total']); + $this->assertEquals($permissions, $publicRows['body']['rows'][0]['$permissions']); + + if (\in_array(Permission::read(Role::any()), $permissions)) { + $this->assertEquals(1, $privateRows['body']['total']); + $this->assertEquals($permissions, $privateRows['body']['rows'][0]['$permissions']); + } else { + $this->assertEquals(0, $privateRows['body']['total']); + } + + foreach ($roles as $role) { + Authorization::setRole($role); + } + } + + public function testWriteRow() + { + $data = $this->createTable(); + $publicTableId = $data['publicTableId']; + $privateTableId = $data['privateTableId']; + $databaseId = $data['databaseId']; + + $roles = Authorization::getRoles(); + Authorization::cleanRoles(); + + $publicResponse = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $publicTableId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Lorem', + ] + ]); + + $publicRowId = $publicResponse['body']['$id']; + $this->assertEquals(201, $publicResponse['headers']['status-code']); + + $privateResponse = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $privateTableId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Lorem', + ], + ]); + + $this->assertEquals(401, $privateResponse['headers']['status-code']); + + // Create a row in private table with API key so we can test that update and delete are also not allowed + $privateResponse = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $privateTableId . '/rows', $this->getServerHeader(), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Lorem', + ], + ]); + + $this->assertEquals(201, $privateResponse['headers']['status-code']); + $privateRowId = $privateResponse['body']['$id']; + + $publicRow = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $publicTableId . '/rows/' . $publicRowId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + ], + ]); + + $this->assertEquals(200, $publicRow['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $publicRow['body']['title']); + + $privateRow = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $privateTableId . '/rows/' . $privateRowId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + ], + ]); + + $this->assertEquals(401, $privateRow['headers']['status-code']); + + $publicRow = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $publicTableId . '/rows/' . $publicRowId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]); + + $this->assertEquals(204, $publicRow['headers']['status-code']); + + $privateRow = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $privateTableId . '/rows/' . $privateRowId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]); + + $this->assertEquals(401, $privateRow['headers']['status-code']); + + foreach ($roles as $role) { + Authorization::setRole($role); + } + } + + public function testWriteRowWithPermissions() + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'GuestPermissionsWrite', + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $this->assertEquals('GuestPermissionsWrite', $database['body']['name']); + + $databaseId = $database['body']['$id']; + $movies = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', $this->getServerHeader(), [ + 'tableId' => ID::unique(), + 'name' => 'Movies', + 'permissions' => [ + Permission::create(Role::any()), + ], + 'rowSecurity' => true + ]); + + $moviesId = $movies['body']['$id']; + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $moviesId . '/columns/string', $this->getServerHeader(), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + + sleep(1); + + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $moviesId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Thor: Ragnarok', + ], + 'permissions' => [ + Permission::read(Role::any()), + ] + ]); + + $this->assertEquals(201, $row['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $row['body']['title']); + } +} diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsMemberTest.php b/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsMemberTest.php new file mode 100644 index 0000000000..8e5af51493 --- /dev/null +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsMemberTest.php @@ -0,0 +1,271 @@ +<?php + +namespace Tests\E2E\Services\Databases\TablesDB; + +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideClient; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; + +class DatabasesPermissionsMemberTest extends Scope +{ + use ProjectCustom; + use SideClient; + use DatabasesPermissionsScope; + + public array $tables = []; + + public function createUsers(): array + { + return [ + 'user1' => $this->createUser('user1', 'lorem@ipsum.com'), + 'user2' => $this->createUser('user2', 'dolor@ipsum.com'), + ]; + } + + public function permissionsProvider(): array + { + return [ + [ + 'permissions' => [Permission::read(Role::any())], + 'any' => 1, + 'users' => 1, + 'doconly' => 1, + ], + [ + 'permissions' => [Permission::read(Role::users())], + 'any' => 2, + 'users' => 2, + 'doconly' => 2, + ], + [ + 'permissions' => [Permission::read(Role::user(ID::custom('random')))], + 'any' => 3, + 'users' => 3, + 'doconly' => 2, + ], + [ + 'permissions' => [Permission::read(Role::user(ID::custom('lorem'))), Permission::update(Role::user('lorem')), Permission::delete(Role::user('lorem'))], + 'any' => 4, + 'users' => 4, + 'doconly' => 2, + ], + [ + 'permissions' => [Permission::read(Role::user(ID::custom('dolor'))), Permission::update(Role::user('dolor')), Permission::delete(Role::user('dolor'))], + 'any' => 5, + 'users' => 5, + 'doconly' => 2, + ], + [ + 'permissions' => [Permission::read(Role::user(ID::custom('dolor'))), Permission::read(Role::user('lorem')), Permission::update(Role::user('dolor')), Permission::delete(Role::user('dolor'))], + 'any' => 6, + 'users' => 6, + 'doconly' => 2, + ], + [ + 'permissions' => [Permission::update(Role::any()), Permission::delete(Role::any())], + 'any' => 7, + 'users' => 7, + 'doconly' => 2, + ], + [ + 'permissions' => [Permission::read(Role::any()), Permission::update(Role::any()), Permission::delete(Role::any())], + 'any' => 8, + 'users' => 8, + 'doconly' => 3, + ], + [ + 'permissions' => [Permission::read(Role::any()), Permission::update(Role::users()), Permission::delete(Role::users())], + 'any' => 9, + 'users' => 9, + 'doconly' => 4, + ], + [ + 'permissions' => [Permission::read(Role::user(ID::custom('user1')))], + 'any' => 10, + 'users' => 10, + 'doconly' => 5, + ], + [ + 'permissions' => [Permission::read(Role::user(ID::custom('user1'))), Permission::read(Role::user(ID::custom('user1')))], + 'any' => 11, + 'users' => 11, + 'doconly' => 6, + ], + [ + 'permissions' => [Permission::read(Role::users()), Permission::update(Role::users()), Permission::delete(Role::users())], + 'any' => 12, + 'users' => 12, + 'doconly' => 7, + ], + ]; + } + + /** + * Setup database + * + * Data providers lose object state so explicitly pass [$users, $tables] to each iteration + * + * @return array + * @throws \Exception + */ + public function testSetupDatabase(): array + { + $this->createUsers(); + + $db = $this->client->call(Client::METHOD_POST, '/databases', $this->getServerHeader(), [ + 'databaseId' => ID::unique(), + 'name' => 'Test Database', + ]); + $this->assertEquals(201, $db['headers']['status-code']); + + $databaseId = $db['body']['$id']; + + $public = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', $this->getServerHeader(), [ + 'tableId' => ID::unique(), + 'name' => 'Movies', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + $this->assertEquals(201, $public['headers']['status-code']); + $this->tables = ['public' => $public['body']['$id']]; + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $this->tables['public'] . '/columns/string', $this->getServerHeader(), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $response['headers']['status-code']); + + $private = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', $this->getServerHeader(), [ + 'tableId' => ID::unique(), + 'name' => 'Private Movies', + 'permissions' => [ + Permission::read(Role::users()), + Permission::create(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + 'rowSecurity' => true, + ]); + $this->assertEquals(201, $private['headers']['status-code']); + $this->tables['private'] = $private['body']['$id']; + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $this->tables['private'] . '/columns/string', $this->getServerHeader(), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $response['headers']['status-code']); + + $doconly = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', $this->getServerHeader(), [ + 'tableId' => ID::unique(), + 'name' => 'Row Only Movies', + 'permissions' => [], + 'rowSecurity' => true, + ]); + $this->assertEquals(201, $private['headers']['status-code']); + $this->tables['doconly'] = $doconly['body']['$id']; + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $this->tables['doconly'] . '/columns/string', $this->getServerHeader(), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(2); + + return [ + 'users' => $this->users, + 'tables' => $this->tables, + 'databaseId' => $databaseId + ]; + } + + /** + * Data provider params are passed before test dependencies + * @dataProvider permissionsProvider + * @depends testSetupDatabase + */ + public function testReadRows($permissions, $anyCount, $usersCount, $docOnlyCount, $data) + { + $users = $data['users']; + $tables = $data['tables']; + $databaseId = $data['databaseId']; + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tables['public'] . '/rows', $this->getServerHeader(), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Lorem', + ], + 'permissions' => $permissions + ]); + $this->assertEquals(201, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tables['private'] . '/rows', $this->getServerHeader(), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Lorem', + ], + 'permissions' => $permissions + ]); + $this->assertEquals(201, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tables['doconly'] . '/rows', $this->getServerHeader(), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Lorem', + ], + 'permissions' => $permissions + ]); + $this->assertEquals(201, $response['headers']['status-code']); + + /** + * Check "any" permission table + */ + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tables['public'] . '/rows', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $users['user1']['session'], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals($anyCount, $rows['body']['total']); + + /** + * Check "users" permission table + */ + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tables['private'] . '/rows', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $users['user1']['session'], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals($usersCount, $rows['body']['total']); + + /** + * Check "user:user1" row only permission table + */ + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tables['doconly'] . '/rows', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $users['user1']['session'], + ]); + + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertEquals($docOnlyCount, $rows['body']['total']); + } +} diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsScope.php b/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsScope.php new file mode 100644 index 0000000000..bffc0606de --- /dev/null +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsScope.php @@ -0,0 +1,87 @@ +<?php + +namespace Tests\E2E\Services\Databases\TablesDB; + +use Tests\E2E\Client; + +trait DatabasesPermissionsScope +{ + public array $users = []; + public array $teams = []; + + public function createUser(string $id, string $email, string $password = 'test123!'): array + { + $user = $this->client->call(Client::METHOD_POST, '/account', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-dev-key' => $this->getProject()['devKey'] ?? '', + ], [ + 'userId' => $id, + 'email' => $email, + 'password' => $password + ]); + + $this->assertEquals(201, $user['headers']['status-code']); + + $session = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'email' => $email, + 'password' => $password, + ]); + + $session = $session['cookies']['a_session_' . $this->getProject()['$id']]; + + $user = [ + '$id' => $user['body']['$id'], + 'email' => $user['body']['email'], + 'session' => $session, + ]; + $this->users[$id] = $user; + + return $user; + } + + public function getCreatedUser(string $id): array + { + return $this->users[$id] ?? []; + } + + public function createTeam(string $id, string $name): array + { + $team = $this->client->call(Client::METHOD_POST, '/teams', $this->getServerHeader(), [ + 'teamId' => $id, + 'name' => $name + ]); + $this->teams[$id] = $team['body']; + + return $team['body']; + } + + public function addToTeam(string $user, string $team, array $roles = []): array + { + $membership = $this->client->call(Client::METHOD_POST, '/teams/' . $team . '/memberships', $this->getServerHeader(), [ + 'teamId' => $team, + 'email' => $this->getCreatedUser($user)['email'], + 'roles' => $roles, + 'url' => 'http://localhost:5000/join-us#title' + ]); + + return [ + 'user' => $membership['body']['userId'], + 'membership' => $membership['body']['$id'] + ]; + } + + public function getServerHeader(): array + { + return [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]; + } +} diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsTeamTest.php b/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsTeamTest.php new file mode 100644 index 0000000000..640ba1acc5 --- /dev/null +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesPermissionsTeamTest.php @@ -0,0 +1,208 @@ +<?php + +namespace Tests\E2E\Services\Databases\TablesDB; + +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideClient; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; + +class DatabasesPermissionsTeamTest extends Scope +{ + use ProjectCustom; + use SideClient; + use DatabasesPermissionsScope; + + public array $tables = []; + public string $databaseId = 'testpermissiondb'; + + public function createTeams(): array + { + return [ + 'team1' => $this->createTeam('team1', 'Team 1'), + 'team2' => $this->createTeam('team2', 'Team 2'), + ]; + } + + public function createUsers(): array + { + return [ + 'user1' => $this->createUser('user1', 'lorem@ipsum.com'), + 'user2' => $this->createUser('user2', 'dolor@ipsum.com'), + 'user3' => $this->createUser('user3', 'sit@ipsum.com'), + ]; + } + + public function createTables($teams) + { + $db = $this->client->call(Client::METHOD_POST, '/tablesdb', $this->getServerHeader(), [ + 'databaseId' => $this->databaseId, + 'name' => 'Test Database', + ]); + $this->assertEquals(201, $db['headers']['status-code']); + + $table1 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $this->databaseId . '/tables', $this->getServerHeader(), [ + 'tableId' => ID::custom('table1'), + 'name' => 'Table 1', + 'permissions' => [ + Permission::read(Role::team($teams['team1']['$id'])), + Permission::create(Role::team($teams['team1']['$id'], 'admin')), + Permission::update(Role::team($teams['team1']['$id'], 'admin')), + Permission::delete(Role::team($teams['team1']['$id'], 'admin')), + ], + ]); + + $this->tables['table1'] = $table1['body']['$id']; + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $this->databaseId . '/tables/' . $this->tables['table1'] . '/columns/string', $this->getServerHeader(), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + + $table2 = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $this->databaseId . '/tables', $this->getServerHeader(), [ + 'tableId' => ID::custom('table2'), + 'name' => 'Table 2', + 'permissions' => [ + Permission::read(Role::team($teams['team2']['$id'])), + Permission::create(Role::team($teams['team2']['$id'], 'owner')), + Permission::update(Role::team($teams['team2']['$id'], 'owner')), + Permission::delete(Role::team($teams['team2']['$id'], 'owner')), + ] + ]); + + $this->tables['table2'] = $table2['body']['$id']; + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $this->databaseId . '/tables/' . $this->tables['table2'] . '/columns/string', $this->getServerHeader(), [ + 'key' => 'title', + 'size' => 256, + 'required' => true, + ]); + + sleep(2); + + return $this->tables; + } + + /* + * $success = can $user read from $table + * [$user, $table, $success] + */ + public function readRowsProvider(): array + { + return [ + ['user1', 'table1', true], + ['user2', 'table1', false], + ['user3', 'table1', true], + ['user1', 'table2', false], + ['user2', 'table2', true], + ['user3', 'table2', true], + ]; + } + + /* + * $success = can $user write to $table + * [$user, $table, $success] + */ + public function writeRowsProvider(): array + { + return [ + ['user1', 'table1', true], + ['user2', 'table1', false], + ['user3', 'table1', false], + ['user1', 'table2', false], + ['user2', 'table2', true], + ['user3', 'table2', false], + ]; + } + + /** + * Setup database + * + * Data providers lose object state + * so explicitly pass $users to each iteration + * @return array $users + */ + public function testSetupDatabase(): array + { + $this->createUsers(); + $this->createTeams(); + + $this->addToTeam('user1', 'team1', ['admin']); + $this->addToTeam('user2', 'team2', ['owner']); + + // user3 in both teams but with no roles + $this->addToTeam('user3', 'team1'); + $this->addToTeam('user3', 'team2'); + + $this->createTables($this->teams); + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $this->databaseId . '/tables/' . $this->tables['table1'] . '/rows', $this->getServerHeader(), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Lorem', + ], + ]); + $this->assertEquals(201, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $this->databaseId . '/tables/' . $this->tables['table2'] . '/rows', $this->getServerHeader(), [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Ipsum', + ], + ]); + $this->assertEquals(201, $response['headers']['status-code']); + + return $this->users; + } + + /** + * Data provider params are passed before test dependencies + * @depends testSetupDatabase + * @dataProvider readRowsProvider + */ + public function testReadRows($user, $table, $success, $users) + { + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $this->databaseId . '/tables/' . $table . '/rows', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $users[$user]['session'], + ]); + + if ($success) { + $this->assertCount(1, $rows['body']['rows']); + } else { + $this->assertEquals(401, $rows['headers']['status-code']); + } + } + + /** + * @depends testSetupDatabase + * @dataProvider writeRowsProvider + */ + public function testWriteRows($user, $table, $success, $users) + { + $rows = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $this->databaseId . '/tables/' . $table . '/rows', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $users[$user]['session'], + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'title' => 'Ipsum', + ], + ]); + + if ($success) { + $this->assertEquals(201, $rows['headers']['status-code']); + } else { + // 401 if user is a part of team, 404 otherwise + $this->assertContains($rows['headers']['status-code'], [401, 404]); + } + } +} diff --git a/tests/e2e/Services/Functions/FunctionsBase.php b/tests/e2e/Services/Functions/FunctionsBase.php index 475eb9b9b4..27b67d851d 100644 --- a/tests/e2e/Services/Functions/FunctionsBase.php +++ b/tests/e2e/Services/Functions/FunctionsBase.php @@ -49,7 +49,7 @@ trait FunctionsBase 'x-appwrite-key' => $this->getProject()['apiKey'], ])); $this->assertEquals('ready', $deployment['body']['status'], 'Deployment status is not ready, deployment: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT)); - }, 50000, 500); + }, 100000, 500); // Not === so multipart/form-data works fine too if (($params['activate'] ?? false) == true) { diff --git a/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php b/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php index 24215f5352..9dae8efdb4 100644 --- a/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php @@ -21,8 +21,8 @@ class FunctionsConsoleClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', 'users.*.delete', @@ -39,8 +39,8 @@ class FunctionsConsoleClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test Failure', 'execute' => ['some-random-string'], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', ]); $this->assertEquals(400, $function2['headers']['status-code']); @@ -453,7 +453,7 @@ class FunctionsConsoleClientTest extends Scope { $function = $this->createFunction([ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Variable E2E Test', 'entrypoint' => 'index.js', 'logging' => false, @@ -481,7 +481,7 @@ class FunctionsConsoleClientTest extends Scope $deploymentId = $this->setupDeployment($functionId, [ 'entrypoint' => 'index.js', - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -502,7 +502,7 @@ class FunctionsConsoleClientTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Download Test', 'entrypoint' => 'index.js', 'logging' => false, @@ -511,7 +511,7 @@ class FunctionsConsoleClientTest extends Scope $deploymentId = $this->setupDeployment($functionId, [ 'entrypoint' => 'index.js', - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index a47bc62d47..f8b7bae325 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -43,8 +43,8 @@ class FunctionsCustomClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', 'users.*.delete', @@ -52,8 +52,7 @@ class FunctionsCustomClientTest extends Scope 'timeout' => 10, ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -75,6 +74,50 @@ class FunctionsCustomClientTest extends Scope $this->cleanupFunction($functionId); } + public function testCreateHeadExecution() + { + /** + * Test for SUCCESS + */ + $functionId = $this->setupFunction([ + 'functionId' => ID::unique(), + 'name' => 'Test', + 'execute' => [Role::user($this->getUser()['$id'])->toString()], + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', + 'events' => [ + 'users.*.create', + 'users.*.delete', + ], + 'timeout' => 10, + ]); + $this->setupDeployment($functionId, [ + 'code' => $this->packageFunction('basic'), + 'activate' => true + ]); + + // Deny create async execution as guest + $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'async' => true, + ]); + $this->assertEquals(401, $execution['headers']['status-code']); + + // Allow create async execution as user + $execution = $this->client->call(Client::METHOD_HEAD, '/functions/' . $functionId . '/executions', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'async' => true, + ]); + $this->assertEquals(200, $execution['headers']['status-code']); + $this->assertEmpty($execution['body']); + + $this->cleanupFunction($functionId); + } + public function testCreateCustomExecution(): array { /** @@ -84,13 +127,12 @@ class FunctionsCustomClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::any()->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, ]); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-fn'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -100,6 +142,19 @@ class FunctionsCustomClientTest extends Scope ]); $output = json_decode($execution['body']['responseBody'], true); $this->assertEquals(201, $execution['headers']['status-code']); + + $this->assertNotEmpty($execution['body']['responseHeaders']); + + $executionIdHeader = null; + foreach ($execution['body']['responseHeaders'] as $header) { + if ($header['name'] === 'x-appwrite-execution-id') { + $executionIdHeader = $header['value']; + break; + } + } + $this->assertNotEmpty($executionIdHeader); + $this->assertEquals($execution['body']['$id'], $executionIdHeader); + $this->assertEquals(200, $execution['body']['responseStatusCode']); $this->assertGreaterThan(0, $execution['body']['duration']); $this->assertEquals('completed', $execution['body']['status']); @@ -107,8 +162,8 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals('Test', $output['APPWRITE_FUNCTION_NAME']); $this->assertEquals($deploymentId, $output['APPWRITE_FUNCTION_DEPLOYMENT']); $this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']); - $this->assertEquals('PHP', $output['APPWRITE_FUNCTION_RUNTIME_NAME']); - $this->assertEquals('8.0', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']); + $this->assertEquals('Node.js', $output['APPWRITE_FUNCTION_RUNTIME_NAME']); + $this->assertEquals('22', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']); $this->assertEquals(APP_VERSION_STABLE, $output['APPWRITE_VERSION']); $this->assertEquals(System::getEnv('_APP_REGION', 'default'), $output['APPWRITE_REGION']); $this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']); @@ -117,6 +172,11 @@ class FunctionsCustomClientTest extends Scope $this->assertNotEmpty($output['APPWRITE_FUNCTION_JWT']); $this->assertEquals($this->getProject()['$id'], $output['APPWRITE_FUNCTION_PROJECT_ID']); + $executionId = $execution['body']['$id'] ?? ''; + $this->assertNotEmpty($output['APPWRITE_FUNCTION_EXECUTION_ID']); + $this->assertEquals($executionId, $output['APPWRITE_FUNCTION_EXECUTION_ID']); + $this->assertNotEmpty($output['APPWRITE_FUNCTION_CLIENT_IP']); + $execution = $this->createExecution($functionId, [ 'body' => 'foobar', 'async' => true @@ -142,10 +202,10 @@ class FunctionsCustomClientTest extends Scope */ $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test', + 'name' => 'Test guest execution', 'execute' => [Role::any()->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'vars' => [ 'funcKey1' => 'funcValue1', 'funcKey2' => 'funcValue2', @@ -154,8 +214,7 @@ class FunctionsCustomClientTest extends Scope 'timeout' => 10, ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-fn'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -175,8 +234,8 @@ class FunctionsCustomClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, ]); @@ -193,15 +252,14 @@ class FunctionsCustomClientTest extends Scope */ $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test', + 'name' => 'Test synchronous execution', 'execute' => [Role::any()->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, ]); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-fn'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -214,11 +272,11 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals('completed', $execution['body']['status']); $this->assertEquals(200, $execution['body']['responseStatusCode']); $this->assertEquals($functionId, $output['APPWRITE_FUNCTION_ID']); - $this->assertEquals('Test', $output['APPWRITE_FUNCTION_NAME']); + $this->assertEquals('Test synchronous execution', $output['APPWRITE_FUNCTION_NAME']); $this->assertEquals($deploymentId, $output['APPWRITE_FUNCTION_DEPLOYMENT']); $this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']); - $this->assertEquals('PHP', $output['APPWRITE_FUNCTION_RUNTIME_NAME']); - $this->assertEquals('8.0', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']); + $this->assertEquals('Node.js', $output['APPWRITE_FUNCTION_RUNTIME_NAME']); + $this->assertEquals('22', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']); $this->assertEquals(APP_VERSION_STABLE, $output['APPWRITE_VERSION']); $this->assertEquals(System::getEnv('_APP_REGION', 'default'), $output['APPWRITE_REGION']); $this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']); @@ -239,12 +297,12 @@ class FunctionsCustomClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::any()->toString()], - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'entrypoint' => 'index.js' ]); $this->setupDeployment($functionId, [ 'entrypoint' => 'index.js', - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -340,7 +398,7 @@ class FunctionsCustomClientTest extends Scope 'limit' => 5, 'offset' => 2, 'useCases' => ['databases'], - 'runtimes' => ['node-16.0'] + 'runtimes' => ['node-22'] ]); $this->assertEquals(200, $templates['headers']['status-code']); @@ -352,7 +410,7 @@ class FunctionsCustomClientTest extends Scope $this->assertContains($template['useCases'][0], ['databases']); } - $this->assertContains('node-16.0', array_column($templates['body']['templates'][0]['runtimes'], 'name')); + $this->assertContains('node-22', array_column($templates['body']['templates'][0]['runtimes'], 'name')); /** * Test for FAILURE diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 6a8db0a88c..0d63791151 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -35,7 +35,7 @@ class FunctionsCustomServerTest extends Scope $function = $this->createFunction([ 'functionId' => ID::unique(), 'name' => 'Specs function', - 'runtime' => 'php-8.0', + 'runtime' => 'node-22', 'specification' => $specifications['body']['specifications'][0]['slug'] ]); $this->assertEquals(201, $function['headers']['status-code']); @@ -50,7 +50,7 @@ class FunctionsCustomServerTest extends Scope $function = $this->createFunction([ 'functionId' => ID::unique(), 'name' => 'Specs function', - 'runtime' => 'php-8.0', + 'runtime' => 'node-22', 'specification' => 'cheap-please' ]); $this->assertEquals(400, $function['headers']['status-code']); @@ -64,8 +64,8 @@ class FunctionsCustomServerTest extends Scope $function = $this->createFunction([ 'functionId' => ID::unique(), 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'buckets.*.create', 'buckets.*.delete', @@ -79,7 +79,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(201, $function['headers']['status-code']); $this->assertNotEmpty($function['body']['$id']); $this->assertEquals('Test', $function['body']['name']); - $this->assertEquals('php-8.0', $function['body']['runtime']); + $this->assertEquals('node-22', $function['body']['runtime']); $this->assertEquals(true, $dateValidator->isValid($function['body']['$createdAt'])); $this->assertEquals(true, $dateValidator->isValid($function['body']['$updatedAt'])); $this->assertEquals('', $function['body']['deploymentId']); @@ -180,7 +180,7 @@ class FunctionsCustomServerTest extends Scope // Test search runtime $functions = $this->listFunctions([ - 'search' => 'php-8.0' + 'search' => 'node-22' ]); $this->assertEquals($functions['headers']['status-code'], 200); @@ -193,8 +193,8 @@ class FunctionsCustomServerTest extends Scope $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test 2', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'buckets.*.create', 'buckets.*.delete', @@ -286,8 +286,8 @@ class FunctionsCustomServerTest extends Scope ], 'schedule' => '0 0 1 1 *', 'timeout' => 15, - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', ]); $dateValidator = new DatetimeValidator(); @@ -322,8 +322,8 @@ class FunctionsCustomServerTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', 'users.*.delete', @@ -338,8 +338,7 @@ class FunctionsCustomServerTest extends Scope 'x-appwrite-key' => $this->getProject()['apiKey'], 'x-sdk-language' => 'cli', ], [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -363,7 +362,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $starterTemplate['headers']['status-code']); $phpRuntime = array_values(array_filter($starterTemplate['body']['runtimes'], function ($runtime) { - return $runtime['name'] === 'php-8.0'; + return $runtime['name'] === 'node-22'; }))[0]; // If this fails, the template has variables, and this test needs to be updated @@ -373,7 +372,7 @@ class FunctionsCustomServerTest extends Scope [ 'functionId' => ID::unique(), 'name' => $starterTemplate['body']['name'], - 'runtime' => 'php-8.0', + 'runtime' => 'node-22', 'execute' => $starterTemplate['body']['permissions'], 'entrypoint' => $phpRuntime['entrypoint'], 'events' => $starterTemplate['body']['events'], @@ -514,7 +513,7 @@ class FunctionsCustomServerTest extends Scope $functionId = $data['functionId']; $deployment = $this->createDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -522,7 +521,7 @@ class FunctionsCustomServerTest extends Scope $this->assertNotEmpty($deployment['body']['$id']); $this->assertEquals('waiting', $deployment['body']['status']); $this->assertEquals(true, (new DatetimeValidator())->isValid($deployment['body']['$createdAt'])); - $this->assertEquals('index.php', $deployment['body']['entrypoint']); + $this->assertEquals('index.js', $deployment['body']['entrypoint']); $deploymentIdActive = $deployment['body']['$id'] ?? ''; @@ -533,7 +532,7 @@ class FunctionsCustomServerTest extends Scope }, 50000, 500); $deployment = $this->createDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => 'false' ]); @@ -573,7 +572,7 @@ class FunctionsCustomServerTest extends Scope $functionId = $data['functionId']; $deployment = $this->createDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => 'false' ]); @@ -582,7 +581,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); $this->assertNotEmpty($deployment['body']['$id']); $this->assertEquals(true, (new DatetimeValidator())->isValid($deployment['body']['$createdAt'])); - $this->assertEquals('index.php', $deployment['body']['entrypoint']); + $this->assertEquals('index.js', $deployment['body']['entrypoint']); $this->assertEventually(function () use ($functionId, $deploymentId) { $deployment = $this->getDeployment($functionId, $deploymentId); @@ -595,12 +594,12 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $deployment['headers']['status-code']); $this->assertEquals('canceled', $deployment['body']['status']); - /** - * Build worker still runs the build. - * 30s sleep gives worker enough time to finish build. - * After build finished, it should still be canceled, not ready. - */ - \sleep(30); + // Ensures worker got eventually aware of cancellation and reacted properly + $this->assertEventually(function () use ($functionId, $deploymentId) { + $deployment = $this->getDeployment($functionId, $deploymentId); + $this->assertEquals(200, $deployment['headers']['status-code']); + $this->assertStringContainsString('Build has been canceled.', $deployment['body']['buildLogs']); + }); $deployment = $this->getDeployment($functionId, $deploymentId); @@ -618,7 +617,7 @@ class FunctionsCustomServerTest extends Scope */ $functionId = $data['functionId']; - $folder = 'php-large'; + $folder = 'large'; $code = realpath(__DIR__ . '/../../../resources/functions') . "/$folder/code.tar.gz"; Console::execute('cd ' . realpath(__DIR__ . "/../../../resources/functions") . "/$folder && tar --exclude code.tar.gz -czf code.tar.gz .", '', $this->stdout, $this->stderr); @@ -633,13 +632,13 @@ class FunctionsCustomServerTest extends Scope ]; $id = ''; while (!feof($handle)) { - $curlFile = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode(@fread($handle, $chunkSize)), $mimeType, 'php-large-fx.tar.gz'); + $curlFile = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode(@fread($handle, $chunkSize)), $mimeType, 'large-fx.tar.gz'); $headers['content-range'] = 'bytes ' . ($counter * $chunkSize) . '-' . min(((($counter * $chunkSize) + $chunkSize) - 1), $size - 1) . '/' . $size; if (!empty($id)) { $headers['x-appwrite-id'] = $id; } $largeTag = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/deployments', array_merge($headers, $this->getHeaders()), [ - 'entrypoint' => 'index.php', + 'entrypoint' => 'index.js', 'code' => $curlFile, 'activate' => true, 'commands' => 'cp blue.mp4 copy.mp4 && ls -al' // +7MB buildSize @@ -652,7 +651,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $largeTag['headers']['status-code']); $this->assertNotEmpty($largeTag['body']['$id']); $this->assertEquals(true, (new DatetimeValidator())->isValid($largeTag['body']['$createdAt'])); - $this->assertEquals('index.php', $largeTag['body']['entrypoint']); + $this->assertEquals('index.js', $largeTag['body']['entrypoint']); $this->assertGreaterThan(1024 * 1024 * 5, $largeTag['body']['sourceSize']); // ~7MB video file $this->assertLessThan(1024 * 1024 * 10, $largeTag['body']['sourceSize']); // ~7MB video file @@ -722,6 +721,30 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals($deployments['headers']['status-code'], 200); $this->assertCount(1, $deployments['body']['deployments']); + $deployments = $this->listDeployments($functionId, [ + 'queries' => [ + Query::select(['status'])->toString(), + ], + ]); + + $this->assertEquals($deployments['headers']['status-code'], 200); + $this->assertArrayHasKey('status', $deployments['body']['deployments'][0]); + $this->assertArrayHasKey('status', $deployments['body']['deployments'][1]); + $this->assertArrayNotHasKey('sourceSize', $deployments['body']['deployments'][0]); + $this->assertArrayNotHasKey('sourceSize', $deployments['body']['deployments'][1]); + + // Extra select query check, for attribute not allowed by filter queries + $deployments = $this->listDeployments($functionId, [ + 'queries' => [ + Query::select(['buildLogs'])->toString(), + ], + ]); + $this->assertEquals($deployments['headers']['status-code'], 200); + $this->assertArrayHasKey('buildLogs', $deployments['body']['deployments'][0]); + $this->assertArrayHasKey('buildLogs', $deployments['body']['deployments'][1]); + $this->assertArrayNotHasKey('sourceSize', $deployments['body']['deployments'][0]); + $this->assertArrayNotHasKey('sourceSize', $deployments['body']['deployments'][1]); + $deployments = $this->listDeployments($functionId, [ 'queries' => [ Query::offset(1)->toString(), @@ -893,6 +916,19 @@ class FunctionsCustomServerTest extends Scope ]); $this->assertEquals(201, $execution['headers']['status-code']); + + $this->assertNotEmpty($execution['body']['responseHeaders']); + + $executionIdHeader = null; + foreach ($execution['body']['responseHeaders'] as $header) { + if ($header['name'] === 'x-appwrite-execution-id') { + $executionIdHeader = $header['value']; + break; + } + } + $this->assertNotEmpty($executionIdHeader); + $this->assertEquals($execution['body']['$id'], $executionIdHeader); + $this->assertNotEmpty($execution['body']['$id']); $this->assertNotEmpty($execution['body']['functionId']); $this->assertEquals(true, (new DatetimeValidator())->isValid($execution['body']['$createdAt'])); @@ -903,8 +939,8 @@ class FunctionsCustomServerTest extends Scope $this->assertStringContainsString($data['deploymentId'], $execution['body']['responseBody']); $this->assertStringContainsString('Test1', $execution['body']['responseBody']); $this->assertStringContainsString('http', $execution['body']['responseBody']); - $this->assertStringContainsString('PHP', $execution['body']['responseBody']); - $this->assertStringContainsString('8.0', $execution['body']['responseBody']); + $this->assertStringContainsString('Node.js', $execution['body']['responseBody']); + $this->assertStringContainsString('22', $execution['body']['responseBody']); $this->assertStringContainsString('Global Variable Value', $execution['body']['responseBody']); // $this->assertStringContainsString('êä', $execution['body']['responseBody']); // tests unknown utf-8 chars $this->assertNotEmpty($execution['body']['errors']); @@ -913,6 +949,26 @@ class FunctionsCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; + /** Test create execution with HEAD method */ + $execution = $this->createExecution($data['functionId'], [ + 'async' => 'false', + 'method' => 'HEAD', + ]); + + $this->assertEquals(201, $execution['headers']['status-code']); + $this->assertEquals('completed', $execution['body']['status']); + $this->assertEquals(200, $execution['body']['responseStatusCode']); + $this->assertIsArray($execution['body']['responseHeaders']); + $this->assertEmpty($execution['body']['responseBody']); // For HEAD requests, response body is empty + + /** Delete execution */ + $execution = $this->client->call(Client::METHOD_DELETE, '/functions/' . $data['functionId'] . '/executions/' . $execution['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + $this->assertEquals(204, $execution['headers']['status-code']); + + /** Test create execution with 400 status code */ $execution = $this->createExecution($data['functionId'], [ 'async' => 'false', 'path' => '/?code=400' @@ -922,11 +978,11 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals('completed', $execution['body']['status']); $this->assertEquals(400, $execution['body']['responseStatusCode']); + /** Delete execution */ $execution = $this->client->call(Client::METHOD_DELETE, '/functions/' . $data['functionId'] . '/executions/' . $execution['body']['$id'], array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); - $this->assertEquals(204, $execution['headers']['status-code']); return array_merge($data, ['executionId' => $executionId]); @@ -946,6 +1002,29 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(1, $executions['body']['total']); $this->assertIsArray($executions['body']['executions']); $this->assertCount(1, $executions['body']['executions']); + $this->assertEquals($data['deploymentId'], $executions['body']['executions'][0]['deploymentId']); + + $executions = $this->listExecutions($data['functionId'], [ + 'queries' => [ + Query::equal('deploymentId', [$data['deploymentId']])->toString(), + ], + ]); + + $this->assertEquals(200, $executions['headers']['status-code']); + $this->assertEquals(1, $executions['body']['total']); + $this->assertIsArray($executions['body']['executions']); + $this->assertCount(1, $executions['body']['executions']); + + $executions = $this->listExecutions($data['functionId'], [ + 'queries' => [ + Query::equal('deploymentId', ['some-random-id'])->toString(), + ], + ]); + + $this->assertEquals(200, $executions['headers']['status-code']); + $this->assertEquals(0, $executions['body']['total']); + $this->assertIsArray($executions['body']['executions']); + $this->assertCount(0, $executions['body']['executions']); $executions = $this->listExecutions($data['functionId'], [ 'queries' => [ @@ -1017,8 +1096,8 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $execution['body']['responseStatusCode']); $this->assertStringContainsString('Test1', $execution['body']['responseBody']); $this->assertStringContainsString('http', $execution['body']['responseBody']); - $this->assertStringContainsString('PHP', $execution['body']['responseBody']); - $this->assertStringContainsString('8.0', $execution['body']['responseBody']); + $this->assertStringContainsString('Node.js', $execution['body']['responseBody']); + $this->assertStringContainsString('22', $execution['body']['responseBody']); // $this->assertStringContainsString('êä', $execution['body']['response']); // tests unknown utf-8 chars $this->assertLessThan(1.500, $execution['body']['duration']); @@ -1035,8 +1114,9 @@ class FunctionsCustomServerTest extends Scope */ $execution = $this->getExecution($data['functionId'], $data['executionId']); - $this->assertEquals($execution['headers']['status-code'], 200); - $this->assertEquals($execution['body']['$id'], $data['executionId']); + $this->assertEquals(200, $execution['headers']['status-code']); + $this->assertEquals($data['executionId'], $execution['body']['$id']); + $this->assertEquals($data['deploymentId'], $execution['body']['deploymentId']); /** * Test for FAILURE @@ -1120,8 +1200,8 @@ class FunctionsCustomServerTest extends Scope 'users.*.update.email', ], 'timeout' => 15, - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'specification' => Specification::S_1VCPU_1GB, ]); @@ -1137,6 +1217,12 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(1, $output['APPWRITE_FUNCTION_CPUS']); $this->assertEquals(1024, $output['APPWRITE_FUNCTION_MEMORY']); + // Test execution ID and client IP + $executionId = $execution['body']['$id'] ?? ''; + $this->assertNotEmpty($output['APPWRITE_FUNCTION_EXECUTION_ID']); + $this->assertEquals($executionId, $output['APPWRITE_FUNCTION_EXECUTION_ID']); + $this->assertNotEmpty($output['APPWRITE_FUNCTION_CLIENT_IP']); + // Change the specs to 1vcpu 512mb $function = $this->client->call(Client::METHOD_PUT, '/functions/' . $data['functionId'], array_merge([ 'content-type' => 'application/json', @@ -1148,8 +1234,8 @@ class FunctionsCustomServerTest extends Scope 'users.*.update.email', ], 'timeout' => 15, - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'specification' => Specification::S_1VCPU_512MB, ]); @@ -1178,8 +1264,8 @@ class FunctionsCustomServerTest extends Scope 'users.*.update.email', ], 'timeout' => 15, - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'specification' => 's-2vcpu-512mb', // Invalid specification ]); @@ -1236,9 +1322,9 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test php-8.0', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test timeout execution', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [], 'schedule' => '', 'timeout' => 5, // Should timeout after 5 seconds @@ -1280,12 +1366,12 @@ class FunctionsCustomServerTest extends Scope */ public function provideCustomExecutions(): array { + // Most disabled to keep tests fast return [ - ['folder' => 'php-fn', 'name' => 'php-8.0', 'entrypoint' => 'index.php', 'runtimeName' => 'PHP', 'runtimeVersion' => '8.0'], - ['folder' => 'node', 'name' => 'node-18.0', 'entrypoint' => 'index.js', 'runtimeName' => 'Node.js', 'runtimeVersion' => '18.0'], - ['folder' => 'python', 'name' => 'python-3.9', 'entrypoint' => 'main.py', 'runtimeName' => 'Python', 'runtimeVersion' => '3.9'], - ['folder' => 'ruby', 'name' => 'ruby-3.1', 'entrypoint' => 'main.rb', 'runtimeName' => 'Ruby', 'runtimeVersion' => '3.1'], - // Swift and Dart disabled on purpose, as it's very slow. + // ['folder' => 'php-fn', 'name' => 'php-8.0', 'entrypoint' => 'index.php', 'runtimeName' => 'PHP', 'runtimeVersion' => '8.0'], + ['folder' => 'node', 'name' => 'node-22', 'entrypoint' => 'index.js', 'runtimeName' => 'Node.js', 'runtimeVersion' => '22'], + // ['folder' => 'python', 'name' => 'python-3.9', 'entrypoint' => 'main.py', 'runtimeName' => 'Python', 'runtimeVersion' => '3.9'], + // ['folder' => 'ruby', 'name' => 'ruby-3.1', 'entrypoint' => 'main.rb', 'runtimeName' => 'Ruby', 'runtimeVersion' => '3.1'], // [ 'folder' => 'dart', 'name' => 'dart-2.15', 'entrypoint' => 'main.dart', 'runtimeName' => 'Dart', 'runtimeVersion' => '2.15' ], // [ 'folder' => 'swift', 'name' => 'swift-5.5', 'entrypoint' => 'index.swift', 'runtimeName' => 'Swift', 'runtimeVersion' => '5.5' ], ]; @@ -1324,27 +1410,14 @@ class FunctionsCustomServerTest extends Scope ]); $execution = $this->createExecution($functionId, [ - 'body' => 'foobar', 'async' => 'false' ]); $output = json_decode($execution['body']['responseBody'], true); $this->assertEquals(201, $execution['headers']['status-code']); - $this->assertEquals('completed', $execution['body']['status']); $this->assertEquals(200, $execution['body']['responseStatusCode']); - $this->assertEquals($functionId, $output['APPWRITE_FUNCTION_ID']); - $this->assertEquals('Test ' . $name, $output['APPWRITE_FUNCTION_NAME']); - $this->assertEquals($deploymentId, $output['APPWRITE_FUNCTION_DEPLOYMENT']); - $this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']); - $this->assertEquals($runtimeName, $output['APPWRITE_FUNCTION_RUNTIME_NAME']); - $this->assertEquals($runtimeVersion, $output['APPWRITE_FUNCTION_RUNTIME_VERSION']); - $this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']); - $this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']); - $this->assertEquals('variable', $output['CUSTOM_VARIABLE']); - $this->assertEmpty($output['APPWRITE_FUNCTION_USER_ID']); - $this->assertEmpty($output['APPWRITE_FUNCTION_JWT']); - $this->assertEquals($this->getProject()['$id'], $output['APPWRITE_FUNCTION_PROJECT_ID']); - $this->assertStringContainsString('Amazing Function Log', $execution['body']['logs']); + $this->assertEquals('OK', $execution['body']['responseBody']); + $this->assertEmpty($execution['body']['logs']); $this->assertEmpty($execution['body']['errors']); $executionId = $execution['body']['$id'] ?? ''; @@ -1357,7 +1430,8 @@ class FunctionsCustomServerTest extends Scope $this->assertCount(1, $executions['body']['executions']); $this->assertEquals($executions['body']['executions'][0]['$id'], $executionId); $this->assertEquals($executions['body']['executions'][0]['trigger'], 'http'); - $this->assertStringContainsString('Amazing Function Log', $executions['body']['executions'][0]['logs']); + $this->assertEquals(200, $executions['body']['executions'][0]['responseStatusCode']); + $this->assertEmpty($executions['body']['executions'][0]['responseBody']); $this->cleanupFunction($functionId); } @@ -1366,15 +1440,14 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Binary executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Binary executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-binary-response'), + 'code' => $this->packageFunction('binary-response'), 'activate' => true ]); @@ -1415,15 +1488,14 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Binary executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Binary executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-binary-request'), + 'code' => $this->packageFunction('binary-request'), 'activate' => true ]); @@ -1461,49 +1533,6 @@ class FunctionsCustomServerTest extends Scope $this->cleanupFunction($functionId); } - public function testv2Function() - { - $functionId = $this->setupFunction([ - 'functionId' => ID::unique(), - 'name' => 'Test PHP V2', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', - 'events' => [], - 'timeout' => 15, - ]); - - $variable = $this->client->call(Client::METHOD_PATCH, '/mock/functions-v2', [ - 'content-type' => 'application/json', - 'origin' => 'http://localhost', - 'cookie' => 'a_session_console=' . $this->getRoot()['session'], - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-mode' => 'admin', - ], [ - 'functionId' => $functionId - ]); - $this->assertEquals(204, $variable['headers']['status-code']); - - $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-v2'), - 'activate' => true - ]); - - $execution = $this->createExecution($functionId, [ - 'body' => 'foobar', - 'async' => 'false' - ]); - - $this->assertEquals(201, $execution['headers']['status-code']); - $this->assertEquals('completed', $execution['body']['status']); - $this->assertEquals(200, $execution['body']['responseStatusCode']); - - $output = json_decode($execution['body']['responseBody'], true); - $this->assertEquals(true, $output['v2Woks']); - - $this->cleanupFunction($functionId); - } - public function testGetRuntimes() { $runtimes = $this->client->call(Client::METHOD_GET, '/functions/runtimes', array_merge([ @@ -1531,17 +1560,16 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Event executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Event executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', ], 'timeout' => 15, ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-event'), + 'code' => $this->packageFunction('event-handler'), 'activate' => true ]); @@ -1567,7 +1595,10 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(204, $lastExecution['responseStatusCode']); $this->assertStringContainsString($userId, $lastExecution['logs']); $this->assertStringContainsString('Event User', $lastExecution['logs']); - }, 10000, 500); + $this->assertNotEmpty($lastExecution['$id']); + $headers = array_column($lastExecution['requestHeaders'] ?? [], 'value', 'name'); + $this->assertEmpty($headers['x-appwrite-client-ip'] ?? ''); + }, 20_000, 500); $this->cleanupFunction($functionId); @@ -1584,17 +1615,16 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Scopes executions', - 'commands' => 'bash setup.sh && composer install', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Scopes executions', + 'commands' => 'bash setup.sh && npm install', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'scopes' => ['users.read'], 'timeout' => 15, ]); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-scopes'), + 'code' => $this->packageFunction('dynamic-api-key'), 'activate' => true, ]); @@ -1643,16 +1673,15 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Cookie executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Cookie executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, ]); $this->assertNotEmpty($functionId); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-cookie'), + 'code' => $this->packageFunction('cookies'), 'activate' => true ]); $this->assertNotEmpty($deploymentId); @@ -1685,9 +1714,9 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Cookie executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Cookie executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); @@ -1695,8 +1724,7 @@ class FunctionsCustomServerTest extends Scope $domain = $this->setupFunctionDomain($functionId); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-cookie'), + 'code' => $this->packageFunction('cookies'), 'activate' => true ]); @@ -1714,6 +1742,9 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals($cookie, $response['body']); + $this->assertArrayHasKey('x-appwrite-execution-id', $response['headers']); + $this->assertNotEmpty($response['headers']['x-appwrite-execution-id']); + // Async execution document creation $this->assertEventually(function () use ($functionId) { $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions', array_merge([ @@ -1743,9 +1774,9 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Binary executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Binary executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); @@ -1753,8 +1784,7 @@ class FunctionsCustomServerTest extends Scope $domain = $this->setupFunctionDomain($functionId); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-binary-response'), + 'code' => $this->packageFunction('binary-response'), 'activate' => true ]); @@ -1778,9 +1808,9 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Binary executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Binary executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); @@ -1788,8 +1818,7 @@ class FunctionsCustomServerTest extends Scope $domain = $this->setupFunctionDomain($functionId); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-binary-request'), + 'code' => $this->packageFunction('binary-request'), 'activate' => true ]); @@ -1816,8 +1845,8 @@ class FunctionsCustomServerTest extends Scope ], $this->getHeaders()), [ 'functionId' => ID::unique(), 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, ]); @@ -1851,8 +1880,8 @@ class FunctionsCustomServerTest extends Scope $function1Id = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); @@ -1860,8 +1889,8 @@ class FunctionsCustomServerTest extends Scope $function2Id = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test2', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); @@ -1892,7 +1921,7 @@ class FunctionsCustomServerTest extends Scope { $function = $this->createFunction([ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Logging Test', 'entrypoint' => 'index.js', 'logging' => false, @@ -1908,7 +1937,7 @@ class FunctionsCustomServerTest extends Scope $domain = $this->setupFunctionDomain($functionId); $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -1985,7 +2014,7 @@ class FunctionsCustomServerTest extends Scope // Check if the function specifications are correctly set in builds $function = $this->createFunction([ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Specification Test', 'entrypoint' => 'index.js', 'logging' => false, @@ -2001,7 +2030,7 @@ class FunctionsCustomServerTest extends Scope $functionId = $functionId = $function['body']['$id'] ?? ''; $deploymentId = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -2027,7 +2056,7 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Duplicate Deployment Test', 'entrypoint' => 'index.js', 'commands' => '' @@ -2035,7 +2064,7 @@ class FunctionsCustomServerTest extends Scope $this->assertNotEmpty($functionId); $deploymentId1 = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); $this->assertNotEmpty($deploymentId1); @@ -2045,7 +2074,7 @@ class FunctionsCustomServerTest extends Scope $this->assertStringContainsString('APPWRITE_FUNCTION_ID', $execution['body']['responseBody']); $function = $this->updateFunction($functionId, [ - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Duplicate Deployment Test', 'entrypoint' => 'index.js', 'commands' => 'rm index.js && mv maintenance.js index.js' @@ -2089,13 +2118,12 @@ class FunctionsCustomServerTest extends Scope $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'runtime' => 'php-8.0', + 'runtime' => 'node-22', 'name' => 'Re-activate Test', - 'entrypoint' => 'index.php', + 'entrypoint' => 'index.js', ]); $this->assertNotEmpty($functionId); - $function = $this->getFunction($functionId); $this->assertEquals(200, $function['headers']['status-code']); $this->assertArrayHasKey('latestDeploymentId', $function['body']); @@ -2106,7 +2134,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEmpty($function['body']['latestDeploymentStatus']); $deploymentId1 = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('php-cookie'), + 'code' => $this->packageFunction('cookies'), 'activate' => true ]); $this->assertNotEmpty($deploymentId1); @@ -2124,7 +2152,7 @@ class FunctionsCustomServerTest extends Scope $this->assertStringContainsString('cookieValue', $execution['body']['responseBody']); $deploymentId2 = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); $this->assertNotEmpty($deploymentId2); @@ -2192,8 +2220,8 @@ class FunctionsCustomServerTest extends Scope $functionId = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test Error Pages', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'commands' => 'cd non-existing-directory', 'execute' => ['any'] @@ -2203,8 +2231,7 @@ class FunctionsCustomServerTest extends Scope $proxyClient->setEndpoint('http://' . $domain); $deployment = $this->createDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -2221,8 +2248,7 @@ class FunctionsCustomServerTest extends Scope // canceled deployment $deployment = $this->createDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -2250,8 +2276,8 @@ class FunctionsCustomServerTest extends Scope $functionId = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test Error Pages', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'commands' => '', 'execute' => ['users'] @@ -2262,7 +2288,7 @@ class FunctionsCustomServerTest extends Scope $proxyClient->setEndpoint('http://' . $domain); $deploymentId = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); $this->assertNotEmpty($deploymentId); @@ -2284,8 +2310,8 @@ class FunctionsCustomServerTest extends Scope $functionId = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test Error Pages', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'commands' => '', 'execute' => ['any'] @@ -2296,7 +2322,7 @@ class FunctionsCustomServerTest extends Scope $proxyClient->setEndpoint('http://' . $domain); $deploymentId = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); $this->assertNotEmpty($deploymentId); @@ -2349,4 +2375,45 @@ class FunctionsCustomServerTest extends Scope $this->cleanupFunction($functionId); } + + public function testLogAndErrorTruncation(): void + { + $functionId = $this->setupFunction([ + 'functionId' => ID::unique(), + 'name' => 'Test Log Truncation', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', + 'timeout' => 15, + ]); + + $this->setupDeployment($functionId, [ + 'code' => $this->packageFunction('log-error-truncation'), + 'activate' => true + ]); + + $execution = $this->createExecution($functionId, [ + 'async' => 'false' + ]); + + $this->assertEquals(201, $execution['headers']['status-code']); + $this->assertEquals(200, $execution['body']['responseStatusCode']); + + // Verify logs are truncated and warning message is present at the beginning + $logs = $execution['body']['logs']; + $this->assertLessThanOrEqual(APP_FUNCTION_LOG_LENGTH_LIMIT, strlen($logs)); + $this->assertStringStartsWith('[WARNING] Logs truncated', $logs); + + $this->assertStringNotContainsString('z', $logs); + $this->assertStringContainsString('a', $logs); + + // Verify errors are truncated and warning message is present at the beginning + $errors = $execution['body']['errors']; + $this->assertLessThanOrEqual(APP_FUNCTION_ERROR_LENGTH_LIMIT, strlen($errors)); + $this->assertStringStartsWith('[WARNING] Errors truncated', $errors); + + $this->assertStringNotContainsString('z', $errors); + $this->assertStringContainsString('a', $errors); + + $this->cleanupFunction($functionId); + } } diff --git a/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php b/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php index 4f4b0c960d..c9ec978cba 100644 --- a/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php +++ b/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php @@ -25,8 +25,8 @@ class FunctionsScheduleTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', 'users.*.delete', @@ -36,8 +36,7 @@ class FunctionsScheduleTest extends Scope ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -63,6 +62,9 @@ class FunctionsScheduleTest extends Scope $this->assertNotEmpty($asyncExecution['logs']); $this->assertNotEmpty($asyncExecution['errors']); $this->assertGreaterThan(0, $asyncExecution['duration']); + $this->assertNotEmpty($asyncExecution['$id']); + $headers = array_column($asyncExecution['requestHeaders'] ?? [], 'value', 'name'); + $this->assertEmpty($headers['x-appwrite-client-ip'] ?? ''); }, 60000, 500); $this->cleanupFunction($functionId); @@ -77,14 +79,13 @@ class FunctionsScheduleTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, 'logging' => true, ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -120,7 +121,9 @@ class FunctionsScheduleTest extends Scope $this->assertEquals('scheduled', $execution['body']['status']); $this->assertEquals('PATCH', $execution['body']['requestMethod']); $this->assertEquals('/custom-path', $execution['body']['requestPath']); - $this->assertCount(0, $execution['body']['requestHeaders']); + $this->assertCount(1, $execution['body']['requestHeaders']); + $this->assertEquals('x-appwrite-client-ip', $execution['body']['requestHeaders'][0]['name']); + $this->assertNotEmpty($execution['body']['requestHeaders'][0]['value']); \sleep(120); @@ -179,15 +182,14 @@ class FunctionsScheduleTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, 'logging' => true, ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); diff --git a/tests/e2e/Services/GraphQL/AccountTest.php b/tests/e2e/Services/GraphQL/AccountTest.php index c17b8a5c24..9dd224f1a1 100644 --- a/tests/e2e/Services/GraphQL/AccountTest.php +++ b/tests/e2e/Services/GraphQL/AccountTest.php @@ -17,7 +17,7 @@ class AccountTest extends Scope public function testCreateAccount(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_ACCOUNT); + $query = $this->getQuery(self::CREATE_ACCOUNT); $email = 'test' . \rand() . '@test.com'; $graphQLPayload = [ 'query' => $query, @@ -45,7 +45,7 @@ class AccountTest extends Scope public function testCreateAccountSession() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_ACCOUNT_SESSION); + $query = $this->getQuery(self::CREATE_ACCOUNT_SESSION); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -70,7 +70,7 @@ class AccountTest extends Scope public function testCreateMagicURLSession(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_MAGIC_URL); + $query = $this->getQuery(self::CREATE_MAGIC_URL); $email = 'test' . \rand() . '@test.com'; $graphQLPayload = [ 'query' => $query, @@ -95,7 +95,7 @@ class AccountTest extends Scope public function testCreateEmailVerification(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_EMAIL_VERIFICATION); + $query = $this->getQuery(self::CREATE_EMAIL_VERIFICATION); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -124,7 +124,7 @@ class AccountTest extends Scope { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_PHONE_VERIFICATION); + $query = $this->getQuery(self::CREATE_PHONE_VERIFICATION); $graphQLPayload = [ 'query' => $query, ]; @@ -144,7 +144,7 @@ class AccountTest extends Scope public function testCreatePasswordRecovery(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_PASSWORD_RECOVERY); + $query = $this->getQuery(self::CREATE_PASSWORD_RECOVERY); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -168,7 +168,7 @@ class AccountTest extends Scope public function testCreateAnonymousSession(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_ANONYMOUS_SESSION); + $query = $this->getQuery(self::CREATE_ANONYMOUS_SESSION); $graphQLPayload = [ 'query' => $query, ]; @@ -188,7 +188,7 @@ class AccountTest extends Scope public function testCreateAccountJWT(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_ACCOUNT_JWT); + $query = $this->getQuery(self::CREATE_ACCOUNT_JWT); $graphQLPayload = [ 'query' => $query, ]; @@ -207,7 +207,7 @@ class AccountTest extends Scope public function testGetAccount(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_ACCOUNT); + $query = $this->getQuery(self::GET_ACCOUNT); $graphQLPayload = [ 'query' => $query, ]; @@ -230,7 +230,7 @@ class AccountTest extends Scope public function testGetAccountPreferences(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_ACCOUNT_PREFS); + $query = $this->getQuery(self::GET_ACCOUNT_PREFS); $graphQLPayload = [ 'query' => $query, ]; @@ -250,7 +250,7 @@ class AccountTest extends Scope public function testGetAccountSessions(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_ACCOUNT_SESSIONS); + $query = $this->getQuery(self::GET_ACCOUNT_SESSIONS); $graphQLPayload = [ 'query' => $query, ]; @@ -270,7 +270,7 @@ class AccountTest extends Scope public function testGetAccountSession(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_ACCOUNT_SESSION); + $query = $this->getQuery(self::GET_ACCOUNT_SESSION); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -294,7 +294,7 @@ class AccountTest extends Scope public function testGetAccountLogs(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_ACCOUNT_LOGS); + $query = $this->getQuery(self::GET_ACCOUNT_LOGS); $graphQLPayload = [ 'query' => $query, ]; @@ -314,7 +314,7 @@ class AccountTest extends Scope public function testUpdateAccountName(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_ACCOUNT_NAME); + $query = $this->getQuery(self::UPDATE_ACCOUNT_NAME); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -338,7 +338,7 @@ class AccountTest extends Scope public function testUpdateAccountEmail(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_ACCOUNT_EMAIL); + $query = $this->getQuery(self::UPDATE_ACCOUNT_EMAIL); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -363,7 +363,7 @@ class AccountTest extends Scope public function testUpdateAccountPassword(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_ACCOUNT_PASSWORD); + $query = $this->getQuery(self::UPDATE_ACCOUNT_PASSWORD); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -387,7 +387,7 @@ class AccountTest extends Scope public function testUpdateAccountPhone(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_ACCOUNT_PHONE); + $query = $this->getQuery(self::UPDATE_ACCOUNT_PHONE); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -412,7 +412,7 @@ class AccountTest extends Scope public function testUpdateAccountStatus(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_ACCOUNT_STATUS); + $query = $this->getQuery(self::UPDATE_ACCOUNT_STATUS); $graphQLPayload = [ 'query' => $query, ]; @@ -436,7 +436,7 @@ class AccountTest extends Scope public function testUpdateAccountPrefs(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_ACCOUNT_PREFS); + $query = $this->getQuery(self::UPDATE_ACCOUNT_PREFS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -462,7 +462,7 @@ class AccountTest extends Scope public function testDeleteAccountSessions(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_ACCOUNT_SESSIONS); + $query = $this->getQuery(self::DELETE_ACCOUNT_SESSIONS); $graphQLPayload = [ 'query' => $query ]; @@ -484,7 +484,7 @@ class AccountTest extends Scope public function testDeleteAccountSession(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_ACCOUNT_SESSION); + $query = $this->getQuery(self::DELETE_ACCOUNT_SESSION); $graphQLPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/GraphQL/AvatarsTest.php b/tests/e2e/Services/GraphQL/AvatarsTest.php index e3aaa2ce80..4c33aedcd7 100644 --- a/tests/e2e/Services/GraphQL/AvatarsTest.php +++ b/tests/e2e/Services/GraphQL/AvatarsTest.php @@ -16,7 +16,7 @@ class AvatarsTest extends Scope public function testGetCreditCardIcon() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_CREDIT_CARD_ICON); + $query = $this->getQuery(self::GET_CREDIT_CARD_ICON); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -29,7 +29,9 @@ class AvatarsTest extends Scope 'x-appwrite-project' => $projectId, ], $this->getHeaders()), $graphQLPayload); - $this->assertEquals(18546, \strlen($creditCardIcon['body'])); + $this->assertEquals(200, $creditCardIcon['headers']['status-code']); + $this->assertNotEmpty($creditCardIcon['body']); + $this->assertStringContainsString('image/', $creditCardIcon['headers']['content-type']); return $creditCardIcon['body']; } @@ -37,7 +39,7 @@ class AvatarsTest extends Scope public function testGetBrowserIcon() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_BROWSER_ICON); + $query = $this->getQuery(self::GET_BROWSER_ICON); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -50,7 +52,9 @@ class AvatarsTest extends Scope 'x-appwrite-project' => $projectId, ], $this->getHeaders()), $graphQLPayload); - $this->assertEquals(13312, \strlen($browserIcon['body'])); + $this->assertEquals(200, $browserIcon['headers']['status-code']); + $this->assertNotEmpty($browserIcon['body']); + $this->assertStringContainsString('image/', $browserIcon['headers']['content-type']); return $browserIcon['body']; } @@ -58,7 +62,7 @@ class AvatarsTest extends Scope public function testGetCountryFlag() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_COUNTRY_FLAG); + $query = $this->getQuery(self::GET_COUNTRY_FLAG); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -71,7 +75,9 @@ class AvatarsTest extends Scope 'x-appwrite-project' => $projectId, ], $this->getHeaders()), $graphQLPayload); - $this->assertEquals(8814, \strlen($countryFlag['body'])); + $this->assertEquals(200, $countryFlag['headers']['status-code']); + $this->assertNotEmpty($countryFlag['body']); + $this->assertStringContainsString('image/', $countryFlag['headers']['content-type']); return $countryFlag['body']; } @@ -79,7 +85,7 @@ class AvatarsTest extends Scope public function testGetImageFromURL() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_IMAGE_FROM_URL); + $query = $this->getQuery(self::GET_IMAGE_FROM_URL); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -92,7 +98,9 @@ class AvatarsTest extends Scope 'x-appwrite-project' => $projectId, ], $this->getHeaders()), $graphQLPayload); - $this->assertEquals(52585, \strlen($image['body'])); + $this->assertEquals(200, $image['headers']['status-code']); + $this->assertNotEmpty($image['body']); + $this->assertStringContainsString('image/', $image['headers']['content-type']); return $image['body']; } @@ -100,7 +108,7 @@ class AvatarsTest extends Scope public function testGetFavicon() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FAVICON); + $query = $this->getQuery(self::GET_FAVICON); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -113,7 +121,9 @@ class AvatarsTest extends Scope 'x-appwrite-project' => $projectId, ], $this->getHeaders()), $graphQLPayload); - $this->assertEquals(5430, \strlen($favicon['body'])); + $this->assertEquals(200, $favicon['headers']['status-code']); + $this->assertNotEmpty($favicon['body']); + $this->assertStringContainsString('image/', $favicon['headers']['content-type']); return $favicon['body']; } @@ -121,7 +131,7 @@ class AvatarsTest extends Scope public function testGetQRCode() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_QRCODE); + $query = $this->getQuery(self::GET_QRCODE); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -134,7 +144,9 @@ class AvatarsTest extends Scope 'x-appwrite-project' => $projectId, ], $this->getHeaders()), $graphQLPayload); - $this->assertEquals(9169, \strlen($qrCode['body'])); + $this->assertEquals(200, $qrCode['headers']['status-code']); + $this->assertNotEmpty($qrCode['body']); + $this->assertStringContainsString('image/', $qrCode['headers']['content-type']); return $qrCode['body']; } @@ -142,7 +154,7 @@ class AvatarsTest extends Scope public function testGetInitials() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_USER_INITIALS); + $query = $this->getQuery(self::GET_USER_INITIALS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -155,7 +167,9 @@ class AvatarsTest extends Scope 'x-appwrite-project' => $projectId, ], $this->getHeaders()), $graphQLPayload); - $this->assertEquals(5025, \strlen($initials['body'])); + $this->assertEquals(200, $initials['headers']['status-code']); + $this->assertNotEmpty($initials['body']); + $this->assertStringContainsString('image/', $initials['headers']['content-type']); return $initials['body']; } diff --git a/tests/e2e/Services/GraphQL/Base.php b/tests/e2e/Services/GraphQL/Base.php index 121d40156e..9f5a93dd00 100644 --- a/tests/e2e/Services/GraphQL/Base.php +++ b/tests/e2e/Services/GraphQL/Base.php @@ -8,257 +8,342 @@ use Utopia\CLI\Console; trait Base { // Databases - public static string $CREATE_DATABASE = 'create_database'; - public static string $GET_DATABASES = 'get_databases'; - public static string $GET_DATABASE = 'get_database'; - public static string $UPDATE_DATABASE = 'update_database'; - public static string $DELETE_DATABASE = 'delete_database'; + public const string CREATE_DATABASE = 'create_database'; + public const string GET_DATABASES = 'get_databases'; + public const string GET_DATABASE = 'get_database'; + public const string UPDATE_DATABASE = 'update_database'; + public const string DELETE_DATABASE = 'delete_database'; + // Collections - public static string $CREATE_COLLECTION = 'create_collection'; - public static string $GET_COLLECTION = 'get_collection'; - public static string $GET_COLLECTIONS = 'list_collections'; - public static string $UPDATE_COLLECTION = 'update_collection'; - public static string $DELETE_COLLECTION = 'delete_collection'; + public const string CREATE_COLLECTION = 'create_collection'; + public const string GET_COLLECTION = 'get_collection'; + public const string GET_COLLECTIONS = 'list_collections'; + public const string UPDATE_COLLECTION = 'update_collection'; + public const string DELETE_COLLECTION = 'delete_collection'; + + // Grid databases + public const string TABLESDB_CREATE_DATABASE = 'tablesdb_create_database'; + public const string TABLESDB_GET_DATABASES = 'tablesdb_get_databases'; + public const string TABLESDB_GET_DATABASE = 'tablesdb_get_database'; + public const string TABLESDB_UPDATE_DATABASE = 'tablesdb_update_database'; + public const string TABLESDB_DELETE_DATABASE = 'tablesdb_delete_database'; + + // Grid tables + public const string CREATE_TABLE = 'create_table'; + public const string GET_TABLE = 'get_table'; + public const string GET_TABLES = 'list_tables'; + public const string UPDATE_TABLE = 'update_table'; + public const string DELETE_TABLE = 'delete_table'; + // Attributes - public static string $CREATE_STRING_ATTRIBUTE = 'create_string_attribute'; - public static string $CREATE_INTEGER_ATTRIBUTE = 'create_integer_attribute'; - public static string $CREATE_FLOAT_ATTRIBUTE = 'create_float_attribute'; - public static string $CREATE_BOOLEAN_ATTRIBUTE = 'create_boolean_attribute'; - public static string $CREATE_URL_ATTRIBUTE = 'create_url_attribute'; - public static string $CREATE_EMAIL_ATTRIBUTE = 'create_email_attribute'; - public static string $CREATE_IP_ATTRIBUTE = 'create_ip_attribute'; - public static string $CREATE_ENUM_ATTRIBUTE = 'create_enum_attribute'; - public static string $CREATE_DATETIME_ATTRIBUTE = 'create_datetime_attribute'; + public const string CREATE_STRING_ATTRIBUTE = 'create_string_attribute'; + public const string CREATE_INTEGER_ATTRIBUTE = 'create_integer_attribute'; + public const string CREATE_FLOAT_ATTRIBUTE = 'create_float_attribute'; + public const string CREATE_BOOLEAN_ATTRIBUTE = 'create_boolean_attribute'; + public const string CREATE_URL_ATTRIBUTE = 'create_url_attribute'; + public const string CREATE_EMAIL_ATTRIBUTE = 'create_email_attribute'; + public const string CREATE_IP_ATTRIBUTE = 'create_ip_attribute'; + public const string CREATE_ENUM_ATTRIBUTE = 'create_enum_attribute'; + public const string CREATE_DATETIME_ATTRIBUTE = 'create_datetime_attribute'; + public const string CREATE_POINT_ATTRIBUTE = 'create_point_attribute'; + public const string CREATE_LINE_ATTRIBUTE = 'create_line_attribute'; + public const string CREATE_POLYGON_ATTRIBUTE = 'create_polygon_attribute'; - public static string $CREATE_RELATIONSHIP_ATTRIBUTE = 'create_relationship_attribute'; - public static string $UPDATE_STRING_ATTRIBUTE = 'update_string_attribute'; - public static string $UPDATE_INTEGER_ATTRIBUTE = 'update_integer_attribute'; - public static string $UPDATE_FLOAT_ATTRIBUTE = 'update_float_attribute'; - public static string $UPDATE_BOOLEAN_ATTRIBUTE = 'update_boolean_attribute'; - public static string $UPDATE_URL_ATTRIBUTE = 'update_url_attribute'; - public static string $UPDATE_EMAIL_ATTRIBUTE = 'update_email_attribute'; - public static string $UPDATE_IP_ATTRIBUTE = 'update_ip_attribute'; - public static string $UPDATE_ENUM_ATTRIBUTE = 'update_enum_attribute'; - public static string $UPDATE_DATETIME_ATTRIBUTE = 'update_datetime_attribute'; + public const string CREATE_RELATIONSHIP_ATTRIBUTE = 'create_relationship_attribute'; + public const string UPDATE_STRING_ATTRIBUTE = 'update_string_attribute'; + public const string UPDATE_INTEGER_ATTRIBUTE = 'update_integer_attribute'; + public const string UPDATE_FLOAT_ATTRIBUTE = 'update_float_attribute'; + public const string UPDATE_BOOLEAN_ATTRIBUTE = 'update_boolean_attribute'; + public const string UPDATE_URL_ATTRIBUTE = 'update_url_attribute'; + public const string UPDATE_EMAIL_ATTRIBUTE = 'update_email_attribute'; + public const string UPDATE_IP_ATTRIBUTE = 'update_ip_attribute'; + public const string UPDATE_ENUM_ATTRIBUTE = 'update_enum_attribute'; + public const string UPDATE_DATETIME_ATTRIBUTE = 'update_datetime_attribute'; + public const string UPDATE_POINT_ATTRIBUTE = 'update_point_attribute'; + public const string UPDATE_LINE_ATTRIBUTE = 'update_line_attribute'; + public const string UPDATE_POLYGON_ATTRIBUTE = 'update_polygon_attribute'; + + public const string UPDATE_RELATIONSHIP_ATTRIBUTE = 'update_relationship_attribute'; + public const string GET_ATTRIBUTES = 'get_attributes'; + public const string GET_ATTRIBUTE = 'get_attribute'; + public const string DELETE_ATTRIBUTE = 'delete_attribute'; + + // TablesDB columns + public const string CREATE_STRING_COLUMN = 'create_string_column'; + public const string CREATE_INTEGER_COLUMN = 'create_integer_column'; + public const string CREATE_FLOAT_COLUMN = 'create_float_column'; + public const string CREATE_BOOLEAN_COLUMN = 'create_boolean_column'; + public const string CREATE_URL_COLUMN = 'create_url_column'; + public const string CREATE_EMAIL_COLUMN = 'create_email_column'; + public const string CREATE_IP_COLUMN = 'create_ip_column'; + public const string CREATE_ENUM_COLUMN = 'create_enum_column'; + public const string CREATE_DATETIME_COLUMN = 'create_datetime_column'; + public const string CREATE_POINT_COLUMN = 'create_point_column'; + public const string CREATE_LINE_COLUMN = 'create_line_column'; + public const string CREATE_POLYGON_COLUMN = 'create_polygon_column'; + + public const string CREATE_RELATIONSHIP_COLUMN = 'create_relationship_column'; + public const string UPDATE_STRING_COLUMN = 'update_string_column'; + public const string UPDATE_INTEGER_COLUMN = 'update_integer_column'; + public const string UPDATE_FLOAT_COLUMN = 'update_float_column'; + public const string UPDATE_BOOLEAN_COLUMN = 'update_boolean_column'; + public const string UPDATE_URL_COLUMN = 'update_url_column'; + public const string UPDATE_EMAIL_COLUMN = 'update_email_column'; + public const string UPDATE_IP_COLUMN = 'update_ip_column'; + public const string UPDATE_ENUM_COLUMN = 'update_enum_column'; + public const string UPDATE_DATETIME_COLUMN = 'update_datetime_column'; + public const string UPDATE_POINT_COLUMN = 'update_point_column'; + public const string UPDATE_LINE_COLUMN = 'update_line_column'; + public const string UPDATE_POLYGON_COLUMN = 'update_polygon_column'; + + public const string UPDATE_RELATIONSHIP_COLUMN = 'update_relationship_column'; + public const string GET_COLUMNS = 'get_columns'; + public const string GET_COLUMN = 'get_column'; + public const string DELETE_COLUMN = 'delete_column'; + + // Attribute Indexes + public const string CREATE_INDEX = 'create_attribute_index'; + public const string GET_INDEXES = 'get_attribute_indexes'; + public const string GET_INDEX = 'get_attribute_index'; + public const string DELETE_INDEX = 'delete_attribute_index'; + + // Grid column indexes + public const string CREATE_COLUMN_INDEX = 'create_column_index'; + public const string GET_COLUMN_INDEXES = 'get_column_indexes'; + public const string GET_COLUMN_INDEX = 'get_column_index'; + public const string DELETE_COLUMN_INDEX = 'delete_column_index'; - public static string $UPDATE_RELATIONSHIP_ATTRIBUTE = 'update_relationship_attribute'; - public static string $GET_ATTRIBUTES = 'get_attributes'; - public static string $GET_ATTRIBUTE = 'get_attribute'; - public static string $DELETE_ATTRIBUTE = 'delete_attribute'; - // Indexes - public static string $CREATE_INDEX = 'create_index'; - public static string $GET_INDEXES = 'get_indexes'; - public static string $GET_INDEX = 'get_index'; - public static string $DELETE_INDEX = 'delete_index'; // Documents - public static string $CREATE_DOCUMENT = 'create_document_rest'; - public static string $GET_DOCUMENTS = 'list_documents'; - public static string $GET_DOCUMENT = 'get_document'; - public static string $UPDATE_DOCUMENT = 'update_document'; - public static string $DELETE_DOCUMENT = 'delete_document'; + public const string CREATE_DOCUMENT = 'create_document_rest'; + public const string GET_DOCUMENTS = 'list_documents'; + public const string GET_DOCUMENT = 'get_document'; + public const string UPDATE_DOCUMENT = 'update_document'; + public const string UPSERT_DOCUMENT = 'upsert_document'; + public const string DELETE_DOCUMENT = 'delete_document'; + + // Documents - Bulk APIs + public const string CREATE_DOCUMENTS = 'create_documents_rest'; + public const string UPDATE_DOCUMENTS = 'update_documents'; + public const string UPSERT_DOCUMENTS = 'upsert_documents'; + public const string DELETE_DOCUMENTS = 'delete_documents'; + + // Grid rows + public const string CREATE_ROW = 'create_row_rest'; + public const string GET_ROWS = 'list_rows'; + public const string GET_ROW = 'get_row'; + public const string UPDATE_ROW = 'update_row'; + public const string UPSERT_ROW = 'upsert_row'; + public const string DELETE_ROW = 'delete_row'; + + // Grid rows - Bulk APIs + public const string CREATE_ROWS = 'create_rows_rest'; + public const string UPDATE_ROWS = 'update_rows'; + public const string UPSERT_ROWS = 'upsert_rows'; + public const string DELETE_ROWS = 'delete_rows'; // Custom Entities - public static string $CREATE_CUSTOM_ENTITY = 'create_custom_entity'; - public static string $GET_CUSTOM_ENTITIES = 'get_custom_entities'; - public static string $GET_CUSTOM_ENTITY = 'get_custom_entity'; - public static string $UPDATE_CUSTOM_ENTITY = 'update_custom_entity'; - public static string $DELETE_CUSTOM_ENTITY = 'delete_custom_entity'; + public const string CREATE_CUSTOM_ENTITY = 'create_custom_entity'; + public const string GET_CUSTOM_ENTITIES = 'get_custom_entities'; + public const string GET_CUSTOM_ENTITY = 'get_custom_entity'; + public const string UPDATE_CUSTOM_ENTITY = 'update_custom_entity'; + public const string DELETE_CUSTOM_ENTITY = 'delete_custom_entity'; // Account - public static string $CREATE_ACCOUNT = 'create_account'; - public static string $CREATE_ACCOUNT_SESSION = 'create_account_session'; - public static string $CREATE_ANONYMOUS_SESSION = 'create_anonymous_session'; - public static string $CREATE_ACCOUNT_JWT = 'create_account_jwt'; - public static string $CREATE_MAGIC_URL = 'create_magic_url'; - public static string $CREATE_PASSWORD_RECOVERY = 'create_password_recovery'; - public static string $CREATE_EMAIL_VERIFICATION = 'create_email_verification'; - public static string $CREATE_PHONE_VERIFICATION = 'create_phone_verification'; - public static string $GET_ACCOUNT = 'get_account'; - public static string $GET_ACCOUNT_SESSION = 'get_account_session'; - public static string $GET_ACCOUNT_SESSIONS = 'get_account_sessions'; - public static string $GET_ACCOUNT_PREFS = 'get_account_preferences'; - public static string $GET_ACCOUNT_LOGS = 'get_account_logs'; - public static string $UPDATE_ACCOUNT_NAME = 'update_account_name'; - public static string $UPDATE_ACCOUNT_EMAIL = 'update_account_email'; - public static string $UPDATE_ACCOUNT_PASSWORD = 'update_account_password'; - public static string $UPDATE_ACCOUNT_PREFS = 'update_account_prefs'; - public static string $UPDATE_ACCOUNT_PHONE = 'update_account_phone'; - public static string $UPDATE_ACCOUNT_STATUS = 'update_account_status'; - public static string $UPDATE_MAGIC_URL = 'confirm_magic_url'; - public static string $UPDATE_PASSWORD_RECOVERY = 'confirm_password_recovery'; - public static string $UPDATE_EMAIL_VERIFICATION = 'confirm_email_verification'; - public static string $UPDATE_PHONE_VERIFICATION = 'confirm_phone_verification'; - public static string $DELETE_ACCOUNT_SESSION = 'delete_account_session'; - public static string $DELETE_ACCOUNT_SESSIONS = 'delete_account_sessions'; + public const string CREATE_ACCOUNT = 'create_account'; + public const string CREATE_ACCOUNT_SESSION = 'create_account_session'; + public const string CREATE_ANONYMOUS_SESSION = 'create_anonymous_session'; + public const string CREATE_ACCOUNT_JWT = 'create_account_jwt'; + public const string CREATE_MAGIC_URL = 'create_magic_url'; + public const string CREATE_PASSWORD_RECOVERY = 'create_password_recovery'; + public const string CREATE_EMAIL_VERIFICATION = 'create_email_verification'; + public const string CREATE_PHONE_VERIFICATION = 'create_phone_verification'; + public const string GET_ACCOUNT = 'get_account'; + public const string GET_ACCOUNT_SESSION = 'get_account_session'; + public const string GET_ACCOUNT_SESSIONS = 'get_account_sessions'; + public const string GET_ACCOUNT_PREFS = 'get_account_preferences'; + public const string GET_ACCOUNT_LOGS = 'get_account_logs'; + public const string UPDATE_ACCOUNT_NAME = 'update_account_name'; + public const string UPDATE_ACCOUNT_EMAIL = 'update_account_email'; + public const string UPDATE_ACCOUNT_PASSWORD = 'update_account_password'; + public const string UPDATE_ACCOUNT_PREFS = 'update_account_prefs'; + public const string UPDATE_ACCOUNT_PHONE = 'update_account_phone'; + public const string UPDATE_ACCOUNT_STATUS = 'update_account_status'; + public const string UPDATE_MAGIC_URL = 'confirm_magic_url'; + public const string UPDATE_PASSWORD_RECOVERY = 'confirm_password_recovery'; + public const string UPDATE_EMAIL_VERIFICATION = 'confirm_email_verification'; + public const string UPDATE_PHONE_VERIFICATION = 'confirm_phone_verification'; + public const string DELETE_ACCOUNT_SESSION = 'delete_account_session'; + public const string DELETE_ACCOUNT_SESSIONS = 'delete_account_sessions'; // Users - public static string $CREATE_USER = 'create_user'; - public static string $GET_USER = 'get_user'; - public static string $GET_USERS = 'list_user'; - public static string $GET_USER_PREFERENCES = 'get_user_preferences'; - public static string $GET_USER_SESSIONS = 'get_user_sessions'; - public static string $GET_USER_MEMBERSHIPS = 'get_user_memberships'; - public static string $GET_USER_LOGS = 'get_user_logs'; - public static string $UPDATE_USER_STATUS = 'update_user_status'; - public static string $UPDATE_USER_NAME = 'update_user_name'; - public static string $UPDATE_USER_EMAIL = 'update_user_email'; - public static string $UPDATE_USER_EMAIL_VERIFICATION = 'update_email_verification'; - public static string $UPDATE_USER_PHONE_VERIFICATION = 'update_phone_verification'; - public static string $UPDATE_USER_PASSWORD = 'update_user_password'; - public static string $UPDATE_USER_PHONE = 'update_user_phone'; - public static string $UPDATE_USER_PREFS = 'update_user_prefs'; - public static string $DELETE_USER_SESSIONS = 'delete_user_sessions'; - public static string $DELETE_USER_SESSION = 'delete_user_session'; - public static string $DELETE_USER = 'delete_user'; - public static string $CREATE_USER_TARGET = 'create_user_target'; - public static string $LIST_USER_TARGETS = 'list_user_targets'; - public static string $GET_USER_TARGET = 'get_user_target'; - public static string $UPDATE_USER_TARGET = 'update_user_target'; - public static string $DELETE_USER_TARGET = 'delete_user_target'; + public const string CREATE_USER = 'create_user'; + public const string GET_USER = 'get_user'; + public const string GET_USERS = 'list_user'; + public const string GET_USER_PREFERENCES = 'get_user_preferences'; + public const string GET_USER_SESSIONS = 'get_user_sessions'; + public const string GET_USER_MEMBERSHIPS = 'get_user_memberships'; + public const string GET_USER_LOGS = 'get_user_logs'; + public const string UPDATE_USER_STATUS = 'update_user_status'; + public const string UPDATE_USER_NAME = 'update_user_name'; + public const string UPDATE_USER_EMAIL = 'update_user_email'; + public const string UPDATE_USER_EMAIL_VERIFICATION = 'update_email_verification'; + public const string UPDATE_USER_PHONE_VERIFICATION = 'update_phone_verification'; + public const string UPDATE_USER_PASSWORD = 'update_user_password'; + public const string UPDATE_USER_PHONE = 'update_user_phone'; + public const string UPDATE_USER_PREFS = 'update_user_prefs'; + public const string DELETE_USER_SESSIONS = 'delete_user_sessions'; + public const string DELETE_USER_SESSION = 'delete_user_session'; + public const string DELETE_USER = 'delete_user'; + public const string CREATE_USER_TARGET = 'create_user_target'; + public const string LIST_USER_TARGETS = 'list_user_targets'; + public const string GET_USER_TARGET = 'get_user_target'; + public const string UPDATE_USER_TARGET = 'update_user_target'; + public const string DELETE_USER_TARGET = 'delete_user_target'; // Teams - public static string $GET_TEAM = 'get_team'; - public static string $GET_TEAM_PREFERENCES = 'get_team_preferences'; - public static string $GET_TEAMS = 'list_teams'; - public static string $CREATE_TEAM = 'create_team'; - public static string $UPDATE_TEAM_NAME = 'update_team_name'; - public static string $UPDATE_TEAM_PREFERENCES = 'update_team_preferences'; + public const string GET_TEAM = 'get_team'; + public const string GET_TEAM_PREFERENCES = 'get_team_preferences'; + public const string GET_TEAMS = 'list_teams'; + public const string CREATE_TEAM = 'create_team'; + public const string UPDATE_TEAM_NAME = 'update_team_name'; + public const string UPDATE_TEAM_PREFERENCES = 'update_team_preferences'; - public static string $DELETE_TEAM = 'delete_team'; - public static string $GET_TEAM_MEMBERSHIP = 'get_team_membership'; - public static string $GET_TEAM_MEMBERSHIPS = 'list_team_memberships'; - public static string $CREATE_TEAM_MEMBERSHIP = 'create_team_membership'; - public static string $UPDATE_TEAM_MEMBERSHIP = 'update_team_membership'; - public static string $UPDATE_TEAM_MEMBERSHIP_STATUS = 'update_membership_status'; - public static string $DELETE_TEAM_MEMBERSHIP = 'delete_team_membership'; + public const string DELETE_TEAM = 'delete_team'; + public const string GET_TEAM_MEMBERSHIP = 'get_team_membership'; + public const string GET_TEAM_MEMBERSHIPS = 'list_team_memberships'; + public const string CREATE_TEAM_MEMBERSHIP = 'create_team_membership'; + public const string UPDATE_TEAM_MEMBERSHIP = 'update_team_membership'; + public const string UPDATE_TEAM_MEMBERSHIP_STATUS = 'update_membership_status'; + public const string DELETE_TEAM_MEMBERSHIP = 'delete_team_membership'; // Functions - public static string $CREATE_FUNCTION = 'create_function'; - public static string $GET_FUNCTIONS = 'list_functions'; - public static string $GET_FUNCTION = 'get_function'; - public static string $GET_RUNTIMES = 'list_runtimes'; - public static string $UPDATE_FUNCTION = 'update_function'; - public static string $DELETE_FUNCTION = 'delete_function'; + public const string CREATE_FUNCTION = 'create_function'; + public const string GET_FUNCTIONS = 'list_functions'; + public const string GET_FUNCTION = 'get_function'; + public const string GET_RUNTIMES = 'list_runtimes'; + public const string UPDATE_FUNCTION = 'update_function'; + public const string DELETE_FUNCTION = 'delete_function'; // Variables - public static string $CREATE_VARIABLE = 'create_variable'; - public static string $GET_VARIABLES = 'list_variables'; - public static string $GET_VARIABLE = 'get_variable'; - public static string $UPDATE_VARIABLE = 'update_variable'; - public static string $DELETE_VARIABLE = 'delete_variable'; + public const string CREATE_VARIABLE = 'create_variable'; + public const string GET_VARIABLES = 'list_variables'; + public const string GET_VARIABLE = 'get_variable'; + public const string UPDATE_VARIABLE = 'update_variable'; + public const string DELETE_VARIABLE = 'delete_variable'; //Deployments - public static string $CREATE_DEPLOYMENT = 'create_deployment'; - public static string $GET_DEPLOYMENTS = 'list_deployments'; - public static string $GET_DEPLOYMENT = 'get_deployment'; - public static string $UPDATE_DEPLOYMENT = 'update_deployment'; - public static string $DELETE_DEPLOYMENT = 'delete_deployment'; + public const string CREATE_DEPLOYMENT = 'create_deployment'; + public const string GET_DEPLOYMENTS = 'list_deployments'; + public const string GET_DEPLOYMENT = 'get_deployment'; + public const string UPDATE_DEPLOYMENT = 'update_deployment'; + public const string DELETE_DEPLOYMENT = 'delete_deployment'; // Executions - public static string $GET_EXECUTIONS = 'list_executions'; - public static string $GET_EXECUTION = 'get_execution'; - public static string $CREATE_EXECUTION = 'create_execution'; - public static string $DELETE_EXECUTION = 'delete_execution'; - public static string $RETRY_BUILD = 'retry_build'; + public const string GET_EXECUTIONS = 'list_executions'; + public const string GET_EXECUTION = 'get_execution'; + public const string CREATE_EXECUTION = 'create_execution'; + public const string DELETE_EXECUTION = 'delete_execution'; + public const string RETRY_BUILD = 'retry_build'; // Buckets - public static string $CREATE_BUCKET = 'create_bucket'; - public static string $GET_BUCKETS = 'list_buckets'; - public static string $GET_BUCKET = 'get_bucket'; - public static string $UPDATE_BUCKET = 'update_bucket'; - public static string $DELETE_BUCKET = 'delete_bucket'; + public const string CREATE_BUCKET = 'create_bucket'; + public const string GET_BUCKETS = 'list_buckets'; + public const string GET_BUCKET = 'get_bucket'; + public const string UPDATE_BUCKET = 'update_bucket'; + public const string DELETE_BUCKET = 'delete_bucket'; // Files - public static string $CREATE_FILE = 'create_file'; - public static string $GET_FILES = 'list_files'; - public static string $GET_FILE = 'get_file'; - public static string $GET_FILE_PREVIEW = 'get_file_preview'; - public static string $GET_FILE_DOWNLOAD = 'get_file_download'; - public static string $GET_FILE_VIEW = 'get_file_view'; - public static string $UPDATE_FILE = 'update_file'; - public static string $DELETE_FILE = 'delete_file'; + public const string CREATE_FILE = 'create_file'; + public const string GET_FILES = 'list_files'; + public const string GET_FILE = 'get_file'; + public const string GET_FILE_PREVIEW = 'get_file_preview'; + public const string GET_FILE_DOWNLOAD = 'get_file_download'; + public const string GET_FILE_VIEW = 'get_file_view'; + public const string UPDATE_FILE = 'update_file'; + public const string DELETE_FILE = 'delete_file'; // Health - public static string $GET_HTTP_HEALTH = 'get_http_health'; - public static string $GET_DB_HEALTH = 'get_db_health'; - public static string $GET_CACHE_HEALTH = 'get_cache_health'; - public static string $GET_TIME_HEALTH = 'get_time_health'; - public static string $GET_WEBHOOKS_QUEUE_HEALTH = 'get_webhooks_queue_health'; - public static string $GET_LOGS_QUEUE_HEALTH = 'get_logs_queue_health'; - public static string $GET_CERTIFICATES_QUEUE_HEALTH = 'get_certificates_queue_health'; - public static string $GET_FUNCTION_QUEUE_HEALTH = 'get_functions_queue_health'; - public static string $GET_LOCAL_STORAGE_HEALTH = 'get_local_storage_health'; - public static string $GET_ANITVIRUS_HEALTH = 'get_antivirus_health'; + public const string GET_HTTP_HEALTH = 'get_http_health'; + public const string GET_DB_HEALTH = 'get_db_health'; + public const string GET_CACHE_HEALTH = 'get_cache_health'; + public const string GET_TIME_HEALTH = 'get_time_health'; + public const string GET_WEBHOOKS_QUEUE_HEALTH = 'get_webhooks_queue_health'; + public const string GET_LOGS_QUEUE_HEALTH = 'get_logs_queue_health'; + public const string GET_CERTIFICATES_QUEUE_HEALTH = 'get_certificates_queue_health'; + public const string GET_FUNCTION_QUEUE_HEALTH = 'get_functions_queue_health'; + public const string GET_LOCAL_STORAGE_HEALTH = 'get_local_storage_health'; + public const string GET_ANITVIRUS_HEALTH = 'get_antivirus_health'; // Localization - public static string $GET_LOCALE = 'get_locale'; - public static string $LIST_COUNTRIES = 'list_countries'; - public static string $LIST_EU_COUNTRIES = 'list_eu_countries'; - public static string $LIST_COUNTRY_PHONE_CODES = 'list_country_phone_codes'; - public static string $LIST_CONTINENTS = 'list_continents'; - public static string $LIST_CURRENCIES = 'list_currencies'; - public static string $LIST_LANGUAGES = 'list_languages'; + public const string GET_LOCALE = 'get_locale'; + public const string LIST_COUNTRIES = 'list_countries'; + public const string LIST_EU_COUNTRIES = 'list_eu_countries'; + public const string LIST_COUNTRY_PHONE_CODES = 'list_country_phone_codes'; + public const string LIST_CONTINENTS = 'list_continents'; + public const string LIST_CURRENCIES = 'list_currencies'; + public const string LIST_LANGUAGES = 'list_languages'; // Avatars - public static string $GET_CREDIT_CARD_ICON = 'get_credit_card_icon'; - public static string $GET_BROWSER_ICON = 'get_browser_icon'; - public static string $GET_COUNTRY_FLAG = 'get_country_flag'; - public static string $GET_IMAGE_FROM_URL = 'get_image_from_url'; - public static string $GET_FAVICON = 'get_favicon'; - public static string $GET_QRCODE = 'get_qrcode'; - public static string $GET_USER_INITIALS = 'get_user_initials'; + public const string GET_CREDIT_CARD_ICON = 'get_credit_card_icon'; + public const string GET_BROWSER_ICON = 'get_browser_icon'; + public const string GET_COUNTRY_FLAG = 'get_country_flag'; + public const string GET_IMAGE_FROM_URL = 'get_image_from_url'; + public const string GET_FAVICON = 'get_favicon'; + public const string GET_QRCODE = 'get_qrcode'; + public const string GET_USER_INITIALS = 'get_user_initials'; // Providers - public static string $CREATE_MAILGUN_PROVIDER = 'create_mailgun_provider'; - public static string $CREATE_SENDGRID_PROVIDER = 'create_sendgrid_provider'; - public static string $CREATE_SMTP_PROVIDER = 'create_smtp_provider'; - public static string $CREATE_TWILIO_PROVIDER = 'create_twilio_provider'; - public static string $CREATE_TELESIGN_PROVIDER = 'create_telesign_provider'; - public static string $CREATE_TEXTMAGIC_PROVIDER = 'create_textmagic_provider'; - public static string $CREATE_MSG91_PROVIDER = 'create_msg91_provider'; - public static string $CREATE_VONAGE_PROVIDER = 'create_vonage_provider'; - public static string $CREATE_FCM_PROVIDER = 'create_fcm_provider'; - public static string $CREATE_APNS_PROVIDER = 'create_apns_provider'; - public static string $LIST_PROVIDERS = 'list_providers'; - public static string $GET_PROVIDER = 'get_provider'; - public static string $UPDATE_MAILGUN_PROVIDER = 'update_mailgun_provider'; - public static string $UPDATE_SENDGRID_PROVIDER = 'update_sendgrid_provider'; - public static string $UPDATE_SMTP_PROVIDER = 'update_smtp_provider'; - public static string $UPDATE_TWILIO_PROVIDER = 'update_twilio_provider'; - public static string $UPDATE_TELESIGN_PROVIDER = 'update_telesign_provider'; - public static string $UPDATE_TEXTMAGIC_PROVIDER = 'update_textmagic_provider'; - public static string $UPDATE_MSG91_PROVIDER = 'update_msg91_provider'; - public static string $UPDATE_VONAGE_PROVIDER = 'update_vonage_provider'; - public static string $UPDATE_FCM_PROVIDER = 'update_fcm_provider'; - public static string $UPDATE_APNS_PROVIDER = 'update_apns_provider'; - public static string $DELETE_PROVIDER = 'delete_provider'; + public const string CREATE_MAILGUN_PROVIDER = 'create_mailgun_provider'; + public const string CREATE_SENDGRID_PROVIDER = 'create_sendgrid_provider'; + public const string CREATE_SMTP_PROVIDER = 'create_smtp_provider'; + public const string CREATE_TWILIO_PROVIDER = 'create_twilio_provider'; + public const string CREATE_TELESIGN_PROVIDER = 'create_telesign_provider'; + public const string CREATE_TEXTMAGIC_PROVIDER = 'create_textmagic_provider'; + public const string CREATE_MSG91_PROVIDER = 'create_msg91_provider'; + public const string CREATE_VONAGE_PROVIDER = 'create_vonage_provider'; + public const string CREATE_FCM_PROVIDER = 'create_fcm_provider'; + public const string CREATE_APNS_PROVIDER = 'create_apns_provider'; + public const string LIST_PROVIDERS = 'list_providers'; + public const string GET_PROVIDER = 'get_provider'; + public const string UPDATE_MAILGUN_PROVIDER = 'update_mailgun_provider'; + public const string UPDATE_SENDGRID_PROVIDER = 'update_sendgrid_provider'; + public const string UPDATE_SMTP_PROVIDER = 'update_smtp_provider'; + public const string UPDATE_TWILIO_PROVIDER = 'update_twilio_provider'; + public const string UPDATE_TELESIGN_PROVIDER = 'update_telesign_provider'; + public const string UPDATE_TEXTMAGIC_PROVIDER = 'update_textmagic_provider'; + public const string UPDATE_MSG91_PROVIDER = 'update_msg91_provider'; + public const string UPDATE_VONAGE_PROVIDER = 'update_vonage_provider'; + public const string UPDATE_FCM_PROVIDER = 'update_fcm_provider'; + public const string UPDATE_APNS_PROVIDER = 'update_apns_provider'; + public const string DELETE_PROVIDER = 'delete_provider'; // Topics - public static string $CREATE_TOPIC = 'create_topic'; - public static string $LIST_TOPICS = 'list_topics'; - public static string $GET_TOPIC = 'get_topic'; - public static string $UPDATE_TOPIC = 'update_topic'; - public static string $DELETE_TOPIC = 'delete_topic'; + public const string CREATE_TOPIC = 'create_topic'; + public const string LIST_TOPICS = 'list_topics'; + public const string GET_TOPIC = 'get_topic'; + public const string UPDATE_TOPIC = 'update_topic'; + public const string DELETE_TOPIC = 'delete_topic'; // Subscriptions - public static string $CREATE_SUBSCRIBER = 'create_subscriber'; - public static string $LIST_SUBSCRIBERS = 'list_subscribers'; - public static string $GET_SUBSCRIBER = 'get_subscriber'; - public static string $DELETE_SUBSCRIBER = 'delete_subscriber'; + public const string CREATE_SUBSCRIBER = 'create_subscriber'; + public const string LIST_SUBSCRIBERS = 'list_subscribers'; + public const string GET_SUBSCRIBER = 'get_subscriber'; + public const string DELETE_SUBSCRIBER = 'delete_subscriber'; // Messages - public static string $CREATE_EMAIL = 'create_email'; - public static string $CREATE_SMS = 'create_sms'; - public static string $CREATE_PUSH_NOTIFICATION = 'create_push_notification'; - public static string $LIST_MESSAGES = 'list_messages'; - public static string $GET_MESSAGE = 'get_message'; + public const string CREATE_EMAIL = 'create_email'; + public const string CREATE_SMS = 'create_sms'; + public const string CREATE_PUSH_NOTIFICATION = 'create_push_notification'; + public const string LIST_MESSAGES = 'list_messages'; + public const string GET_MESSAGE = 'get_message'; - public static string $UPDATE_EMAIL = 'update_email'; - public static string $UPDATE_SMS = 'update_sms'; - public static string $UPDATE_PUSH_NOTIFICATION = 'update_push_notification'; + public const string UPDATE_EMAIL = 'update_email'; + public const string UPDATE_SMS = 'update_sms'; + public const string UPDATE_PUSH_NOTIFICATION = 'update_push_notification'; // Complex queries - public static string $COMPLEX_QUERY = 'complex_query'; + public const string COMPLEX_QUERY_TABLE = 'complex_query_table'; + public const string COMPLEX_QUERY_COLLECTION = 'complex_query_collection'; - // Fragments - public static string $FRAGMENT_ATTRIBUTES = ' + // Attribute Fragments + public const string FRAGMENT_ATTRIBUTES = ' fragment attributeProperties on Attributes { ... on AttributeString { key @@ -332,7 +417,82 @@ trait Base } '; - public static string $FRAGMENT_HASH_OPTIONS = ' + // Column Fragments + public const string FRAGMENT_COLUMNS = ' + fragment columnProperties on Columns { + ... on ColumnString { + key + required + array + status + default + size + } + ... on ColumnInteger { + key + required + array + status + intDefault: default + intMin: min + intMax: max + } + ... on ColumnFloat { + key + required + array + status + floatDefault: default + floatMin: min + floatMax: max + } + ... on ColumnBoolean { + key + required + array + status + boolDefault: default + } + ... on ColumnUrl { + key + required + array + status + default + } + ... on ColumnEmail { + key + required + array + status + default + } + ... on ColumnIp { + key + required + array + status + default + } + ... on ColumnEnum { + key + required + array + status + default + elements + } + ... on ColumnDatetime { + key + required + array + status + default + } + } + '; + + public const string FRAGMENT_HASH_OPTIONS = ' fragment options on HashOptions { ... on AlgoArgon2 { memoryCost @@ -356,14 +516,14 @@ trait Base public function getQuery(string $name): string { switch ($name) { - case self::$CREATE_DATABASE: + case self::CREATE_DATABASE: return 'mutation createDatabase($databaseId: String!, $name: String!) { databasesCreate(databaseId: $databaseId, name: $name) { _id name } }'; - case self::$GET_DATABASES: + case self::GET_DATABASES: return 'query listDatabases { databasesList { total @@ -373,27 +533,64 @@ trait Base } } }'; - case self::$GET_DATABASE: + case self::GET_DATABASE: return 'query getDatabase($databaseId: String!) { databasesGet(databaseId: $databaseId) { _id name } }'; - case self::$UPDATE_DATABASE: + case self::UPDATE_DATABASE: return 'mutation updateDatabase($databaseId: String!, $name: String!) { databasesUpdate(databaseId: $databaseId, name: $name) { _id name } }'; - case self::$DELETE_DATABASE: + case self::DELETE_DATABASE: return 'mutation deleteDatabase($databaseId: String!) { databasesDelete(databaseId: $databaseId) { status } }'; - case self::$GET_COLLECTION: + case self::TABLESDB_CREATE_DATABASE: + return 'mutation tablesDBCreate($databaseId: String!, $name: String!) { + tablesDBCreate(databaseId: $databaseId, name: $name) { + _id + name + } + }'; + case self::TABLESDB_GET_DATABASES: + return 'query tablesDBList { + tablesDBList { + total + databases { + _id + name + } + } + }'; + case self::TABLESDB_GET_DATABASE: + return 'query tablesDBGet($databaseId: String!) { + tablesDBGet(databaseId: $databaseId) { + _id + name + } + }'; + case self::TABLESDB_UPDATE_DATABASE: + return 'mutation tablesDBUpdate($databaseId: String!, $name: String!) { + tablesDBUpdate(databaseId: $databaseId, name: $name) { + _id + name + } + }'; + case self::TABLESDB_DELETE_DATABASE: + return 'mutation tablesDBDelete($databaseId: String!) { + tablesDBDelete(databaseId: $databaseId) { + status + } + }'; + case self::GET_COLLECTION: return 'query getCollection($databaseId: String!, $collectionId: String!) { databasesGetCollection(databaseId: $databaseId, collectionId: $collectionId) { _id @@ -402,7 +599,7 @@ trait Base name } }'; - case self::$GET_COLLECTIONS: + case self::GET_COLLECTIONS: return 'query listCollections($databaseId: String!) { databasesListCollections(databaseId: $databaseId) { total @@ -414,7 +611,7 @@ trait Base } } }'; - case self::$CREATE_COLLECTION: + case self::CREATE_COLLECTION: return 'mutation createCollection($databaseId: String!, $collectionId: String!, $name: String!, $documentSecurity: Boolean!, $permissions: [String!]!) { databasesCreateCollection(databaseId: $databaseId, collectionId: $collectionId, name: $name, documentSecurity: $documentSecurity, permissions: $permissions) { _id @@ -423,7 +620,7 @@ trait Base name } }'; - case self::$UPDATE_COLLECTION: + case self::UPDATE_COLLECTION: return 'mutation updateCollection($databaseId: String!, $collectionId: String!, $name: String!, $documentSecurity: Boolean!, $permissions: [String!], $enabled: Boolean){ databasesUpdateCollection(databaseId: $databaseId, collectionId: $collectionId, name: $name, documentSecurity: $documentSecurity, permissions: $permissions, enabled: $enabled) { _id @@ -432,13 +629,58 @@ trait Base name } }'; - case self::$DELETE_COLLECTION: + case self::DELETE_COLLECTION: return 'mutation deleteCollection($databaseId: String!, $collectionId: String!){ databasesDeleteCollection(databaseId: $databaseId, collectionId: $collectionId) { status } }'; - case self::$CREATE_STRING_ATTRIBUTE: + case self::GET_TABLE: + return 'query tablesDBGetTable($databaseId: String!, $tableId: String!) { + tablesDBGetTable(databaseId: $databaseId, tableId: $tableId) { + _id + _permissions + rowSecurity + name + } + }'; + case self::GET_TABLES: + return 'query tablesDBListTables($databaseId: String!) { + tablesDBListTables(databaseId: $databaseId) { + total + tables { + _id + _permissions + rowSecurity + name + } + } + }'; + case self::CREATE_TABLE: + return 'mutation tablesDBCreateTable($databaseId: String!, $tableId: String!, $name: String!, $rowSecurity: Boolean!, $permissions: [String!]!) { + tablesDBCreateTable(databaseId: $databaseId, tableId: $tableId, name: $name, rowSecurity: $rowSecurity, permissions: $permissions) { + _id + _permissions + rowSecurity + name + } + }'; + case self::UPDATE_TABLE: + return 'mutation tablesDBUpdateTable($databaseId: String!, $tableId: String!, $name: String!, $rowSecurity: Boolean!, $permissions: [String!], $enabled: Boolean) { + tablesDBUpdateTable(databaseId: $databaseId, tableId: $tableId, name: $name, rowSecurity: $rowSecurity, permissions: $permissions, enabled: $enabled) { + _id + _permissions + rowSecurity + name + } + }'; + case self::DELETE_TABLE: + return 'mutation tablesDBDeleteTable($databaseId: String!, $tableId: String!) { + tablesDBDeleteTable(databaseId: $databaseId, tableId: $tableId) { + status + } + }'; + case self::CREATE_STRING_ATTRIBUTE: return 'mutation createStringAttribute($databaseId: String!, $collectionId: String!, $key: String!, $size: Int!, $required: Boolean!, $default: String, $array: Boolean){ databasesCreateStringAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, size: $size, required: $required, default: $default, array: $array) { key @@ -447,7 +689,7 @@ trait Base array } }'; - case self::$CREATE_INTEGER_ATTRIBUTE: + case self::CREATE_INTEGER_ATTRIBUTE: return 'mutation createIntegerAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $min: Int, $max: Int, $default: Int, $array: Boolean){ databasesCreateIntegerAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, min: $min, max: $max, required: $required, default: $default, array: $array) { key @@ -458,7 +700,7 @@ trait Base array } }'; - case self::$CREATE_FLOAT_ATTRIBUTE: + case self::CREATE_FLOAT_ATTRIBUTE: return 'mutation createFloatAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $min: Float, $max: Float, $default: Float, $array: Boolean){ databasesCreateFloatAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, min: $min, max: $max, required: $required, default: $default, array: $array) { key @@ -469,7 +711,7 @@ trait Base array } }'; - case self::$CREATE_BOOLEAN_ATTRIBUTE: + case self::CREATE_BOOLEAN_ATTRIBUTE: return 'mutation createBooleanAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $default: Boolean, $array: Boolean){ databasesCreateBooleanAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, default: $default, array: $array) { key @@ -478,7 +720,7 @@ trait Base array } }'; - case self::$CREATE_URL_ATTRIBUTE: + case self::CREATE_URL_ATTRIBUTE: return 'mutation createUrlAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $default: String, $array: Boolean){ databasesCreateUrlAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, default: $default, array: $array) { key @@ -487,7 +729,7 @@ trait Base array } }'; - case self::$CREATE_EMAIL_ATTRIBUTE: + case self::CREATE_EMAIL_ATTRIBUTE: return 'mutation createEmailAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $default: String, $array: Boolean){ databasesCreateEmailAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, default: $default, array: $array) { key @@ -496,7 +738,7 @@ trait Base array } }'; - case self::$CREATE_IP_ATTRIBUTE: + case self::CREATE_IP_ATTRIBUTE: return 'mutation createIpAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $default: String, $array: Boolean){ databasesCreateIpAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, default: $default, array: $array) { key @@ -505,7 +747,7 @@ trait Base array } }'; - case self::$CREATE_ENUM_ATTRIBUTE: + case self::CREATE_ENUM_ATTRIBUTE: return 'mutation createEnumAttribute($databaseId: String!, $collectionId: String!, $key: String!, $elements: [String!]!, $required: Boolean!, $default: String, $array: Boolean){ databasesCreateEnumAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, elements: $elements, required: $required, default: $default, array: $array) { key @@ -515,7 +757,7 @@ trait Base array } }'; - case self::$CREATE_DATETIME_ATTRIBUTE: + case self::CREATE_DATETIME_ATTRIBUTE: return 'mutation createDatetimeAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $default: String, $array: Boolean){ databasesCreateDatetimeAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, default: $default, array: $array) { key @@ -524,7 +766,7 @@ trait Base array } }'; - case self::$CREATE_RELATIONSHIP_ATTRIBUTE: + case self::CREATE_RELATIONSHIP_ATTRIBUTE: return 'mutation createRelationshipAttribute($databaseId: String!, $collectionId: String!, $relatedCollectionId: String!, $type: String!, $twoWay: Boolean, $key: String, $twoWayKey: String, $onDelete: String){ databasesCreateRelationshipAttribute(databaseId: $databaseId, collectionId: $collectionId, relatedCollectionId: $relatedCollectionId, type: $type, twoWay: $twoWay, key: $key, twoWayKey: $twoWayKey, onDelete: $onDelete) { relatedCollection @@ -535,14 +777,14 @@ trait Base onDelete } }'; - case self::$UPDATE_STRING_ATTRIBUTE: + case self::UPDATE_STRING_ATTRIBUTE: return 'mutation updateStringAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $default: String){ databasesUpdateStringAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, default: $default) { required default } }'; - case self::$UPDATE_INTEGER_ATTRIBUTE: + case self::UPDATE_INTEGER_ATTRIBUTE: return 'mutation updateIntegerAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $min: Int!, $max: Int!, $default: Int){ databasesUpdateIntegerAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, min: $min, max: $max, default: $default) { required @@ -551,7 +793,7 @@ trait Base default } }'; - case self::$UPDATE_FLOAT_ATTRIBUTE: + case self::UPDATE_FLOAT_ATTRIBUTE: return 'mutation updateFloatAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $min: Float!, $max: Float!, $default: Float){ databasesUpdateFloatAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, min: $min, max: $max, required: $required, default: $default) { required @@ -560,35 +802,35 @@ trait Base default } }'; - case self::$UPDATE_BOOLEAN_ATTRIBUTE: + case self::UPDATE_BOOLEAN_ATTRIBUTE: return 'mutation updateBooleanAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $default: Boolean){ databasesUpdateBooleanAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, default: $default) { required default } }'; - case self::$UPDATE_URL_ATTRIBUTE: + case self::UPDATE_URL_ATTRIBUTE: return 'mutation updateUrlAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $default: String){ databasesUpdateUrlAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, default: $default) { required default } }'; - case self::$UPDATE_EMAIL_ATTRIBUTE: + case self::UPDATE_EMAIL_ATTRIBUTE: return 'mutation updateEmailAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $default: String){ databasesUpdateEmailAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, default: $default) { required default } }'; - case self::$UPDATE_IP_ATTRIBUTE: + case self::UPDATE_IP_ATTRIBUTE: return 'mutation updateIpAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $default: String){ databasesUpdateIpAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, default: $default) { required default } }'; - case self::$UPDATE_ENUM_ATTRIBUTE: + case self::UPDATE_ENUM_ATTRIBUTE: return 'mutation updateEnumAttribute($databaseId: String!, $collectionId: String!, $key: String!, $elements: [String!]!, $required: Boolean!, $default: String){ databasesUpdateEnumAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, elements: $elements, required: $required, default: $default) { elements @@ -596,14 +838,14 @@ trait Base default } }'; - case self::$UPDATE_DATETIME_ATTRIBUTE: + case self::UPDATE_DATETIME_ATTRIBUTE: return 'mutation updateDatetimeAttribute($databaseId: String!, $collectionId: String!, $key: String!, $required: Boolean!, $default: String){ databasesUpdateDatetimeAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, required: $required, default: $default) { required default } }'; - case self::$UPDATE_RELATIONSHIP_ATTRIBUTE: + case self::UPDATE_RELATIONSHIP_ATTRIBUTE: return 'mutation updateRelationshipAttribute($databaseId: String!, $collectionId: String!, $key: String!, $onDelete: String){ databasesUpdateRelationshipAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key, onDelete: $onDelete) { relatedCollection @@ -614,7 +856,233 @@ trait Base onDelete } }'; - case self::$CREATE_INDEX: + case self::CREATE_STRING_COLUMN: + return 'mutation createStringColumn($databaseId: String!, $tableId: String!, $key: String!, $size: Int!, $required: Boolean!, $default: String, $array: Boolean){ + tablesDBCreateStringColumn(databaseId: $databaseId, tableId: $tableId, key: $key, size: $size, required: $required, default: $default, array: $array) { + key + required + default + array + } + }'; + case self::CREATE_INTEGER_COLUMN: + return 'mutation createIntegerColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $min: Int, $max: Int, $default: Int, $array: Boolean){ + tablesDBCreateIntegerColumn(databaseId: $databaseId, tableId: $tableId, key: $key, min: $min, max: $max, required: $required, default: $default, array: $array) { + key + required + min + max + default + array + } + }'; + case self::CREATE_FLOAT_COLUMN: + return 'mutation createFloatColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $min: Float, $max: Float, $default: Float, $array: Boolean){ + tablesDBCreateFloatColumn(databaseId: $databaseId, tableId: $tableId, key: $key, min: $min, max: $max, required: $required, default: $default, array: $array) { + key + required + min + max + default + array + } + }'; + case self::CREATE_BOOLEAN_COLUMN: + return 'mutation createBooleanColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $default: Boolean, $array: Boolean){ + tablesDBCreateBooleanColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, default: $default, array: $array) { + key + required + default + array + } + }'; + case self::CREATE_URL_COLUMN: + return 'mutation createUrlColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $default: String, $array: Boolean){ + tablesDBCreateUrlColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, default: $default, array: $array) { + key + required + default + array + } + }'; + case self::CREATE_EMAIL_COLUMN: + return 'mutation createEmailColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $default: String, $array: Boolean){ + tablesDBCreateEmailColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, default: $default, array: $array) { + key + required + default + array + } + }'; + case self::CREATE_IP_COLUMN: + return 'mutation createIpColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $default: String, $array: Boolean){ + tablesDBCreateIpColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, default: $default, array: $array) { + key + required + default + array + } + }'; + case self::CREATE_ENUM_COLUMN: + return 'mutation createEnumColumn($databaseId: String!, $tableId: String!, $key: String!, $elements: [String!]!, $required: Boolean!, $default: String, $array: Boolean){ + tablesDBCreateEnumColumn(databaseId: $databaseId, tableId: $tableId, key: $key, elements: $elements, required: $required, default: $default, array: $array) { + key + elements + required + default + array + } + }'; + case self::CREATE_DATETIME_COLUMN: + return 'mutation createDatetimeColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $default: String, $array: Boolean){ + tablesDBCreateDatetimeColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, default: $default, array: $array) { + key + required + default + array + } + }'; + case self::CREATE_POINT_COLUMN: + return 'mutation createPointColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $array: Boolean){ + tablesDBCreatePointColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, array: $array) { + key + required + array + status + } + }'; + + case self::CREATE_LINE_COLUMN: + return 'mutation createLineColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $array: Boolean){ + tablesDBCreateLineColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, array: $array) { + key + required + array + status + } + }'; + + case self::CREATE_POLYGON_COLUMN: + return 'mutation createPolygonColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $array: Boolean){ + tablesDBCreatePolygonColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, array: $array) { + key + required + array + status + } + }'; + case self::CREATE_RELATIONSHIP_COLUMN: + return 'mutation createRelationshipColumn($databaseId: String!, $tableId: String!, $relatedTableId: String!, $type: String!, $twoWay: Boolean, $key: String, $twoWayKey: String, $onDelete: String){ + tablesDBCreateRelationshipColumn(databaseId: $databaseId, tableId: $tableId, relatedTableId: $relatedTableId, type: $type, twoWay: $twoWay, key: $key, twoWayKey: $twoWayKey, onDelete: $onDelete) { + relatedTable + relationType + twoWay + key + twoWayKey + onDelete + } + }'; + case self::UPDATE_STRING_COLUMN: + return 'mutation updateStringColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $default: String){ + tablesDBUpdateStringColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, default: $default) { + required + default + } + }'; + case self::UPDATE_INTEGER_COLUMN: + return 'mutation updateIntegerColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $min: Int!, $max: Int!, $default: Int){ + tablesDBUpdateIntegerColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, min: $min, max: $max, default: $default) { + required + min + max + default + } + }'; + case self::UPDATE_FLOAT_COLUMN: + return 'mutation updateFloatColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $min: Float!, $max: Float!, $default: Float){ + tablesDBUpdateFloatColumn(databaseId: $databaseId, tableId: $tableId, key: $key, min: $min, max: $max, required: $required, default: $default) { + required + min + max + default + } + }'; + case self::UPDATE_BOOLEAN_COLUMN: + return 'mutation updateBooleanColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $default: Boolean){ + tablesDBUpdateBooleanColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, default: $default) { + required + default + } + }'; + case self::UPDATE_URL_COLUMN: + return 'mutation updateUrlColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $default: String){ + tablesDBUpdateUrlColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, default: $default) { + required + default + } + }'; + case self::UPDATE_EMAIL_COLUMN: + return 'mutation updateEmailColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $default: String){ + tablesDBUpdateEmailColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, default: $default) { + required + default + } + }'; + case self::UPDATE_IP_COLUMN: + return 'mutation updateIpColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $default: String){ + tablesDBUpdateIpColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, default: $default) { + required + default + } + }'; + case self::UPDATE_ENUM_COLUMN: + return 'mutation updateEnumColumn($databaseId: String!, $tableId: String!, $key: String!, $elements: [String!]!, $required: Boolean!, $default: String){ + tablesDBUpdateEnumColumn(databaseId: $databaseId, tableId: $tableId, key: $key, elements: $elements, required: $required, default: $default) { + elements + required + default + } + }'; + case self::UPDATE_DATETIME_COLUMN: + return 'mutation updateDatetimeColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $default: String){ + tablesDBUpdateDatetimeColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, default: $default) { + required + default + } + }'; + case self::UPDATE_POINT_COLUMN: + return 'mutation updatePointColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!){ + tablesDBUpdatePointColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required) { + required + } + }'; + + case self::UPDATE_LINE_COLUMN: + return 'mutation updateLineColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!){ + tablesDBUpdateLineColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required) { + required + } + }'; + + case self::UPDATE_POLYGON_COLUMN: + return 'mutation updatePolygonColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!){ + tablesDBUpdatePolygonColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required) { + required + } + }'; + + case self::UPDATE_RELATIONSHIP_COLUMN: + return 'mutation updateRelationshipColumn($databaseId: String!, $tableId: String!, $key: String!, $onDelete: String){ + tablesDBUpdateRelationshipColumn(databaseId: $databaseId, tableId: $tableId, key: $key, onDelete: $onDelete) { + relatedTable + relationType + twoWay + key + twoWayKey + onDelete + } + }'; + case self::CREATE_INDEX: return 'mutation createIndex($databaseId: String!, $collectionId: String!, $key: String!, $type: String!, $attributes: [String!]!, $orders: [String!]){ databasesCreateIndex(databaseId: $databaseId, collectionId: $collectionId, key: $key, type: $type, attributes: $attributes, orders: $orders) { key @@ -622,7 +1090,7 @@ trait Base status } }'; - case self::$GET_INDEXES: + case self::GET_INDEXES: return 'query listIndexes($databaseId: String!, $collectionId: String!) { databasesListIndexes(databaseId: $databaseId, collectionId: $collectionId) { total @@ -633,7 +1101,7 @@ trait Base } } }'; - case self::$GET_INDEX: + case self::GET_INDEX: return 'query getIndex($databaseId: String!, $collectionId: String!, $key: String!) { databasesGetIndex(databaseId: $databaseId, collectionId: $collectionId, key: $key) { key @@ -641,13 +1109,46 @@ trait Base status } }'; - case self::$DELETE_INDEX: + case self::DELETE_INDEX: return 'mutation deleteIndex($databaseId: String!, $collectionId: String!, $key: String!) { databasesDeleteIndex(databaseId: $databaseId, collectionId: $collectionId, key: $key) { status } }'; - case self::$GET_ATTRIBUTES: + case self::CREATE_COLUMN_INDEX: + return 'mutation createIndex($databaseId: String!, $tableId: String!, $key: String!, $type: String!, $columns: [String!]!, $orders: [String!]){ + tablesDBCreateIndex(databaseId: $databaseId, tableId: $tableId, key: $key, type: $type, columns: $columns, orders: $orders) { + key + type + status + } + }'; + case self::GET_COLUMN_INDEXES: + return 'query listIndexes($databaseId: String!, $tableId: String!) { + tablesDBListIndexes(databaseId: $databaseId, tableId: $tableId) { + total + indexes { + key + type + status + } + } + }'; + case self::GET_COLUMN_INDEX: + return 'query getIndex($databaseId: String!, $tableId: String!, $key: String!) { + tablesDBGetIndex(databaseId: $databaseId, tableId: $tableId, key: $key) { + key + type + status + } + }'; + case self::DELETE_COLUMN_INDEX: + return 'mutation deleteIndex($databaseId: String!, $tableId: String!, $key: String!) { + tablesDBDeleteIndex(databaseId: $databaseId, tableId: $tableId, key: $key) { + status + } + }'; + case self::GET_ATTRIBUTES: return 'query listAttributes($databaseId: String!, $collectionId: String!) { databasesListAttributes(databaseId: $databaseId, collectionId: $collectionId) { total @@ -655,20 +1156,42 @@ trait Base ...attributeProperties } } - }' . PHP_EOL . self::$FRAGMENT_ATTRIBUTES; - case self::$GET_ATTRIBUTE: + }' . PHP_EOL . self::FRAGMENT_ATTRIBUTES; + case self::GET_ATTRIBUTE: return 'query getAttribute($databaseId: String!, $collectionId: String!, $key: String!) { databasesGetAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key) { ...attributeProperties } - }' . PHP_EOL . self::$FRAGMENT_ATTRIBUTES; - case self::$DELETE_ATTRIBUTE: + }' . PHP_EOL . self::FRAGMENT_ATTRIBUTES; + case self::DELETE_ATTRIBUTE: return 'mutation deleteAttribute($databaseId: String!, $collectionId: String!, $key: String!) { databasesDeleteAttribute(databaseId: $databaseId, collectionId: $collectionId, key: $key) { status } }'; - case self::$GET_DOCUMENT: + case self::GET_COLUMNS: + return 'query listColumns($databaseId: String!, $tableId: String!) { + tablesDBListColumns(databaseId: $databaseId, tableId: $tableId) { + total + columns { + ...columnProperties + } + } + }' . PHP_EOL . self::FRAGMENT_COLUMNS; + case self::GET_COLUMN: + return 'query getColumn($databaseId: String!, $tableId: String!, $key: String!) { + tablesDBGetColumn(databaseId: $databaseId, tableId: $tableId, key: $key) { + ...columnProperties + } + }' . PHP_EOL . self::FRAGMENT_COLUMNS; + case self::DELETE_COLUMN: + return 'mutation deleteColumn($databaseId: String!, $tableId: String!, $key: String!) { + tablesDBDeleteColumn(databaseId: $databaseId, tableId: $tableId, key: $key) { + status + } + }'; + + case self::GET_DOCUMENT: return 'query getDocument($databaseId: String!, $collectionId: String!, $documentId: String!) { databasesGetDocument(databaseId: $databaseId, collectionId: $collectionId, documentId: $documentId) { _id @@ -677,7 +1200,7 @@ trait Base data } }'; - case self::$GET_DOCUMENTS: + case self::GET_DOCUMENTS: return 'query listDocuments($databaseId: String!, $collectionId: String!){ databasesListDocuments(databaseId: $databaseId, collectionId: $collectionId) { total @@ -689,7 +1212,7 @@ trait Base } } }'; - case self::$CREATE_DOCUMENT: + case self::CREATE_DOCUMENT: return 'mutation createDocument($databaseId: String!, $collectionId: String!, $documentId: String!, $data: Json!, $permissions: [String!]){ databasesCreateDocument(databaseId: $databaseId, collectionId: $collectionId, documentId: $documentId, data: $data, permissions: $permissions) { _id @@ -697,7 +1220,59 @@ trait Base _permissions } }'; - case self::$CREATE_CUSTOM_ENTITY: + case self::CREATE_DOCUMENTS: + return 'mutation createDocuments($databaseId: String!, $collectionId: String!, $documents: [Json!]!) { + databasesCreateDocuments(databaseId: $databaseId, collectionId: $collectionId, documents: $documents) { + documents { + _id + _collectionId + _permissions + data + } + } + }'; + case self::CREATE_ROWS: + return 'mutation createRows($databaseId: String!, $tableId: String!, $rows: [Json!]!) { + tablesDBCreateRows(databaseId: $databaseId, tableId: $tableId, rows: $rows) { + rows { + _id + _tableId + _permissions + data + } + } + }'; + case self::GET_ROW: + return 'query getRow($databaseId: String!, $tableId: String!, $rowId: String!) { + tablesDBGetRow(databaseId: $databaseId, tableId: $tableId, rowId: $rowId) { + _id + _tableId + _permissions + data + } + }'; + case self::GET_ROWS: + return 'query listRows($databaseId: String!, $tableId: String!, $queries: [String!] = []) { + tablesDBListRows(databaseId: $databaseId, tableId: $tableId, queries: $queries) { + total + rows { + _id + _databaseId + _tableId + _permissions + data + } + } + }'; + case self::CREATE_ROW: + return 'mutation createRow($databaseId: String!, $tableId: String!, $rowId: String!, $data: Json!, $permissions: [String!]) { + tablesDBCreateRow(databaseId: $databaseId, tableId: $tableId, rowId: $rowId, data: $data, permissions: $permissions) { + _id + _tableId + _permissions + } + }'; + case self::CREATE_CUSTOM_ENTITY: return 'mutation createActor($name: String!, $age: Int!, $alive: Boolean!, $salary: Float, $email: String!, $role: String!, $dob: String!, $ip: String, $url: String){ actorsCreate(name: $name, age: $age, alive: $alive, salary: $salary, email: $email, role: $role, dob: $dob, ip: $ip, url: $url) { _id @@ -709,7 +1284,7 @@ trait Base role } }'; - case self::$GET_CUSTOM_ENTITIES: + case self::GET_CUSTOM_ENTITIES: return 'query getCustomEntities { actorsList { _id @@ -724,7 +1299,7 @@ trait Base url } }'; - case self::$GET_CUSTOM_ENTITY: + case self::GET_CUSTOM_ENTITY: return 'query getCustomEntity($id: String!) { actorsGet(id: $id) { name @@ -738,7 +1313,7 @@ trait Base url } }'; - case self::$UPDATE_CUSTOM_ENTITY: + case self::UPDATE_CUSTOM_ENTITY: return 'mutation updateCustomEntity($id: String!, $name: String, $age: Int, $alive: Boolean, $salary: Float, $email: String, $role: String, $dob: String, $ip: String, $url: String){ actorsUpdate(id: $id, name: $name, age: $age, alive: $alive, salary: $salary, email: $email, role: $role, dob: $dob, ip: $ip, url: $url) { name @@ -752,11 +1327,11 @@ trait Base url } }'; - case self::$DELETE_CUSTOM_ENTITY: + case self::DELETE_CUSTOM_ENTITY: return 'mutation deleteCustomEntity($id: String!){ actorsDelete(id: $id) }'; - case self::$UPDATE_DOCUMENT: + case self::UPDATE_DOCUMENT: return 'mutation updateDocument($databaseId: String!, $collectionId: String!, $documentId: String!, $data: Json!, $permissions: [String!]){ databasesUpdateDocument(databaseId: $databaseId, collectionId: $collectionId, documentId: $documentId, data: $data, permissions: $permissions) { _id @@ -764,14 +1339,121 @@ trait Base data } }'; - case self::$DELETE_DOCUMENT: + case self::UPSERT_DOCUMENT: + return 'mutation upsertDocument($databaseId: String!, $collectionId: String!, $documentId: String!, $data: Json!, $permissions: [String!] = []) { + databasesUpsertDocument(databaseId: $databaseId, collectionId: $collectionId, documentId: $documentId, data: $data, permissions: $permissions) { + _id + _databaseId + _collectionId + data + } + }'; + case self::UPDATE_DOCUMENTS: + return 'mutation updateDocuments($databaseId: String!, $collectionId: String!, $data: Json!, $queries: [String!]) { + databasesUpdateDocuments(databaseId: $databaseId, collectionId: $collectionId, data: $data, queries: $queries) { + total + documents { + _id + _databaseId + _collectionId + _permissions + data + } + } + }'; + case self::UPSERT_DOCUMENTS: + return 'mutation upsertDocuments($databaseId: String!, $collectionId: String!, $documents: [Json!]!) { + databasesUpsertDocuments(databaseId: $databaseId, collectionId: $collectionId, documents: $documents) { + total + documents { + _id + _databaseId + _collectionId + _permissions + data + } + } + }'; + case self::DELETE_DOCUMENTS: + return 'mutation deleteDocuments($databaseId: String!, $collectionId: String!, $queries: [String!] = []) { + databasesDeleteDocuments(databaseId: $databaseId, collectionId: $collectionId, queries: $queries) { + total + documents { + _id + _databaseId + _collectionId + data + } + } + }'; + case self::DELETE_DOCUMENT: return 'mutation deleteDocument($databaseId: String!, $collectionId: String!, $documentId: String!){ databasesDeleteDocument(databaseId: $databaseId, collectionId: $collectionId, documentId: $documentId) { status } }'; - - case self::$GET_USER: + case self::UPDATE_ROW: + return 'mutation updateRow($databaseId: String!, $tableId: String!, $rowId: String!, $data: Json!, $permissions: [String!]) { + tablesDBUpdateRow(databaseId: $databaseId, tableId: $tableId, rowId: $rowId, data: $data, permissions: $permissions) { + _id + _tableId + data + } + }'; + case self::UPSERT_ROW: + return 'mutation upsertRow($databaseId: String!, $tableId: String!, $rowId: String!, $data: Json!, $permissions: [String!] = []) { + tablesDBUpsertRow(databaseId: $databaseId, tableId: $tableId, rowId: $rowId, data: $data, permissions: $permissions) { + _id + _databaseId + _tableId + data + } + }'; + case self::DELETE_ROW: + return 'mutation deleteRow($databaseId: String!, $tableId: String!, $rowId: String!) { + tablesDBDeleteRow(databaseId: $databaseId, tableId: $tableId, rowId: $rowId) { + status + } + }'; + case self::UPDATE_ROWS: + return 'mutation updateRows($databaseId: String!, $tableId: String!, $data: Json!, $queries: [String!]) { + tablesDBUpdateRows(databaseId: $databaseId, tableId: $tableId, data: $data, queries: $queries) { + total + rows { + _id + _databaseId + _tableId + _permissions + data + } + } + }'; + case self::UPSERT_ROWS: + return 'mutation upsertRows($databaseId: String!, $tableId: String!, $rows: [Json!]!) { + tablesDBUpsertRows(databaseId: $databaseId, tableId: $tableId, rows: $rows) { + total + rows { + _id + _databaseId + _tableId + _permissions + data + } + } + }'; + case self::DELETE_ROWS: + return 'mutation deleteRows($databaseId: String!, $tableId: String!, $queries: [String!] = []) { + tablesDBDeleteRows(databaseId: $databaseId, tableId: $tableId, queries: $queries) { + total + rows { + _id + _databaseId + _tableId + data + } + } + }'; + case self::GET_USER: return 'query getUser($userId : String!) { usersGet(userId : $userId) { _id @@ -785,14 +1467,14 @@ trait Base ...options } } - }' . PHP_EOL . self::$FRAGMENT_HASH_OPTIONS; - case self::$GET_USER_PREFERENCES: + }' . PHP_EOL . self::FRAGMENT_HASH_OPTIONS; + case self::GET_USER_PREFERENCES: return 'query getUserPreferences($userId : String!) { usersGetPrefs(userId : $userId) { data } }'; - case self::$GET_USER_SESSIONS: + case self::GET_USER_SESSIONS: return 'query listUserSessions($userId : String!) { usersListSessions(userId : $userId) { total @@ -802,7 +1484,7 @@ trait Base } } }'; - case self::$GET_USER_MEMBERSHIPS: + case self::GET_USER_MEMBERSHIPS: return 'query listUserMemberships($userId : String!) { usersListMemberships(userId : $userId) { total @@ -813,7 +1495,7 @@ trait Base } } }'; - case self::$GET_USER_LOGS: + case self::GET_USER_LOGS: return 'query listUserLogs($userId : String!) { usersListLogs(userId : $userId) { total @@ -823,7 +1505,7 @@ trait Base } } }'; - case self::$GET_USERS: + case self::GET_USERS: return 'query listUsers($queries: [String!], $search: String) { usersList(queries: $queries, search: $search) { total @@ -837,7 +1519,7 @@ trait Base } } }'; - case self::$CREATE_USER: + case self::CREATE_USER: return 'mutation createUser($userId: String!, $email: String!, $password: String!, $name: String){ usersCreate(userId: $userId, email: $email, password: $password, name: $name) { _id @@ -848,7 +1530,7 @@ trait Base emailVerification } }'; - case self::$UPDATE_USER_STATUS: + case self::UPDATE_USER_STATUS: return 'mutation updateUserStatus($userId: String!, $status: Boolean!){ usersUpdateStatus(userId: $userId, status: $status) { _id @@ -856,7 +1538,7 @@ trait Base email } }'; - case self::$UPDATE_USER_NAME: + case self::UPDATE_USER_NAME: return 'mutation updateUserName($userId: String!, $name: String!){ usersUpdateName(userId: $userId, name: $name) { _id @@ -867,7 +1549,7 @@ trait Base emailVerification } }'; - case self::$UPDATE_USER_EMAIL: + case self::UPDATE_USER_EMAIL: return 'mutation updateUserEmail($userId: String!, $email: String!){ usersUpdateEmail(userId: $userId, email: $email) { _id @@ -878,7 +1560,7 @@ trait Base emailVerification } }'; - case self::$UPDATE_USER_PASSWORD: + case self::UPDATE_USER_PASSWORD: return 'mutation updateUserPassword($userId: String!, $password: String!){ usersUpdatePassword(userId: $userId, password: $password) { _id @@ -889,7 +1571,7 @@ trait Base emailVerification } }'; - case self::$UPDATE_USER_PHONE: + case self::UPDATE_USER_PHONE: return 'mutation updateUserPhone($userId: String!, $number: String!){ usersUpdatePhone(userId: $userId, number: $number) { name @@ -897,20 +1579,20 @@ trait Base email } }'; - case self::$UPDATE_USER_PREFS: + case self::UPDATE_USER_PREFS: return 'mutation updateUserPrefs($userId: String!, $prefs: Assoc!){ usersUpdatePrefs(userId: $userId, prefs: $prefs) { data } }'; - case self::$UPDATE_USER_EMAIL_VERIFICATION: + case self::UPDATE_USER_EMAIL_VERIFICATION: return 'mutation updateUserEmailVerification($userId: String!, $emailVerification: Boolean!){ usersUpdateEmailVerification(userId: $userId, emailVerification: $emailVerification) { name email } }'; - case self::$UPDATE_USER_PHONE_VERIFICATION: + case self::UPDATE_USER_PHONE_VERIFICATION: return 'mutation updateUserPhoneVerification($userId: String!, $phoneVerification: Boolean!){ usersUpdatePhoneVerification(userId: $userId, phoneVerification: $phoneVerification) { _id @@ -918,25 +1600,25 @@ trait Base email } }'; - case self::$DELETE_USER_SESSIONS: + case self::DELETE_USER_SESSIONS: return 'mutation deleteUserSessions($userId: String!){ usersDeleteSessions(userId: $userId) { status } }'; - case self::$DELETE_USER_SESSION: + case self::DELETE_USER_SESSION: return 'mutation deleteUserSession($userId: String!, $sessionId: String!){ usersDeleteSession(userId: $userId, sessionId: $sessionId) { status } }'; - case self::$DELETE_USER: + case self::DELETE_USER: return 'mutation deleteUser($userId: String!) { usersDelete(userId: $userId) { status } }'; - case self::$CREATE_USER_TARGET: + case self::CREATE_USER_TARGET: return 'mutation createUserTarget($userId: String!, $targetId: String!, $providerType: String!, $identifier: String! $providerId: String){ usersCreateTarget(userId: $userId, targetId: $targetId, providerType: $providerType, identifier: $identifier, providerId: $providerId) { _id @@ -946,7 +1628,7 @@ trait Base identifier } }'; - case self::$LIST_USER_TARGETS: + case self::LIST_USER_TARGETS: return 'query listUserTargets($userId: String!) { usersListTargets(userId: $userId) { total @@ -959,7 +1641,7 @@ trait Base } } }'; - case self::$GET_USER_TARGET: + case self::GET_USER_TARGET: return 'query getUserTarget($userId: String!, $targetId: String!) { usersGetTarget(userId: $userId, targetId: $targetId) { _id @@ -969,7 +1651,7 @@ trait Base identifier } }'; - case self::$UPDATE_USER_TARGET: + case self::UPDATE_USER_TARGET: return 'mutation updateUserTarget($userId: String!, $targetId: String!, $providerId: String, $identifier: String){ usersUpdateTarget(userId: $userId, targetId: $targetId, providerId: $providerId, identifier: $identifier) { _id @@ -979,13 +1661,13 @@ trait Base identifier } }'; - case self::$DELETE_USER_TARGET: + case self::DELETE_USER_TARGET: return 'mutation deleteUserTarget($userId: String!, $targetId: String!){ usersDeleteTarget(userId: $userId, targetId: $targetId) { status } }'; - case self::$GET_LOCALE: + case self::GET_LOCALE: return 'query getLocale { localeGet { ip @@ -994,7 +1676,7 @@ trait Base currency } }'; - case self::$LIST_COUNTRIES: + case self::LIST_COUNTRIES: return 'query listCountries { localeListCountries{ total @@ -1004,7 +1686,7 @@ trait Base } } }'; - case self::$LIST_EU_COUNTRIES: + case self::LIST_EU_COUNTRIES: return 'query listEuCountries { localeListCountriesEU{ total @@ -1014,7 +1696,7 @@ trait Base } } }'; - case self::$LIST_COUNTRY_PHONE_CODES: + case self::LIST_COUNTRY_PHONE_CODES: return 'query listCountryPhoneCodes { localeListCountriesPhones { total @@ -1024,7 +1706,7 @@ trait Base } } }'; - case self::$LIST_CONTINENTS: + case self::LIST_CONTINENTS: return 'query listContinents { localeListContinents{ total @@ -1034,7 +1716,7 @@ trait Base } } }'; - case self::$LIST_CURRENCIES: + case self::LIST_CURRENCIES: return 'query listCurrencies { localeListCurrencies{ total @@ -1045,7 +1727,7 @@ trait Base } } }'; - case self::$LIST_LANGUAGES: + case self::LIST_LANGUAGES: return 'query listLanguages { localeListLanguages{ total @@ -1055,49 +1737,49 @@ trait Base } } }'; - case self::$GET_CREDIT_CARD_ICON: + case self::GET_CREDIT_CARD_ICON: return 'query getCreditCardIcon($code: String!) { avatarsGetCreditCard(code: $code) { status } }'; - case self::$GET_BROWSER_ICON: + case self::GET_BROWSER_ICON: return 'query getBrowserIcon($code: String!) { avatarsGetBrowser(code: $code) { status } }'; - case self::$GET_COUNTRY_FLAG: + case self::GET_COUNTRY_FLAG: return 'query getCountryFlag($code: String!) { avatarsGetFlag(code: $code) { status } }'; - case self::$GET_IMAGE_FROM_URL: + case self::GET_IMAGE_FROM_URL: return 'query getImageFromUrl($url: String!) { avatarsGetImage(url: $url) { status } }'; - case self::$GET_FAVICON: + case self::GET_FAVICON: return 'query getFavicon($url: String!) { avatarsGetFavicon(url: $url) { status } }'; - case self::$GET_QRCODE: + case self::GET_QRCODE: return 'query getQrCode($text: String!) { avatarsGetQR(text: $text) { status } }'; - case self::$GET_USER_INITIALS: + case self::GET_USER_INITIALS: return 'query getUserInitials($name: String!) { avatarsGetInitials(name: $name) { status } }'; - case self::$GET_ACCOUNT: + case self::GET_ACCOUNT: return 'query getAccount { accountGet { _id @@ -1108,7 +1790,7 @@ trait Base emailVerification } }'; - case self::$CREATE_ACCOUNT: + case self::CREATE_ACCOUNT: return 'mutation createAccount($userId: String!, $email: String!, $password: String!, $name: String){ accountCreate(userId: $userId, email: $email, password: $password, name: $name) { _id @@ -1119,7 +1801,7 @@ trait Base emailVerification } }'; - case self::$UPDATE_ACCOUNT_NAME: + case self::UPDATE_ACCOUNT_NAME: return 'mutation updateAccountName($name: String!){ accountUpdateName(name: $name) { _id @@ -1129,7 +1811,7 @@ trait Base phone } }'; - case self::$UPDATE_ACCOUNT_EMAIL: + case self::UPDATE_ACCOUNT_EMAIL: return 'mutation updateAccountEmail($email: String!, $password: String!){ accountUpdateEmail(email: $email, password: $password) { _id @@ -1138,7 +1820,7 @@ trait Base email } }'; - case self::$UPDATE_ACCOUNT_PASSWORD: + case self::UPDATE_ACCOUNT_PASSWORD: return 'mutation updateAccountPassword($password: String!, $oldPassword: String!){ accountUpdatePassword(password: $password, oldPassword: $oldPassword) { _id @@ -1147,7 +1829,7 @@ trait Base email } }'; - case self::$UPDATE_ACCOUNT_PHONE: + case self::UPDATE_ACCOUNT_PHONE: return 'mutation updateAccountPhone($phone: String!, $password: String!){ accountUpdatePhone(phone: $phone, password: $password) { _id @@ -1157,7 +1839,7 @@ trait Base phone } }'; - case self::$UPDATE_ACCOUNT_PREFS: + case self::UPDATE_ACCOUNT_PREFS: return 'mutation updateAccountPrefs($prefs: Assoc!){ accountUpdatePrefs(prefs: $prefs) { _id @@ -1171,21 +1853,21 @@ trait Base } } }'; - case self::$UPDATE_ACCOUNT_STATUS: + case self::UPDATE_ACCOUNT_STATUS: return 'mutation updateAccountStatus{ accountUpdateStatus { status email } }'; - case self::$GET_ACCOUNT_SESSION: + case self::GET_ACCOUNT_SESSION: return 'query getAccountSession($sessionId: String!) { accountGetSession(sessionId: $sessionId) { _id userId } }'; - case self::$CREATE_ACCOUNT_SESSION: + case self::CREATE_ACCOUNT_SESSION: return 'mutation createAccountEmailSession($email: String!, $password: String!){ accountCreateEmailPasswordSession(email: $email, password: $password) { _id @@ -1195,26 +1877,26 @@ trait Base current } }'; - case self::$DELETE_ACCOUNT_SESSION: + case self::DELETE_ACCOUNT_SESSION: return 'mutation deleteAccountSession($sessionId: String!){ accountDeleteSession(sessionId: $sessionId) { status } }'; - case self::$DELETE_ACCOUNT_SESSIONS: + case self::DELETE_ACCOUNT_SESSIONS: return 'mutation deleteAccountSessions { accountDeleteSessions { status } }'; - case self::$CREATE_MAGIC_URL: + case self::CREATE_MAGIC_URL: return 'mutation createMagicURL($userId: String!, $email: String!){ accountCreateMagicURLToken(userId: $userId, email: $email) { userId expire } }'; - case self::$UPDATE_MAGIC_URL: + case self::UPDATE_MAGIC_URL: return 'mutation confirmMagicURL($userId: String!, $secret: String!){ accountUpdateMagicURLSession(userId: $userId, secret: $secret) { userId @@ -1223,26 +1905,26 @@ trait Base ip } }'; - case self::$CREATE_ANONYMOUS_SESSION: + case self::CREATE_ANONYMOUS_SESSION: return 'mutation createAnonymousSession { accountCreateAnonymousSession { _id userId } }'; - case self::$CREATE_ACCOUNT_JWT: + case self::CREATE_ACCOUNT_JWT: return 'mutation createJWT{ accountCreateJWT { jwt } }'; - case self::$GET_ACCOUNT_PREFS: + case self::GET_ACCOUNT_PREFS: return 'query getAccountPreferences { accountGetPrefs { data } }'; - case self::$GET_ACCOUNT_SESSIONS: + case self::GET_ACCOUNT_SESSIONS: return 'query listAccountSessions { accountListSessions { total @@ -1253,7 +1935,7 @@ trait Base } } }'; - case self::$GET_ACCOUNT_LOGS: + case self::GET_ACCOUNT_LOGS: return 'query getAccountLogs { accountListLogs { total @@ -1265,7 +1947,7 @@ trait Base } } }'; - case self::$CREATE_PASSWORD_RECOVERY: + case self::CREATE_PASSWORD_RECOVERY: return 'mutation createPasswordRecovery($email: String!, $url: String!){ accountCreateRecovery(email: $email, url: $url) { userId @@ -1273,7 +1955,7 @@ trait Base expire } }'; - case self::$UPDATE_PASSWORD_RECOVERY: + case self::UPDATE_PASSWORD_RECOVERY: return 'mutation confirmPasswordRecovery($userId: String!, $secret: String!, $password: String!) { accountUpdateRecovery(userId: $userId, secret: $secret, password: $password) { userId @@ -1281,7 +1963,7 @@ trait Base expire } }'; - case self::$CREATE_EMAIL_VERIFICATION: + case self::CREATE_EMAIL_VERIFICATION: return 'mutation createVerification($url: String!){ accountCreateVerification(url: $url) { userId @@ -1289,7 +1971,7 @@ trait Base expire } }'; - case self::$UPDATE_EMAIL_VERIFICATION: + case self::UPDATE_EMAIL_VERIFICATION: return 'mutation confirmVerification($userId: String!, $secret: String!) { accountUpdateVerification(userId: $userId, secret: $secret) { userId @@ -1297,7 +1979,7 @@ trait Base expire } }'; - case self::$CREATE_PHONE_VERIFICATION: + case self::CREATE_PHONE_VERIFICATION: return 'mutation createPhoneVerification { accountCreatePhoneVerification { userId @@ -1305,7 +1987,7 @@ trait Base expire } }'; - case self::$UPDATE_PHONE_VERIFICATION: + case self::UPDATE_PHONE_VERIFICATION: return 'mutation confirmPhoneVerification($userId: String!, $phoneVerification: Boolean!) { accountUpdatePhoneVerification(userId: $userId, phoneVerification: $phoneVerification) { userId @@ -1313,7 +1995,7 @@ trait Base expire } }'; - case self::$GET_TEAM: + case self::GET_TEAM: return 'query getTeam($teamId: String!){ teamsGet(teamId: $teamId) { _id @@ -1321,13 +2003,13 @@ trait Base total } }'; - case self::$GET_TEAM_PREFERENCES: + case self::GET_TEAM_PREFERENCES: return 'query getTeamPreferences($teamId: String!) { teamsGetPrefs(teamId: $teamId) { data } }'; - case self::$GET_TEAMS: + case self::GET_TEAMS: return 'query listTeams { teamsList { total @@ -1337,7 +2019,7 @@ trait Base } } }'; - case self::$CREATE_TEAM: + case self::CREATE_TEAM: return 'mutation createTeam($teamId: String!, $name: String!, $roles: [String]){ teamsCreate(teamId: $teamId, name : $name, roles: $roles) { _id @@ -1345,7 +2027,7 @@ trait Base total } }'; - case self::$UPDATE_TEAM_NAME: + case self::UPDATE_TEAM_NAME: return 'mutation updateTeamName($teamId: String!, $name: String!){ teamsUpdateName(teamId: $teamId, name : $name) { _id @@ -1353,19 +2035,19 @@ trait Base total } }'; - case self::$UPDATE_TEAM_PREFERENCES: + case self::UPDATE_TEAM_PREFERENCES: return 'mutation updateTeamPrefs($teamId: String!, $prefs: Assoc!){ teamsUpdatePrefs(teamId: $teamId, prefs: $prefs) { data } }'; - case self::$DELETE_TEAM: + case self::DELETE_TEAM: return 'mutation deleteTeam($teamId: String!){ teamsDelete(teamId: $teamId) { status } }'; - case self::$GET_TEAM_MEMBERSHIP: + case self::GET_TEAM_MEMBERSHIP: return 'query getTeamMembership($teamId: String!, $membershipId: String!){ teamsGetMembership(teamId: $teamId, membershipId: $membershipId) { _id @@ -1375,7 +2057,7 @@ trait Base userEmail } }'; - case self::$GET_TEAM_MEMBERSHIPS: + case self::GET_TEAM_MEMBERSHIPS: return 'query listTeamMemberships($teamId: String!){ teamsListMemberships(teamId: $teamId) { total @@ -1388,7 +2070,7 @@ trait Base } } }'; - case self::$CREATE_TEAM_MEMBERSHIP: + case self::CREATE_TEAM_MEMBERSHIP: return 'mutation createTeamMembership($teamId: String!, $email: String!, $name: String, $roles: [String!]!, $url: String!){ teamsCreateMembership(teamId: $teamId, email: $email, name : $name, roles: $roles, url: $url) { _id @@ -1402,7 +2084,7 @@ trait Base roles } }'; - case self::$UPDATE_TEAM_MEMBERSHIP: + case self::UPDATE_TEAM_MEMBERSHIP: return 'mutation updateTeamMembership($teamId: String!, $membershipId: String!, $roles: [String!]!){ teamsUpdateMembership(teamId: $teamId, membershipId: $membershipId, roles: $roles) { _id @@ -1416,7 +2098,7 @@ trait Base roles } }'; - case self::$UPDATE_TEAM_MEMBERSHIP_STATUS: + case self::UPDATE_TEAM_MEMBERSHIP_STATUS: return 'mutation updateTeamMembership($teamId: String!, $membershipId: String!, $userId: String!, $secret: String!){ teamsUpdateMembershipStatus(teamId: $teamId, membershipId: $membershipId, userId: $userId, secret: $secret ) { _id @@ -1430,13 +2112,13 @@ trait Base roles } }'; - case self::$DELETE_TEAM_MEMBERSHIP: + case self::DELETE_TEAM_MEMBERSHIP: return 'mutation deleteTeamMembership($teamId: String!, $membershipId: String!){ teamsDeleteMembership(teamId: $teamId, membershipId: $membershipId) { status } }'; - case self::$GET_FUNCTION: + case self::GET_FUNCTION: return 'query getFunction($functionId: String!) { functionsGet(functionId: $functionId) { _id @@ -1445,7 +2127,7 @@ trait Base execute } }'; - case self::$GET_FUNCTIONS: + case self::GET_FUNCTIONS: return 'query listFunctions { functionsList { total @@ -1457,7 +2139,7 @@ trait Base } } }'; - case self::$GET_RUNTIMES: + case self::GET_RUNTIMES: return 'query listRuntimes { functionsListRuntimes { total @@ -1468,7 +2150,7 @@ trait Base } } }'; - case self::$GET_DEPLOYMENTS: + case self::GET_DEPLOYMENTS: return 'query listDeployments($functionId: String!) { functionsListDeployments(functionId: $functionId) { total @@ -1478,7 +2160,7 @@ trait Base } } }'; - case self::$GET_DEPLOYMENT: + case self::GET_DEPLOYMENT: return 'query getDeployment($functionId: String!, $deploymentId: String!) { functionsGetDeployment(functionId: $functionId, deploymentId: $deploymentId) { _id @@ -1488,7 +2170,7 @@ trait Base status } }'; - case self::$CREATE_FUNCTION: + case self::CREATE_FUNCTION: return 'mutation createFunction($functionId: String!, $name: String!, $runtime: String!, $execute: [String!]!, $events: [String], $schedule: String, $timeout: Int, $entrypoint: String!) { functionsCreate(functionId: $functionId, name: $name, execute: $execute, runtime: $runtime, events: $events, schedule: $schedule, timeout: $timeout, entrypoint: $entrypoint) { _id @@ -1497,7 +2179,7 @@ trait Base execute } }'; - case self::$UPDATE_FUNCTION: + case self::UPDATE_FUNCTION: return 'mutation updateFunction($functionId: String!, $name: String!, $execute: [String!]!, $runtime: String!, $entrypoint: String!, $events: [String], $schedule: String, $timeout: Int) { functionsUpdate(functionId: $functionId, name: $name, execute: $execute, runtime: $runtime, entrypoint: $entrypoint, events: $events, schedule: $schedule, timeout: $timeout) { _id @@ -1506,7 +2188,7 @@ trait Base execute } }'; - case self::$UPDATE_DEPLOYMENT: + case self::UPDATE_DEPLOYMENT: return 'mutation updateFunctionDeployment($functionId: String!, $deploymentId: String!) { functionsUpdateDeployment(functionId: $functionId, deploymentId: $deploymentId) { _id @@ -1515,13 +2197,13 @@ trait Base execute } }'; - case self::$DELETE_FUNCTION: + case self::DELETE_FUNCTION: return 'mutation deleteFunction($functionId: String!) { functionsDelete(functionId: $functionId) { status } }'; - case self::$CREATE_VARIABLE: + case self::CREATE_VARIABLE: return 'mutation createVariable($functionId: String!, $key: String!, $value: String!) { functionsCreateVariable(functionId: $functionId, key: $key, value: $value) { _id @@ -1529,7 +2211,7 @@ trait Base value } }'; - case self::$GET_VARIABLES: + case self::GET_VARIABLES: return 'query listVariables($functionId: String!) { functionsListVariables(functionId: $functionId) { total @@ -1540,7 +2222,7 @@ trait Base } } }'; - case self::$GET_VARIABLE: + case self::GET_VARIABLE: return 'query getVariable($functionId: String!, $variableId: String!) { functionsGetVariable(functionId: $functionId, variableId: $variableId) { _id @@ -1548,7 +2230,7 @@ trait Base value } }'; - case self::$UPDATE_VARIABLE: + case self::UPDATE_VARIABLE: return 'mutation updateVariable($functionId: String!, $variableId: String!, $key: String!, $value: String) { functionsUpdateVariable(functionId: $functionId, variableId: $variableId, key: $key, value: $value) { _id @@ -1556,13 +2238,13 @@ trait Base value } }'; - case self::$DELETE_VARIABLE: + case self::DELETE_VARIABLE: return 'mutation deleteVariable($functionId: String!, $variableId: String!) { functionsDeleteVariable(functionId: $functionId, variableId: $variableId) { status } }'; - case self::$CREATE_DEPLOYMENT: + case self::CREATE_DEPLOYMENT: return 'mutation createDeployment($functionId: String!, $code: InputFile!, $activate: Boolean!) { functionsCreateDeployment(functionId: $functionId, code: $code, activate: $activate) { _id @@ -1573,13 +2255,13 @@ trait Base buildLogs } }'; - case self::$DELETE_DEPLOYMENT: + case self::DELETE_DEPLOYMENT: return 'mutation deleteDeployment($functionId: String!, $deploymentId: String!) { functionsDeleteDeployment(functionId: $functionId, deploymentId: $deploymentId) { status } }'; - case self::$GET_EXECUTION: + case self::GET_EXECUTION: return 'query getExecution($functionId: String!$executionId: String!) { functionsGetExecution(functionId: $functionId, executionId: $executionId) { _id @@ -1589,7 +2271,7 @@ trait Base errors } }'; - case self::$GET_EXECUTIONS: + case self::GET_EXECUTIONS: return 'query listExecutions($functionId: String!) { functionsListExecutions(functionId: $functionId) { total @@ -1602,7 +2284,7 @@ trait Base } } }'; - case self::$CREATE_EXECUTION: + case self::CREATE_EXECUTION: return 'mutation createExecution($functionId: String!, $body: String, $async: Boolean) { functionsCreateExecution(functionId: $functionId, body: $body, async: $async) { _id @@ -1612,19 +2294,19 @@ trait Base errors } }'; - case self::$DELETE_EXECUTION: + case self::DELETE_EXECUTION: return 'mutation deleteExecution($functionId: String!, $executionId: String!) { functionsDeleteExecution(functionId: $functionId, executionId: $executionId) { status } }'; - case self::$RETRY_BUILD: + case self::RETRY_BUILD: return 'mutation retryBuild($functionId: String!, $deploymentId: String!, $buildId: String!) { functionsCreateDuplicateDeployment(functionId: $functionId, deploymentId: $deploymentId, buildId: $buildId) { status } }'; - case self::$CREATE_BUCKET: + case self::CREATE_BUCKET: return 'mutation createBucket($bucketId: String!, $name: String!, $fileSecurity: Boolean, $permissions: [String!]) { storageCreateBucket(bucketId: $bucketId, name: $name, fileSecurity: $fileSecurity, permissions: $permissions) { _id @@ -1636,7 +2318,7 @@ trait Base fileSecurity } }'; - case self::$GET_BUCKETS: + case self::GET_BUCKETS: return 'query getBuckets { storageListBuckets { total @@ -1647,7 +2329,7 @@ trait Base } } }'; - case self::$GET_BUCKET: + case self::GET_BUCKET: return 'query getBucket($bucketId: String!) { storageGetBucket(bucketId: $bucketId) { _id @@ -1655,7 +2337,7 @@ trait Base enabled } }'; - case self::$UPDATE_BUCKET: + case self::UPDATE_BUCKET: return 'mutation updateBucket($bucketId: String!, $name: String!, $fileSecurity: Boolean, $permissions: [String!]) { storageUpdateBucket(bucketId: $bucketId, name: $name, fileSecurity: $fileSecurity, permissions: $permissions) { _id @@ -1663,13 +2345,13 @@ trait Base enabled } }'; - case self::$DELETE_BUCKET: + case self::DELETE_BUCKET: return 'mutation deleteBucket($bucketId: String!) { storageDeleteBucket(bucketId: $bucketId) { status } }'; - case self::$CREATE_FILE: + case self::CREATE_FILE: return 'mutation createFile($bucketId: String!, $fileId: String!, $file: InputFile!, $permissions: [String!]) { storageCreateFile(bucketId: $bucketId, fileId: $fileId, file: $file, permissions: $permissions) { _id @@ -1677,7 +2359,7 @@ trait Base name } }'; - case self::$GET_FILES: + case self::GET_FILES: return 'query getFiles($bucketId: String!) { storageListFiles(bucketId: $bucketId) { total @@ -1687,66 +2369,66 @@ trait Base } } }'; - case self::$GET_FILE: + case self::GET_FILE: return 'query getFile($bucketId: String!, $fileId: String!) { storageGetFile(bucketId: $bucketId, fileId: $fileId) { _id name } }'; - case self::$GET_FILE_PREVIEW: + case self::GET_FILE_PREVIEW: return 'query getFilePreview($bucketId: String!, $fileId: String!) { storageGetFilePreview(bucketId: $bucketId, fileId: $fileId) { status } }'; - case self::$GET_FILE_DOWNLOAD: + case self::GET_FILE_DOWNLOAD: return 'query getFileDownload($bucketId: String!, $fileId: String!) { storageGetFileDownload(bucketId: $bucketId, fileId: $fileId) { status } }'; - case self::$GET_FILE_VIEW: + case self::GET_FILE_VIEW: return 'query getFileView($bucketId: String!, $fileId: String!) { storageGetFileView(bucketId: $bucketId, fileId: $fileId) { status } }'; - case self::$UPDATE_FILE: + case self::UPDATE_FILE: return 'mutation updateFile($bucketId: String!, $fileId: String!, $permissions: [String!]) { storageUpdateFile(bucketId: $bucketId, fileId: $fileId, permissions: $permissions) { _id name } }'; - case self::$DELETE_FILE: + case self::DELETE_FILE: return 'mutation deleteFile($bucketId: String!, $fileId: String!) { storageDeleteFile(bucketId: $bucketId, fileId: $fileId) { status } }'; - case self::$GET_HTTP_HEALTH: + case self::GET_HTTP_HEALTH: return 'query getHttpHealth { healthGet { ping status } }'; - case self::$GET_DB_HEALTH: + case self::GET_DB_HEALTH: return 'query getDbHealth { healthGetDB { ping status } }'; - case self::$GET_CACHE_HEALTH: + case self::GET_CACHE_HEALTH: return 'query getCacheHealth { healthGetCache { ping status } }'; - case self::$GET_TIME_HEALTH: + case self::GET_TIME_HEALTH: return 'query getTimeHealth { healthGetTime { remoteTime @@ -1754,45 +2436,45 @@ trait Base diff } }'; - case self::$GET_WEBHOOKS_QUEUE_HEALTH: + case self::GET_WEBHOOKS_QUEUE_HEALTH: return 'query getWebhooksQueueHealth { healthGetQueueWebhooks { size } }'; - case self::$GET_LOGS_QUEUE_HEALTH: + case self::GET_LOGS_QUEUE_HEALTH: return 'query getLogsQueueHealth { healthGetQueueLogs { size } }'; - case self::$GET_CERTIFICATES_QUEUE_HEALTH: + case self::GET_CERTIFICATES_QUEUE_HEALTH: return 'query getCertificatesQueueHealth { healthGetQueueCertificates { size } }'; - case self::$GET_FUNCTION_QUEUE_HEALTH: + case self::GET_FUNCTION_QUEUE_HEALTH: return 'query getFunctionQueueHealth { healthGetQueueFunctions { size } }'; - case self::$GET_LOCAL_STORAGE_HEALTH: + case self::GET_LOCAL_STORAGE_HEALTH: return 'query getLocalStorageHealth { healthGetStorageLocal { ping status } }'; - case self::$GET_ANITVIRUS_HEALTH: + case self::GET_ANITVIRUS_HEALTH: return 'query getAntivirusHealth { healthGetAntivirus { version status } }'; - case self::$CREATE_MAILGUN_PROVIDER: + case self::CREATE_MAILGUN_PROVIDER: return 'mutation createMailgunProvider($providerId: String!, $name: String!, $domain: String!, $apiKey: String!, $fromName: String!, $fromEmail: String!, $isEuRegion: Boolean!, $replyToName: String, $replyToEmail: String) { messagingCreateMailgunProvider(providerId: $providerId, name: $name, domain: $domain, apiKey: $apiKey, fromName: $fromName, fromEmail: $fromEmail, isEuRegion: $isEuRegion, replyToName: $replyToName, replyToEmail: $replyToEmail) { _id @@ -1802,7 +2484,7 @@ trait Base enabled } }'; - case self::$CREATE_SENDGRID_PROVIDER: + case self::CREATE_SENDGRID_PROVIDER: return 'mutation createSendgridProvider($providerId: String!, $name: String!, $fromName: String!, $fromEmail: String!, $apiKey: String!, $replyToName: String, $replyToEmail: String) { messagingCreateSendgridProvider(providerId: $providerId, name: $name, fromName: $fromName, fromEmail: $fromEmail, apiKey: $apiKey, replyToName: $replyToName, replyToEmail: $replyToEmail) { _id @@ -1812,7 +2494,7 @@ trait Base enabled } }'; - case self::$CREATE_SMTP_PROVIDER: + case self::CREATE_SMTP_PROVIDER: return 'mutation createSmtpProvider($providerId: String!, $name: String!, $host: String!, $port: Int!, $username: String!, $password: String!, $encryption: String!, $autoTLS: Boolean! $fromName: String!, $fromEmail: String!, $replyToName: String, $replyToEmail: String) { messagingCreateSmtpProvider(providerId: $providerId, name: $name, host: $host, port: $port, username: $username, password: $password, encryption: $encryption, autoTLS: $autoTLS, fromName: $fromName, fromEmail: $fromEmail, replyToName: $replyToName, replyToEmail: $replyToEmail) { _id @@ -1822,7 +2504,7 @@ trait Base enabled } }'; - case self::$CREATE_TWILIO_PROVIDER: + case self::CREATE_TWILIO_PROVIDER: return 'mutation createTwilioProvider($providerId: String!, $name: String!, $from: String!, $accountSid: String!, $authToken: String!) { messagingCreateTwilioProvider(providerId: $providerId, name: $name, from: $from, accountSid: $accountSid, authToken: $authToken) { _id @@ -1832,7 +2514,7 @@ trait Base enabled } }'; - case self::$CREATE_TELESIGN_PROVIDER: + case self::CREATE_TELESIGN_PROVIDER: return 'mutation createTelesignProvider($providerId: String!, $name: String!, $from: String!, $customerId: String!, $apiKey: String!) { messagingCreateTelesignProvider(providerId: $providerId, name: $name, from: $from, customerId: $customerId, apiKey: $apiKey) { _id @@ -1842,7 +2524,7 @@ trait Base enabled } }'; - case self::$CREATE_TEXTMAGIC_PROVIDER: + case self::CREATE_TEXTMAGIC_PROVIDER: return 'mutation createTextmagicProvider($providerId: String!, $name: String!, $from: String!, $username: String!, $apiKey: String!) { messagingCreateTextmagicProvider(providerId: $providerId, name: $name, from: $from, username: $username, apiKey: $apiKey) { _id @@ -1852,7 +2534,7 @@ trait Base enabled } }'; - case self::$CREATE_MSG91_PROVIDER: + case self::CREATE_MSG91_PROVIDER: return 'mutation createMsg91Provider($providerId: String!, $name: String!, $templateId: String!, $senderId: String!, $authKey: String!, $enabled: Boolean) { messagingCreateMsg91Provider(providerId: $providerId, name: $name, templateId: $templateId, senderId: $senderId, authKey: $authKey, enabled: $enabled) { _id @@ -1862,7 +2544,7 @@ trait Base enabled } }'; - case self::$CREATE_VONAGE_PROVIDER: + case self::CREATE_VONAGE_PROVIDER: return 'mutation createVonageProvider($providerId: String!, $name: String!, $from: String!, $apiKey: String!, $apiSecret: String!) { messagingCreateVonageProvider(providerId: $providerId, name: $name, from: $from, apiKey: $apiKey, apiSecret: $apiSecret) { _id @@ -1872,7 +2554,7 @@ trait Base enabled } }'; - case self::$CREATE_FCM_PROVIDER: + case self::CREATE_FCM_PROVIDER: return 'mutation createFcmProvider($providerId: String!, $name: String!, $serviceAccountJSON: Json) { messagingCreateFcmProvider(providerId: $providerId, name: $name, serviceAccountJSON: $serviceAccountJSON) { _id @@ -1882,7 +2564,7 @@ trait Base enabled } }'; - case self::$CREATE_APNS_PROVIDER: + case self::CREATE_APNS_PROVIDER: return 'mutation createApnsProvider($providerId: String!, $name: String!, $authKey: String!, $authKeyId: String!, $teamId: String!, $bundleId: String!) { messagingCreateApnsProvider(providerId: $providerId, name: $name, authKey: $authKey, authKeyId: $authKeyId, teamId: $teamId, bundleId: $bundleId) { _id @@ -1892,7 +2574,7 @@ trait Base enabled } }'; - case self::$LIST_PROVIDERS: + case self::LIST_PROVIDERS: return 'query listProviders { messagingListProviders { total @@ -1906,7 +2588,7 @@ trait Base } } }'; - case self::$GET_PROVIDER: + case self::GET_PROVIDER: return 'query getProvider($providerId: String!) { messagingGetProvider(providerId: $providerId) { _id @@ -1916,7 +2598,7 @@ trait Base enabled } }'; - case self::$UPDATE_MAILGUN_PROVIDER: + case self::UPDATE_MAILGUN_PROVIDER: return 'mutation updateMailgunProvider($providerId: String!, $name: String!, $domain: String!, $apiKey: String!, $isEuRegion: Boolean, $enabled: Boolean, $fromName: String, $fromEmail: String) { messagingUpdateMailgunProvider(providerId: $providerId, name: $name, domain: $domain, apiKey: $apiKey, isEuRegion: $isEuRegion, enabled: $enabled, fromName: $fromName, fromEmail: $fromEmail) { _id @@ -1926,7 +2608,7 @@ trait Base enabled } }'; - case self::$UPDATE_SENDGRID_PROVIDER: + case self::UPDATE_SENDGRID_PROVIDER: return 'mutation messagingUpdateSendgridProvider($providerId: String!, $name: String!, $apiKey: String!, $enabled: Boolean, $fromName: String, $fromEmail: String) { messagingUpdateSendgridProvider(providerId: $providerId, name: $name, apiKey: $apiKey, enabled: $enabled, fromName: $fromName, fromEmail: $fromEmail) { _id @@ -1936,7 +2618,7 @@ trait Base enabled } }'; - case self::$UPDATE_SMTP_PROVIDER: + case self::UPDATE_SMTP_PROVIDER: return 'mutation updateSmtpProvider($providerId: String!, $name: String!, $host: String!, $port: Int!, $username: String!, $password: String!, $encryption: String!, $autoTLS: Boolean!, $fromName: String, $fromEmail: String, $enabled: Boolean) { messagingUpdateSmtpProvider(providerId: $providerId, name: $name, host: $host, port: $port, username: $username, password: $password, encryption: $encryption, autoTLS: $autoTLS, fromName: $fromName, fromEmail: $fromEmail, enabled: $enabled) { _id @@ -1946,7 +2628,7 @@ trait Base enabled } }'; - case self::$UPDATE_TWILIO_PROVIDER: + case self::UPDATE_TWILIO_PROVIDER: return 'mutation updateTwilioProvider($providerId: String!, $name: String!, $accountSid: String!, $authToken: String!) { messagingUpdateTwilioProvider(providerId: $providerId, name: $name, accountSid: $accountSid, authToken: $authToken) { _id @@ -1956,7 +2638,7 @@ trait Base enabled } }'; - case self::$UPDATE_TELESIGN_PROVIDER: + case self::UPDATE_TELESIGN_PROVIDER: return 'mutation updateTelesignProvider($providerId: String!, $name: String!, $customerId: String!, $apiKey: String!) { messagingUpdateTelesignProvider(providerId: $providerId, name: $name, customerId: $customerId, apiKey: $apiKey) { _id @@ -1966,7 +2648,7 @@ trait Base enabled } }'; - case self::$UPDATE_TEXTMAGIC_PROVIDER: + case self::UPDATE_TEXTMAGIC_PROVIDER: return 'mutation updateTextmagicProvider($providerId: String!, $name: String!, $username: String!, $apiKey: String!) { messagingUpdateTextmagicProvider(providerId: $providerId, name: $name, username: $username, apiKey: $apiKey) { _id @@ -1976,7 +2658,7 @@ trait Base enabled } }'; - case self::$UPDATE_MSG91_PROVIDER: + case self::UPDATE_MSG91_PROVIDER: return 'mutation updateMsg91Provider($providerId: String!, $name: String!, $templateId: String!, $senderId: String!, $authKey: String!) { messagingUpdateMsg91Provider(providerId: $providerId, name: $name, templateId: $templateId, senderId: $senderId, authKey: $authKey) { _id @@ -1986,7 +2668,7 @@ trait Base enabled } }'; - case self::$UPDATE_VONAGE_PROVIDER: + case self::UPDATE_VONAGE_PROVIDER: return 'mutation updateVonageProvider($providerId: String!, $name: String!, $apiKey: String!, $apiSecret: String!) { messagingUpdateVonageProvider(providerId: $providerId, name: $name, apiKey: $apiKey, apiSecret: $apiSecret) { _id @@ -1996,7 +2678,7 @@ trait Base enabled } }'; - case self::$UPDATE_FCM_PROVIDER: + case self::UPDATE_FCM_PROVIDER: return 'mutation updateFcmProvider($providerId: String!, $name: String!, $serviceAccountJSON: Json) { messagingUpdateFcmProvider(providerId: $providerId, name: $name, serviceAccountJSON: $serviceAccountJSON) { _id @@ -2006,7 +2688,7 @@ trait Base enabled } }'; - case self::$UPDATE_APNS_PROVIDER: + case self::UPDATE_APNS_PROVIDER: return 'mutation updateApnsProvider($providerId: String!, $name: String!, $authKey: String!, $authKeyId: String!, $teamId: String!, $bundleId: String!) { messagingUpdateApnsProvider(providerId: $providerId, name: $name, authKey: $authKey, authKeyId: $authKeyId, teamId: $teamId, bundleId: $bundleId) { _id @@ -2016,13 +2698,13 @@ trait Base enabled } }'; - case self::$DELETE_PROVIDER: + case self::DELETE_PROVIDER: return 'mutation deleteProvider($providerId: String!) { messagingDeleteProvider(providerId: $providerId) { status } }'; - case self::$CREATE_TOPIC: + case self::CREATE_TOPIC: return 'mutation createTopic($topicId: String!, $name: String!) { messagingCreateTopic(topicId: $topicId, name: $name) { _id @@ -2032,7 +2714,7 @@ trait Base pushTotal } }'; - case self::$LIST_TOPICS: + case self::LIST_TOPICS: return 'query listTopics { messagingListTopics { total @@ -2045,7 +2727,7 @@ trait Base } } }'; - case self::$GET_TOPIC: + case self::GET_TOPIC: return 'query getTopic($topicId: String!) { messagingGetTopic(topicId: $topicId) { _id @@ -2055,7 +2737,7 @@ trait Base pushTotal } }'; - case self::$UPDATE_TOPIC: + case self::UPDATE_TOPIC: return 'mutation updateTopic($topicId: String!, $name: String!) { messagingUpdateTopic(topicId: $topicId, name: $name) { _id @@ -2065,13 +2747,13 @@ trait Base pushTotal } }'; - case self::$DELETE_TOPIC: + case self::DELETE_TOPIC: return 'mutation deleteTopic($topicId: String!) { messagingDeleteTopic(topicId: $topicId) { status } }'; - case self::$CREATE_SUBSCRIBER: + case self::CREATE_SUBSCRIBER: return 'mutation createSubscriber($subscriberId: String!, $targetId: String!, $topicId: String!) { messagingCreateSubscriber(subscriberId: $subscriberId, targetId: $targetId, topicId: $topicId) { _id @@ -2087,7 +2769,7 @@ trait Base } } }'; - case self::$LIST_SUBSCRIBERS: + case self::LIST_SUBSCRIBERS: return 'query listSubscribers($topicId: String!) { messagingListSubscribers(topicId: $topicId) { total @@ -2106,7 +2788,7 @@ trait Base } } }'; - case self::$GET_SUBSCRIBER: + case self::GET_SUBSCRIBER: return 'query getSubscriber($topicId: String!, $subscriberId: String!) { messagingGetSubscriber(topicId: $topicId, subscriberId: $subscriberId) { _id @@ -2122,13 +2804,13 @@ trait Base } } }'; - case self::$DELETE_SUBSCRIBER: + case self::DELETE_SUBSCRIBER: return 'mutation deleteSubscriber($topicId: String!, $subscriberId: String!) { messagingDeleteSubscriber(topicId: $topicId, subscriberId: $subscriberId) { status } }'; - case self::$CREATE_EMAIL: + case self::CREATE_EMAIL: return 'mutation createEmail($messageId: String!, $topics: [String!], $users: [String!], $targets: [String!], $subject: String!, $content: String!, $status: String, $html: Boolean, $cc: [String], $bcc: [String], $scheduledAt: String) { messagingCreateEmail(messageId: $messageId, topics: $topics, users: $users, targets: $targets, subject: $subject, content: $content, status: $status, html: $html, cc: $cc, bcc: $bcc, scheduledAt: $scheduledAt) { _id @@ -2142,7 +2824,7 @@ trait Base status } }'; - case self::$CREATE_SMS: + case self::CREATE_SMS: return 'mutation createSMS($messageId: String!, $topics: [String!], $users: [String!], $targets: [String!], $content: String!, $status: String, $scheduledAt: String) { messagingCreateSMS(messageId: $messageId, topics: $topics, users: $users, targets: $targets, content: $content, status: $status, scheduledAt: $scheduledAt) { _id @@ -2156,7 +2838,7 @@ trait Base status } }'; - case self::$CREATE_PUSH_NOTIFICATION: + case self::CREATE_PUSH_NOTIFICATION: return 'mutation createPushNotification($messageId: String!, $topics: [String!], $users: [String!], $targets: [String!], $title: String!, $body: String!, $data: Json, $action: String, $icon: String, $sound: String, $color: String, $tag: String, $badge: String, $status: String, $scheduledAt: String) { messagingCreatePushNotification(messageId: $messageId, topics: $topics, users: $users, targets: $targets, title: $title, body: $body, data: $data, action: $action, icon: $icon, sound: $sound, color: $color, tag: $tag, badge: $badge, status: $status, scheduledAt: $scheduledAt) { _id @@ -2170,7 +2852,7 @@ trait Base status } }'; - case self::$LIST_MESSAGES: + case self::LIST_MESSAGES: return 'query listMessages { messagingListMessages { total @@ -2188,7 +2870,7 @@ trait Base } } }'; - case self::$GET_MESSAGE: + case self::GET_MESSAGE: return 'query getMessage($messageId: String!) { messagingGetMessage(messageId: $messageId) { _id @@ -2203,8 +2885,8 @@ trait Base status } }'; - case self::$UPDATE_EMAIL: - return 'mutation updateEmail($messageId: String!, $topics: [String!], $users: [String!], $targets: [String!], $subject: String, $content: String, $status: String, , $html: Boolean, $cc: [String], $bcc: [String], $scheduledAt: String) { + case self::UPDATE_EMAIL: + return 'mutation updateEmail($messageId: String!, $topics: [String!], $users: [String!], $targets: [String!], $subject: String, $content: String, $status: String, $html: Boolean, $cc: [String], $bcc: [String], $scheduledAt: String) { messagingUpdateEmail(messageId: $messageId, topics: $topics, users: $users, targets: $targets, subject: $subject, content: $content, status: $status, html: $html, cc: $cc, bcc: $bcc, scheduledAt: $scheduledAt) { _id topics @@ -2217,7 +2899,7 @@ trait Base status } }'; - case self::$UPDATE_SMS: + case self::UPDATE_SMS: return 'mutation updateSMS($messageId: String!, $topics: [String!], $users: [String!], $targets: [String!], $content: String, $status: String, $scheduledAt: String) { messagingUpdateSMS(messageId: $messageId, topics: $topics, users: $users, targets: $targets, content: $content, status: $status, scheduledAt: $scheduledAt) { _id @@ -2231,7 +2913,7 @@ trait Base status } }'; - case self::$UPDATE_PUSH_NOTIFICATION: + case self::UPDATE_PUSH_NOTIFICATION: return 'mutation updatePushNotification($messageId: String!, $topics: [String!], $users: [String!], $targets: [String!], $title: String, $body: String, $data: Json, $action: String, $icon: String, $sound: String, $color: String, $tag: String, $badge: String, $status: String, $scheduledAt: String) { messagingUpdatePushNotification(messageId: $messageId, topics: $topics, users: $users, targets: $targets, title: $title, body: $body, data: $data, action: $action, icon: $icon, sound: $sound, color: $color, tag: $tag, badge: $badge, status: $status, scheduledAt: $scheduledAt) { _id @@ -2245,7 +2927,7 @@ trait Base status } }'; - case self::$COMPLEX_QUERY: + case self::COMPLEX_QUERY_COLLECTION: return 'mutation complex($databaseId: String!, $databaseName: String!, $collectionId: String!, $collectionName: String!, $documentSecurity: Boolean!, $collectionPermissions: [String!]!) { databasesCreate(databaseId: $databaseId, name: $databaseName) { _id @@ -2256,7 +2938,7 @@ trait Base _createdAt _updatedAt _permissions - _databaseId + databaseId name documentSecurity attributes { @@ -2487,7 +3169,250 @@ trait Base data } } - }' . PHP_EOL . self::$FRAGMENT_ATTRIBUTES; + }' . PHP_EOL . self::FRAGMENT_ATTRIBUTES; + case self::COMPLEX_QUERY_TABLE: + return 'mutation complex($databaseId: String!, $databaseName: String!, $tableId: String!, $tableName: String!, $rowSecurity: Boolean!, $tablePermissions: [String!]!) { + databasesCreate(databaseId: $databaseId, name: $databaseName) { + _id + name + } + tablesDBCreate(databaseId: $databaseId, tableId: $tableId, name: $tableName, rowSecurity: $rowSecurity, permissions: $tablePermissions) { + _id + _createdAt + _updatedAt + _permissions + databaseId + name + rowSecurity + columns { + ...columnProperties + } + indexes { + key + type + status + } + } + tablesDBCreateStringColumn(databaseId: $databaseId, tableId: $tableId, key: "name", size: 255, required: true) { + key + type + status + size + required + default + array + } + tablesDBCreateIntegerColumn(databaseId: $databaseId, tableId: $tableId, key: "age", min: 0, max: 150, required: true) { + key + type + status + required + min + max + default + array + } + tablesDBCreateBooleanColumn(databaseId: $databaseId, tableId: $tableId, key: "alive", required: false, default: true) { + key + type + status + required + default + array + } + user1: usersCreate(userId: "unique()", email: "test1@appwrite.io", password: "password", name: "Tester 1") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + user2: usersCreate(userId: "unique()", email: "test2@appwrite.io", password: "password", name: "Tester 2") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + user3: usersCreate(userId: "unique()", email: "test3@appwrite.io", password: "password", name: "Tester 3") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + user4: usersCreate(userId: "unique()", email: "test4@appwrite.io", password: "password", name: "Tester 4") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + user5: usersCreate(userId: "unique()", email: "test5@appwrite.io", password: "password", name: "Tester 5") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + user6: usersCreate(userId: "unique()", email: "test6@appwrite.io", password: "password", name: "Tester 6") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + user7: usersCreate(userId: "unique()", email: "test7@appwrite.io", password: "password", name: "Tester 7") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + user8: usersCreate(userId: "unique()", email: "test8@appwrite.io", password: "password", name: "Tester 8") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + user9: usersCreate(userId: "unique()", email: "test9@appwrite.io", password: "password", name: "Tester 9") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + user10: usersCreate(userId: "unique()", email: "test10@appwrite.io", password: "password", name: "Tester 10") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + user11: usersCreate(userId: "unique()", email: "test11@appwrite.io", password: "password", name: "Tester 11") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + user12: usersCreate(userId: "unique()", email: "test12@appwrite.io", password: "password", name: "Tester 5") { + _id + _createdAt + _updatedAt + name + phone + email + status + registration + passwordUpdate + emailVerification + phoneVerification + prefs { + data + } + } + }' . PHP_EOL . self::FRAGMENT_COLUMNS; } throw new \InvalidArgumentException('Invalid query type'); diff --git a/tests/e2e/Services/GraphQL/ContentTypeTest.php b/tests/e2e/Services/GraphQL/ContentTypeTest.php index 190f1d4fcd..c1320cd47a 100644 --- a/tests/e2e/Services/GraphQL/ContentTypeTest.php +++ b/tests/e2e/Services/GraphQL/ContentTypeTest.php @@ -102,7 +102,7 @@ class ContentTypeTest extends Scope { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_BUCKET); + $query = $this->getQuery(self::CREATE_BUCKET); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -124,7 +124,7 @@ class ContentTypeTest extends Scope $bucket = $bucket['body']['data']['storageCreateBucket']; - $query = $this->getQuery(self::$CREATE_FILE); + $query = $this->getQuery(self::CREATE_FILE); $gqlPayload = [ 'operations' => \json_encode([ 'query' => $query, diff --git a/tests/e2e/Services/GraphQL/FunctionsClientTest.php b/tests/e2e/Services/GraphQL/FunctionsClientTest.php index 14b714d551..afb3afb428 100644 --- a/tests/e2e/Services/GraphQL/FunctionsClientTest.php +++ b/tests/e2e/Services/GraphQL/FunctionsClientTest.php @@ -20,14 +20,14 @@ class FunctionsClientTest extends Scope public function testCreateFunction(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_FUNCTION); + $query = $this->getQuery(self::CREATE_FUNCTION); $gqlPayload = [ 'query' => $query, 'variables' => [ 'functionId' => ID::unique(), 'name' => 'Test Function', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'execute' => [Role::any()->toString()], ] ]; @@ -82,7 +82,7 @@ class FunctionsClientTest extends Scope public function testCreateDeployment($function): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_DEPLOYMENT); + $query = $this->getQuery(self::CREATE_DEPLOYMENT); $gqlPayload = [ 'operations' => \json_encode([ @@ -96,7 +96,7 @@ class FunctionsClientTest extends Scope 'map' => \json_encode([ 'code' => ["variables.code"] ]), - 'code' => $this->packageFunction('php') + 'code' => $this->packageFunction('basic') ]; $deployment = $this->client->call(Client::METHOD_POST, '/graphql', [ @@ -112,7 +112,7 @@ class FunctionsClientTest extends Scope $deployment = $deployment['body']['data']['functionsCreateDeployment']; $deploymentId = $deployment['_id']; - $query = $this->getQuery(self::$GET_DEPLOYMENT); + $query = $this->getQuery(self::GET_DEPLOYMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -149,7 +149,7 @@ class FunctionsClientTest extends Scope public function testCreateExecution($function, $deployment): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_EXECUTION); + $query = $this->getQuery(self::CREATE_EXECUTION); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -176,7 +176,7 @@ class FunctionsClientTest extends Scope public function testGetExecutions($function): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_EXECUTIONS); + $query = $this->getQuery(self::GET_EXECUTIONS); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -208,7 +208,7 @@ class FunctionsClientTest extends Scope public function testGetExecution($function, $execution): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_EXECUTION); + $query = $this->getQuery(self::GET_EXECUTION); $gqlPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/GraphQL/FunctionsServerTest.php b/tests/e2e/Services/GraphQL/FunctionsServerTest.php index d211dcceea..ed439f457f 100644 --- a/tests/e2e/Services/GraphQL/FunctionsServerTest.php +++ b/tests/e2e/Services/GraphQL/FunctionsServerTest.php @@ -20,14 +20,14 @@ class FunctionsServerTest extends Scope public function testCreateFunction(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_FUNCTION); + $query = $this->getQuery(self::CREATE_FUNCTION); $gqlPayload = [ 'query' => $query, 'variables' => [ 'functionId' => ID::unique(), 'name' => 'Test Function', - 'entrypoint' => 'index.php', - 'runtime' => 'php-8.0', + 'entrypoint' => 'index.js', + 'runtime' => 'node-22', 'execute' => [Role::any()->toString()], ] ]; @@ -81,7 +81,7 @@ class FunctionsServerTest extends Scope public function testCreateDeployment($function): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_DEPLOYMENT); + $query = $this->getQuery(self::CREATE_DEPLOYMENT); $gqlPayload = [ 'operations' => \json_encode([ @@ -95,7 +95,7 @@ class FunctionsServerTest extends Scope 'map' => \json_encode([ 'code' => ["variables.code"] ]), - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), ]; $deployment = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([ @@ -110,7 +110,7 @@ class FunctionsServerTest extends Scope $deployment = $deployment['body']['data']['functionsCreateDeployment']; $deploymentId = $deployment['_id']; - $query = $this->getQuery(self::$GET_DEPLOYMENT); + $query = $this->getQuery(self::GET_DEPLOYMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -143,7 +143,7 @@ class FunctionsServerTest extends Scope public function testCreateExecution($deployment): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_EXECUTION); + $query = $this->getQuery(self::CREATE_EXECUTION); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -171,7 +171,7 @@ class FunctionsServerTest extends Scope public function testCreateRetryBuild($deployment): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$RETRY_BUILD); + $query = $this->getQuery(self::RETRY_BUILD); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -193,7 +193,7 @@ class FunctionsServerTest extends Scope public function testGetFunctions(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FUNCTIONS); + $query = $this->getQuery(self::GET_FUNCTIONS); $gqlPayload = [ 'query' => $query, ]; @@ -220,7 +220,7 @@ class FunctionsServerTest extends Scope public function testGetFunction($function): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FUNCTION); + $query = $this->getQuery(self::GET_FUNCTION); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -244,7 +244,7 @@ class FunctionsServerTest extends Scope public function testGetRuntimes(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_RUNTIMES); + $query = $this->getQuery(self::GET_RUNTIMES); $gqlPayload = [ 'query' => $query, ]; @@ -271,7 +271,7 @@ class FunctionsServerTest extends Scope public function testGetDeployments($function) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_DEPLOYMENTS); + $query = $this->getQuery(self::GET_DEPLOYMENTS); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -301,7 +301,7 @@ class FunctionsServerTest extends Scope public function testGetDeployment($deployment) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_DEPLOYMENT); + $query = $this->getQuery(self::GET_DEPLOYMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -332,7 +332,7 @@ class FunctionsServerTest extends Scope public function testGetExecutions($function): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_EXECUTIONS); + $query = $this->getQuery(self::GET_EXECUTIONS); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -362,7 +362,7 @@ class FunctionsServerTest extends Scope public function testGetExecution($execution): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_EXECUTION); + $query = $this->getQuery(self::GET_EXECUTION); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -393,7 +393,7 @@ class FunctionsServerTest extends Scope public function testUpdateFunction($function): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_FUNCTION); + $query = $this->getQuery(self::UPDATE_FUNCTION); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -430,7 +430,7 @@ class FunctionsServerTest extends Scope public function testDeleteDeployment($deployment): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_DEPLOYMENT); + $query = $this->getQuery(self::DELETE_DEPLOYMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -458,7 +458,7 @@ class FunctionsServerTest extends Scope public function testDeleteFunction($deployment): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_FUNCTION); + $query = $this->getQuery(self::DELETE_FUNCTION); $gqlPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/GraphQL/HealthTest.php b/tests/e2e/Services/GraphQL/HealthTest.php index 76153a751c..484883f668 100644 --- a/tests/e2e/Services/GraphQL/HealthTest.php +++ b/tests/e2e/Services/GraphQL/HealthTest.php @@ -16,7 +16,7 @@ class HealthTest extends Scope public function testGetHTTPHealth() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_HTTP_HEALTH); + $query = $this->getQuery(self::GET_HTTP_HEALTH); $graphQLPayload = [ 'query' => $query, ]; @@ -37,7 +37,7 @@ class HealthTest extends Scope public function testGetDBHealth() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_DB_HEALTH); + $query = $this->getQuery(self::GET_DB_HEALTH); $graphQLPayload = [ 'query' => $query, ]; @@ -58,7 +58,7 @@ class HealthTest extends Scope public function testGetCacheHealth() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_CACHE_HEALTH); + $query = $this->getQuery(self::GET_CACHE_HEALTH); $graphQLPayload = [ 'query' => $query, ]; @@ -79,7 +79,7 @@ class HealthTest extends Scope public function testGetTimeHealth() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_TIME_HEALTH); + $query = $this->getQuery(self::GET_TIME_HEALTH); $graphQLPayload = [ 'query' => $query, ]; @@ -100,7 +100,7 @@ class HealthTest extends Scope public function testGetWebhooksQueueHealth() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_WEBHOOKS_QUEUE_HEALTH); + $query = $this->getQuery(self::GET_WEBHOOKS_QUEUE_HEALTH); $graphQLPayload = [ 'query' => $query, ]; @@ -121,7 +121,7 @@ class HealthTest extends Scope public function testGetLogsQueueHealth() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_LOGS_QUEUE_HEALTH); + $query = $this->getQuery(self::GET_LOGS_QUEUE_HEALTH); $graphQLPayload = [ 'query' => $query, ]; @@ -142,7 +142,7 @@ class HealthTest extends Scope public function testGetCertificatesQueueHealth() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_CERTIFICATES_QUEUE_HEALTH); + $query = $this->getQuery(self::GET_CERTIFICATES_QUEUE_HEALTH); $graphQLPayload = [ 'query' => $query, ]; @@ -163,7 +163,7 @@ class HealthTest extends Scope public function testGetFunctionsQueueHealth() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FUNCTION_QUEUE_HEALTH); + $query = $this->getQuery(self::GET_FUNCTION_QUEUE_HEALTH); $graphQLPayload = [ 'query' => $query, ]; @@ -184,7 +184,7 @@ class HealthTest extends Scope public function testGetLocalStorageHealth() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_LOCAL_STORAGE_HEALTH); + $query = $this->getQuery(self::GET_LOCAL_STORAGE_HEALTH); $graphQLPayload = [ 'query' => $query, ]; @@ -205,7 +205,7 @@ class HealthTest extends Scope public function testGetAntiVirusHealth() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_ANITVIRUS_HEALTH); + $query = $this->getQuery(self::GET_ANITVIRUS_HEALTH); $graphQLPayload = [ 'query' => $query, ]; diff --git a/tests/e2e/Services/GraphQL/AbuseTest.php b/tests/e2e/Services/GraphQL/Legacy/AbuseTest.php similarity index 91% rename from tests/e2e/Services/GraphQL/AbuseTest.php rename to tests/e2e/Services/GraphQL/Legacy/AbuseTest.php index ea97492c2b..a5dc2ec685 100644 --- a/tests/e2e/Services/GraphQL/AbuseTest.php +++ b/tests/e2e/Services/GraphQL/Legacy/AbuseTest.php @@ -1,11 +1,12 @@ <?php -namespace Tests\E2E\Services\GraphQL; +namespace Tests\E2E\Services\GraphQL\Legacy; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; +use Tests\E2E\Services\GraphQL\Base; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -32,7 +33,7 @@ class AbuseTest extends Scope $databaseId = $data['databaseId']; $collectionId = $data['collectionId']; $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_DOCUMENT); + $query = $this->getQuery(self::CREATE_DOCUMENT); $max = 120; for ($i = 0; $i <= $max + 1; $i++) { @@ -64,7 +65,7 @@ class AbuseTest extends Scope public function testComplexQueryBlocked() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$COMPLEX_QUERY); + $query = $this->getQuery(self::COMPLEX_QUERY_COLLECTION); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -102,7 +103,7 @@ class AbuseTest extends Scope $query = []; for ($i = 0; $i <= $maxQueries + 1; $i++) { - $query[] = ['query' => $this->getQuery(self::$LIST_COUNTRIES)]; + $query[] = ['query' => $this->getQuery(self::LIST_COUNTRIES)]; } $response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([ @@ -113,10 +114,10 @@ class AbuseTest extends Scope $this->assertEquals('Too many queries.', $response['body']['message']); } - private function createCollection() + private function createCollection(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_DATABASE); + $query = $this->getQuery(self::CREATE_DATABASE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -133,7 +134,7 @@ class AbuseTest extends Scope $databaseId = $response['body']['data']['databasesCreate']['_id']; - $query = $this->getQuery(self::$CREATE_COLLECTION); + $query = $this->getQuery(self::CREATE_COLLECTION); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -156,7 +157,7 @@ class AbuseTest extends Scope $collectionId = $response['body']['data']['databasesCreateCollection']['_id']; - $query = $this->getQuery(self::$CREATE_STRING_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_STRING_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/GraphQL/AuthTest.php b/tests/e2e/Services/GraphQL/Legacy/AuthTest.php similarity index 93% rename from tests/e2e/Services/GraphQL/AuthTest.php rename to tests/e2e/Services/GraphQL/Legacy/AuthTest.php index ecce29f2b3..560f0693ea 100644 --- a/tests/e2e/Services/GraphQL/AuthTest.php +++ b/tests/e2e/Services/GraphQL/Legacy/AuthTest.php @@ -1,11 +1,12 @@ <?php -namespace Tests\E2E\Services\GraphQL; +namespace Tests\E2E\Services\GraphQL\Legacy; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; +use Tests\E2E\Services\GraphQL\Base; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -30,7 +31,7 @@ class AuthTest extends Scope parent::setUp(); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_ACCOUNT); + $query = $this->getQuery(self::CREATE_ACCOUNT); $email1 = 'test' . \rand() . '@test.com'; $email2 = 'test' . \rand() . '@test.com'; @@ -60,7 +61,7 @@ class AuthTest extends Scope ], $graphQLPayload); // Create session 1 - $query = $this->getQuery(self::$CREATE_ACCOUNT_SESSION); + $query = $this->getQuery(self::CREATE_ACCOUNT_SESSION); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -86,7 +87,7 @@ class AuthTest extends Scope $this->token2 = $session2['cookies']['a_session_' . $projectId]; // Create database - $query = $this->getQuery(self::$CREATE_DATABASE); + $query = $this->getQuery(self::CREATE_DATABASE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -101,7 +102,7 @@ class AuthTest extends Scope ], $gqlPayload); // Create collection - $query = $this->getQuery(self::$CREATE_COLLECTION); + $query = $this->getQuery(self::CREATE_COLLECTION); $userId = $this->account1['body']['data']['accountCreate']['_id']; $gqlPayload = [ 'query' => $query, @@ -122,7 +123,7 @@ class AuthTest extends Scope ], $gqlPayload); // Create string attribute - $query = $this->getQuery(self::$CREATE_STRING_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_STRING_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -147,7 +148,7 @@ class AuthTest extends Scope $projectId = $this->getProject()['$id']; // Create document as account 1 - $query = $this->getQuery(self::$CREATE_DOCUMENT); + $query = $this->getQuery(self::CREATE_DOCUMENT); $userId = $this->account1['body']['data']['accountCreate']['_id']; $gqlPayload = [ 'query' => $query, @@ -172,7 +173,7 @@ class AuthTest extends Scope ], $gqlPayload); // Try to read as account 1 - $query = $this->getQuery(self::$GET_DOCUMENT); + $query = $this->getQuery(self::GET_DOCUMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -206,7 +207,7 @@ class AuthTest extends Scope $projectId = $this->getProject()['$id']; // Create document as account 1 - $query = $this->getQuery(self::$CREATE_DOCUMENT); + $query = $this->getQuery(self::CREATE_DOCUMENT); $userId = $this->account1['body']['data']['accountCreate']['_id']; $gqlPayload = [ 'query' => $query, @@ -231,7 +232,7 @@ class AuthTest extends Scope ], $gqlPayload); // Try to delete as account 1 - $query = $this->getQuery(self::$DELETE_DOCUMENT); + $query = $this->getQuery(self::DELETE_DOCUMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/GraphQL/DatabaseClientTest.php b/tests/e2e/Services/GraphQL/Legacy/DatabaseClientTest.php similarity index 58% rename from tests/e2e/Services/GraphQL/DatabaseClientTest.php rename to tests/e2e/Services/GraphQL/Legacy/DatabaseClientTest.php index 3853a3fc17..192cc8203c 100644 --- a/tests/e2e/Services/GraphQL/DatabaseClientTest.php +++ b/tests/e2e/Services/GraphQL/Legacy/DatabaseClientTest.php @@ -1,11 +1,12 @@ <?php -namespace Tests\E2E\Services\GraphQL; +namespace Tests\E2E\Services\GraphQL\Legacy; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; +use Tests\E2E\Services\GraphQL\Base; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -19,7 +20,7 @@ class DatabaseClientTest extends Scope public function testCreateDatabase(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_DATABASE); + $query = $this->getQuery(self::CREATE_DATABASE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -48,7 +49,7 @@ class DatabaseClientTest extends Scope public function testCreateCollection($database): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_COLLECTION); + $query = $this->getQuery(self::CREATE_COLLECTION); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -88,7 +89,7 @@ class DatabaseClientTest extends Scope public function testCreateStringAttribute($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_STRING_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_STRING_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -119,7 +120,7 @@ class DatabaseClientTest extends Scope public function testCreateIntegerAttribute($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_INTEGER_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_INTEGER_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -154,7 +155,7 @@ class DatabaseClientTest extends Scope sleep(1); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_DOCUMENT); + $query = $this->getQuery(self::CREATE_DOCUMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -198,7 +199,7 @@ class DatabaseClientTest extends Scope public function testGetDocuments($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_DOCUMENTS); + $query = $this->getQuery(self::GET_DOCUMENTS); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -224,7 +225,7 @@ class DatabaseClientTest extends Scope public function testGetDocument($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_DOCUMENT); + $query = $this->getQuery(self::GET_DOCUMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -251,7 +252,7 @@ class DatabaseClientTest extends Scope public function testUpdateDocument($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_DOCUMENT); + $query = $this->getQuery(self::UPDATE_DOCUMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -284,7 +285,7 @@ class DatabaseClientTest extends Scope public function testDeleteDocument($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_DOCUMENT); + $query = $this->getQuery(self::DELETE_DOCUMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -302,4 +303,180 @@ class DatabaseClientTest extends Scope $this->assertIsNotArray($document['body']); $this->assertEquals(204, $document['headers']['status-code']); } + + /** + * @throws \Exception + */ + public function testBulkCreateDocuments(): array + { + $project = $this->getProject(); + $projectId = $project['$id']; + $headers = [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $project['apiKey'], + ]; + + // Step 1: Create database + $query = $this->getQuery(self::CREATE_DATABASE); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => 'bulk', + 'name' => 'Bulk', + ], + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $databaseId = $res['body']['data']['databasesCreate']['_id']; + + // Step 2: Create collection + $query = $this->getQuery(self::CREATE_COLLECTION); + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'collectionId' => 'operations', + 'name' => 'Operations', + 'documentSecurity' => false, + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $collectionId = $res['body']['data']['databasesCreateCollection']['_id']; + + // Step 3: Create attribute + $query = $this->getQuery(self::CREATE_STRING_ATTRIBUTE); + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'collectionId' => $collectionId, + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + sleep(1); + + // Step 4: Create documents + $query = $this->getQuery(self::CREATE_DOCUMENTS); + $documents = []; + for ($i = 1; $i <= 10; $i++) { + $documents[] = ['$id' => 'doc' . $i, 'name' => 'Doc #' . $i]; + } + + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'collectionId' => $collectionId, + 'documents' => $documents, + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(10, $res['body']['data']['databasesCreateDocuments']['documents']); + + return [ + 'databaseId' => $databaseId, + 'collectionId' => $collectionId, + 'projectId' => $projectId, + ]; + } + + /** + * @depends testBulkCreateDocuments + */ + public function testBulkUpdateDocuments(array $data): array + { + $userId = $this->getUser()['$id']; + $permissions = [ + Permission::read(Role::user($userId)), + Permission::update(Role::user($userId)), + Permission::delete(Role::user($userId)), + ]; + + $headers = [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]; + + $query = $this->getQuery(self::UPDATE_DOCUMENTS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'collectionId' => $data['collectionId'], + 'data' => [ + 'name' => 'Docs Updated', + '$permissions' => $permissions, + ], + ], + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(10, $res['body']['data']['databasesUpdateDocuments']['documents']); + + return $data; + } + + /** + * @depends testBulkUpdateDocuments + */ + public function testBulkUpsertDocuments(array $data): array + { + $headers = [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]; + + // Upsert: Update one, insert one + $query = $this->getQuery(self::UPSERT_DOCUMENTS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'collectionId' => $data['collectionId'], + 'documents' => [ + ['$id' => 'doc10', 'name' => 'Doc #1000'], + ['name' => 'Doc #11'], + ], + ], + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(2, $res['body']['data']['databasesUpsertDocuments']['documents']); + + return $data; + } + + /** + * @depends testBulkUpsertDocuments + */ + public function testBulkDeleteDocuments(array $data): array + { + $headers = [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]; + + $query = $this->getQuery(self::DELETE_DOCUMENTS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'collectionId' => $data['collectionId'], + ], + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(11, $res['body']['data']['databasesDeleteDocuments']['documents']); + + return $data; + } } diff --git a/tests/e2e/Services/GraphQL/DatabaseServerTest.php b/tests/e2e/Services/GraphQL/Legacy/DatabaseServerTest.php similarity index 84% rename from tests/e2e/Services/GraphQL/DatabaseServerTest.php rename to tests/e2e/Services/GraphQL/Legacy/DatabaseServerTest.php index 87006a1bea..799746ccc7 100644 --- a/tests/e2e/Services/GraphQL/DatabaseServerTest.php +++ b/tests/e2e/Services/GraphQL/Legacy/DatabaseServerTest.php @@ -1,12 +1,13 @@ <?php -namespace Tests\E2E\Services\GraphQL; +namespace Tests\E2E\Services\GraphQL\Legacy; use Exception; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; +use Tests\E2E\Services\GraphQL\Base; use Utopia\Database\Database; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; @@ -21,7 +22,7 @@ class DatabaseServerTest extends Scope public function testCreateDatabase(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_DATABASE); + $query = $this->getQuery(self::CREATE_DATABASE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -49,7 +50,7 @@ class DatabaseServerTest extends Scope public function testCreateCollection($database): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_COLLECTION); + $query = $this->getQuery(self::CREATE_COLLECTION); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -116,7 +117,7 @@ class DatabaseServerTest extends Scope public function testCreateStringAttribute($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_STRING_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_STRING_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -133,6 +134,7 @@ class DatabaseServerTest extends Scope 'x-appwrite-project' => $projectId, ], $this->getHeaders()), $gqlPayload); + // TODO: @itznotabug - check for `encrypt` attribute in string column's response body as well! $this->assertArrayNotHasKey('errors', $attribute['body']); $this->assertIsArray($attribute['body']['data']); $this->assertIsArray($attribute['body']['data']['databasesCreateStringAttribute']); @@ -150,7 +152,7 @@ class DatabaseServerTest extends Scope sleep(1); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_STRING_ATTRIBUTE); + $query = $this->getQuery(self::UPDATE_STRING_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -183,7 +185,7 @@ class DatabaseServerTest extends Scope public function testCreateIntegerAttribute($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_INTEGER_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_INTEGER_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -218,7 +220,7 @@ class DatabaseServerTest extends Scope sleep(1); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_INTEGER_ATTRIBUTE); + $query = $this->getQuery(self::UPDATE_INTEGER_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -255,7 +257,7 @@ class DatabaseServerTest extends Scope public function testCreateBooleanAttribute($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_BOOLEAN_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_BOOLEAN_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -288,7 +290,7 @@ class DatabaseServerTest extends Scope sleep(1); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_BOOLEAN_ATTRIBUTE); + $query = $this->getQuery(self::UPDATE_BOOLEAN_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -321,7 +323,7 @@ class DatabaseServerTest extends Scope public function testCreateFloatAttribute($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_FLOAT_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_FLOAT_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -357,7 +359,7 @@ class DatabaseServerTest extends Scope sleep(1); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_FLOAT_ATTRIBUTE); + $query = $this->getQuery(self::UPDATE_FLOAT_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -394,7 +396,7 @@ class DatabaseServerTest extends Scope public function testCreateEmailAttribute($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_EMAIL_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_EMAIL_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -427,7 +429,7 @@ class DatabaseServerTest extends Scope sleep(1); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_EMAIL_ATTRIBUTE); + $query = $this->getQuery(self::UPDATE_EMAIL_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -460,7 +462,7 @@ class DatabaseServerTest extends Scope public function testCreateEnumAttribute($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_ENUM_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_ENUM_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -499,7 +501,7 @@ class DatabaseServerTest extends Scope sleep(1); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_ENUM_ATTRIBUTE); + $query = $this->getQuery(self::UPDATE_ENUM_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -539,7 +541,7 @@ class DatabaseServerTest extends Scope public function testCreateDatetimeAttribute($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_DATETIME_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_DATETIME_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -572,7 +574,7 @@ class DatabaseServerTest extends Scope sleep(1); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_DATETIME_ATTRIBUTE); + $query = $this->getQuery(self::UPDATE_DATETIME_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -604,7 +606,7 @@ class DatabaseServerTest extends Scope public function testCreateRelationshipAttribute(array $data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_RELATIONSHIP_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_RELATIONSHIP_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -638,7 +640,7 @@ class DatabaseServerTest extends Scope sleep(1); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_RELATIONSHIP_ATTRIBUTE); + $query = $this->getQuery(self::UPDATE_RELATIONSHIP_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -668,7 +670,7 @@ class DatabaseServerTest extends Scope public function testCreateIPAttribute($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_IP_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_IP_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -702,7 +704,7 @@ class DatabaseServerTest extends Scope sleep(3); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_IP_ATTRIBUTE); + $query = $this->getQuery(self::UPDATE_IP_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -735,7 +737,7 @@ class DatabaseServerTest extends Scope public function testCreateURLAttribute($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_URL_ATTRIBUTE); + $query = $this->getQuery(self::CREATE_URL_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -769,7 +771,7 @@ class DatabaseServerTest extends Scope sleep(3); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_URL_ATTRIBUTE); + $query = $this->getQuery(self::UPDATE_URL_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -801,7 +803,7 @@ class DatabaseServerTest extends Scope public function testCreateIndex($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_INDEX); + $query = $this->getQuery(self::CREATE_INDEX); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -842,7 +844,7 @@ class DatabaseServerTest extends Scope public function testCreateDocument($data): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_DOCUMENT); + $query = $this->getQuery(self::CREATE_DOCUMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -897,7 +899,7 @@ class DatabaseServerTest extends Scope // public function testCreateCustomEntity(): array // { // $projectId = $this->getProject()['$id']; - // $query = $this->getQuery(self::$CREATE_CUSTOM_ENTITY); + // $query = $this->getQuery(self::CREATE_CUSTOM_ENTITY); // $gqlPayload = [ // 'query' => $query, // 'variables' => [ @@ -927,7 +929,7 @@ class DatabaseServerTest extends Scope public function testGetDatabases(): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_DATABASES); + $query = $this->getQuery(self::GET_DATABASES); $gqlPayload = [ 'query' => $query, ]; @@ -949,7 +951,7 @@ class DatabaseServerTest extends Scope public function testGetDatabase($database): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_DATABASE); + $query = $this->getQuery(self::GET_DATABASE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -974,7 +976,7 @@ class DatabaseServerTest extends Scope public function testGetCollections($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_COLLECTIONS); + $query = $this->getQuery(self::GET_COLLECTIONS); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -999,7 +1001,7 @@ class DatabaseServerTest extends Scope public function testGetCollection($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_COLLECTION); + $query = $this->getQuery(self::GET_COLLECTION); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1026,7 +1028,7 @@ class DatabaseServerTest extends Scope public function testGetAttributes($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_ATTRIBUTES); + $query = $this->getQuery(self::GET_ATTRIBUTES); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1052,7 +1054,7 @@ class DatabaseServerTest extends Scope public function testGetAttribute($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_ATTRIBUTE); + $query = $this->getQuery(self::GET_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1079,7 +1081,7 @@ class DatabaseServerTest extends Scope public function testGetIndexes($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_INDEXES); + $query = $this->getQuery(self::GET_INDEXES); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1105,7 +1107,7 @@ class DatabaseServerTest extends Scope public function testGetIndex($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_INDEX); + $query = $this->getQuery(self::GET_INDEX); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1132,7 +1134,7 @@ class DatabaseServerTest extends Scope public function testGetDocuments($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_DOCUMENTS); + $query = $this->getQuery(self::GET_DOCUMENTS); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1158,7 +1160,7 @@ class DatabaseServerTest extends Scope public function testGetDocument($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_DOCUMENT); + $query = $this->getQuery(self::GET_DOCUMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1185,7 +1187,7 @@ class DatabaseServerTest extends Scope // public function testGetCustomEntities($data) // { // $projectId = $this->getProject()['$id']; - // $query = $this->getQuery(self::$GET_CUSTOM_ENTITIES); + // $query = $this->getQuery(self::GET_CUSTOM_ENTITIES); // $gqlPayload = [ // 'query' => $query, // ]; @@ -1207,7 +1209,7 @@ class DatabaseServerTest extends Scope // public function testGetCustomEntity($data) // { // $projectId = $this->getProject()['$id']; - // $query = $this->getQuery(self::$GET_CUSTOM_ENTITY); + // $query = $this->getQuery(self::GET_CUSTOM_ENTITY); // $gqlPayload = [ // 'query' => $query, // 'variables' => [ @@ -1232,7 +1234,7 @@ class DatabaseServerTest extends Scope public function testUpdateDatabase($database) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_DATABASE); + $query = $this->getQuery(self::UPDATE_DATABASE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1258,7 +1260,7 @@ class DatabaseServerTest extends Scope public function testUpdateCollection($data) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_COLLECTION); + $query = $this->getQuery(self::UPDATE_COLLECTION); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1286,7 +1288,7 @@ class DatabaseServerTest extends Scope public function testUpdateDocument($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_DOCUMENT); + $query = $this->getQuery(self::UPDATE_DOCUMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1318,7 +1320,7 @@ class DatabaseServerTest extends Scope // public function testUpdateCustomEntity(array $data) // { // $projectId = $this->getProject()['$id']; - // $query = $this->getQuery(self::$UPDATE_CUSTOM_ENTITY); + // $query = $this->getQuery(self::UPDATE_CUSTOM_ENTITY); // $gqlPayload = [ // 'query' => $query, // 'variables' => [ @@ -1346,7 +1348,7 @@ class DatabaseServerTest extends Scope public function testDeleteDocument($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_DOCUMENT); + $query = $this->getQuery(self::DELETE_DOCUMENT); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1372,7 +1374,7 @@ class DatabaseServerTest extends Scope // public function testDeleteCustomEntity(array $data) // { // $projectId = $this->getProject()['$id']; - // $query = $this->getQuery(self::$DELETE_CUSTOM_ENTITY); + // $query = $this->getQuery(self::DELETE_CUSTOM_ENTITY); // $gqlPayload = [ // 'query' => $query, // 'variables' => [ @@ -1396,7 +1398,7 @@ class DatabaseServerTest extends Scope public function testDeleteAttribute($data): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_ATTRIBUTE); + $query = $this->getQuery(self::DELETE_ATTRIBUTE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1422,7 +1424,7 @@ class DatabaseServerTest extends Scope public function testDeleteCollection($data) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_COLLECTION); + $query = $this->getQuery(self::DELETE_COLLECTION); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1447,7 +1449,7 @@ class DatabaseServerTest extends Scope public function testDeleteDatabase($database) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_DATABASE); + $query = $this->getQuery(self::DELETE_DATABASE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -1463,4 +1465,176 @@ class DatabaseServerTest extends Scope $this->assertIsNotArray($database['body']); $this->assertEquals(204, $database['headers']['status-code']); } + + /** + * @throws Exception + */ + public function testBulkCreateDocuments(): array + { + $project = $this->getProject(); + $projectId = $project['$id']; + $headers = array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()); + + // Step 1: Create database + $query = $this->getQuery(self::CREATE_DATABASE); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => 'bulk', + 'name' => 'Bulk', + ], + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $databaseId = $res['body']['data']['databasesCreate']['_id']; + + // Step 2: Create collection + $query = $this->getQuery(self::CREATE_COLLECTION); + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'collectionId' => 'operations', + 'name' => 'Operations', + 'documentSecurity' => false, + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $collectionId = $res['body']['data']['databasesCreateCollection']['_id']; + + // Step 3: Create attribute + $query = $this->getQuery(self::CREATE_STRING_ATTRIBUTE); + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'collectionId' => $collectionId, + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + sleep(1); + + // Step 4: Create documents + $query = $this->getQuery(self::CREATE_DOCUMENTS); + $documents = []; + for ($i = 1; $i <= 10; $i++) { + $documents[] = ['$id' => 'doc' . $i, 'name' => 'Doc #' . $i]; + } + + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'collectionId' => $collectionId, + 'documents' => $documents, + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(10, $res['body']['data']['databasesCreateDocuments']['documents']); + + return [ + 'databaseId' => $databaseId, + 'collectionId' => $collectionId, + 'projectId' => $projectId, + ]; + } + + /** + * @depends testBulkCreateDocuments + */ + public function testBulkUpdateDocuments(array $data): array + { + $userId = $this->getUser()['$id']; + $permissions = [ + Permission::read(Role::user($userId)), + Permission::update(Role::user($userId)), + Permission::delete(Role::user($userId)), + ]; + + $headers = array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + ], $this->getHeaders()); + + $query = $this->getQuery(self::UPDATE_DOCUMENTS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'collectionId' => $data['collectionId'], + 'data' => [ + 'name' => 'Docs Updated', + '$permissions' => $permissions, + ], + ], + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(10, $res['body']['data']['databasesUpdateDocuments']['documents']); + + return $data; + } + + /** + * @depends testBulkUpdateDocuments + */ + public function testBulkUpsertDocuments(array $data): array + { + $headers = array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + ], $this->getHeaders()); + + // Upsert: Update one, insert one + $query = $this->getQuery(self::UPSERT_DOCUMENTS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'collectionId' => $data['collectionId'], + 'documents' => [ + ['$id' => 'doc10', 'name' => 'Doc #1000'], + ['name' => 'Doc #11'], + ], + ], + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(2, $res['body']['data']['databasesUpsertDocuments']['documents']); + + return $data; + } + + /** + * @depends testBulkUpsertDocuments + */ + public function testBulkDeleteDocuments(array $data): array + { + $headers = array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + ], $this->getHeaders()); + + $query = $this->getQuery(self::DELETE_DOCUMENTS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'collectionId' => $data['collectionId'], + ], + ]; + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(11, $res['body']['data']['databasesDeleteDocuments']['documents']); + + return $data; + } } diff --git a/tests/e2e/Services/GraphQL/LocalizationTest.php b/tests/e2e/Services/GraphQL/LocalizationTest.php index 38200911c8..182cdaabae 100644 --- a/tests/e2e/Services/GraphQL/LocalizationTest.php +++ b/tests/e2e/Services/GraphQL/LocalizationTest.php @@ -16,7 +16,7 @@ class LocalizationTest extends Scope public function testGetLocale(): array { $projectId = $this->getProject()['$id']; - $query = \urlencode($this->getQuery(self::$GET_LOCALE)); + $query = \urlencode($this->getQuery(self::GET_LOCALE)); $locale = $this->client->call(Client::METHOD_GET, '/graphql?query=' . $query, \array_merge([ 'content-type' => 'application/json', @@ -34,7 +34,7 @@ class LocalizationTest extends Scope public function testGetCountries(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$LIST_COUNTRIES); + $query = $this->getQuery(self::LIST_COUNTRIES); $graphQLPayload = [ 'query' => $query, ]; @@ -56,7 +56,7 @@ class LocalizationTest extends Scope public function testGetCountriesEU(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$LIST_EU_COUNTRIES); + $query = $this->getQuery(self::LIST_EU_COUNTRIES); $graphQLPayload = [ 'query' => $query, ]; @@ -78,7 +78,7 @@ class LocalizationTest extends Scope public function testGetCountriesPhones(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$LIST_COUNTRY_PHONE_CODES); + $query = $this->getQuery(self::LIST_COUNTRY_PHONE_CODES); $graphQLPayload = [ 'query' => $query, ]; @@ -100,7 +100,7 @@ class LocalizationTest extends Scope public function testGetContinents(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$LIST_CONTINENTS); + $query = $this->getQuery(self::LIST_CONTINENTS); $graphQLPayload = [ 'query' => $query, ]; @@ -122,7 +122,7 @@ class LocalizationTest extends Scope public function testGetCurrencies(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$LIST_CURRENCIES); + $query = $this->getQuery(self::LIST_CURRENCIES); $graphQLPayload = [ 'query' => $query, ]; @@ -144,7 +144,7 @@ class LocalizationTest extends Scope public function testGetLanguages(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$LIST_LANGUAGES); + $query = $this->getQuery(self::LIST_LANGUAGES); $graphQLPayload = [ 'query' => $query, ]; diff --git a/tests/e2e/Services/GraphQL/MessagingTest.php b/tests/e2e/Services/GraphQL/MessagingTest.php index fecb1692a9..4fb3dac84f 100644 --- a/tests/e2e/Services/GraphQL/MessagingTest.php +++ b/tests/e2e/Services/GraphQL/MessagingTest.php @@ -225,7 +225,7 @@ class MessagingTest extends Scope */ public function testListProviders(array $providers) { - $query = $this->getQuery(self::$LIST_PROVIDERS); + $query = $this->getQuery(self::LIST_PROVIDERS); $graphQLPayload = [ 'query' => $query, ]; @@ -243,7 +243,7 @@ class MessagingTest extends Scope */ public function testGetProvider(array $providers) { - $query = $this->getQuery(self::$GET_PROVIDER); + $query = $this->getQuery(self::GET_PROVIDER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -265,7 +265,7 @@ class MessagingTest extends Scope public function testDeleteProvider(array $providers) { foreach ($providers as $provider) { - $query = $this->getQuery(self::$DELETE_PROVIDER); + $query = $this->getQuery(self::DELETE_PROVIDER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -283,7 +283,7 @@ class MessagingTest extends Scope public function testCreateTopic() { - $query = $this->getQuery(self::$CREATE_TOPIC); + $query = $this->getQuery(self::CREATE_TOPIC); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -309,7 +309,7 @@ class MessagingTest extends Scope public function testUpdateTopic(array $topic) { $topicId = $topic['_id']; - $query = $this->getQuery(self::$UPDATE_TOPIC); + $query = $this->getQuery(self::UPDATE_TOPIC); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -334,7 +334,7 @@ class MessagingTest extends Scope */ public function testListTopics() { - $query = $this->getQuery(self::$LIST_TOPICS); + $query = $this->getQuery(self::LIST_TOPICS); $graphQLPayload = [ 'query' => $query, ]; @@ -353,7 +353,7 @@ class MessagingTest extends Scope */ public function testGetTopic(string $topicId) { - $query = $this->getQuery(self::$GET_TOPIC); + $query = $this->getQuery(self::GET_TOPIC); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -388,7 +388,7 @@ class MessagingTest extends Scope 'fromEmail' => 'sender-email@my-domain.com', ] ]; - $query = $this->getQuery(self::$CREATE_SENDGRID_PROVIDER); + $query = $this->getQuery(self::CREATE_SENDGRID_PROVIDER); $graphQLPayload = [ 'query' => $query, 'variables' => $providerParam['sendgrid'], @@ -401,7 +401,7 @@ class MessagingTest extends Scope $providerId = $response['body']['data']['messagingCreateSendgridProvider']['_id']; - $query = $this->getQuery(self::$CREATE_USER_TARGET); + $query = $this->getQuery(self::CREATE_USER_TARGET); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -424,7 +424,7 @@ class MessagingTest extends Scope $targetId = $response['body']['data']['usersCreateTarget']['_id']; - $query = $this->getQuery(self::$CREATE_SUBSCRIBER); + $query = $this->getQuery(self::CREATE_SUBSCRIBER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -451,7 +451,7 @@ class MessagingTest extends Scope */ public function testListSubscribers(array $subscriber) { - $query = $this->getQuery(self::$LIST_SUBSCRIBERS); + $query = $this->getQuery(self::LIST_SUBSCRIBERS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -479,7 +479,7 @@ class MessagingTest extends Scope $topicId = $subscriber['topicId']; $subscriberId = $subscriber['_id']; - $query = $this->getQuery(self::$GET_SUBSCRIBER); + $query = $this->getQuery(self::GET_SUBSCRIBER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -509,7 +509,7 @@ class MessagingTest extends Scope $topicId = $subscriber['topicId']; $subscriberId = $subscriber['_id']; - $query = $this->getQuery(self::$DELETE_SUBSCRIBER); + $query = $this->getQuery(self::DELETE_SUBSCRIBER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -530,7 +530,7 @@ class MessagingTest extends Scope */ public function testDeleteTopic(string $topicId) { - $query = $this->getQuery(self::$DELETE_TOPIC); + $query = $this->getQuery(self::DELETE_TOPIC); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -564,7 +564,7 @@ class MessagingTest extends Scope $this->markTestSkipped('Email provider not configured'); } - $query = $this->getQuery(self::$CREATE_MAILGUN_PROVIDER); + $query = $this->getQuery(self::CREATE_MAILGUN_PROVIDER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -587,7 +587,7 @@ class MessagingTest extends Scope $providerId = $provider['body']['data']['messagingCreateMailgunProvider']['_id']; - $query = $this->getQuery(self::$CREATE_TOPIC); + $query = $this->getQuery(self::CREATE_TOPIC); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -603,7 +603,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $topic['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_USER); + $query = $this->getQuery(self::CREATE_USER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -621,7 +621,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $user['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_USER_TARGET); + $query = $this->getQuery(self::CREATE_USER_TARGET); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -640,7 +640,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $target['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_SUBSCRIBER); + $query = $this->getQuery(self::CREATE_SUBSCRIBER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -656,7 +656,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $subscriber['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_EMAIL); + $query = $this->getQuery(self::CREATE_EMAIL); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -676,7 +676,7 @@ class MessagingTest extends Scope \sleep(5); - $query = $this->getQuery(self::$GET_MESSAGE); + $query = $this->getQuery(self::GET_MESSAGE); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -701,7 +701,7 @@ class MessagingTest extends Scope */ public function testUpdateEmail(array $email) { - $query = $this->getQuery(self::$CREATE_EMAIL); + $query = $this->getQuery(self::CREATE_EMAIL); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -720,7 +720,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $email['headers']['status-code']); - $query = $this->getQuery(self::$UPDATE_EMAIL); + $query = $this->getQuery(self::UPDATE_EMAIL); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -738,7 +738,7 @@ class MessagingTest extends Scope \sleep(5); - $query = $this->getQuery(self::$GET_MESSAGE); + $query = $this->getQuery(self::GET_MESSAGE); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -772,7 +772,7 @@ class MessagingTest extends Scope $this->markTestSkipped('SMS provider not configured'); } - $query = $this->getQuery(self::$CREATE_MSG91_PROVIDER); + $query = $this->getQuery(self::CREATE_MSG91_PROVIDER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -793,7 +793,7 @@ class MessagingTest extends Scope $providerId = $provider['body']['data']['messagingCreateMsg91Provider']['_id']; - $query = $this->getQuery(self::$CREATE_TOPIC); + $query = $this->getQuery(self::CREATE_TOPIC); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -809,7 +809,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $topic['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_USER); + $query = $this->getQuery(self::CREATE_USER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -827,7 +827,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $user['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_USER_TARGET); + $query = $this->getQuery(self::CREATE_USER_TARGET); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -846,7 +846,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $target['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_SUBSCRIBER); + $query = $this->getQuery(self::CREATE_SUBSCRIBER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -862,7 +862,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $subscriber['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_SMS); + $query = $this->getQuery(self::CREATE_SMS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -881,7 +881,7 @@ class MessagingTest extends Scope \sleep(5); - $query = $this->getQuery(self::$GET_MESSAGE); + $query = $this->getQuery(self::GET_MESSAGE); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -905,7 +905,7 @@ class MessagingTest extends Scope */ public function testUpdateSMS(array $sms) { - $query = $this->getQuery(self::$CREATE_SMS); + $query = $this->getQuery(self::CREATE_SMS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -923,7 +923,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $sms['headers']['status-code']); - $query = $this->getQuery(self::$UPDATE_SMS); + $query = $this->getQuery(self::UPDATE_SMS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -941,7 +941,7 @@ class MessagingTest extends Scope \sleep(5); - $query = $this->getQuery(self::$GET_MESSAGE); + $query = $this->getQuery(self::GET_MESSAGE); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -973,7 +973,7 @@ class MessagingTest extends Scope $this->markTestSkipped('Push provider not configured'); } - $query = $this->getQuery(self::$CREATE_FCM_PROVIDER); + $query = $this->getQuery(self::CREATE_FCM_PROVIDER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -997,7 +997,7 @@ class MessagingTest extends Scope $providerId = $provider['body']['data']['messagingCreateFcmProvider']['_id']; - $query = $this->getQuery(self::$CREATE_TOPIC); + $query = $this->getQuery(self::CREATE_TOPIC); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -1013,7 +1013,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $topic['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_USER); + $query = $this->getQuery(self::CREATE_USER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -1031,7 +1031,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $user['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_USER_TARGET); + $query = $this->getQuery(self::CREATE_USER_TARGET); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -1050,7 +1050,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $target['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_SUBSCRIBER); + $query = $this->getQuery(self::CREATE_SUBSCRIBER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -1066,7 +1066,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $subscriber['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_PUSH_NOTIFICATION); + $query = $this->getQuery(self::CREATE_PUSH_NOTIFICATION); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -1086,7 +1086,7 @@ class MessagingTest extends Scope \sleep(5); - $query = $this->getQuery(self::$GET_MESSAGE); + $query = $this->getQuery(self::GET_MESSAGE); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -1111,7 +1111,7 @@ class MessagingTest extends Scope */ public function testUpdatePushNotification(array $push) { - $query = $this->getQuery(self::$CREATE_PUSH_NOTIFICATION); + $query = $this->getQuery(self::CREATE_PUSH_NOTIFICATION); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -1130,7 +1130,7 @@ class MessagingTest extends Scope $this->assertEquals(200, $push['headers']['status-code']); - $query = $this->getQuery(self::$UPDATE_PUSH_NOTIFICATION); + $query = $this->getQuery(self::UPDATE_PUSH_NOTIFICATION); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -1148,7 +1148,7 @@ class MessagingTest extends Scope \sleep(5); - $query = $this->getQuery(self::$GET_MESSAGE); + $query = $this->getQuery(self::GET_MESSAGE); $graphQLPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/GraphQL/ScopeTest.php b/tests/e2e/Services/GraphQL/ScopeTest.php index a270d6e660..4020e8330a 100644 --- a/tests/e2e/Services/GraphQL/ScopeTest.php +++ b/tests/e2e/Services/GraphQL/ScopeTest.php @@ -18,7 +18,7 @@ class ScopeTest extends Scope { $projectId = $this->getProject()['$id']; $apiKey = $this->getNewKey(['databases.read']); - $query = $this->getQuery(self::$CREATE_DATABASE); + $query = $this->getQuery(self::CREATE_DATABASE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -33,7 +33,7 @@ class ScopeTest extends Scope 'x-appwrite-key' => $apiKey, ], $gqlPayload); - $message = "app.{$projectId}@service.localhost (role: applications) missing scope (databases.write)"; + $message = "app.{$projectId}@service.localhost (role: applications) missing scopes ([\"databases.write\"])"; $this->assertArrayHasKey('errors', $database['body']); $this->assertEquals($message, $database['body']['errors'][0]['message']); } @@ -42,7 +42,7 @@ class ScopeTest extends Scope { $projectId = $this->getProject()['$id']; $apiKey = $this->getNewKey(['databases.read', 'databases.write']); - $query = $this->getQuery(self::$CREATE_DATABASE); + $query = $this->getQuery(self::CREATE_DATABASE); $gqlPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/GraphQL/StorageClientTest.php b/tests/e2e/Services/GraphQL/StorageClientTest.php index 9896598c2d..e05a394d6f 100644 --- a/tests/e2e/Services/GraphQL/StorageClientTest.php +++ b/tests/e2e/Services/GraphQL/StorageClientTest.php @@ -20,7 +20,7 @@ class StorageClientTest extends Scope public function testCreateBucket(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_BUCKET); + $query = $this->getQuery(self::CREATE_BUCKET); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -56,7 +56,7 @@ class StorageClientTest extends Scope public function testCreateFile($bucket): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_FILE); + $query = $this->getQuery(self::CREATE_FILE); $gqlPayload = [ 'operations' => \json_encode([ 'query' => $query, @@ -98,7 +98,7 @@ class StorageClientTest extends Scope public function testGetFiles($bucket): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FILES); + $query = $this->getQuery(self::GET_FILES); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -130,7 +130,7 @@ class StorageClientTest extends Scope public function testGetFile($bucket, $file) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FILE); + $query = $this->getQuery(self::GET_FILE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -159,7 +159,7 @@ class StorageClientTest extends Scope public function testGetFilePreview($file) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FILE_PREVIEW); + $query = $this->getQuery(self::GET_FILE_PREVIEW); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -189,7 +189,7 @@ class StorageClientTest extends Scope public function testGetFileDownload($file) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FILE_DOWNLOAD); + $query = $this->getQuery(self::GET_FILE_DOWNLOAD); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -215,7 +215,7 @@ class StorageClientTest extends Scope public function testGetFileView($file): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FILE_VIEW); + $query = $this->getQuery(self::GET_FILE_VIEW); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -241,7 +241,7 @@ class StorageClientTest extends Scope public function testUpdateFile($file): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_FILE); + $query = $this->getQuery(self::UPDATE_FILE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -276,7 +276,7 @@ class StorageClientTest extends Scope public function testDeleteFile($file): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_FILE); + $query = $this->getQuery(self::DELETE_FILE); $gqlPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/GraphQL/StorageServerTest.php b/tests/e2e/Services/GraphQL/StorageServerTest.php index 7fea895b1c..37dba77ab3 100644 --- a/tests/e2e/Services/GraphQL/StorageServerTest.php +++ b/tests/e2e/Services/GraphQL/StorageServerTest.php @@ -20,7 +20,7 @@ class StorageServerTest extends Scope public function testCreateBucket(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_BUCKET); + $query = $this->getQuery(self::CREATE_BUCKET); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -55,7 +55,7 @@ class StorageServerTest extends Scope public function testCreateFile($bucket): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_FILE); + $query = $this->getQuery(self::CREATE_FILE); $gqlPayload = [ 'operations' => \json_encode([ 'query' => $query, @@ -90,7 +90,7 @@ class StorageServerTest extends Scope public function testGetBuckets(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_BUCKETS); + $query = $this->getQuery(self::GET_BUCKETS); $gqlPayload = [ 'query' => $query, ]; @@ -117,7 +117,7 @@ class StorageServerTest extends Scope public function testGetBucket($bucket): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_BUCKET); + $query = $this->getQuery(self::GET_BUCKET); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -147,7 +147,7 @@ class StorageServerTest extends Scope public function testGetFiles($bucket): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FILES); + $query = $this->getQuery(self::GET_FILES); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -179,7 +179,7 @@ class StorageServerTest extends Scope public function testGetFile($bucket, $file) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FILE); + $query = $this->getQuery(self::GET_FILE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -208,7 +208,7 @@ class StorageServerTest extends Scope public function testGetFilePreview($file) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FILE_PREVIEW); + $query = $this->getQuery(self::GET_FILE_PREVIEW); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -238,7 +238,7 @@ class StorageServerTest extends Scope public function testGetFileDownload($file) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FILE_DOWNLOAD); + $query = $this->getQuery(self::GET_FILE_DOWNLOAD); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -264,7 +264,7 @@ class StorageServerTest extends Scope public function testGetFileView($file): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_FILE_VIEW); + $query = $this->getQuery(self::GET_FILE_VIEW); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -290,7 +290,7 @@ class StorageServerTest extends Scope public function testUpdateBucket($bucket): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_BUCKET); + $query = $this->getQuery(self::UPDATE_BUCKET); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -322,7 +322,7 @@ class StorageServerTest extends Scope public function testUpdateFile($file): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_FILE); + $query = $this->getQuery(self::UPDATE_FILE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -357,7 +357,7 @@ class StorageServerTest extends Scope public function testDeleteFile($file): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_FILE); + $query = $this->getQuery(self::DELETE_FILE); $gqlPayload = [ 'query' => $query, 'variables' => [ @@ -384,7 +384,7 @@ class StorageServerTest extends Scope public function testDeleteBucket($bucket): void { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_BUCKET); + $query = $this->getQuery(self::DELETE_BUCKET); $gqlPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/GraphQL/TablesDB/AbuseTest.php b/tests/e2e/Services/GraphQL/TablesDB/AbuseTest.php new file mode 100644 index 0000000000..9fab95a9ea --- /dev/null +++ b/tests/e2e/Services/GraphQL/TablesDB/AbuseTest.php @@ -0,0 +1,185 @@ +<?php + +namespace Tests\E2E\Services\GraphQL\TablesDB; + +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideServer; +use Tests\E2E\Services\GraphQL\Base; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; +use Utopia\System\System; + +class AbuseTest extends Scope +{ + use ProjectCustom; + use SideServer; + use Base; + + protected function setUp(): void + { + parent::setUp(); + + if (System::getEnv('_APP_OPTIONS_ABUSE') === 'disabled') { + $this->markTestSkipped('Abuse is not enabled.'); + } + } + + public function testRateLimitEnforced() + { + $data = $this->createTable(); + $databaseId = $data['databaseId']; + $tableId = $data['tableId']; + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_ROW); + $max = 120; + + for ($i = 0; $i <= $max + 1; $i++) { + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $databaseId, + 'tableId' => $tableId, + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'John Doe', + ], + ], + ]; + + $response = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $gqlPayload); + + if ($i < $max) { + $this->assertArrayNotHasKey('errors', $response['body']); + } else { + $this->assertArrayHasKey('errors', $response['body']); + } + } + } + + public function testComplexQueryBlocked() + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::COMPLEX_QUERY_TABLE); + $graphQLPayload = [ + 'query' => $query, + 'variables' => [ + 'userId' => 'user', + 'email' => 'user@appwrite.io', + 'password' => 'password', + 'databaseId' => 'database', + 'databaseName' => 'database', + 'tableId' => 'table', + 'tableName' => 'table', + 'tablePermissions' => [ + Permission::read(Role::users()), + Permission::create(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + 'rowSecurity' => false, + ], + ]; + + $response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $graphQLPayload); + + $max = System::getEnv('_APP_GRAPHQL_MAX_QUERY_COMPLEXITY', 250); + + $this->assertEquals('Max query complexity should be ' . $max . ' but got 259.', $response['body']['errors'][0]['message']); + } + + public function testTooManyQueriesBlocked() + { + $projectId = $this->getProject()['$id']; + $maxQueries = System::getEnv('_APP_GRAPHQL_MAX_QUERIES', 10); + + $query = []; + for ($i = 0; $i <= $maxQueries + 1; $i++) { + $query[] = ['query' => $this->getQuery(self::LIST_COUNTRIES)]; + } + + $response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $query); + + $this->assertEquals('Too many queries.', $response['body']['message']); + } + + private function createTable(): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_DATABASE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => 'actors', + 'name' => 'AbuseDatabase', + ] + ]; + + $response = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $gqlPayload); + + $databaseId = $response['body']['data']['databasesCreate']['_id']; + + $query = $this->getQuery(self::CREATE_TABLE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $databaseId, + 'tableId' => 'actors', + 'name' => 'Actors', + 'rowSecurity' => false, + 'permissions' => [ + Permission::read(Role::any()), + Permission::write(Role::any()), + ], + ] + ]; + + $response = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $gqlPayload); + + $tableId = $response['body']['data']['tablesDBCreateTable']['_id']; + + $query = $this->getQuery(self::CREATE_STRING_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $databaseId, + 'tableId' => $tableId, + 'key' => 'name', + 'size' => 256, + 'required' => true, + ] + ]; + + $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $gqlPayload); + + sleep(2); + + return [ + 'databaseId' => $databaseId, + 'tableId' => $tableId, + ]; + } +} diff --git a/tests/e2e/Services/GraphQL/TablesDB/AuthTest.php b/tests/e2e/Services/GraphQL/TablesDB/AuthTest.php new file mode 100644 index 0000000000..5b5e721323 --- /dev/null +++ b/tests/e2e/Services/GraphQL/TablesDB/AuthTest.php @@ -0,0 +1,253 @@ +<?php + +namespace Tests\E2E\Services\GraphQL\TablesDB; + +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideClient; +use Tests\E2E\Services\GraphQL\Base; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; + +class AuthTest extends Scope +{ + use ProjectCustom; + use SideClient; + use Base; + + private array $account1; + private array $account2; + + private string $token1; + private string $token2; + + private array $database; + private array $table; + + public function setUp(): void + { + parent::setUp(); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_ACCOUNT); + + $email1 = 'test' . \rand() . '@test.com'; + $email2 = 'test' . \rand() . '@test.com'; + + // Create account 1 + $graphQLPayload = [ + 'query' => $query, + 'variables' => [ + 'userId' => ID::unique(), + 'name' => 'User Name', + 'email' => $email1, + 'password' => 'password', + ], + ]; + $this->account1 = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $graphQLPayload); + + // Create account 2 + $graphQLPayload['variables']['userId'] = ID::unique(); + $graphQLPayload['variables']['email'] = $email2; + + $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $graphQLPayload); + + // Create session 1 + $query = $this->getQuery(self::CREATE_ACCOUNT_SESSION); + $graphQLPayload = [ + 'query' => $query, + 'variables' => [ + 'email' => $email1, + 'password' => 'password', + ] + ]; + $session1 = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $graphQLPayload); + + $this->token1 = $session1['cookies']['a_session_' . $projectId]; + + // Create session 2 + $graphQLPayload['variables']['email'] = $email2; + + $session2 = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $graphQLPayload); + + $this->token2 = $session2['cookies']['a_session_' . $projectId]; + + // Create database + $query = $this->getQuery(self::CREATE_DATABASE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => ID::unique(), + 'name' => 'Actors', + ] + ]; + $this->database = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $gqlPayload); + + // Create table + $query = $this->getQuery(self::CREATE_TABLE); + $userId = $this->account1['body']['data']['accountCreate']['_id']; + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $this->database['body']['data']['databasesCreate']['_id'], + 'tableId' => ID::unique(), + 'name' => 'Actors', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($userId)) + ] + ] + ]; + $this->table = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $gqlPayload); + + // Create string attribute + $query = $this->getQuery(self::CREATE_STRING_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $this->database['body']['data']['databasesCreate']['_id'], + 'tableId' => $this->table['body']['data']['tablesDBCreateTable']['_id'], + 'key' => 'name', + 'size' => 256, + 'required' => true, + ] + ]; + $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $gqlPayload); + + sleep(1); + } + + public function testInvalidAuth() + { + $projectId = $this->getProject()['$id']; + + // Create row as account 1 + $query = $this->getQuery(self::CREATE_ROW); + $userId = $this->account1['body']['data']['accountCreate']['_id']; + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $this->database['body']['data']['databasesCreate']['_id'], + 'tableId' => $this->table['body']['data']['tablesDBCreateTable']['_id'], + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'John Doe', + ], + 'permissions' => [ + Permission::read(Role::user($userId)), + Permission::update(Role::user($userId)), + Permission::delete(Role::user($userId)), + ] + ] + ]; + $row = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'cookie' => 'a_session_' . $projectId . '=' . $this->token1, + ], $gqlPayload); + + // Try to read as account 1 + $query = $this->getQuery(self::GET_ROW); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $this->database['body']['data']['databasesCreate']['_id'], + 'tableId' => $this->table['body']['data']['tablesDBCreateTable']['_id'], + 'rowId' => $row['body']['data']['tablesDBCreateRow']['_id'], + ] + ]; + $row = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'cookie' => 'a_session_' . $projectId . '=' . $this->token1, + ], $gqlPayload); + + $this->assertIsArray($row['body']['data']['tablesDBGetRow']); + $this->assertArrayNotHasKey('errors', $row['body']); + + // Try to read as account 2 + $row = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'cookie' => 'a_session_' . $projectId . '=' . $this->token2, + ], $gqlPayload); + + $this->assertArrayHasKey('errors', $row['body']); + $this->assertEquals('Row with the requested ID could not be found.', $row['body']['errors'][0]['message']); + } + + public function testValidAuth() + { + $projectId = $this->getProject()['$id']; + + // Create row as account 1 + $query = $this->getQuery(self::CREATE_ROW); + $userId = $this->account1['body']['data']['accountCreate']['_id']; + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $this->database['body']['data']['databasesCreate']['_id'], + 'tableId' => $this->table['body']['data']['tablesDBCreateTable']['_id'], + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'John Doe', + ], + 'permissions' => [ + Permission::read(Role::user($userId)), + Permission::update(Role::user($userId)), + Permission::delete(Role::user($userId)), + ], + ] + ]; + $row = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'cookie' => 'a_session_' . $projectId . '=' . $this->token1, + ], $gqlPayload); + + // Try to delete as account 1 + $query = $this->getQuery(self::DELETE_ROW); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $this->database['body']['data']['databasesCreate']['_id'], + 'tableId' => $this->table['body']['data']['tablesDBCreateTable']['_id'], + 'rowId' => $row['body']['data']['tablesDBCreateRow']['_id'], + ] + ]; + $row = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'cookie' => 'a_session_' . $projectId . '=' . $this->token1, + ], $gqlPayload); + + $this->assertIsNotArray($row['body']); + $this->assertEquals(204, $row['headers']['status-code']); + } +} diff --git a/tests/e2e/Services/GraphQL/TablesDB/DatabaseClientTest.php b/tests/e2e/Services/GraphQL/TablesDB/DatabaseClientTest.php new file mode 100644 index 0000000000..80d891125a --- /dev/null +++ b/tests/e2e/Services/GraphQL/TablesDB/DatabaseClientTest.php @@ -0,0 +1,589 @@ +<?php + +namespace Tests\E2E\Services\GraphQL\TablesDB; + +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideClient; +use Tests\E2E\Services\GraphQL\Base; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; +use Utopia\Database\Query; + +class DatabaseClientTest extends Scope +{ + use ProjectCustom; + use SideClient; + use Base; + + public function testCreateDatabase(): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::TABLESDB_CREATE_DATABASE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => ID::unique(), + 'name' => 'Actors', + ] + ]; + + $database = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $gqlPayload); + + $this->assertIsArray($database['body']['data']); + $this->assertArrayNotHasKey('errors', $database['body']); + $database = $database['body']['data']['tablesDBCreate']; + $this->assertEquals('Actors', $database['name']); + + return $database; + } + + /** + * @depends testCreateDatabase + */ + public function testCreateTable($database): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_TABLE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $database['_id'], + 'tableId' => 'actors', + 'name' => 'Actors', + 'rowSecurity' => false, + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + ] + ]; + + $table = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $gqlPayload); + + $this->assertIsArray($table['body']['data']); + $this->assertArrayNotHasKey('errors', $table['body']); + $table = $table['body']['data']['tablesDBCreateTable']; + $this->assertEquals('Actors', $table['name']); + + return [ + 'table' => $table, + 'database' => $database, + ]; + } + + /** + * @depends testCreateTable + */ + public function testCreateStringColumn($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_STRING_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'name', + 'size' => 256, + 'required' => true, + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateStringColumn']); + + return $data; + } + + /** + * @depends testCreateTable + */ + public function testCreateIntegerColumn($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_INTEGER_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'age', + 'min' => 18, + 'max' => 150, + 'required' => true, + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateIntegerColumn']); + + return $data; + } + + /** + * @depends testCreateStringColumn + * @depends testCreateIntegerColumn + */ + public function testCreateRow($data): array + { + sleep(1); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_ROW); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'John Doe', + 'age' => 35, + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ] + ]; + + $row = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $row['body']); + $this->assertIsArray($row['body']['data']); + + $row = $row['body']['data']['tablesDBCreateRow']; + $this->assertIsArray($row); + + return [ + 'database' => $data['database'], + 'table' => $data['table'], + 'row' => $row, + ]; + } + + /** + * @depends testCreateTable + * @throws \Exception + */ + public function testGetRows($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::GET_ROWS); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + ] + ]; + + $rows = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $rows['body']); + $this->assertIsArray($rows['body']['data']); + $this->assertIsArray($rows['body']['data']['tablesDBListRows']); + } + + /** + * @depends testCreateRow + * @throws \Exception + */ + public function testGetDocument($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::GET_ROW); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'rowId' => $data['row']['_id'], + ] + ]; + + $row = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $row['body']); + $this->assertIsArray($row['body']['data']); + $this->assertIsArray($row['body']['data']['tablesDBGetRow']); + } + + /** + * @depends testCreateRow + * @throws \Exception + */ + public function testUpdateRow($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_ROW); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'rowId' => $data['row']['_id'], + 'data' => [ + 'name' => 'New Row Name', + ], + ] + ]; + + $row = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $row['body']); + $this->assertIsArray($row['body']['data']); + $row = $row['body']['data']['tablesDBUpdateRow']; + $this->assertIsArray($row); + + $this->assertStringContainsString('New Row Name', $row['data']); + } + + /** + * @depends testCreateRow + * @throws \Exception + */ + public function testDeleteRow($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::DELETE_ROW); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'rowId' => $data['row']['_id'], + ] + ]; + + $row = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsNotArray($row['body']); + $this->assertEquals(204, $row['headers']['status-code']); + } + + /** + * @throws \Exception + */ + public function testBulkCreate(): array + { + $project = $this->getProject(); + $projectId = $project['$id']; + $headers = [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $project['apiKey'], + ]; + + // Step 1: Create database + $query = $this->getQuery(self::TABLESDB_CREATE_DATABASE); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => 'bulk', + 'name' => 'Bulk', + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $databaseId = $res['body']['data']['tablesDBCreate']['_id']; + + // Step 2: Create table + $query = $this->getQuery(self::CREATE_TABLE); + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'tableId' => 'operations', + 'name' => 'Operations', + 'rowSecurity' => false, + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $tableId = $res['body']['data']['tablesDBCreateTable']['_id']; + + // Step 3: Create column + $query = $this->getQuery(self::CREATE_STRING_COLUMN); + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'tableId' => $tableId, + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + sleep(1); + + // Step 4: Create rows + $query = $this->getQuery(self::CREATE_ROWS); + $rows = []; + for ($i = 1; $i <= 10; $i++) { + $rows[] = ['$id' => 'row' . $i, 'name' => 'Row #' . $i]; + } + + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'tableId' => $tableId, + 'rows' => $rows, + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(10, $res['body']['data']['tablesDBCreateRows']['rows']); + + return compact('databaseId', 'tableId', 'projectId'); + } + + /** + * @depends testBulkCreate + */ + public function testBulkUpdate(array $data): array + { + $userId = $this->getUser()['$id']; + $permissions = [ + Permission::read(Role::user($userId)), + Permission::update(Role::user($userId)), + Permission::delete(Role::user($userId)), + ]; + + $headers = [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]; + + // Step 1: Bulk update rows + $query = $this->getQuery(self::UPDATE_ROWS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + 'data' => [ + 'name' => 'Rows Updated', + '$permissions' => $permissions, + ], + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(10, $res['body']['data']['tablesDBUpdateRows']['rows']); + + // Step 2: Fetch and validate updated rows + $query = $this->getQuery(self::GET_ROWS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + 'queries' => [Query::equal('name', ['Rows Updated'])->toString()], + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertEquals(200, $res['headers']['status-code']); + + $fetched = $res['body']['data']['tablesDBListRows']; + $this->assertEquals(10, $fetched['total']); + + foreach ($fetched['rows'] as $row) { + $this->assertEquals($permissions, $row['_permissions']); + $this->assertEquals($data['tableId'], $row['_tableId']); + $this->assertEquals($data['databaseId'], $row['_databaseId']); + $this->assertEquals('Rows Updated', json_decode($row['data'], true)['name']); + } + + return $data; + } + + /** + * @depends testBulkCreate + */ + public function testBulkUpsert(array $data): array + { + $userId = $this->getUser()['$id']; + $headers = [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]; + + $permissions = [ + Permission::read(Role::user($userId)), + Permission::update(Role::user($userId)), + Permission::delete(Role::user($userId)), + ]; + + // Step 1: Mutate row 10 and add row 11 + $query = $this->getQuery(self::UPSERT_ROWS); + $upsertPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + 'rows' => [ + [ + '$id' => 'row10', + 'name' => 'Row #1000', + ], + [ + 'name' => 'Row #11', + ], + ], + ], + ]; + + $response = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $upsertPayload); + $this->assertArrayNotHasKey('errors', $response['body']); + + $rows = $response['body']['data']['tablesDBUpsertRows']['rows']; + $this->assertCount(2, $rows); + + $rowMap = []; + foreach ($rows as $row) { + $decoded = json_decode($row['data'], true); + $rowMap[$decoded['name']] = $decoded; + } + + $this->assertArrayHasKey('Row #1000', $rowMap); + $this->assertArrayHasKey('Row #11', $rowMap); + + // Step 2: Fetch all rows and confirm count is now 11 + $query = $this->getQuery(self::GET_ROWS); + $fetchPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $fetchPayload); + $this->assertEquals(200, $res['headers']['status-code']); + + $fetched = $res['body']['data']['tablesDBListRows']; + $this->assertEquals(11, $fetched['total']); + + // Step 3: Upsert row with new permissions using `tablesUpsertRow` + $query = $this->getQuery(self::UPSERT_ROW); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + 'rowId' => 'row10', + 'data' => ['name' => 'Row #10 Patched'], + 'permissions' => $permissions, + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + + $updated = $res['body']['data']['tablesDBUpsertRow']; + $this->assertEquals('Row #10 Patched', json_decode($updated['data'], true)['name']); + $this->assertEquals($data['databaseId'], $updated['_databaseId']); + $this->assertEquals($data['tableId'], $updated['_tableId']); + + return $data; + } + + /** + * @depends testBulkUpsert + */ + public function testBulkDelete(array $data): array + { + $headers = [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]; + + // Step 1: Perform bulk delete + $query = $this->getQuery(self::DELETE_ROWS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + + $deleted = $res['body']['data']['tablesDBDeleteRows']['rows']; + $this->assertIsArray($deleted); + $this->assertCount(11, $deleted); + + // Step 2: Confirm deletion via refetch + $query = $this->getQuery(self::GET_ROWS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertEquals(200, $res['headers']['status-code']); + $this->assertEquals(0, $res['body']['data']['tablesDBListRows']['total']); + + return $data; + } +} diff --git a/tests/e2e/Services/GraphQL/TablesDB/DatabaseServerTest.php b/tests/e2e/Services/GraphQL/TablesDB/DatabaseServerTest.php new file mode 100644 index 0000000000..676d570d74 --- /dev/null +++ b/tests/e2e/Services/GraphQL/TablesDB/DatabaseServerTest.php @@ -0,0 +1,1749 @@ +<?php + +namespace Tests\E2E\Services\GraphQL\TablesDB; + +use Exception; +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideServer; +use Tests\E2E\Services\GraphQL\Base; +use Utopia\Database\Database; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; +use Utopia\Database\Query; + +class DatabaseServerTest extends Scope +{ + use ProjectCustom; + use SideServer; + use Base; + + public function testCreateDatabase(): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::TABLESDB_CREATE_DATABASE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => 'actors', + 'name' => 'Actors', + ] + ]; + + $database = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($database['body']['data']); + $this->assertArrayNotHasKey('errors', $database['body']); + $database = $database['body']['data']['tablesDBCreate']; + $this->assertEquals('Actors', $database['name']); + + return $database; + } + + /** + * @depends testCreateDatabase + */ + public function testCreateTable($database): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_TABLE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $database['_id'], + 'tableId' => 'actors', + 'name' => 'Actors', + 'rowSecurity' => false, + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + ] + ]; + + $table = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($table['body']['data']); + $this->assertArrayNotHasKey('errors', $table['body']); + $table = $table['body']['data']['tablesDBCreateTable']; + $this->assertEquals('Actors', $table['name']); + + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $database['_id'], + 'tableId' => 'movies', + 'name' => 'Movies', + 'rowSecurity' => false, + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + ] + ]; + + $table2 = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($table2['body']['data']); + $this->assertArrayNotHasKey('errors', $table2['body']); + $table2 = $table2['body']['data']['tablesDBCreateTable']; + $this->assertEquals('Movies', $table2['name']); + + return [ + 'database' => $database, + 'table' => $table, + 'table2' => $table2, + ]; + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testCreateStringColumn($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_STRING_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'name', + 'size' => 256, + 'required' => true, + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + // TODO: @itznotabug - check for `encrypt` attribute in string column's response body as well! + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateStringColumn']); + + return $data; + } + + /** + * @depends testCreateStringColumn + * @throws Exception + */ + public function testUpdateStringColumn($data): array + { + // Wait for columns to be available + sleep(1); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_STRING_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'name', + 'required' => false, + 'default' => 'Default Value', + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBUpdateStringColumn']); + $this->assertFalse($column['body']['data']['tablesDBUpdateStringColumn']['required']); + $this->assertEquals('Default Value', $column['body']['data']['tablesDBUpdateStringColumn']['default']); + $this->assertEquals(200, $column['headers']['status-code']); + + return $data; + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testCreateIntegerColumn($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_INTEGER_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'age', + 'min' => 18, + 'max' => 150, + 'required' => true, + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateIntegerColumn']); + + return $data; + } + + /** + * @depends testCreateIntegerColumn + * @throws Exception + */ + public function testUpdateIntegerColumn($data): array + { + // Wait for columns to be available + sleep(1); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_INTEGER_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'age', + 'required' => false, + 'min' => 12, + 'max' => 160, + 'default' => 50 + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBUpdateIntegerColumn']); + $this->assertFalse($column['body']['data']['tablesDBUpdateIntegerColumn']['required']); + $this->assertEquals(12, $column['body']['data']['tablesDBUpdateIntegerColumn']['min']); + $this->assertEquals(160, $column['body']['data']['tablesDBUpdateIntegerColumn']['max']); + $this->assertEquals(50, $column['body']['data']['tablesDBUpdateIntegerColumn']['default']); + $this->assertEquals(200, $column['headers']['status-code']); + + return $data; + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testCreateBooleanColumn($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_BOOLEAN_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'alive', + 'required' => true, + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateBooleanColumn']); + + return $data; + } + + /** + * @depends testCreateBooleanColumn + * @throws Exception + */ + public function testUpdateBooleanColumn($data): array + { + // Wait for columns to be available + sleep(1); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_BOOLEAN_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'alive', + 'required' => false, + 'default' => true + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBUpdateBooleanColumn']); + $this->assertFalse($column['body']['data']['tablesDBUpdateBooleanColumn']['required']); + $this->assertTrue($column['body']['data']['tablesDBUpdateBooleanColumn']['default']); + $this->assertEquals(200, $column['headers']['status-code']); + + return $data; + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testCreateFloatColumn($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_FLOAT_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'salary', + 'min' => 1000.0, + 'max' => 999999.99, + 'default' => 1000.0, + 'required' => false, + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateFloatColumn']); + + return $data; + } + + /** + * @depends testCreateFloatColumn + * @throws Exception + */ + public function testUpdateFloatColumn($data): array + { + // Wait for columns to be available + sleep(1); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_FLOAT_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'salary', + 'required' => false, + 'min' => 100.0, + 'max' => 1000000.0, + 'default' => 2500.0 + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBUpdateFloatColumn']); + $this->assertFalse($column['body']['data']['tablesDBUpdateFloatColumn']['required']); + $this->assertEquals(100.0, $column['body']['data']['tablesDBUpdateFloatColumn']['min']); + $this->assertEquals(1000000.0, $column['body']['data']['tablesDBUpdateFloatColumn']['max']); + $this->assertEquals(2500.0, $column['body']['data']['tablesDBUpdateFloatColumn']['default']); + $this->assertEquals(200, $column['headers']['status-code']); + + return $data; + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testCreateEmailColumn($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_EMAIL_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'email', + 'required' => true, + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateEmailColumn']); + + return $data; + } + + /** + * @depends testCreateEmailColumn + * @throws Exception + */ + public function testUpdateEmailColumn($data): array + { + // Wait for columns to be available + sleep(1); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_EMAIL_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'email', + 'required' => false, + 'default' => 'torsten@appwrite.io', + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBUpdateEmailColumn']); + $this->assertFalse($column['body']['data']['tablesDBUpdateEmailColumn']['required']); + $this->assertEquals('torsten@appwrite.io', $column['body']['data']['tablesDBUpdateEmailColumn']['default']); + $this->assertEquals(200, $column['headers']['status-code']); + + return $data; + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testCreateEnumColumn($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_ENUM_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'role', + 'elements' => [ + 'crew', + 'actor', + 'guest', + ], + 'required' => true, + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateEnumColumn']); + + return $data; + } + + + /** + * @depends testCreateEnumColumn + * @throws Exception + */ + public function testUpdateEnumColumn($data): array + { + // Wait for columns to be available + sleep(1); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_ENUM_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'role', + 'required' => false, + 'elements' => [ + 'crew', + 'tech', + 'actor' + ], + 'default' => 'tech' + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBUpdateEnumColumn']); + $this->assertFalse($column['body']['data']['tablesDBUpdateEnumColumn']['required']); + $this->assertEquals('tech', $column['body']['data']['tablesDBUpdateEnumColumn']['default']); + $this->assertContains('tech', $column['body']['data']['tablesDBUpdateEnumColumn']['elements']); + $this->assertNotContains('guest', $column['body']['data']['tablesDBUpdateEnumColumn']['elements']); + $this->assertEquals(200, $column['headers']['status-code']); + + return $data; + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testCreateDatetimeColumn($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_DATETIME_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'dob', + 'required' => true, + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateDatetimeColumn']); + + return $data; + } + + /** + * @depends testCreateDatetimeColumn + * @throws Exception + */ + public function testUpdateDatetimeColumn($data): array + { + // Wait for columns to be available + sleep(1); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_DATETIME_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'dob', + 'required' => false, + 'default' => '2000-01-01T00:00:00Z' + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBUpdateDatetimeColumn']); + $this->assertFalse($column['body']['data']['tablesDBUpdateDatetimeColumn']['required']); + $this->assertEquals('2000-01-01T00:00:00Z', $column['body']['data']['tablesDBUpdateDatetimeColumn']['default']); + $this->assertEquals(200, $column['headers']['status-code']); + + return $data; + } + + /** + * @depends testCreateTable + */ + public function testCreateRelationshipColumn(array $data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_RELATIONSHIP_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table2']['_id'], // Movies + 'relatedTableId' => $data['table']['_id'], // Actors + 'type' => Database::RELATION_ONE_TO_MANY, + 'twoWay' => true, + 'key' => 'actors', + 'twoWayKey' => 'movie' + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateRelationshipColumn']); + + return $data; + } + + /** + * @depends testCreateRelationshipColumn + */ + public function testUpdateRelationshipColumn(array $data): array + { + sleep(1); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_RELATIONSHIP_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table2']['_id'], + 'key' => 'actors', + 'onDelete' => Database::RELATION_MUTATE_CASCADE, + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBUpdateRelationshipColumn']); + + return $data; + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testCreateIPColumn($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_IP_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'ip', + 'required' => false, + 'default' => '::1', + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateIpColumn']); + + return $data; + } + + /** + * @depends testCreateIPColumn + * @throws Exception + */ + public function testUpdateIPColumn($data): array + { + // Wait for columns to be available + sleep(3); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_IP_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'ip', + 'required' => false, + 'default' => '127.0.0.1' + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBUpdateIpColumn']); + $this->assertFalse($column['body']['data']['tablesDBUpdateIpColumn']['required']); + $this->assertEquals('127.0.0.1', $column['body']['data']['tablesDBUpdateIpColumn']['default']); + $this->assertEquals(200, $column['headers']['status-code']); + + return $data; + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testCreateURLColumn($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_URL_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'url', + 'required' => false, + 'default' => 'https://appwrite.io', + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBCreateUrlColumn']); + + return $data; + } + + /** + * @depends testCreateURLColumn + * @throws Exception + */ + public function testUpdateURLColumn($data): void + { + // Wait for columns to be available + sleep(3); + + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_URL_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'url', + 'required' => false, + 'default' => 'https://cloud.appwrite.io' + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBUpdateUrlColumn']); + $this->assertFalse($column['body']['data']['tablesDBUpdateUrlColumn']['required']); + $this->assertEquals('https://cloud.appwrite.io', $column['body']['data']['tablesDBUpdateUrlColumn']['default']); + $this->assertEquals(200, $column['headers']['status-code']); + } + + /** + * @depends testUpdateStringColumn + * @depends testUpdateIntegerColumn + * @throws Exception + */ + public function testCreateIndex($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_COLUMN_INDEX); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'index', + 'type' => 'key', + 'columns' => [ + 'name', + 'age', + ], + ] + ]; + + $index = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $index['body']); + $this->assertIsArray($index['body']['data']); + $this->assertIsArray($index['body']['data']['tablesDBCreateIndex']); + + return [ + 'database' => $data['database'], + 'table' => $data['table'], + 'index' => $index['body']['data']['tablesDBCreateIndex'], + ]; + } + + /** + * @depends testUpdateStringColumn + * @depends testUpdateIntegerColumn + * @depends testUpdateBooleanColumn + * @depends testUpdateEnumColumn + * @throws Exception + */ + public function testCreateRow($data): array + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::CREATE_ROW); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'John Doe', + 'email' => 'example@appwrite.io', + 'age' => 30, + 'alive' => true, + 'salary' => 9999.9, + 'role' => 'crew', + 'dob' => '2000-01-01T00:00:00Z', + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ] + ]; + + $row = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $row['body']); + $this->assertIsArray($row['body']['data']); + + $row = $row['body']['data']['tablesDBCreateRow']; + $this->assertIsArray($row); + + return [ + 'database' => $data['database'], + 'table' => $data['table'], + 'row' => $row, + ]; + } + + // /** + // * @depends testCreateStringColumn + // * @depends testCreateIntegerColumn + // * @depends testCreateBooleanColumn + // * @depends testCreateFloatColumn + // * @depends testCreateEmailColumn + // * @depends testCreateEnumColumn + // * @depends testCreateDatetimeColumn + // * @throws Exception + // */ + // public function testCreateCustomEntity(): array + // { + // $projectId = $this->getProject()['$id']; + // $query = $this->getQuery(self::CREATE_CUSTOM_ENTITY); + // $gqlPayload = [ + // 'query' => $query, + // 'variables' => [ + // 'name' => 'John Doe', + // 'age' => 35, + // 'alive' => true, + // 'salary' => 9999.9, + // 'email' => 'johndoe@appwrite.io', + // 'role' => 'crew', + // 'dob' => '2000-01-01T00:00:00Z', + // ] + // ]; + // + // $actor = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + // 'content-type' => 'application/json', + // 'x-appwrite-project' => $projectId, + // ], $this->getHeaders()), $gqlPayload); + // + // $this->assertArrayNotHasKey('errors', $actor['body']); + // $this->assertIsArray($actor['body']['data']); + // $actor = $actor['body']['data']['actorsCreate']; + // $this->assertIsArray($actor); + // + // return $actor; + // } + + public function testGetDatabases(): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::TABLESDB_GET_DATABASES); + $gqlPayload = [ + 'query' => $query, + ]; + + $databases = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $databases['body']); + $this->assertIsArray($databases['body']['data']); + $this->assertIsArray($databases['body']['data']['tablesDBList']); + } + + /** + * @depends testCreateDatabase + * @throws Exception + */ + public function testGetDatabase($database): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::TABLESDB_GET_DATABASE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $database['_id'], + ] + ]; + + $database = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $database['body']); + $this->assertIsArray($database['body']['data']); + $this->assertIsArray($database['body']['data']['tablesDBGet']); + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testGetTables($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::GET_TABLES); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + ] + ]; + + $tables = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + + + $this->assertArrayNotHasKey('errors', $tables['body']); + $this->assertIsArray($tables['body']['data']); + $this->assertIsArray($tables['body']['data']['tablesDBListTables']); + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testGetTable($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::GET_TABLE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + ] + ]; + + $table = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $table['body']); + $this->assertIsArray($table['body']['data']); + $this->assertIsArray($table['body']['data']['tablesDBGetTable']); + } + + /** + * @depends testUpdateStringColumn + * @depends testUpdateIntegerColumn + * @throws Exception + */ + public function testGetColumns($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::GET_COLUMNS); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + ] + ]; + + $columns = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $columns['body']); + $this->assertIsArray($columns['body']['data']); + $this->assertIsArray($columns['body']['data']['tablesDBListColumns']); + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testGetColumn($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::GET_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'name', + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $column['body']); + $this->assertIsArray($column['body']['data']); + $this->assertIsArray($column['body']['data']['tablesDBGetColumn']); + } + + /** + * @depends testCreateIndex + * @throws Exception + */ + public function testGetIndexes($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::GET_COLUMN_INDEXES); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + ] + ]; + + $indices = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $indices['body']); + $this->assertIsArray($indices['body']['data']); + $this->assertIsArray($indices['body']['data']['tablesDBListIndexes']); + } + + /** + * @depends testCreateIndex + * @throws Exception + */ + public function testGetIndex($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::GET_COLUMN_INDEX); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => $data['index']['key'], + ] + ]; + + $index = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $index['body']); + $this->assertIsArray($index['body']['data']); + $this->assertIsArray($index['body']['data']['tablesDBGetIndex']); + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testGetRows($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::GET_ROWS); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + ] + ]; + + $rows = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $rows['body']); + $this->assertIsArray($rows['body']['data']); + $this->assertIsArray($rows['body']['data']['tablesDBListRows']); + } + + /** + * @depends testCreateRow + * @throws Exception + */ + public function testGetRow($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::GET_ROW); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'rowId' => $data['row']['_id'], + ] + ]; + + $row = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $row['body']); + $this->assertIsArray($row['body']['data']); + $this->assertIsArray($row['body']['data']['tablesDBGetRow']); + } + + // /** + // * @depends testCreateCustomEntity + // * @throws Exception + // */ + // public function testGetCustomEntities($data) + // { + // $projectId = $this->getProject()['$id']; + // $query = $this->getQuery(self::GET_CUSTOM_ENTITIES); + // $gqlPayload = [ + // 'query' => $query, + // ]; + // + // $customEntities = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + // 'content-type' => 'application/json', + // 'x-appwrite-project' => $projectId, + // ], $this->getHeaders()), $gqlPayload); + // + // $this->assertArrayNotHasKey('errors', $customEntities['body']); + // $this->assertIsArray($customEntities['body']['data']); + // $this->assertIsArray($customEntities['body']['data']['actorsList']); + // } + // + // /** + // * @depends testCreateCustomEntity + // * @throws Exception + // */ + // public function testGetCustomEntity($data) + // { + // $projectId = $this->getProject()['$id']; + // $query = $this->getQuery(self::GET_CUSTOM_ENTITY); + // $gqlPayload = [ + // 'query' => $query, + // 'variables' => [ + // 'id' => $data['id'], + // ] + // ]; + // + // $entity = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + // 'content-type' => 'application/json', + // 'x-appwrite-project' => $projectId, + // ], $this->getHeaders()), $gqlPayload); + // + // $this->assertArrayNotHasKey('errors', $entity['body']); + // $this->assertIsArray($entity['body']['data']); + // $this->assertIsArray($entity['body']['data']['actorsGet']); + // } + + /** + * @depends testCreateDatabase + * @throws Exception + */ + public function testUpdateDatabase($database) + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::TABLESDB_UPDATE_DATABASE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $database['_id'], + 'name' => 'New Database Name', + ] + ]; + + $database = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $database['body']); + $this->assertIsArray($database['body']['data']); + $this->assertIsArray($database['body']['data']['tablesDBUpdate']); + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testUpdateTable($data) + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_TABLE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'name' => 'New Table Name', + 'rowSecurity' => false, + ] + ]; + + $table = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $table['body']); + $this->assertIsArray($table['body']['data']); + $this->assertIsArray($table['body']['data']['tablesDBUpdateTable']); + } + + /** + * @depends testCreateRow + * @throws Exception + */ + public function testUpdateRow($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::UPDATE_ROW); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'rowId' => $data['row']['_id'], + 'data' => [ + 'name' => 'New Row Name', + ], + ] + ]; + + $row = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertArrayNotHasKey('errors', $row['body']); + $this->assertIsArray($row['body']['data']); + $row = $row['body']['data']['tablesDBUpdateRow']; + $this->assertIsArray($row); + $this->assertStringContainsString('New Row Name', $row['data']); + } + + // /** + // * @depends testCreateCustomEntity + // * @throws Exception + // */ + // public function testUpdateCustomEntity(array $data) + // { + // $projectId = $this->getProject()['$id']; + // $query = $this->getQuery(self::UPDATE_CUSTOM_ENTITY); + // $gqlPayload = [ + // 'query' => $query, + // 'variables' => [ + // 'id' => $data['id'], + // 'name' => 'New Custom Entity Name', + // ] + // ]; + // + // $entity = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + // 'content-type' => 'application/json', + // 'x-appwrite-project' => $projectId, + // ], $this->getHeaders()), $gqlPayload); + // + // $this->assertArrayNotHasKey('errors', $entity['body']); + // $this->assertIsArray($entity['body']['data']); + // $entity = $entity['body']['data']['actorsUpdate']; + // $this->assertIsArray($entity); + // $this->assertStringContainsString('New Custom Entity Name', $entity['name']); + // } + + /** + * @depends testCreateRow + * @throws Exception + */ + public function testDeleteRow($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::DELETE_ROW); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'rowId' => $data['row']['_id'], + ] + ]; + + $row = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsNotArray($row['body']); + $this->assertEquals(204, $row['headers']['status-code']); + } + + // /** + // * @depends testCreateCustomEntity + // * @throws Exception + // */ + // public function testDeleteCustomEntity(array $data) + // { + // $projectId = $this->getProject()['$id']; + // $query = $this->getQuery(self::DELETE_CUSTOM_ENTITY); + // $gqlPayload = [ + // 'query' => $query, + // 'variables' => [ + // 'id' => $data['id'], + // ] + // ]; + // + // $entity = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + // 'content-type' => 'application/json', + // 'x-appwrite-project' => $projectId, + // ], $this->getHeaders()), $gqlPayload); + // + // $this->assertIsNotArray($entity['body']); + // $this->assertEquals(204, $entity['headers']['status-code']); + // } + + /** + * @depends testUpdateStringColumn + * @throws Exception + */ + public function testDeleteColumn($data): void + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::DELETE_COLUMN); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + 'key' => 'name', + ] + ]; + + $column = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsNotArray($column['body']); + $this->assertEquals(204, $column['headers']['status-code']); + } + + /** + * @depends testCreateTable + * @throws Exception + */ + public function testDeleteTable($data) + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::DELETE_TABLE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['database']['_id'], + 'tableId' => $data['table']['_id'], + ] + ]; + + $table = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsNotArray($table['body']); + $this->assertEquals(204, $table['headers']['status-code']); + } + + /** + * @depends testCreateDatabase + * @throws Exception + */ + public function testDeleteDatabase($database) + { + $projectId = $this->getProject()['$id']; + $query = $this->getQuery(self::TABLESDB_DELETE_DATABASE); + $gqlPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $database['_id'], + ] + ]; + + $database = $this->client->call(Client::METHOD_POST, '/graphql', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()), $gqlPayload); + + $this->assertIsNotArray($database['body']); + $this->assertEquals(204, $database['headers']['status-code']); + } + + /** + * @throws Exception + */ + public function testBulkCreate(): array + { + $project = $this->getProject(); + $projectId = $project['$id']; + $headers = array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders()); + + // Step 1: Create database + $query = $this->getQuery(self::TABLESDB_CREATE_DATABASE); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => 'bulk', + 'name' => 'Bulk', + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $databaseId = $res['body']['data']['tablesDBCreate']['_id']; + + // Step 2: Create table + $query = $this->getQuery(self::CREATE_TABLE); + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'tableId' => 'operations', + 'name' => 'Operations', + 'rowSecurity' => false, + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $tableId = $res['body']['data']['tablesDBCreateTable']['_id']; + + // Step 3: Create column + $query = $this->getQuery(self::CREATE_STRING_COLUMN); + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'tableId' => $tableId, + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + sleep(1); + + // Step 4: Create rows + $query = $this->getQuery(self::CREATE_ROWS); + $rows = []; + for ($i = 1; $i <= 10; $i++) { + $rows[] = ['$id' => 'row' . $i, 'name' => 'Row #' . $i]; + } + + $payload['query'] = $query; + $payload['variables'] = [ + 'databaseId' => $databaseId, + 'tableId' => $tableId, + 'rows' => $rows, + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(10, $res['body']['data']['tablesDBCreateRows']['rows']); + + return compact('databaseId', 'tableId', 'projectId'); + } + + /** + * @depends testBulkCreate + */ + public function testBulkUpdate(array $data): array + { + $userId = $this->getUser()['$id']; + $permissions = [ + Permission::read(Role::user($userId)), + Permission::update(Role::user($userId)), + Permission::delete(Role::user($userId)), + ]; + + $headers = array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + ], $this->getHeaders()); + + // Step 1: Bulk update rows + $query = $this->getQuery(self::UPDATE_ROWS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + 'data' => [ + 'name' => 'Rows Updated', + '$permissions' => $permissions, + ], + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + $this->assertCount(10, $res['body']['data']['tablesDBUpdateRows']['rows']); + + // Step 2: Fetch and validate updated rows + $query = $this->getQuery(self::GET_ROWS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + 'queries' => [Query::equal('name', ['Rows Updated'])->toString()], + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertEquals(200, $res['headers']['status-code']); + + $fetched = $res['body']['data']['tablesDBListRows']; + $this->assertEquals(10, $fetched['total']); + + foreach ($fetched['rows'] as $row) { + $this->assertEquals($permissions, $row['_permissions']); + $this->assertEquals($data['tableId'], $row['_tableId']); + $this->assertEquals($data['databaseId'], $row['_databaseId']); + $this->assertEquals('Rows Updated', json_decode($row['data'], true)['name']); + } + + return $data; + } + + /** + * @depends testBulkCreate + */ + public function testBulkUpsert(array $data): array + { + $userId = $this->getUser()['$id']; + $headers = array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + ], $this->getHeaders()); + + $permissions = [ + Permission::read(Role::user($userId)), + Permission::update(Role::user($userId)), + Permission::delete(Role::user($userId)), + ]; + + // Step 1: Mutate row 10 and add row 11 + $query = $this->getQuery(self::UPSERT_ROWS); + $upsertPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + 'rows' => [ + [ + '$id' => 'row10', + 'name' => 'Row #1000', + ], + [ + 'name' => 'Row #11', + ], + ], + ], + ]; + + $response = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $upsertPayload); + $this->assertArrayNotHasKey('errors', $response['body']); + + $rows = $response['body']['data']['tablesDBUpsertRows']['rows']; + $this->assertCount(2, $rows); + + $rowMap = []; + foreach ($rows as $row) { + $decoded = json_decode($row['data'], true); + $rowMap[$decoded['name']] = $decoded; + } + + $this->assertArrayHasKey('Row #1000', $rowMap); + $this->assertArrayHasKey('Row #11', $rowMap); + + // Step 2: Fetch all rows and confirm count is now 11 + $query = $this->getQuery(self::GET_ROWS); + $fetchPayload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $fetchPayload); + $this->assertEquals(200, $res['headers']['status-code']); + + $fetched = $res['body']['data']['tablesDBListRows']; + $this->assertEquals(11, $fetched['total']); + + // Step 3: Upsert row with new permissions using `tablesUpsertRow` + $query = $this->getQuery(self::UPSERT_ROW); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + 'rowId' => 'row10', + 'data' => ['name' => 'Row #10 Patched'], + 'permissions' => $permissions, + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + + $updated = $res['body']['data']['tablesDBUpsertRow']; + $this->assertEquals('Row #10 Patched', json_decode($updated['data'], true)['name']); + $this->assertEquals($data['databaseId'], $updated['_databaseId']); + $this->assertEquals($data['tableId'], $updated['_tableId']); + + return $data; + } + + /** + * @depends testBulkUpsert + */ + public function testBulkDelete(array $data): array + { + $headers = array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $data['projectId'], + ], $this->getHeaders()); + + // Step 1: Perform bulk delete + $query = $this->getQuery(self::DELETE_ROWS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertArrayNotHasKey('errors', $res['body']); + + $deleted = $res['body']['data']['tablesDBDeleteRows']['rows']; + $this->assertIsArray($deleted); + $this->assertCount(11, $deleted); + + // Step 2: Confirm deletion via refetch + $query = $this->getQuery(self::GET_ROWS); + $payload = [ + 'query' => $query, + 'variables' => [ + 'databaseId' => $data['databaseId'], + 'tableId' => $data['tableId'], + ], + ]; + + $res = $this->client->call(Client::METHOD_POST, '/graphql', $headers, $payload); + $this->assertEquals(200, $res['headers']['status-code']); + $this->assertEquals(0, $res['body']['data']['tablesDBListRows']['total']); + + return $data; + } +} diff --git a/tests/e2e/Services/GraphQL/TeamsClientTest.php b/tests/e2e/Services/GraphQL/TeamsClientTest.php index 87dbfcca00..d077d3c87b 100644 --- a/tests/e2e/Services/GraphQL/TeamsClientTest.php +++ b/tests/e2e/Services/GraphQL/TeamsClientTest.php @@ -17,7 +17,7 @@ class TeamsClientTest extends Scope public function testCreateTeam(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_TEAM); + $query = $this->getQuery(self::CREATE_TEAM); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -46,7 +46,7 @@ class TeamsClientTest extends Scope public function testCreateTeamMembership($team): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_TEAM_MEMBERSHIP); + $query = $this->getQuery(self::CREATE_TEAM_MEMBERSHIP); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -75,7 +75,7 @@ class TeamsClientTest extends Scope public function testGetTeams() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_TEAMS); + $query = $this->getQuery(self::GET_TEAMS); $graphQLPayload = [ 'query' => $query, ]; @@ -95,7 +95,7 @@ class TeamsClientTest extends Scope public function testGetTeam($team) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_TEAM); + $query = $this->getQuery(self::GET_TEAM); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -120,7 +120,7 @@ class TeamsClientTest extends Scope public function testGetTeamMemberships($team) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_TEAM_MEMBERSHIPS); + $query = $this->getQuery(self::GET_TEAM_MEMBERSHIPS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -145,7 +145,7 @@ class TeamsClientTest extends Scope public function testGetTeamMembership($team, $membership) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_TEAM_MEMBERSHIP); + $query = $this->getQuery(self::GET_TEAM_MEMBERSHIP); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -170,7 +170,7 @@ class TeamsClientTest extends Scope public function testDeleteTeamMembership($team, $membership) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_TEAM_MEMBERSHIP); + $query = $this->getQuery(self::DELETE_TEAM_MEMBERSHIP); $graphQLPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/GraphQL/TeamsServerTest.php b/tests/e2e/Services/GraphQL/TeamsServerTest.php index d773dcef5d..d99ae99cf0 100644 --- a/tests/e2e/Services/GraphQL/TeamsServerTest.php +++ b/tests/e2e/Services/GraphQL/TeamsServerTest.php @@ -17,7 +17,7 @@ class TeamsServerTest extends Scope public function testCreateTeam(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_TEAM); + $query = $this->getQuery(self::CREATE_TEAM); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -46,7 +46,7 @@ class TeamsServerTest extends Scope public function testCreateTeamMembership($team): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_TEAM_MEMBERSHIP); + $query = $this->getQuery(self::CREATE_TEAM_MEMBERSHIP); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -74,7 +74,7 @@ class TeamsServerTest extends Scope public function testGetTeams() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_TEAMS); + $query = $this->getQuery(self::GET_TEAMS); $graphQLPayload = [ 'query' => $query, ]; @@ -94,7 +94,7 @@ class TeamsServerTest extends Scope public function testGetTeam($team) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_TEAM); + $query = $this->getQuery(self::GET_TEAM); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -121,7 +121,7 @@ class TeamsServerTest extends Scope public function testUpdateTeamPrefs($team) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_TEAM_PREFERENCES); + $query = $this->getQuery(self::UPDATE_TEAM_PREFERENCES); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -151,7 +151,7 @@ class TeamsServerTest extends Scope public function testGetTeamPreferences($team) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_TEAM_PREFERENCES); + $query = $this->getQuery(self::GET_TEAM_PREFERENCES); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -175,7 +175,7 @@ class TeamsServerTest extends Scope public function testGetTeamMemberships($team) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_TEAM_MEMBERSHIPS); + $query = $this->getQuery(self::GET_TEAM_MEMBERSHIPS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -200,7 +200,7 @@ class TeamsServerTest extends Scope public function testGetTeamMembership($team, $membership) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_TEAM_MEMBERSHIP); + $query = $this->getQuery(self::GET_TEAM_MEMBERSHIP); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -224,7 +224,7 @@ class TeamsServerTest extends Scope public function testUpdateTeam($team) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_TEAM_NAME); + $query = $this->getQuery(self::UPDATE_TEAM_NAME); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -251,7 +251,7 @@ class TeamsServerTest extends Scope public function testUpdateTeamMembershipRoles($team, $membership) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_TEAM_MEMBERSHIP); + $query = $this->getQuery(self::UPDATE_TEAM_MEMBERSHIP); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -279,7 +279,7 @@ class TeamsServerTest extends Scope public function testDeleteTeamMembership($team, $membership) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_TEAM_MEMBERSHIP); + $query = $this->getQuery(self::DELETE_TEAM_MEMBERSHIP); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -303,7 +303,7 @@ class TeamsServerTest extends Scope $team = $this->testCreateTeam(); $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_TEAM); + $query = $this->getQuery(self::DELETE_TEAM); $graphQLPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/GraphQL/UsersTest.php b/tests/e2e/Services/GraphQL/UsersTest.php index 64d690a0fc..7093c354a0 100644 --- a/tests/e2e/Services/GraphQL/UsersTest.php +++ b/tests/e2e/Services/GraphQL/UsersTest.php @@ -18,7 +18,7 @@ class UsersTest extends Scope public function testCreateUser(): array { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_USER); + $query = $this->getQuery(self::CREATE_USER); $email = 'users.service@example.com'; $graphQLPayload = [ 'query' => $query, @@ -52,7 +52,7 @@ class UsersTest extends Scope { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$CREATE_MAILGUN_PROVIDER); + $query = $this->getQuery(self::CREATE_MAILGUN_PROVIDER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -73,7 +73,7 @@ class UsersTest extends Scope $this->assertEquals(200, $provider['headers']['status-code']); - $query = $this->getQuery(self::$CREATE_USER_TARGET); + $query = $this->getQuery(self::CREATE_USER_TARGET); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -99,7 +99,7 @@ class UsersTest extends Scope public function testGetUsers() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_USERS); + $query = $this->getQuery(self::GET_USERS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -124,7 +124,7 @@ class UsersTest extends Scope public function testGetUser() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_USER); + $query = $this->getQuery(self::GET_USER); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -146,7 +146,7 @@ class UsersTest extends Scope public function testGetUserPreferences() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_USER_PREFERENCES); + $query = $this->getQuery(self::GET_USER_PREFERENCES); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -167,7 +167,7 @@ class UsersTest extends Scope public function testGetUserSessions() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_USER_SESSIONS); + $query = $this->getQuery(self::GET_USER_SESSIONS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -188,7 +188,7 @@ class UsersTest extends Scope public function testGetUserMemberships() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_USER_MEMBERSHIPS); + $query = $this->getQuery(self::GET_USER_MEMBERSHIPS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -209,7 +209,7 @@ class UsersTest extends Scope public function testGetUserLogs() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_USER_LOGS); + $query = $this->getQuery(self::GET_USER_LOGS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -233,7 +233,7 @@ class UsersTest extends Scope public function testListUserTargets(array $target) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$LIST_USER_TARGETS); + $query = $this->getQuery(self::LIST_USER_TARGETS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -257,7 +257,7 @@ class UsersTest extends Scope public function testGetUserTarget(array $target) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$GET_USER_TARGET); + $query = $this->getQuery(self::GET_USER_TARGET); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -278,7 +278,7 @@ class UsersTest extends Scope public function testUpdateUserStatus() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_USER_STATUS); + $query = $this->getQuery(self::UPDATE_USER_STATUS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -301,7 +301,7 @@ class UsersTest extends Scope public function testUpdateUserEmailVerification() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_USER_EMAIL_VERIFICATION); + $query = $this->getQuery(self::UPDATE_USER_EMAIL_VERIFICATION); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -323,7 +323,7 @@ class UsersTest extends Scope public function testUpdateUserPhoneVerification() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_USER_PHONE_VERIFICATION); + $query = $this->getQuery(self::UPDATE_USER_PHONE_VERIFICATION); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -346,7 +346,7 @@ class UsersTest extends Scope public function testUpdateUserName() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_USER_NAME); + $query = $this->getQuery(self::UPDATE_USER_NAME); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -369,7 +369,7 @@ class UsersTest extends Scope public function testUpdateUserEmail() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_USER_EMAIL); + $query = $this->getQuery(self::UPDATE_USER_EMAIL); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -392,7 +392,7 @@ class UsersTest extends Scope public function testUpdateUserPassword() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_USER_PASSWORD); + $query = $this->getQuery(self::UPDATE_USER_PASSWORD); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -414,7 +414,7 @@ class UsersTest extends Scope public function testUpdateUserPhone() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_USER_PHONE); + $query = $this->getQuery(self::UPDATE_USER_PHONE); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -437,7 +437,7 @@ class UsersTest extends Scope public function testUpdateUserPrefs() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_USER_PREFS); + $query = $this->getQuery(self::UPDATE_USER_PREFS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -465,7 +465,7 @@ class UsersTest extends Scope public function testUpdateUserTarget(array $target) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$UPDATE_USER_TARGET); + $query = $this->getQuery(self::UPDATE_USER_TARGET); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -487,7 +487,7 @@ class UsersTest extends Scope public function testDeleteUserSessions() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_USER_SESSIONS); + $query = $this->getQuery(self::DELETE_USER_SESSIONS); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -510,7 +510,7 @@ class UsersTest extends Scope public function testDeleteUserSession() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_USER_SESSION); + $query = $this->getQuery(self::DELETE_USER_SESSION); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -537,7 +537,7 @@ class UsersTest extends Scope public function testDeleteUserTarget(array $target) { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_USER_TARGET); + $query = $this->getQuery(self::DELETE_USER_TARGET); $graphQLPayload = [ 'query' => $query, 'variables' => [ @@ -557,7 +557,7 @@ class UsersTest extends Scope public function testDeleteUser() { $projectId = $this->getProject()['$id']; - $query = $this->getQuery(self::$DELETE_USER); + $query = $this->getQuery(self::DELETE_USER); $graphQLPayload = [ 'query' => $query, 'variables' => [ diff --git a/tests/e2e/Services/Locale/LocaleBase.php b/tests/e2e/Services/Locale/LocaleBase.php index ee731a99e5..431a2a4409 100644 --- a/tests/e2e/Services/Locale/LocaleBase.php +++ b/tests/e2e/Services/Locale/LocaleBase.php @@ -269,4 +269,57 @@ trait LocaleBase return []; } + + public function testFallbackLocale() + { + $en = 'A mock translation for testing purposes.'; + $de = 'Eine Beispielübersetzung für Testzwecke.'; + + $response = $this->client->call(Client::METHOD_GET, '/mock/tests/locale', [ + 'x-appwrite-project' => $this->getProject()['$id'], + ]); + + $this->assertEquals($response['headers']['status-code'], 200); + $this->assertEquals($en, $response['body']); + + $response = $this->client->call(Client::METHOD_GET, '/mock/tests/locale', [ + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-locale' => 'en' + ]); + + $this->assertEquals($response['headers']['status-code'], 200); + $this->assertEquals($en, $response['body']); + + $response = $this->client->call(Client::METHOD_GET, '/mock/tests/locale', [ + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-locale' => 'de' + ]); + + $this->assertEquals($response['headers']['status-code'], 200); + $this->assertEquals($de, $response['body']); + + $response = $this->client->call(Client::METHOD_GET, '/mock/tests/locale', [ + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-locale' => 'cs' + ]); + + $this->assertEquals($response['headers']['status-code'], 200); + $this->assertEquals($en, $response['body']); + + $response = $this->client->call(Client::METHOD_GET, '/mock/tests/locale', [ + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-locale' => 'non-existing' + ]); + + $this->assertEquals($response['headers']['status-code'], 200); + $this->assertEquals($en, $response['body']); + + $response = $this->client->call(Client::METHOD_GET, '/mock/tests/locale', [ + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-locale' => '' + ]); + + $this->assertEquals($response['headers']['status-code'], 200); + $this->assertEquals($en, $response['body']); + } } diff --git a/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php b/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php index 245eb3e8de..49d13128e2 100644 --- a/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php +++ b/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php @@ -206,15 +206,17 @@ class MessagingConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); - $logs = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topic['body']['$id'] . '/logs', \array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); + $this->assertEventually(function () use ($topic) { + $logs = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topic['body']['$id'] . '/logs', \array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); - $this->assertEquals($logs['headers']['status-code'], 200); - $this->assertIsArray($logs['body']['logs']); - $this->assertCount(2, $logs['body']['logs']); - $this->assertIsNumeric($logs['body']['total']); + $this->assertEquals($logs['headers']['status-code'], 200); + $this->assertIsArray($logs['body']['logs']); + $this->assertCount(2, $logs['body']['logs']); + $this->assertIsNumeric($logs['body']['total']); + }); $logs = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topic['body']['$id'] . '/logs', \array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php index c241b38e3d..7a57b7f8f9 100644 --- a/tests/e2e/Services/Migrations/MigrationsBase.php +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -13,7 +13,6 @@ use Utopia\Database\Helpers\Role; use Utopia\Database\Query; use Utopia\Migration\Resource; use Utopia\Migration\Sources\Appwrite; -use Utopia\Migration\Sources\CSV; trait MigrationsBase { @@ -436,25 +435,25 @@ trait MigrationsBase /** * @depends testAppwriteMigrationDatabase */ - public function testAppwriteMigrationDatabasesCollection(array $data): array + public function testAppwriteMigrationDatabasesTable(array $data): array { $databaseId = $data['databaseId']; - $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', [ + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], ], [ - 'collectionId' => ID::unique(), - 'name' => 'Test Collection', + 'tableId' => ID::unique(), + 'name' => 'Test Table', ]); - $this->assertEquals(201, $collection['headers']['status-code']); + $this->assertEquals(201, $table['headers']['status-code']); - $collectionId = $collection['body']['$id']; + $tableId = $table['body']['$id']; - // Create Attribute - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', [ + // Create Column + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -467,9 +466,9 @@ trait MigrationsBase $this->assertEquals(202, $response['headers']['status-code']); - // Wait for attribute to be ready - $this->assertEventually(function () use ($databaseId, $collectionId) { - $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/name', [ + // Wait for column to be ready + $this->assertEventually(function () use ($databaseId, $tableId) { + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/name', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -482,8 +481,8 @@ trait MigrationsBase $result = $this->performMigrationSync([ 'resources' => [ Resource::TYPE_DATABASE, - Resource::TYPE_COLLECTION, - Resource::TYPE_ATTRIBUTE, + Resource::TYPE_TABLE, + Resource::TYPE_COLUMN, ], 'endpoint' => 'http://localhost/v1', 'projectId' => $this->getProject()['$id'], @@ -491,9 +490,9 @@ trait MigrationsBase ]); $this->assertEquals('completed', $result['status']); - $this->assertEquals([Resource::TYPE_DATABASE, Resource::TYPE_COLLECTION, Resource::TYPE_ATTRIBUTE], $result['resources']); + $this->assertEquals([Resource::TYPE_DATABASE, Resource::TYPE_TABLE, Resource::TYPE_COLUMN], $result['resources']); - foreach ([Resource::TYPE_DATABASE, Resource::TYPE_COLLECTION, Resource::TYPE_ATTRIBUTE] as $resource) { + foreach ([Resource::TYPE_DATABASE, Resource::TYPE_TABLE, Resource::TYPE_COLUMN] as $resource) { $this->assertArrayHasKey($resource, $result['statusCounters']); $this->assertEquals(0, $result['statusCounters'][$resource]['error']); $this->assertEquals(0, $result['statusCounters'][$resource]['pending']); @@ -502,7 +501,7 @@ trait MigrationsBase $this->assertEquals(0, $result['statusCounters'][$resource]['warning']); } - $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId, [ + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -511,10 +510,10 @@ trait MigrationsBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']); - $this->assertEquals($collectionId, $response['body']['$id']); - $this->assertEquals('Test Collection', $response['body']['name']); + $this->assertEquals($tableId, $response['body']['$id']); + $this->assertEquals('Test Table', $response['body']['name']); - $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/name', [ + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/name', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -536,41 +535,41 @@ trait MigrationsBase return [ 'databaseId' => $databaseId, - 'collectionId' => $collectionId, + 'tableId' => $tableId, ]; } /** - * @depends testAppwriteMigrationDatabasesCollection + * @depends testAppwriteMigrationDatabasesTable */ - public function testAppwriteMigrationDatabasesDocument(array $data): void + public function testAppwriteMigrationDatabasesRow(array $data): void { + $table = $data['tableId']; $databaseId = $data['databaseId']; - $collectionId = $data['collectionId']; - $document = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', [ + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $table . '/rows', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], ], [ - 'documentId' => ID::unique(), + 'rowId' => ID::unique(), 'data' => [ - 'name' => 'Test Document', + 'name' => 'Test Row', ] ]); - $this->assertEquals(201, $document['headers']['status-code']); - $this->assertNotEmpty($document['body']); - $this->assertNotEmpty($document['body']['$id']); + $this->assertEquals(201, $row['headers']['status-code']); + $this->assertNotEmpty($row['body']); + $this->assertNotEmpty($row['body']['$id']); - $documentId = $document['body']['$id']; + $rowId = $row['body']['$id']; $result = $this->performMigrationSync([ 'resources' => [ Resource::TYPE_DATABASE, - Resource::TYPE_COLLECTION, - Resource::TYPE_ATTRIBUTE, - Resource::TYPE_DOCUMENT, + Resource::TYPE_TABLE, + Resource::TYPE_COLUMN, + Resource::TYPE_ROW, ], 'endpoint' => 'http://localhost/v1', 'projectId' => $this->getProject()['$id'], @@ -586,10 +585,10 @@ trait MigrationsBase ]); $this->assertEquals('completed', $result['status']); - $this->assertEquals([Resource::TYPE_DATABASE, Resource::TYPE_COLLECTION, Resource::TYPE_ATTRIBUTE, Resource::TYPE_DOCUMENT], $result['resources']); + $this->assertEquals([Resource::TYPE_DATABASE, Resource::TYPE_TABLE, Resource::TYPE_COLUMN, Resource::TYPE_ROW], $result['resources']); - //TODO: Add TYPE_DOCUMENT to the migration status counters once pending issue is resolved - foreach ([Resource::TYPE_DATABASE, Resource::TYPE_COLLECTION, Resource::TYPE_ATTRIBUTE] as $resource) { + // TODO: Add TYPE_ROW to the migration status counters once pending issue is resolved + foreach ([Resource::TYPE_DATABASE, Resource::TYPE_TABLE, Resource::TYPE_COLUMN] as $resource) { $this->assertArrayHasKey($resource, $result['statusCounters']); $this->assertEquals(0, $result['statusCounters'][$resource]['error']); $this->assertEquals(0, $result['statusCounters'][$resource]['pending']); @@ -598,7 +597,7 @@ trait MigrationsBase $this->assertEquals(0, $result['statusCounters'][$resource]['warning']); } - $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, [ + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $table . '/rows/' . $rowId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -607,8 +606,8 @@ trait MigrationsBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']); - $this->assertEquals($documentId, $response['body']['$id']); - $this->assertEquals('Test Document', $response['body']['name']); + $this->assertEquals($rowId, $response['body']['$id']); + $this->assertEquals('Test Row', $response['body']['name']); // Cleanup $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, [ @@ -805,13 +804,12 @@ trait MigrationsBase $functionId = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php' + 'runtime' => 'node-22', + 'entrypoint' => 'index.js' ]); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -855,8 +853,8 @@ trait MigrationsBase $this->assertEquals($functionId, $response['body']['$id']); $this->assertEquals('Test', $response['body']['name']); - $this->assertEquals('php-8.0', $response['body']['runtime']); - $this->assertEquals('index.php', $response['body']['entrypoint']); + $this->assertEquals('node-22', $response['body']['runtime']); + $this->assertEquals('index.js', $response['body']['entrypoint']); $this->assertEventually(function () use ($functionId) { @@ -871,7 +869,7 @@ trait MigrationsBase $this->assertEquals(1, $deployments['body']['total']); $this->assertEquals('ready', $deployments['body']['deployments'][0]['status'], 'Deployment status is not ready, deployment: ' . json_encode($deployments['body']['deployments'][0], JSON_PRETTY_PRINT)); - }, 50000, 500); + }, 100000, 500); // Attempt execution $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', [ @@ -902,9 +900,9 @@ trait MigrationsBase /** * Import documents from a CSV file. */ - public function testCreateCsvMigration(): array + public function testCreateCsvMigration(): void { - // make a database + // Make a database $response = $this->client->call(Client::METHOD_POST, '/databases', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -920,23 +918,23 @@ trait MigrationsBase $databaseId = $response['body']['$id']; - // make a collection - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + // make a table + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ]), [ - 'name' => 'Test collection', - 'collectionId' => ID::unique(), + 'name' => 'Test table', + 'tableId' => ID::unique(), ]); $this->assertEquals(201, $response['headers']['status-code']); - $this->assertEquals($response['body']['name'], 'Test collection'); + $this->assertEquals($response['body']['name'], 'Test table'); - $collectionId = $response['body']['$id']; + $tableId = $response['body']['$id']; - // make attributes - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + // make columns + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -952,7 +950,7 @@ trait MigrationsBase $this->assertEquals($response['body']['size'], 256); $this->assertEquals($response['body']['required'], true); - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/integer', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -993,6 +991,7 @@ trait MigrationsBase 'missing-row' => $bucketOneId, 'missing-column' => $bucketOneId, 'irrelevant-column' => $bucketOneId, + 'documents-internals' => $bucketOneId, ]; $fileIds = []; @@ -1001,7 +1000,8 @@ trait MigrationsBase $csvFileName = match ($label) { 'missing-row', 'missing-column', - 'irrelevant-column' => "{$label}.csv", + 'irrelevant-column', + 'documents-internals' => "{$label}.csv", default => 'documents.csv', }; @@ -1026,16 +1026,16 @@ trait MigrationsBase $fileIds[$label] = $response['body']['$id']; } - // missing attribute, fail in worker. + // missing column, fail in worker. $missingColumn = $this->performCsvMigration( [ 'fileId' => $fileIds['missing-column'], 'bucketId' => $bucketIds['missing-column'], - 'resourceId' => $databaseId . ':' . $collectionId, + 'resourceId' => $databaseId . ':' . $tableId, ] ); - $this->assertEventually(function () use ($missingColumn, $databaseId, $collectionId) { + $this->assertEventually(function () use ($missingColumn, $databaseId, $tableId) { $migrationId = $missingColumn['body']['$id']; $migration = $this->client->call(Client::METHOD_GET, '/migrations/'.$migrationId, array_merge([ 'content-type' => 'application/json', @@ -1047,24 +1047,27 @@ trait MigrationsBase $this->assertEquals('failed', $migration['body']['status']); $this->assertEquals('CSV', $migration['body']['source']); $this->assertEquals('Appwrite', $migration['body']['destination']); - $this->assertContains(Resource::TYPE_DOCUMENT, $migration['body']['resources']); + $this->assertContains(Resource::TYPE_ROW, $migration['body']['resources']); $this->assertEmpty($migration['body']['statusCounters']); + $errorJson = $migration['body']['errors'][0]; + $errorData = json_decode($errorJson, true); + $this->assertThat( implode("\n", $migration['body']['errors']), - $this->stringContains("CSV header mismatch. Missing attribute: 'age'") + $this->stringContains("CSV header validation failed: Missing required column: 'age'") ); - }, 60000, 500); + }, 60_000, 500); // missing row data, fail in worker. $missingColumn = $this->performCsvMigration( [ 'fileId' => $fileIds['missing-row'], 'bucketId' => $bucketIds['missing-row'], - 'resourceId' => $databaseId . ':' . $collectionId, + 'resourceId' => $databaseId . ':' . $tableId, ] ); - $this->assertEventually(function () use ($missingColumn, $databaseId, $collectionId) { + $this->assertEventually(function () use ($missingColumn, $databaseId, $tableId) { $migrationId = $missingColumn['body']['$id']; $migration = $this->client->call(Client::METHOD_GET, '/migrations/'.$migrationId, array_merge([ 'content-type' => 'application/json', @@ -1076,109 +1079,111 @@ trait MigrationsBase $this->assertEquals('failed', $migration['body']['status']); $this->assertEquals('CSV', $migration['body']['source']); $this->assertEquals('Appwrite', $migration['body']['destination']); - $this->assertContains(Resource::TYPE_DOCUMENT, $migration['body']['resources']); + $this->assertContains(Resource::TYPE_ROW, $migration['body']['resources']); $this->assertEmpty($migration['body']['statusCounters']); + $errorJson = $migration['body']['errors'][0]; + $errorData = json_decode($errorJson, true); + $this->assertThat( implode("\n", $migration['body']['errors']), $this->stringContains('CSV row does not match the number of header columns') ); - }, 60000, 500); + }, 60_000, 500); - // irrelevant column - email, fail in worker. + // irrelevant column - email, success. $irrelevantColumn = $this->performCsvMigration( [ 'fileId' => $fileIds['irrelevant-column'], 'bucketId' => $bucketIds['irrelevant-column'], - 'resourceId' => $databaseId . ':' . $collectionId, + 'resourceId' => $databaseId . ':' . $tableId, ] ); - $this->assertEventually(function () use ($irrelevantColumn, $databaseId, $collectionId) { + $this->assertEventually(function () use ($irrelevantColumn, $databaseId, $tableId) { $migrationId = $irrelevantColumn['body']['$id']; $migration = $this->client->call(Client::METHOD_GET, '/migrations/'.$migrationId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); - $this->assertEquals(200, $migration['headers']['status-code']); - $this->assertEquals('finished', $migration['body']['stage']); - $this->assertEquals('failed', $migration['body']['status']); - $this->assertEquals('CSV', $migration['body']['source']); - $this->assertEquals('Appwrite', $migration['body']['destination']); - $this->assertContains(Resource::TYPE_DOCUMENT, $migration['body']['resources']); - $this->assertEmpty($migration['body']['statusCounters']); - $this->assertThat( - implode("\n", $migration['body']['errors']), - $this->stringContains("CSV header mismatch. Unexpected attribute: 'email'") - ); - }, 60000, 500); - - // all data exists, pass/ - $migration = $this->performCsvMigration( - [ - 'endpoint' => 'http://localhost/v1', - 'fileId' => $fileIds['default'], - 'bucketId' => $bucketIds['default'], - 'resourceId' => $databaseId . ':' . $collectionId, - ] - ); - - $this->assertEmpty($migration['body']['statusCounters']); - $this->assertEquals('CSV', $migration['body']['source']); - $this->assertEquals('pending', $migration['body']['status']); - $this->assertEquals('Appwrite', $migration['body']['destination']); - $this->assertContains(Resource::TYPE_DOCUMENT, $migration['body']['resources']); - - return [ - 'databaseId' => $databaseId, - 'collectionId' => $collectionId, - 'migrationId' => $migration['body']['$id'], - ]; - } - - /** - * @depends testCreateCsvMigration - */ - public function testImportSuccessful(array $response): void - { - $databaseId = $response['databaseId']; - $collectionId = $response['collectionId']; - $migrationId = $response['migrationId']; - - $documentsCountInCSV = 100; - - // get migration stats - $this->assertEventually(function () use ($migrationId, $databaseId, $collectionId, $documentsCountInCSV) { - $migration = $this->client->call(Client::METHOD_GET, '/migrations/'.$migrationId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - $this->assertEquals(200, $migration['headers']['status-code']); $this->assertEquals('finished', $migration['body']['stage']); $this->assertEquals('completed', $migration['body']['status']); $this->assertEquals('CSV', $migration['body']['source']); $this->assertEquals('Appwrite', $migration['body']['destination']); - $this->assertContains(Resource::TYPE_DOCUMENT, $migration['body']['resources']); - $this->assertArrayHasKey(Resource::TYPE_DOCUMENT, $migration['body']['statusCounters']); - $this->assertEquals($documentsCountInCSV, $migration['body']['statusCounters'][Resource::TYPE_DOCUMENT]['success']); - }, 60000, 500); + $this->assertContains(Resource::TYPE_ROW, $migration['body']['resources']); + $this->assertArrayHasKey(Resource::TYPE_ROW, $migration['body']['statusCounters']); + $this->assertEquals(100, $migration['body']['statusCounters'][Resource::TYPE_ROW]['success']); + }, 10_000, 500); - // get documents count - $documents = $this->client->call(Client::METHOD_GET, '/databases/'.$databaseId.'/collections/'.$collectionId.'/documents', array_merge([ + // all data exists, pass. + $migration = $this->performCsvMigration( + [ + 'endpoint' => 'http://localhost/v1', + 'fileId' => $fileIds['default'], + 'bucketId' => $bucketIds['default'], + 'resourceId' => $databaseId . ':' . $tableId, + ] + ); + + $this->assertEventually(function () use ($migration, $databaseId, $tableId) { + $migrationId = $migration['body']['$id']; + $migration = $this->client->call(Client::METHOD_GET, '/migrations/'.$migrationId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $migration['headers']['status-code']); + $this->assertEquals('finished', $migration['body']['stage']); + $this->assertEquals('completed', $migration['body']['status']); + $this->assertEquals('CSV', $migration['body']['source']); + $this->assertEquals('Appwrite', $migration['body']['destination']); + $this->assertContains(Resource::TYPE_ROW, $migration['body']['resources']); + $this->assertArrayHasKey(Resource::TYPE_ROW, $migration['body']['statusCounters']); + $this->assertEquals(100, $migration['body']['statusCounters'][Resource::TYPE_ROW]['success']); + }, 10_000, 500); + + // get rows count + $rows = $this->client->call(Client::METHOD_GET, '/tablesdb/'.$databaseId.'/tables/'.$tableId.'/rows', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'queries' => [ - // there should be only 100! Query::limit(150)->toString() ] ]); - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertIsArray($documents['body']['documents']); - $this->assertIsNumeric($documents['body']['total']); - $this->assertEquals($documentsCountInCSV, $documents['body']['total']); + $this->assertEquals(200, $rows['headers']['status-code']); + $this->assertIsArray($rows['body']['rows']); + $this->assertIsNumeric($rows['body']['total']); + $this->assertEquals(200, $rows['body']['total']); + + // all data exists and includes internals, pass. + $migration = $this->performCsvMigration( + [ + 'endpoint' => 'http://localhost/v1', + 'fileId' => $fileIds['documents-internals'], + 'bucketId' => $bucketIds['documents-internals'], + 'resourceId' => $databaseId . ':' . $tableId, + ] + ); + + $this->assertEventually(function () use ($migration, $databaseId, $tableId) { + $migrationId = $migration['body']['$id']; + $migration = $this->client->call(Client::METHOD_GET, '/migrations/'.$migrationId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $migration['headers']['status-code']); + $this->assertEquals('finished', $migration['body']['stage']); + $this->assertEquals('completed', $migration['body']['status']); + $this->assertEquals('CSV', $migration['body']['source']); + $this->assertEquals('Appwrite', $migration['body']['destination']); + $this->assertContains(Resource::TYPE_ROW, $migration['body']['resources']); + $this->assertArrayHasKey(Resource::TYPE_ROW, $migration['body']['statusCounters']); + $this->assertEquals(25, $migration['body']['statusCounters'][Resource::TYPE_ROW]['success']); + }, 10_000, 500); } private function performCsvMigration(array $body): array diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index aea1971be7..e297757225 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -483,7 +483,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertIsArray($response['body']['requests']); $this->assertIsArray($response['body']['network']); $this->assertIsNumeric($response['body']['executionsTotal']); - $this->assertIsNumeric($response['body']['documentsTotal']); + $this->assertIsNumeric($response['body']['rowsTotal']); $this->assertIsNumeric($response['body']['databasesTotal']); $this->assertIsNumeric($response['body']['bucketsTotal']); $this->assertIsNumeric($response['body']['usersTotal']); @@ -951,6 +951,55 @@ class ProjectsConsoleClientTest extends Scope return ['projectId' => $projectId]; } + /** @depends testCreateProject */ + public function testUpdateProjectInvalidateSessions($data): array + { + $id = $data['projectId']; + + // Check defaults + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => 'console', + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertTrue($response['body']['authInvalidateSessions']); + + $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/session-invalidation', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'enabled' => false, + ]); + $this->assertFalse($response['body']['authInvalidateSessions']); + + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => 'console', + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertFalse($response['body']['authInvalidateSessions']); + + $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/session-invalidation', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'enabled' => true, + ]); + $this->assertTrue($response['body']['authInvalidateSessions']); + + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => 'console', + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertTrue($response['body']['authInvalidateSessions']); + + return $data; + } + /** * @depends testCreateProject */ @@ -2942,7 +2991,7 @@ class ProjectsConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'name' => 'Key Test Update', - 'scopes' => ['users.read', 'users.write', 'collections.read'], + 'scopes' => ['users.read', 'users.write', 'collections.read', 'tables.read'], 'expire' => DateTime::addSeconds(new \DateTime(), 360), ]); @@ -2953,6 +3002,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertContains('users.read', $response['body']['scopes']); $this->assertContains('users.write', $response['body']['scopes']); $this->assertContains('collections.read', $response['body']['scopes']); + $this->assertContains('tables.read', $response['body']['scopes']); $this->assertCount(3, $response['body']['scopes']); $this->assertArrayHasKey('sdks', $response['body']); $this->assertEmpty($response['body']['sdks']); @@ -2971,6 +3021,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertContains('users.read', $response['body']['scopes']); $this->assertContains('users.write', $response['body']['scopes']); $this->assertContains('collections.read', $response['body']['scopes']); + $this->assertContains('tables.read', $response['body']['scopes']); $this->assertCount(3, $response['body']['scopes']); $this->assertArrayHasKey('sdks', $response['body']); $this->assertEmpty($response['body']['sdks']); @@ -4637,7 +4688,6 @@ class ProjectsConsoleClientTest extends Scope 'failure' => 'https://example.com' ]); $this->assertEquals(400, $response['headers']['status-code']); - $this->assertStringContainsString('Invalid `success` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']); /** Test oauth2 with devKey and now get oauth2 is disabled */ $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/' . $provider, [ @@ -4660,7 +4710,6 @@ class ProjectsConsoleClientTest extends Scope 'url' => 'https://example.com', ]); $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('Invalid `url` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']['message']); /** Test hostname in Magic URL with devKey */ $response = $this->client->call(Client::METHOD_POST, '/account/sessions/magic-url', [ diff --git a/tests/e2e/Services/Projects/ProjectsCustomServerTest.php b/tests/e2e/Services/Projects/ProjectsCustomServerTest.php index a01073f3a3..68ff53ae55 100644 --- a/tests/e2e/Services/Projects/ProjectsCustomServerTest.php +++ b/tests/e2e/Services/Projects/ProjectsCustomServerTest.php @@ -30,8 +30,6 @@ class ProjectsCustomServerTest extends Scope 'domain' => $testId . '-api.appwrite.test', ]); - \var_dump($response); - $this->assertEquals(201, $response['headers']['status-code']); $response = $this->client->call(Client::METHOD_POST, '/proxy/rules/api', $headers, [ diff --git a/tests/e2e/Services/Proxy/ProxyBase.php b/tests/e2e/Services/Proxy/ProxyBase.php index 44e015b751..c6d63495a0 100644 --- a/tests/e2e/Services/Proxy/ProxyBase.php +++ b/tests/e2e/Services/Proxy/ProxyBase.php @@ -68,7 +68,7 @@ trait ProxyBase return $rule; } - protected function createRedirectRule(string $domain, string $url, int $statusCode): mixed + protected function createRedirectRule(string $domain, string $url, int $statusCode, string $resourceType, string $resourceId): mixed { $rule = $this->client->call(Client::METHOD_POST, '/proxy/rules/redirect', array_merge([ 'content-type' => 'application/json', @@ -77,6 +77,8 @@ trait ProxyBase 'domain' => $domain, 'url' => $url, 'statusCode' => $statusCode, + 'resourceType' => $resourceType, + 'resourceId' => $resourceId, ]); return $rule; @@ -115,9 +117,9 @@ trait ProxyBase return $rule['body']['$id']; } - protected function setupRedirectRule(string $domain, string $url, int $statusCode): string + protected function setupRedirectRule(string $domain, string $url, int $statusCode, string $resourceType, string $resourceId): string { - $rule = $this->createRedirectRule($domain, $url, $statusCode); + $rule = $this->createRedirectRule($domain, $url, $statusCode, $resourceType, $resourceId); $this->assertEquals(201, $rule['headers']['status-code'], 'Failed to setup rule: ' . \json_encode($rule)); @@ -225,7 +227,7 @@ trait ProxyBase 'x-appwrite-key' => $this->getProject()['apiKey'], ]), [ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Proxy Function', 'entrypoint' => 'index.js', 'commands' => '', @@ -242,7 +244,7 @@ trait ProxyBase 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], ]), [ - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => 'true' ]); diff --git a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php index 9a7ba74ec1..5a1cd1dea6 100644 --- a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php +++ b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php @@ -70,12 +70,29 @@ class ProxyCustomServerTest extends Scope $this->assertNotEmpty($siteId); $this->assertNotEmpty($deploymentId); + $rule = $this->createSiteRule('commit-' . $domain, $siteId); + $this->assertEquals(201, $rule['headers']['status-code']); + $this->cleanupRule($rule['body']['$id']); + + $rule = $this->createSiteRule('branch-' . $domain, $siteId); + $this->assertEquals(201, $rule['headers']['status-code']); + $this->cleanupRule($rule['body']['$id']); + + $rule = $this->createSiteRule('anything-' . $domain, $siteId); + $this->assertEquals(201, $rule['headers']['status-code']); + $this->cleanupRule($rule['body']['$id']); + + $domain = \uniqid() . '-vcs.' . System::getEnv('_APP_DOMAIN_SITES', ''); + $rule = $this->createSiteRule('commit-' . $domain, $siteId); $this->assertEquals(400, $rule['headers']['status-code']); $rule = $this->createSiteRule('branch-' . $domain, $siteId); $this->assertEquals(400, $rule['headers']['status-code']); + $rule = $this->createSiteRule('subdomain.anything-' . $domain, $siteId); + $this->assertEquals(400, $rule['headers']['status-code']); + $rule = $this->createSiteRule('anything-' . $domain, $siteId); $this->assertEquals(201, $rule['headers']['status-code']); $this->cleanupRule($rule['body']['$id']); @@ -109,15 +126,11 @@ class ProxyCustomServerTest extends Scope $rule = $this->createAPIRule('https://' . $domain); $this->assertEquals(400, $rule['headers']['status-code']); - // Unexpected I would say, but it is the current behaviour $rule = $this->createAPIRule('wss://' . $domain); - $this->assertEquals(201, $rule['headers']['status-code']); - $this->cleanupRule($rule['body']['$id']); + $this->assertEquals(400, $rule['headers']['status-code']); - // Unexpected I would say, but it is the current behaviour $rule = $this->createAPIRule($domain . '/some-path'); - $this->assertEquals(201, $rule['headers']['status-code']); - $this->cleanupRule($rule['body']['$id']); + $this->assertEquals(400, $rule['headers']['status-code']); } public function testCreateRedirectRule(): void @@ -131,7 +144,9 @@ class ProxyCustomServerTest extends Scope $response = $proxyClient->call(Client::METHOD_GET, '/todos/1'); $this->assertEquals(404, $response['headers']['status-code']); - $ruleId = $this->setupRedirectRule($domain, 'https://jsonplaceholder.typicode.com/todos/1', 301); + $siteId = $this->setupSite()['siteId']; + + $ruleId = $this->setupRedirectRule($domain, 'https://jsonplaceholder.typicode.com/todos/1', 301, 'site', $siteId); $this->assertNotEmpty($ruleId); $response = $proxyClient->call(Client::METHOD_GET, '/todos/1'); @@ -147,7 +162,7 @@ class ProxyCustomServerTest extends Scope $this->assertEquals('https://jsonplaceholder.typicode.com/todos/1', $response['headers']['location']); $domain = \uniqid() . '-redirect-307.custom.localhost'; - $ruleId = $this->setupRedirectRule($domain, 'https://jsonplaceholder.typicode.com/todos/1', 307); + $ruleId = $this->setupRedirectRule($domain, 'https://jsonplaceholder.typicode.com/todos/1', 307, 'site', $siteId); $this->assertNotEmpty($ruleId); $proxyClient = new Client(); @@ -158,6 +173,18 @@ class ProxyCustomServerTest extends Scope $this->assertEquals(307, $response['headers']['status-code']); $this->assertEquals('https://jsonplaceholder.typicode.com/todos/1', $response['headers']['location']); + $rules = $this->listRules([ + 'queries' => [ + Query::equal('type', ['redirect'])->toString(), + Query::equal('trigger', ['manual'])->toString(), + Query::equal('deploymentResourceType', ['site'])->toString(), + Query::equal('deploymentResourceId', [$siteId])->toString(), + ], + ]); + $this->assertEquals(200, $rules['headers']['status-code']); + $this->assertEquals(2, $rules['body']['total']); + + $this->cleanupSite($siteId); $this->cleanupRule($ruleId); } diff --git a/tests/e2e/Services/Realtime/RealtimeBase.php b/tests/e2e/Services/Realtime/RealtimeBase.php index 99f31134c0..e9b60c4067 100644 --- a/tests/e2e/Services/Realtime/RealtimeBase.php +++ b/tests/e2e/Services/Realtime/RealtimeBase.php @@ -16,13 +16,6 @@ trait RealtimeBase $projectId = $this->getProject()['$id']; } - $headers = array_merge( - [ - "Origin" => "appwrite.test", - ], - $headers - ); - $query = [ "project" => $projectId, "channels" => $channels, @@ -42,14 +35,14 @@ trait RealtimeBase /** * Test for SUCCESS */ - $client = $this->getWebsocket(["documents"]); + $client = $this->getWebsocket(["rows"]); $this->assertNotEmpty($client->receive()); $client->close(); } public function testConnectionFailureMissingChannels(): void { - $client = $this->getWebsocket(); + $client = $this->getWebsocket([]); $payload = json_decode($client->receive(), true); $this->assertArrayHasKey("type", $payload); @@ -58,20 +51,13 @@ trait RealtimeBase $this->assertEquals(1008, $payload["data"]["code"]); $this->assertEquals("Missing channels", $payload["data"]["message"]); \usleep(250000); // 250ms - $this->expectException(ConnectionException::class); // Check if server disconnnected client + $this->expectException(ConnectionException::class); // Check if server disconnected client $client->close(); } public function testConnectionFailureUnknownProject(): void { - $client = new WebSocketClient( - "ws://appwrite-traefik/v1/realtime?project=123", - [ - "headers" => [ - "Origin" => "appwrite.test", - ], - ] - ); + $client = $this->getWebsocket(projectId: '123'); $payload = json_decode($client->receive(), true); $this->assertArrayHasKey("type", $payload); @@ -83,7 +69,7 @@ trait RealtimeBase $payload["data"]["message"] ); \usleep(250000); // 250ms - $this->expectException(ConnectionException::class); // Check if server disconnnected client + $this->expectException(ConnectionException::class); // Check if server disconnected client $client->close(); } } diff --git a/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php b/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php index ba2d18694a..c2834a0228 100644 --- a/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php @@ -123,9 +123,8 @@ class RealtimeConsoleClientTest extends Scope $client->close(); } - public function testAttributes(): array + public function testAttributesCollectionsAPI(): array { - $user = $this->getUser(); $projectId = 'console'; $client = $this->getWebsocket(['console'], [ @@ -184,13 +183,13 @@ class RealtimeConsoleClientTest extends Scope ]); $projectId = $this->getProject()['$id']; - $attributeKey = $name['body']['key']; - $this->assertEquals($name['headers']['status-code'], 202); - $this->assertEquals($name['body']['key'], 'name'); - $this->assertEquals($name['body']['type'], 'string'); - $this->assertEquals($name['body']['size'], 256); - $this->assertEquals($name['body']['required'], true); + $this->assertEquals(202, $name['headers']['status-code']); + $this->assertEquals('name', $name['body']['key']); + $this->assertEquals('string', $name['body']['type']); + $this->assertEquals(256, $name['body']['size']); + $this->assertTrue($name['body']['required']); + $response = json_decode($client->receive(), true); $this->assertArrayHasKey('type', $response); @@ -235,15 +234,128 @@ class RealtimeConsoleClientTest extends Scope $client->close(); - $data = ['actorsId' => $actorsId, 'databaseId' => $databaseId]; + return ['actorsId' => $actorsId, 'databaseId' => $databaseId]; + } - return $data; + public function testAttributesTablesAPI(): array + { + $projectId = 'console'; + + $client = $this->getWebsocket(['console'], [ + 'origin' => 'http://localhost', + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ], $projectId); + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('connected', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertCount(1, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertNotEmpty($response['data']['user']); + + /** + * Create database + */ + $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'databaseId' => ID::unique(), + 'name' => 'Actors DB', + ]); + + $databaseId = $database['body']['$id']; + + /** + * Test Attributes + */ + $actors = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'tableId' => ID::unique(), + 'name' => 'Actors', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $actorsId = $actors['body']['$id']; + + $name = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actorsId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $projectId = $this->getProject()['$id']; + + $this->assertEquals(202, $name['headers']['status-code']); + $this->assertEquals('name', $name['body']['key']); + $this->assertEquals('string', $name['body']['type']); + $this->assertEquals(256, $name['body']['size']); + $this->assertTrue($name['body']['required']); + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(2, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertContains("projects.{$projectId}", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.columns.*.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.columns.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.columns.*.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.columns.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertEquals('processing', $response['data']['payload']['status']); + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(2, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertContains("projects.{$projectId}", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.columns.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.columns.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.columns.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.columns.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertEquals('available', $response['data']['payload']['status']); + + $client->close(); + + return ['actorsId' => $actorsId, 'databaseId' => $databaseId]; } /** - * @depends testAttributes + * @depends testAttributesCollectionsAPI */ - public function testIndexes(array $data) + public function testIndexesCollectionAPI(array $data) { $projectId = 'console'; $actorsId = $data['actorsId']; @@ -277,10 +389,9 @@ class RealtimeConsoleClientTest extends Scope ], ]); - $this->assertEquals($index['headers']['status-code'], 202); + $this->assertEquals(202, $index['headers']['status-code']); $projectId = $this->getProject()['$id']; - $indexKey = $index['body']['key']; $response = json_decode($client->receive(), true); @@ -326,9 +437,93 @@ class RealtimeConsoleClientTest extends Scope } /** - * @depends testIndexes + * @depends testAttributesTablesAPI */ - public function testDeleteIndex(array $data) + public function testIndexesTablesAPI(array $data) + { + $projectId = 'console'; + $actorsId = $data['actorsId']; + $databaseId = $data['databaseId']; + $client = $this->getWebsocket(['console'], [ + 'origin' => 'http://localhost', + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ], $projectId); + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('connected', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertCount(1, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertNotEmpty($response['data']['user']); + + /** + * Test Indexes + */ + $index = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actorsId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'key' => 'key_name', + 'type' => 'key', + 'columns' => [ + 'name', + ], + ]); + + $this->assertEquals(202, $index['headers']['status-code']); + + $projectId = $this->getProject()['$id']; + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(2, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertContains("projects.{$projectId}", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.indexes.*.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.indexes.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.indexes.*.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.indexes.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertEquals('processing', $response['data']['payload']['status']); + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(2, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertContains("projects.{$projectId}", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.indexes.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.indexes.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.indexes.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.indexes.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertEquals('available', $response['data']['payload']['status']); + + $client->close(); + + return $data; + } + + /** + * @depends testIndexesCollectionAPI + */ + public function testDeleteIndexCollectionsAPI(array $data) { $actorsId = $data['actorsId']; $projectId = 'console'; @@ -360,7 +555,7 @@ class RealtimeConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); - $this->assertEquals($attribute['headers']['status-code'], 204); + $this->assertEquals(204, $attribute['headers']['status-code']); $response = json_decode($client->receive(), true); @@ -382,6 +577,7 @@ class RealtimeConsoleClientTest extends Scope /** Delete index generates two events. One from the API and one from the database worker */ $response = json_decode($client->receive(), true); + $this->assertArrayHasKey('type', $response); $this->assertArrayHasKey('data', $response); $this->assertEquals('event', $response['type']); @@ -404,12 +600,91 @@ class RealtimeConsoleClientTest extends Scope } /** - * @depends testDeleteIndex + * @depends testIndexesTablesAPI */ - public function testDeleteAttribute(array $data) + public function testDeleteIndexTablesAPI(array $data) { - $actorsId = $data['actorsId']; $projectId = 'console'; + $actorsId = $data['actorsId']; + $databaseId = $data['databaseId']; + + $client = $this->getWebsocket(['console'], [ + 'origin' => 'http://localhost', + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ], $projectId); + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('connected', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertCount(1, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertNotEmpty($response['data']['user']); + + $projectId = $this->getProject()['$id']; + + /** + * Test Delete Index + */ + $indexKey = 'key_name'; + $attribute = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $actorsId . '/indexes/' . $indexKey, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(204, $attribute['headers']['status-code']); + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(2, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertContains("projects.{$projectId}", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.indexes.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.indexes.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.indexes.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.indexes.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + + /** Delete index generates two events. One from the API and one from the database worker */ + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(2, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertContains("projects.{$projectId}", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.indexes.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.indexes.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.indexes.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.indexes.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + + $client->close(); + + return $data; + } + + /** + * @depends testDeleteIndexCollectionsAPI + */ + public function testDeleteAttributeCollectionsAPI(array $data) + { + $projectId = 'console'; + $actorsId = $data['actorsId']; $databaseId = $data['databaseId']; $client = $this->getWebsocket(['console'], [ @@ -438,7 +713,7 @@ class RealtimeConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); - $this->assertEquals($attribute['headers']['status-code'], 204); + $this->assertEquals(204, $attribute['headers']['status-code']); $response = json_decode($client->receive(), true); $this->assertArrayHasKey('type', $response); @@ -478,6 +753,81 @@ class RealtimeConsoleClientTest extends Scope $client->close(); } + /** + * @depends testDeleteIndexTablesAPI + */ + public function testDeleteAttributeTablesAPI(array $data) + { + $projectId = 'console'; + $actorsId = $data['actorsId']; + $databaseId = $data['databaseId']; + + $client = $this->getWebsocket(['console'], [ + 'origin' => 'http://localhost', + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ], $projectId); + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('connected', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertCount(1, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertNotEmpty($response['data']['user']); + + $attributeKey = 'name'; + $projectId = $this->getProject()['$id']; + + /** + * Test Delete Attribute + */ + $attribute = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['actorsId'] . '/columns/' . $attributeKey, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(204, $attribute['headers']['status-code']); + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(2, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertContains("projects.{$projectId}", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.columns.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.columns.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.columns.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.columns.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(2, $response['data']['channels']); + $this->assertContains('console', $response['data']['channels']); + $this->assertContains("projects.{$projectId}", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.columns.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}.columns.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.columns.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*.columns.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.tables.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + + $client->close(); + } + public function testPing() { $client = $this->getWebsocket(['console'], [ @@ -524,8 +874,8 @@ class RealtimeConsoleClientTest extends Scope ], $this->getHeaders()), [ 'functionId' => ID::unique(), 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', 'users.*.delete', @@ -564,8 +914,7 @@ class RealtimeConsoleClientTest extends Scope 'content-type' => 'multipart/form-data', 'x-appwrite-project' => $projectId, ], $this->getHeaders()), [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -607,10 +956,8 @@ class RealtimeConsoleClientTest extends Scope $this->assertContains("projects.{$projectId}", $response['data']['channels']); $this->assertArrayHasKey('buildLogs', $response['data']['payload']); - if (!empty($response['data']['payload']['buildEndedAt'])) { - $this->assertNotEmpty($response['data']['payload']['buildEndedAt']); + if (!empty($response['data']['payload']['buildSize'])) { $this->assertNotEmpty($response['data']['payload']['buildStartedAt']); - $this->assertNotEmpty($response['data']['payload']['buildDuration']); $this->assertNotEmpty($response['data']['payload']['buildPath']); $this->assertNotEmpty($response['data']['payload']['buildSize']); $this->assertNotEmpty($response['data']['payload']['totalSize']); @@ -618,7 +965,7 @@ class RealtimeConsoleClientTest extends Scope break; } - // Ignore comparasion for first payload + // Ignore comparison for first payload if ($previousBuildLogs !== null) { $this->assertNotEquals($previousBuildLogs, $response['data']['payload']['buildLogs']); } @@ -634,6 +981,13 @@ class RealtimeConsoleClientTest extends Scope $this->assertContains("projects.{$projectId}", $response['data']['channels']); $this->assertEquals("ready", $response['data']['payload']['status']); + $response = json_decode($client->receive(), true); + $this->assertContains("functions.{$functionId}.deployments.{$deploymentId}.update", $response['data']['events']); + $this->assertContains('console', $response['data']['channels']); + $this->assertContains("projects.{$projectId}", $response['data']['channels']); + $this->assertNotEmpty($response['data']['payload']['buildDuration']); + $this->assertNotEmpty($response['data']['payload']['buildEndedAt']); + $client->close(); } } diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 9e3f1a66b7..3e57c5e9bc 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -3,6 +3,7 @@ namespace Tests\E2E\Services\Realtime; use CURLFile; +use Exception; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; @@ -12,6 +13,7 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use WebSocket\ConnectionException; +use WebSocket\TimeoutException; class RealtimeCustomClientTest extends Scope { @@ -81,11 +83,17 @@ class RealtimeCustomClientTest extends Scope 'files', 'files.1', 'collections', + 'tables', 'collections.1.documents', 'collections.2.documents', + 'tables.1.rows', + 'tables.2.rows', 'documents', + 'rows', 'collections.1.documents.1', 'collections.2.documents.2', + 'tables.1.rows.1', + 'tables.2.rows.2', ], $headers); $response = json_decode($client->receive(), true); @@ -95,17 +103,22 @@ class RealtimeCustomClientTest extends Scope $this->assertEquals('connected', $response['type']); $this->assertNotEmpty($response['data']); $this->assertNotEmpty($response['data']['user']); - $this->assertCount(10, $response['data']['channels']); + $this->assertCount(16, $response['data']['channels']); $this->assertContains('account', $response['data']['channels']); $this->assertContains('account.' . $userId, $response['data']['channels']); $this->assertContains('files', $response['data']['channels']); $this->assertContains('files.1', $response['data']['channels']); $this->assertContains('collections', $response['data']['channels']); + $this->assertContains('tables', $response['data']['channels']); $this->assertContains('collections.1.documents', $response['data']['channels']); $this->assertContains('collections.2.documents', $response['data']['channels']); + $this->assertContains('tables.1.rows', $response['data']['channels']); + $this->assertContains('tables.2.rows', $response['data']['channels']); $this->assertContains('documents', $response['data']['channels']); $this->assertContains('collections.1.documents.1', $response['data']['channels']); $this->assertContains('collections.2.documents.2', $response['data']['channels']); + $this->assertContains('tables.1.rows.1', $response['data']['channels']); + $this->assertContains('tables.2.rows.2', $response['data']['channels']); $this->assertEquals($userId, $response['data']['user']['$id']); $client->close(); @@ -415,7 +428,8 @@ class RealtimeCustomClientTest extends Scope $this->assertContains("users.*", $response['data']['events']); $lastEmail = $this->getLastEmail(); - $verification = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $verification = $tokens['secret']; /** * Test Account Verification Complete @@ -612,7 +626,8 @@ class RealtimeCustomClientTest extends Scope $response = json_decode($client->receive(), true); $lastEmail = $this->getLastEmail(); - $recovery = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $recovery = $tokens['secret']; $this->assertArrayHasKey('type', $response); $this->assertArrayHasKey('data', $response); @@ -734,11 +749,11 @@ class RealtimeCustomClientTest extends Scope 'required' => true, ]); - $this->assertEquals($name['headers']['status-code'], 202); - $this->assertEquals($name['body']['key'], 'name'); - $this->assertEquals($name['body']['type'], 'string'); - $this->assertEquals($name['body']['size'], 256); - $this->assertEquals($name['body']['required'], true); + $this->assertEquals(202, $name['headers']['status-code']); + $this->assertEquals('name', $name['body']['key']); + $this->assertEquals('string', $name['body']['type']); + $this->assertEquals(256, $name['body']['size']); + $this->assertTrue($name['body']['required']); sleep(2); @@ -768,7 +783,7 @@ class RealtimeCustomClientTest extends Scope $this->assertEquals('event', $response['type']); $this->assertNotEmpty($response['data']); $this->assertArrayHasKey('timestamp', $response['data']); - $this->assertCount(3, $response['data']['channels']); + $this->assertCount(6, $response['data']['channels']); $this->assertContains('documents', $response['data']['channels']); $this->assertContains('databases.' . $databaseId . '.collections.' . $actorsId . '.documents.' . $documentId, $response['data']['channels']); $this->assertContains('databases.' . $databaseId . '.collections.' . $actorsId . '.documents', $response['data']['channels']); @@ -785,7 +800,7 @@ class RealtimeCustomClientTest extends Scope $this->assertContains("databases.{$databaseId}", $response['data']['events']); $this->assertContains("databases.*", $response['data']['events']); $this->assertNotEmpty($response['data']['payload']); - $this->assertEquals($response['data']['payload']['name'], 'Chris Evans'); + $this->assertEquals('Chris Evans', $response['data']['payload']['name']); /** * Test Document Update @@ -806,13 +821,12 @@ class RealtimeCustomClientTest extends Scope ]); $response = json_decode($client->receive(), true); - $this->assertArrayHasKey('type', $response); $this->assertArrayHasKey('data', $response); $this->assertEquals('event', $response['type']); $this->assertNotEmpty($response['data']); $this->assertArrayHasKey('timestamp', $response['data']); - $this->assertCount(3, $response['data']['channels']); + $this->assertCount(6, $response['data']['channels']); $this->assertContains('documents', $response['data']['channels']); $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['channels']); $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); @@ -830,7 +844,7 @@ class RealtimeCustomClientTest extends Scope $this->assertContains("databases.*", $response['data']['events']); $this->assertNotEmpty($response['data']['payload']); - $this->assertEquals($response['data']['payload']['name'], 'Chris Evans 2'); + $this->assertEquals('Chris Evans 2', $response['data']['payload']['name']); /** * Test Document Delete @@ -866,7 +880,7 @@ class RealtimeCustomClientTest extends Scope $this->assertEquals('event', $response['type']); $this->assertNotEmpty($response['data']); $this->assertArrayHasKey('timestamp', $response['data']); - $this->assertCount(3, $response['data']['channels']); + $this->assertCount(6, $response['data']['channels']); $this->assertContains('documents', $response['data']['channels']); $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['channels']); $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); @@ -883,11 +897,907 @@ class RealtimeCustomClientTest extends Scope $this->assertContains("databases.{$databaseId}", $response['data']['events']); $this->assertContains("databases.*", $response['data']['events']); $this->assertNotEmpty($response['data']['payload']); - $this->assertEquals($response['data']['payload']['name'], 'Bradley Cooper'); + $this->assertEquals('Bradley Cooper', $response['data']['payload']['name']); + + // test bulk create + $documents = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$actorsId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Robert Downey Jr.', + '$permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ], + [ + '$id' => ID::unique(), + 'name' => 'Scarlett Johansson', + '$permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ] + ], + ]); + + // Receive first document event + $response = json_decode($client->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.create", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.create", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.create", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertArrayHasKey('name', $response['data']['payload']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + $this->assertIsArray($response['data']['payload']['$permissions']); + $this->assertContains(Permission::read(Role::any()), $response['data']['payload']['$permissions']); + $this->assertContains(Permission::update(Role::any()), $response['data']['payload']['$permissions']); + $this->assertContains(Permission::delete(Role::any()), $response['data']['payload']['$permissions']); + + // Receive second document event + $response = json_decode($client->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.create", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.create", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.create", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertArrayHasKey('name', $response['data']['payload']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + $this->assertIsArray($response['data']['payload']['$permissions']); + $this->assertContains(Permission::read(Role::any()), $response['data']['payload']['$permissions']); + $this->assertContains(Permission::update(Role::any()), $response['data']['payload']['$permissions']); + $this->assertContains(Permission::delete(Role::any()), $response['data']['payload']['$permissions']); + + // test bulk update + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents/', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'name' => 'Marvel Hero', + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ], + ]); + $this->assertEquals(200, $response['headers']['status-code']); + + // Receive first document update event + $response = json_decode($client->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.update", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertEquals('Marvel Hero', $response['data']['payload']['name']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + + // Receive second document update event + $response = json_decode($client->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.update", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertEquals('Marvel Hero', $response['data']['payload']['name']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + + // Receive third document update event + $response = json_decode($client->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.update", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertEquals('Marvel Hero', $response['data']['payload']['name']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + + // Test bulk delete + $response = $this->client->call(Client::METHOD_DELETE, "/databases/{$databaseId}/collections/{$actorsId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $response['headers']['status-code']); + + // Receive first document delete event + $response = json_decode($client->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.delete", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertArrayHasKey('name', $response['data']['payload']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + $this->assertIsArray($response['data']['payload']['$permissions']); + + // Receive second document delete event + $response = json_decode($client->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.delete", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertArrayHasKey('name', $response['data']['payload']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + $this->assertIsArray($response['data']['payload']['$permissions']); + + // Receive third document delete event + $response = json_decode($client->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.delete", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertArrayHasKey('name', $response['data']['payload']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + $this->assertIsArray($response['data']['payload']['$permissions']); + + // bulk upsert + $this->client->call(Client::METHOD_PUT, "/databases/{$databaseId}/collections/{$actorsId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Robert Downey Jr.', + '$permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ] + ], + ]); + + $response = json_decode($client->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertArrayHasKey('name', $response['data']['payload']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + $this->assertIsArray($response['data']['payload']['$permissions']); $client->close(); } + public function testChannelDatabaseBulkOperationMultipleClient() + { + // user with api key will do operations and other valid users + $user1 = $this->getUser(true); + $user1Id = $user1['$id']; + $session = $user1['session'] ?? ''; + $projectId = $this->getProject()['$id']; + + $client1 = $this->getWebsocket(['documents', 'collections'], [ + 'origin' => 'http://localhost', + 'cookie' => 'a_session_' . $projectId . '=' . $session + ]); + + $response = json_decode($client1->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('connected', $response['type']); + $this->assertNotEmpty($response['data']); + + $user2 = $this->getUser(true); + $user2Id = $user2['$id']; + $session = $user2['session'] ?? ''; + $projectId = $this->getProject()['$id']; + + $client2 = $this->getWebsocket(['documents', 'collections'], [ + 'origin' => 'http://localhost', + 'cookie' => 'a_session_' . $projectId . '=' . $session + ]); + + $response = json_decode($client2->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('connected', $response['type']); + $this->assertNotEmpty($response['data']); + + + /** + * Test Database Create + */ + $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'Actors DB', + ]); + + $databaseId = $database['body']['$id']; + + /** + * Test Collection Create + */ + $actors = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Actors', + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + 'documentSecurity' => true, + ]); + + $actorsId = $actors['body']['$id']; + + $name = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $actorsId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $name['headers']['status-code']); + $this->assertEquals('name', $name['body']['key']); + $this->assertEquals('string', $name['body']['type']); + $this->assertEquals(256, $name['body']['size']); + $this->assertTrue($name['body']['required']); + + sleep(2); + + // create + $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$actorsId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Any', + '$permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ], + [ + '$id' => ID::unique(), + 'name' => 'Users', + '$permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ], + ], + [ + '$id' => ID::unique(), + 'name' => 'User1', + '$permissions' => [ + Permission::read(Role::user($user1Id)), + ], + ], + [ + '$id' => ID::unique(), + 'name' => 'User2', + '$permissions' => [ + Permission::read(Role::user($user2Id)), + ], + ], + [ + '$id' => ID::unique(), + 'name' => 'User2', + '$permissions' => [ + Permission::read(Role::user($user2Id)), + ], + ] + ], + ]); + + // Receive and assert for client1 - should receive 3 individual document events + for ($i = 0; $i < 3; $i++) { + $response1 = json_decode($client1->receive(), true); + $this->assertArrayHasKey('type', $response1); + $this->assertArrayHasKey('data', $response1); + $this->assertEquals('event', $response1['type']); + $this->assertNotEmpty($response1['data']); + $this->assertArrayHasKey('timestamp', $response1['data']); + $this->assertCount(6, $response1['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response1['data']['payload']['$id']}.create", $response1['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.create", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.create", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.create", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response1['data']['events']); + $this->assertContains("databases.*.collections.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.create", $response1['data']['events']); + $this->assertContains("databases.*", $response1['data']['events']); + $this->assertNotEmpty($response1['data']['payload']); + $this->assertIsArray($response1['data']['payload']); + $this->assertArrayHasKey('$id', $response1['data']['payload']); + $this->assertArrayHasKey('name', $response1['data']['payload']); + $this->assertArrayHasKey('$permissions', $response1['data']['payload']); + $this->assertIsArray($response1['data']['payload']['$permissions']); + } + + // Receive and assert for client2 - should receive 4 individual document events + for ($i = 0; $i < 4; $i++) { + $response2 = json_decode($client2->receive(), true); + $this->assertArrayHasKey('type', $response2); + $this->assertArrayHasKey('data', $response2); + $this->assertEquals('event', $response2['type']); + $this->assertNotEmpty($response2['data']); + $this->assertArrayHasKey('timestamp', $response2['data']); + $this->assertCount(6, $response2['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response2['data']['payload']['$id']}.create", $response2['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.create", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.create", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.create", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response2['data']['events']); + $this->assertContains("databases.*.collections.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.create", $response2['data']['events']); + $this->assertContains("databases.*", $response2['data']['events']); + $this->assertNotEmpty($response2['data']['payload']); + $this->assertIsArray($response2['data']['payload']); + $this->assertArrayHasKey('$id', $response2['data']['payload']); + $this->assertArrayHasKey('name', $response2['data']['payload']); + $this->assertArrayHasKey('$permissions', $response2['data']['payload']); + $this->assertIsArray($response2['data']['payload']['$permissions']); + } + + + // Perform bulk update(making it only accessible by user1) + $response = $this->client->call(Client::METHOD_PATCH, "/databases/{$databaseId}/collections/{$actorsId}/documents/", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'name' => 'Marvel Hero', + '$permissions' => [ + Permission::read(Role::user($user1Id)), + Permission::update(Role::user($user1Id)), + Permission::delete(Role::user($user1Id)), + ] + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + // Receive and assert for client1 + for ($i = 0; $i < 5; $i++) { + $response1 = json_decode($client1->receive(), true); + $this->assertArrayHasKey('type', $response1); + $this->assertArrayHasKey('data', $response1); + $this->assertEquals('event', $response1['type']); + $this->assertNotEmpty($response1['data']); + $this->assertArrayHasKey('timestamp', $response1['data']); + $this->assertCount(6, $response1['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response1['data']['payload']['$id']}.update", $response1['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.update", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.update", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response1['data']['events']); + $this->assertContains("databases.*.collections.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response1['data']['events']); + $this->assertContains("databases.*", $response1['data']['events']); + $this->assertNotEmpty($response1['data']['payload']); + $this->assertIsArray($response1['data']['payload']); + $this->assertArrayHasKey('$id', $response1['data']['payload']); + $this->assertEquals('Marvel Hero', $response1['data']['payload']['name']); + $this->assertArrayHasKey('$permissions', $response1['data']['payload']); + } + + // client2 shouldn't receive any event and lead to timeout + try { + json_decode($client2->receive(), true); + $this->fail('Expected TimeoutException was not thrown.'); + } catch (Exception $e) { + $this->assertInstanceOf(TimeoutException::class, $e); + } + + // Perform bulk update(making it only accessible by user2) + $response = $this->client->call(Client::METHOD_PATCH, "/databases/{$databaseId}/collections/{$actorsId}/documents/", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'name' => 'Marvel Hero', + '$permissions' => [ + Permission::read(Role::user($user2Id)), + Permission::update(Role::user($user2Id)), + Permission::delete(Role::user($user2Id)), + ] + ], + ]); + + // Receive and assert for client2 + for ($i = 0; $i < 5; $i++) { + $response2 = json_decode($client2->receive(), true); + $this->assertArrayHasKey('type', $response2); + $this->assertArrayHasKey('data', $response2); + $this->assertEquals('event', $response2['type']); + $this->assertNotEmpty($response2['data']); + $this->assertArrayHasKey('timestamp', $response2['data']); + $this->assertCount(6, $response2['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response2['data']['payload']['$id']}.update", $response2['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.update", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.update", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response2['data']['events']); + $this->assertContains("databases.*.collections.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response2['data']['events']); + $this->assertContains("databases.*", $response2['data']['events']); + $this->assertNotEmpty($response2['data']['payload']); + $this->assertIsArray($response2['data']['payload']); + $this->assertArrayHasKey('$id', $response2['data']['payload']); + $this->assertEquals('Marvel Hero', $response2['data']['payload']['name']); + $this->assertArrayHasKey('$permissions', $response2['data']['payload']); + } + + // client1 shouldn't receive any event and lead to timeout + try { + json_decode($client1->receive(), true); + $this->fail('Expected TimeoutException was not thrown.'); + } catch (Exception $e) { + $this->assertInstanceOf(TimeoutException::class, $e); + } + + // Updating the permission for both the users + $response = $this->client->call(Client::METHOD_PATCH, "/databases/{$databaseId}/collections/{$actorsId}/documents/", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'data' => [ + 'name' => 'Marvel Hero', + '$permissions' => [ + Permission::read(Role::users()), + Permission::update(Role::users()), + Permission::delete(Role::users()), + ] + ], + ]); + // both user1 and user2 should receive the event + for ($i = 0; $i < 5; $i++) { + $response1 = json_decode($client1->receive(), true); + $this->assertArrayHasKey('type', $response1); + $this->assertArrayHasKey('data', $response1); + $this->assertEquals('event', $response1['type']); + $this->assertNotEmpty($response1['data']); + $this->assertArrayHasKey('timestamp', $response1['data']); + $this->assertCount(6, $response1['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response1['data']['payload']['$id']}.update", $response1['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.update", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.update", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response1['data']['events']); + $this->assertContains("databases.*.collections.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response1['data']['events']); + $this->assertContains("databases.*", $response1['data']['events']); + $this->assertNotEmpty($response1['data']['payload']); + $this->assertIsArray($response1['data']['payload']); + $this->assertArrayHasKey('$id', $response1['data']['payload']); + $this->assertEquals('Marvel Hero', $response1['data']['payload']['name']); + $this->assertArrayHasKey('$permissions', $response1['data']['payload']); + + $response2 = json_decode($client2->receive(), true); + $this->assertArrayHasKey('type', $response2); + $this->assertArrayHasKey('data', $response2); + $this->assertEquals('event', $response2['type']); + $this->assertNotEmpty($response2['data']); + $this->assertArrayHasKey('timestamp', $response2['data']); + $this->assertCount(6, $response2['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response2['data']['payload']['$id']}.update", $response2['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.update", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.update", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response2['data']['events']); + $this->assertContains("databases.*.collections.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response2['data']['events']); + $this->assertContains("databases.*", $response2['data']['events']); + $this->assertNotEmpty($response2['data']['payload']); + $this->assertIsArray($response2['data']['payload']); + $this->assertArrayHasKey('$id', $response2['data']['payload']); + $this->assertEquals('Marvel Hero', $response2['data']['payload']['name']); + $this->assertArrayHasKey('$permissions', $response2['data']['payload']); + } + + // Perform bulk delete + $response = $this->client->call(Client::METHOD_DELETE, "/databases/{$databaseId}/collections/{$actorsId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $response['headers']['status-code']); + + // Receive and assert for client1 + for ($i = 0; $i < 5; $i++) { + $response1 = json_decode($client1->receive(), true); + $this->assertArrayHasKey('type', $response1); + $this->assertArrayHasKey('data', $response1); + $this->assertEquals('event', $response1['type']); + $this->assertNotEmpty($response1['data']); + $this->assertArrayHasKey('timestamp', $response1['data']); + $this->assertCount(6, $response1['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response1['data']['payload']['$id']}.delete", $response1['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.delete", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.delete", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response1['data']['events']); + $this->assertContains("databases.*.collections.*", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response1['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response1['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response1['data']['events']); + $this->assertContains("databases.*", $response1['data']['events']); + $this->assertNotEmpty($response1['data']['payload']); + $this->assertIsArray($response1['data']['payload']); + $this->assertArrayHasKey('$id', $response1['data']['payload']); + $this->assertArrayHasKey('name', $response1['data']['payload']); + $this->assertArrayHasKey('$permissions', $response1['data']['payload']); + $this->assertIsArray($response1['data']['payload']['$permissions']); + } + + // Receive and assert for client2 + for ($i = 0; $i < 5; $i++) { + $response2 = json_decode($client2->receive(), true); + $this->assertArrayHasKey('type', $response2); + $this->assertArrayHasKey('data', $response2); + $this->assertEquals('event', $response2['type']); + $this->assertNotEmpty($response2['data']); + $this->assertArrayHasKey('timestamp', $response2['data']); + $this->assertCount(6, $response2['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response2['data']['payload']['$id']}.delete", $response2['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.delete", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.delete", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response2['data']['events']); + $this->assertContains("databases.*.collections.*", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response2['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response2['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response2['data']['events']); + $this->assertContains("databases.*", $response2['data']['events']); + $this->assertNotEmpty($response2['data']['payload']); + $this->assertIsArray($response2['data']['payload']); + $this->assertArrayHasKey('$id', $response2['data']['payload']); + $this->assertArrayHasKey('name', $response2['data']['payload']); + $this->assertArrayHasKey('$permissions', $response2['data']['payload']); + $this->assertIsArray($response2['data']['payload']['$permissions']); + } + + // bulk upsert + $this->client->call(Client::METHOD_PUT, "/databases/{$databaseId}/collections/{$actorsId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Robert Downey Jr.', + '$permissions' => [ + Permission::read(Role::user($user1Id)), + ], + ], + [ + '$id' => ID::unique(), + 'name' => 'Thor', + '$permissions' => [ + Permission::read(Role::user($user2Id)), + ], + ] + ], + ]); + + $response = json_decode($client1->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertArrayHasKey('name', $response['data']['payload']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + $this->assertIsArray($response['data']['payload']['$permissions']); + + // client1 shouldnot receive more than 1 event + try { + json_decode(json_decode($client1->receive(), true)); + $this->fail('Expected TimeoutException was not thrown.'); + } catch (Exception $e) { + $this->assertInstanceOf(TimeoutException::class, $e); + } + + $response = json_decode($client2->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertArrayHasKey('name', $response['data']['payload']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + $this->assertIsArray($response['data']['payload']['$permissions']); + + // client2 shouldnot receive more than 1 event + try { + json_decode(json_decode($client2->receive(), true)); + $this->fail('Expected TimeoutException was not thrown.'); + } catch (Exception $e) { + $this->assertInstanceOf(TimeoutException::class, $e); + } + + + $client1->close(); + $client2->close(); + } + public function testChannelDatabaseCollectionPermissions() { $user = $this->getUser(); @@ -955,11 +1865,11 @@ class RealtimeCustomClientTest extends Scope 'required' => true, ]); - $this->assertEquals($name['headers']['status-code'], 202); - $this->assertEquals($name['body']['key'], 'name'); - $this->assertEquals($name['body']['type'], 'string'); - $this->assertEquals($name['body']['size'], 256); - $this->assertEquals($name['body']['required'], true); + $this->assertEquals(202, $name['headers']['status-code']); + $this->assertEquals('name', $name['body']['key']); + $this->assertEquals('string', $name['body']['type']); + $this->assertEquals(256, $name['body']['size']); + $this->assertTrue($name['body']['required']); sleep(2); @@ -986,7 +1896,7 @@ class RealtimeCustomClientTest extends Scope $this->assertEquals('event', $response['type']); $this->assertNotEmpty($response['data']); $this->assertArrayHasKey('timestamp', $response['data']); - $this->assertCount(3, $response['data']['channels']); + $this->assertCount(6, $response['data']['channels']); $this->assertContains('documents', $response['data']['channels']); $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['channels']); $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); @@ -1003,7 +1913,7 @@ class RealtimeCustomClientTest extends Scope $this->assertContains("databases.{$databaseId}", $response['data']['events']); $this->assertContains("databases.*", $response['data']['events']); $this->assertNotEmpty($response['data']['payload']); - $this->assertEquals($response['data']['payload']['name'], 'Chris Evans'); + $this->assertEquals('Chris Evans', $response['data']['payload']['name']); /** * Test Document Update @@ -1025,7 +1935,7 @@ class RealtimeCustomClientTest extends Scope $this->assertEquals('event', $response['type']); $this->assertNotEmpty($response['data']); $this->assertArrayHasKey('timestamp', $response['data']); - $this->assertCount(3, $response['data']['channels']); + $this->assertCount(6, $response['data']['channels']); $this->assertContains('documents', $response['data']['channels']); $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['channels']); $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); @@ -1043,7 +1953,7 @@ class RealtimeCustomClientTest extends Scope $this->assertContains("databases.*", $response['data']['events']); $this->assertNotEmpty($response['data']['payload']); - $this->assertEquals($response['data']['payload']['name'], 'Chris Evans 2'); + $this->assertEquals('Chris Evans 2', $response['data']['payload']['name']); /** * Test Document Delete @@ -1075,7 +1985,7 @@ class RealtimeCustomClientTest extends Scope $this->assertEquals('event', $response['type']); $this->assertNotEmpty($response['data']); $this->assertArrayHasKey('timestamp', $response['data']); - $this->assertCount(3, $response['data']['channels']); + $this->assertCount(6, $response['data']['channels']); $this->assertContains('documents', $response['data']['channels']); $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['channels']); $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); @@ -1092,7 +2002,7 @@ class RealtimeCustomClientTest extends Scope $this->assertContains("databases.{$databaseId}", $response['data']['events']); $this->assertContains("databases.*", $response['data']['events']); $this->assertNotEmpty($response['data']['payload']); - $this->assertEquals($response['data']['payload']['name'], 'Bradley Cooper'); + $this->assertEquals('Bradley Cooper', $response['data']['payload']['name']); $client->close(); } @@ -1283,16 +2193,16 @@ class RealtimeCustomClientTest extends Scope 'x-appwrite-key' => $this->getProject()['apiKey'] ], [ 'functionId' => ID::unique(), - 'name' => 'Test', + 'name' => 'Test timeout execution', 'execute' => ['users'], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, ]); $functionId = $function['body']['$id'] ?? ''; - $this->assertEquals($function['headers']['status-code'], 201); + $this->assertEquals(201, $function['headers']['status-code']); $this->assertNotEmpty($function['body']['$id']); $deployment = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/deployments', array_merge([ @@ -1300,14 +2210,13 @@ class RealtimeCustomClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ]), [ - 'entrypoint' => 'index.php', 'code' => $this->packageFunction('timeout'), 'activate' => true ]); $deploymentId = $deployment['body']['$id'] ?? ''; - $this->assertEquals($deployment['headers']['status-code'], 202); + $this->assertEquals(202, $deployment['headers']['status-code']); $this->assertNotEmpty($deployment['body']['$id']); // Poll until deployment is built @@ -1467,7 +2376,7 @@ class RealtimeCustomClientTest extends Scope 'name' => 'Manchester' ]); - $this->assertEquals($team['headers']['status-code'], 200); + $this->assertEquals(200, $team['headers']['status-code']); $this->assertNotEmpty($team['body']['$id']); $response = json_decode($client->receive(), true); @@ -1499,9 +2408,9 @@ class RealtimeCustomClientTest extends Scope ] ]); - $this->assertEquals($team['headers']['status-code'], 200); - $this->assertEquals($team['body']['funcKey1'], 'funcValue1'); - $this->assertEquals($team['body']['funcKey2'], 'funcValue2'); + $this->assertEquals(200, $team['headers']['status-code']); + $this->assertEquals('funcValue1', $team['body']['funcKey1']); + $this->assertEquals('funcValue2', $team['body']['funcKey2']); $response = json_decode($client->receive(), true); @@ -1520,8 +2429,8 @@ class RealtimeCustomClientTest extends Scope $this->assertContains("teams.*.update", $response['data']['events']); $this->assertContains("teams.*", $response['data']['events']); $this->assertNotEmpty($response['data']['payload']); - $this->assertEquals($response['data']['payload']['funcKey1'], 'funcValue1'); - $this->assertEquals($response['data']['payload']['funcKey2'], 'funcValue2'); + $this->assertEquals('funcValue1', $response['data']['payload']['funcKey1']); + $this->assertEquals('funcValue2', $response['data']['payload']['funcKey2']); $client->close(); diff --git a/tests/e2e/Services/Sites/SitesBase.php b/tests/e2e/Services/Sites/SitesBase.php index 00edcc1b72..93c55b82b7 100644 --- a/tests/e2e/Services/Sites/SitesBase.php +++ b/tests/e2e/Services/Sites/SitesBase.php @@ -3,6 +3,7 @@ namespace Tests\E2E\Services\Sites; use Appwrite\Tests\Async; +use Appwrite\Tests\Async\Exceptions\Critical; use CURLFile; use Tests\E2E\Client; use Utopia\CLI\Console; @@ -48,8 +49,23 @@ trait SitesBase 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], ])); + + if ($deployment['body']['status'] === 'failed') { + throw new Critical('Deployment failed: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT)); + } + + Console::execute("docker inspect openruntimes-executor --format='{{.State.ExitCode}}'", '', $this->stdout, $this->stderr); + if (\trim($this->stdout) !== '0') { + $msg = 'Executor has a problem: ' . $this->stderr . ' (' . $this->stdout . '), current status: '; + + Console::execute("docker compose logs openruntimes-executor", '', $this->stdout, $this->stderr); + $msg .= $this->stdout . ' (' . $this->stderr . ')'; + + throw new Critical($msg . json_encode($deployment['body'], JSON_PRETTY_PRINT)); + } + $this->assertEquals('ready', $deployment['body']['status'], 'Deployment status is not ready, deployment: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT)); - }, 150000, 500); + }, 300000, 500); // Not === so multipart/form-data works fine too if (($params['activate'] ?? false) == true) { @@ -265,7 +281,7 @@ trait SitesBase $this->assertEventually(function () use ($siteId, $deploymentId) { $deployment = $this->getDeployment($siteId, $deploymentId); $this->assertEquals('ready', $deployment['body']['status'], 'Deployment status is not ready, deployment: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT)); - }, 100000, 500); + }, 150000, 500); $this->assertEventually(function () use ($siteId, $deploymentId) { $site = $this->getSite($siteId); diff --git a/tests/e2e/Services/Sites/SitesConsoleClientTest.php b/tests/e2e/Services/Sites/SitesConsoleClientTest.php index 1a84f46ed7..227e36a50e 100644 --- a/tests/e2e/Services/Sites/SitesConsoleClientTest.php +++ b/tests/e2e/Services/Sites/SitesConsoleClientTest.php @@ -14,6 +14,9 @@ class SitesConsoleClientTest extends Scope use SideConsole; use SitesBase; + /** + * @group screenshots + */ public function testSiteScreenshot(): void { $siteId = $this->setupSite([ @@ -89,12 +92,51 @@ class SitesConsoleClientTest extends Scope $this->assertNotEquals($screenshotDarkHash, $screenshotHash); + $screenshotId = $deployment['body']['screenshotLight']; $file = $this->client->call(Client::METHOD_GET, "/storage/buckets/screenshots/files/$screenshotId/view?project=console"); $this->assertEquals(404, $file['headers']['status-code']); + $screenshotId = $deployment['body']['screenshotDark']; $file = $this->client->call(Client::METHOD_GET, "/storage/buckets/screenshots/files/$screenshotId/view?project=console"); $this->assertEquals(404, $file['headers']['status-code']); + // Verify previews + $screenshotId = $deployment['body']['screenshotLight']; + $file = $this->client->call(Client::METHOD_GET, "/storage/buckets/screenshots/files/$screenshotId/preview?project=console", array_merge($this->getHeaders(), [ + 'x-appwrite-mode' => 'default' // NOT ADMIN! + ])); + + $this->assertEquals(200, $file['headers']['status-code']); + $this->assertNotEmpty(200, $file['body']); + $this->assertGreaterThan(1, $file['headers']['content-length']); + $this->assertEquals('image/png', $file['headers']['content-type']); + + $screenshotHash = \md5($file['body']); + $this->assertNotEmpty($screenshotHash); + + $screenshotId = $deployment['body']['screenshotDark']; + $file = $this->client->call(Client::METHOD_GET, "/storage/buckets/screenshots/files/$screenshotId/preview?project=console", array_merge($this->getHeaders(), [ + 'x-appwrite-mode' => 'default' // NOT ADMIN! + ])); + + $this->assertEquals(200, $file['headers']['status-code']); + $this->assertNotEmpty(200, $file['body']); + $this->assertGreaterThan(1, $file['headers']['content-length']); + $this->assertEquals('image/png', $file['headers']['content-type']); + + $screenshotDarkHash = \md5($file['body']); + $this->assertNotEmpty($screenshotDarkHash); + + $this->assertNotEquals($screenshotDarkHash, $screenshotHash); + + $screenshotId = $deployment['body']['screenshotLight']; + $file = $this->client->call(Client::METHOD_GET, "/storage/buckets/screenshots/files/$screenshotId/preview?project=console"); + $this->assertEquals(404, $file['headers']['status-code']); + + $screenshotId = $deployment['body']['screenshotDark']; + $file = $this->client->call(Client::METHOD_GET, "/storage/buckets/screenshots/files/$screenshotId/preview?project=console"); + $this->assertEquals(404, $file['headers']['status-code']); + $this->cleanupSite($siteId); } } diff --git a/tests/e2e/Services/Sites/SitesCustomClientTest.php b/tests/e2e/Services/Sites/SitesCustomClientTest.php index 9bf389ea62..42fe26d216 100644 --- a/tests/e2e/Services/Sites/SitesCustomClientTest.php +++ b/tests/e2e/Services/Sites/SitesCustomClientTest.php @@ -6,6 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; +use Utopia\System\System; class SitesCustomClientTest extends Scope { @@ -121,6 +122,7 @@ class SitesCustomClientTest extends Scope * Test for SUCCESS */ $template = $this->getTemplate('starter-for-react'); + $hostname = System::getEnv('_APP_DOMAIN') ?: ''; $this->assertEquals(200, $template['headers']['status-code']); $this->assertIsArray($template['body']); $this->assertEquals('starter-for-react', $template['body']['key']); @@ -129,8 +131,8 @@ class SitesCustomClientTest extends Scope $this->assertEquals('github', $template['body']['vcsProvider']); $this->assertEquals('Simple React application integrated with Appwrite SDK.', $template['body']['tagline']); $this->assertIsArray($template['body']['frameworks']); - $this->assertEquals('http://localhost/images/sites/templates/starter-for-react-dark.png', $template['body']['screenshotDark']); - $this->assertEquals('http://localhost/images/sites/templates/starter-for-react-light.png', $template['body']['screenshotLight']); + $this->assertEquals('http://'. $hostname . '/images/sites/templates/starter-for-react-dark.png', $template['body']['screenshotDark']); + $this->assertEquals('http://' . $hostname . '/images/sites/templates/starter-for-react-light.png', $template['body']['screenshotLight']); /** * Test for FAILURE diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index d3b4922b87..c8301b9428 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -405,8 +405,10 @@ class SitesCustomServerTest extends Scope ]); $this->assertNotEmpty($deploymentId); - $site = $this->getSite($siteId); - $this->assertEquals('ssr', $site['body']['adapter']); + $this->assertEventually(function () use ($siteId, &$site) { + $site = $this->getSite($siteId); + $this->assertEquals('ssr', $site['body']['adapter']); + }); $proxyClient = new Client(); $proxyClient->setEndpoint('http://' . $domain); @@ -416,6 +418,7 @@ class SitesCustomServerTest extends Scope $this->cleanupSite($siteId); } + #[Retry(count: 3)] public function testAdapterDetectionAstroStatic(): void { $siteId = $this->setupSite([ @@ -477,7 +480,7 @@ class SitesCustomServerTest extends Scope $this->assertNotEmpty($domain); $deploymentId = $this->setupDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'true' ]); $this->assertNotEmpty($deploymentId); @@ -856,7 +859,7 @@ class SitesCustomServerTest extends Scope $deployment = $this->createDeployment($siteId, [ 'siteId' => $siteId, - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => true, ]); @@ -874,7 +877,7 @@ class SitesCustomServerTest extends Scope }, 50000, 500); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -917,7 +920,7 @@ class SitesCustomServerTest extends Scope $this->assertNotNull($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -937,12 +940,12 @@ class SitesCustomServerTest extends Scope $this->assertEquals(200, $deployment['headers']['status-code']); $this->assertEquals('canceled', $deployment['body']['status']); - /** - * Build worker still runs the build. - * 30s sleep gives worker enough time to finish build. - * After build finished, it should still be canceled, not ready. - */ - \sleep(30); + // Ensures worker got eventually aware of cancellation and reacted properly + $this->assertEventually(function () use ($siteId, $deploymentId) { + $deployment = $this->getDeployment($siteId, $deploymentId); + $this->assertEquals(200, $deployment['headers']['status-code']); + $this->assertStringContainsString('Build has been canceled.', $deployment['body']['buildLogs']); + }); $deployment = $this->getDeployment($siteId, $deploymentId); @@ -969,7 +972,7 @@ class SitesCustomServerTest extends Scope $this->assertNotNull($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -1014,7 +1017,7 @@ class SitesCustomServerTest extends Scope $this->assertNotNull($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -1022,7 +1025,7 @@ class SitesCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -1049,6 +1052,30 @@ class SitesCustomServerTest extends Scope $this->assertEquals($deployments['headers']['status-code'], 200); $this->assertCount(1, $deployments['body']['deployments']); + $deployments = $this->listDeployments($siteId, [ + 'queries' => [ + Query::select(['status'])->toString(), + ], + ]); + + $this->assertEquals($deployments['headers']['status-code'], 200); + $this->assertArrayHasKey('status', $deployments['body']['deployments'][0]); + $this->assertArrayHasKey('status', $deployments['body']['deployments'][1]); + $this->assertArrayNotHasKey('sourceSize', $deployments['body']['deployments'][0]); + $this->assertArrayNotHasKey('sourceSize', $deployments['body']['deployments'][1]); + + // Extra select query check, for attribute not allowed by filter queries + $deployments = $this->listDeployments($siteId, [ + 'queries' => [ + Query::select(['buildLogs'])->toString(), + ], + ]); + $this->assertEquals($deployments['headers']['status-code'], 200); + $this->assertArrayHasKey('buildLogs', $deployments['body']['deployments'][0]); + $this->assertArrayHasKey('buildLogs', $deployments['body']['deployments'][1]); + $this->assertArrayNotHasKey('sourceSize', $deployments['body']['deployments'][0]); + $this->assertArrayNotHasKey('sourceSize', $deployments['body']['deployments'][1]); + $deployments = $this->listDeployments($siteId, [ 'queries' => [ Query::offset(1)->toString(), @@ -1193,7 +1220,7 @@ class SitesCustomServerTest extends Scope $this->assertNotNull($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -1318,7 +1345,7 @@ class SitesCustomServerTest extends Scope $this->assertNotNull($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -1430,6 +1457,9 @@ class SitesCustomServerTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertStringContainsString("Index page", $response['body']); + $this->assertArrayHasKey('x-appwrite-log-id', $response['headers']); + $this->assertNotEmpty($response['headers']['x-appwrite-log-id']); + $response = $proxyClient->call(Client::METHOD_GET, '/contact', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -1446,7 +1476,7 @@ class SitesCustomServerTest extends Scope $this->assertEquals(404, $response['headers']['status-code']); $this->assertStringContainsString("Page not found", $response['body']); // Title $this->assertStringContainsString("Go to homepage", $response['body']); // Button - $this->assertStringContainsString("Powered by", $response['body']); // Brand + $this->assertStringNotContainsString("Powered by", $response['body']); // Brand $this->cleanupSite($siteId); } @@ -1502,11 +1532,12 @@ class SitesCustomServerTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertStringContainsString("Customized 404 page", $response['body']); - $this->assertStringNotContainsString("Powered by", $response['body']); // Brand + $this->assertStringNotContainsString("Powered by", $response['body']); //brand $this->cleanupSite($siteId); } + #[Retry(count: 3)] public function testSiteTemplate(): void { $template = $this->getTemplate('playground-for-astro'); @@ -1818,7 +1849,7 @@ class SitesCustomServerTest extends Scope ]); $deploymentId = $this->setupDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => true ]); @@ -1883,6 +1914,7 @@ class SitesCustomServerTest extends Scope Query::limit(1)->toString(), ]); $this->assertEquals(200, $logs['headers']['status-code']); + $this->assertStringContainsString($deploymentId, $logs['body']['executions'][0]['deploymentId']); $this->assertStringContainsString("GET", $logs['body']['executions'][0]['requestMethod']); $this->assertStringContainsString("/logs-inline", $logs['body']['executions'][0]['requestPath']); $this->assertStringContainsString("Log1", $logs['body']['executions'][0]['logs']); @@ -1892,6 +1924,24 @@ class SitesCustomServerTest extends Scope $log1Id = $logs['body']['executions'][0]['$id']; $this->assertNotEmpty($log1Id); + $logs = $this->listLogs($siteId, [ + Query::orderDesc('$createdAt')->toString(), + Query::limit(1)->toString(), + Query::equal('deploymentId', [$deploymentId])->toString() + ]); + $this->assertEquals(200, $logs['headers']['status-code']); + $this->assertGreaterThanOrEqual(1, $logs['body']['total']); + $this->assertCount(1, $logs['body']['executions']); + + $logs = $this->listLogs($siteId, [ + Query::orderDesc('$createdAt')->toString(), + Query::limit(1)->toString(), + Query::equal('deploymentId', ['some-random-id'])->toString() + ]); + $this->assertEquals(200, $logs['headers']['status-code']); + $this->assertEquals(0, $logs['body']['total']); + $this->assertCount(0, $logs['body']['executions']); + $response = $proxyClient->call(Client::METHOD_GET, '/logs-action'); $this->assertEquals(200, $response['headers']['status-code']); $this->assertStringContainsString("Action logs printed.", $response['body']); @@ -1901,6 +1951,7 @@ class SitesCustomServerTest extends Scope Query::limit(1)->toString(), ]); $this->assertEquals(200, $logs['headers']['status-code']); + $this->assertStringContainsString($deploymentId, $logs['body']['executions'][0]['deploymentId']); $this->assertStringContainsString("GET", $logs['body']['executions'][0]['requestMethod']); $this->assertStringContainsString("/logs-action", $logs['body']['executions'][0]['requestPath']); $this->assertStringContainsString("Log1", $logs['body']['executions'][0]['logs']); @@ -2435,7 +2486,7 @@ class SitesCustomServerTest extends Scope $this->assertNotEmpty($siteId); $deploymentId = $this->setupDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'true' ]); @@ -2477,7 +2528,7 @@ class SitesCustomServerTest extends Scope // test canceled deployment error page $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'true' ]); $deploymentId = $deployment['body']['$id'] ?? ''; @@ -2517,7 +2568,7 @@ class SitesCustomServerTest extends Scope $this->assertStringContainsString('View deployments', $response['body']); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('astro'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'true' ]); @@ -2606,7 +2657,7 @@ class SitesCustomServerTest extends Scope $this->assertNotEmpty($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => true ]); $this->assertEquals(202, $deployment['headers']['status-code']); @@ -2635,7 +2686,7 @@ class SitesCustomServerTest extends Scope $this->assertNotEmpty($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => true ]); $this->assertEquals(202, $deployment['headers']['status-code']); @@ -2693,4 +2744,45 @@ class SitesCustomServerTest extends Scope $this->cleanupSite($siteId); } + + public function testCookieHeader() + { + $siteId = $this->setupSite([ + 'siteId' => ID::unique(), + 'name' => 'Astro site', + 'framework' => 'astro', + 'adapter' => 'ssr', + 'buildRuntime' => 'node-22', + 'outputDirectory' => './dist', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'fallbackFile' => '', + ]); + + $this->assertNotEmpty($siteId); + + $domain = $this->setupSiteDomain($siteId); + + $deploymentId = $this->setupDeployment($siteId, [ + 'code' => $this->packageSite('astro'), + 'activate' => 'true' + ]); + + $this->assertNotEmpty($deploymentId); + + $domain = $this->getSiteDomain($siteId); + $proxyClient = new Client(); + $proxyClient->setEndpoint('http://' . $domain); + + $response = $proxyClient->call(Client::METHOD_GET, '/cookies', [ + 'cookie' => 'custom-session-id=abcd123; custom-user-id=efgh456' + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals("abcd123;efgh456", $response['body']); + $this->assertEquals("value-one", $response['cookies']['my-cookie-one']); + $this->assertEquals("value-two", $response['cookies']['my-cookie-two']); + + $this->cleanupSite($siteId); + } } diff --git a/tests/e2e/Services/Teams/TeamsBase.php b/tests/e2e/Services/Teams/TeamsBase.php index 80ac1621ee..fccfded1e1 100644 --- a/tests/e2e/Services/Teams/TeamsBase.php +++ b/tests/e2e/Services/Teams/TeamsBase.php @@ -64,7 +64,7 @@ trait TeamsBase // Step 4: Assert failure — cannot remove the only OWNER from a team $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('general_argument_invalid', $response['body']['type']); + $this->assertEquals('membership_downgrade_prohibited', $response['body']['type']); $this->assertEquals('There must be at least one owner in the organization.', $response['body']['message']); } diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index 1858fd50ad..5c8e94feb1 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -223,8 +223,10 @@ trait TeamsBaseClient $this->assertEquals($email, $lastEmail['to'][0]['address']); $this->assertEquals($name, $lastEmail['to'][0]['name']); $this->assertEquals('Invitation to ' . $teamName . ' Team at ' . $this->getProject()['name'], $lastEmail['subject']); - $this->assertEquals($response['body']['teamId'], substr($lastEmail['text'], strpos($lastEmail['text'], '&teamId=', 0) + 8, 20)); - $this->assertEquals($teamName, substr($lastEmail['text'], strpos($lastEmail['text'], '&teamName=', 0) + 10, 7)); + + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $this->assertEquals($teamName, $tokens['teamName']); + $this->assertEquals($response['body']['teamId'], $tokens['teamId']); /** * Test with UserId @@ -288,8 +290,10 @@ trait TeamsBaseClient $this->assertEquals($secondEmail, $lastEmail['to'][0]['address']); $this->assertEquals($secondName, $lastEmail['to'][0]['name']); $this->assertEquals('Invitation to ' . $teamName . ' Team at ' . $this->getProject()['name'], $lastEmail['subject']); - $this->assertEquals($response['body']['teamId'], substr($lastEmail['text'], strpos($lastEmail['text'], '&teamId=', 0) + 8, 20)); - $this->assertEquals($teamName, substr($lastEmail['text'], strpos($lastEmail['text'], '&teamName=', 0) + 10, 7)); + + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $this->assertEquals($teamName, $tokens['teamName']); + $this->assertEquals($response['body']['teamId'], $tokens['teamId']); // test for resending invitation $response = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ @@ -305,9 +309,10 @@ trait TeamsBaseClient $this->assertEquals(201, $response['headers']['status-code']); $lastEmail = $this->getLastEmail(); - $membershipUid = substr($lastEmail['text'], strpos($lastEmail['text'], '?membershipId=', 0) + 14, 20); - $userUid = substr($lastEmail['text'], strpos($lastEmail['text'], '&userId=', 0) + 8, 20); - $secret = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $membershipUid = $tokens['membershipId']; + $userUid = $tokens['userId']; + $secret = $tokens['secret']; /** * Test for FAILURE @@ -338,11 +343,11 @@ trait TeamsBaseClient $this->assertEquals(400, $response['headers']['status-code']); return [ - 'teamUid' => $teamUid, - 'teamName' => $teamName, - 'secret' => $secret, - 'membershipUid' => $membershipUid, - 'userUid' => $userUid, + 'teamUid' => $tokens['teamId'], + 'teamName' => $tokens['teamName'], + 'secret' => $tokens['secret'], + 'membershipUid' => $tokens['membershipId'], + 'userUid' => $tokens['userId'], 'email' => $email, 'name' => $name ]; @@ -600,10 +605,11 @@ trait TeamsBaseClient $this->assertEquals(201, $response['headers']['status-code']); $lastEmail = $this->getLastEmail(); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); - $secret = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); - $membershipUid = substr($lastEmail['text'], strpos($lastEmail['text'], '?membershipId=', 0) + 14, 20); - $userUid = substr($lastEmail['text'], strpos($lastEmail['text'], '&userId=', 0) + 8, 20); + $secret = $tokens['secret']; + $membershipUid = $tokens['membershipId']; + $userUid = $tokens['userId']; $response = $this->client->call(Client::METHOD_PATCH, '/teams/' . $teamUid . '/memberships/' . $membershipUid . '/status', [ 'origin' => 'http://localhost', diff --git a/tests/e2e/Services/Teams/TeamsConsoleClientTest.php b/tests/e2e/Services/Teams/TeamsConsoleClientTest.php index f096831a76..7949761d7f 100644 --- a/tests/e2e/Services/Teams/TeamsConsoleClientTest.php +++ b/tests/e2e/Services/Teams/TeamsConsoleClientTest.php @@ -65,7 +65,7 @@ class TeamsConsoleClientTest extends Scope /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ + $developer = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -75,7 +75,8 @@ class TeamsConsoleClientTest extends Scope 'url' => 'http://localhost:5000/join-us#title' ]); - $this->assertEquals(201, $response['headers']['status-code']); + $developerUserId = $developer['body']['$id']; + $this->assertEquals(201, $developer['headers']['status-code']); $response = $this->client->call(Client::METHOD_GET, '/users', array_merge([ 'content-type' => 'application/json', @@ -90,13 +91,26 @@ class TeamsConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); - $ownerMembershipUid = $response['body']['memberships'][1]['$id']; + $ownerMembershipUid = $response['body']['memberships'][0]['$id']; $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/' . $ownerMembershipUid, array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); + + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('membership_deletion_prohibited', $response['body']['type']); + $this->assertEquals('There must be at least one owner in the organization.', $response['body']['message']); + + // Remove the excess developer member to reduce the membership count in `TeamsBaseClient` tests. + // This is necessary because the only owner cannot be removed in the console project / top level team / organization. + $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/' . $developerUserId, array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(204, $response['headers']['status-code']); return $data; @@ -109,21 +123,6 @@ class TeamsConsoleClientTest extends Scope $membershipUid = $data['membershipUid'] ?? ''; $session = $data['session'] ?? ''; - /** - * Test for FAILURE - */ - $roles = ['developer']; - $response = $this->client->call(Client::METHOD_PATCH, '/teams/' . $teamUid . '/memberships/' . $membershipUid, array_merge([ - 'origin' => 'http://localhost', - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'roles' => $roles - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('There must be at least one owner in the organization.', $response['body']['message']); - /** * Test for unknown team */ @@ -132,7 +131,7 @@ class TeamsConsoleClientTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'roles' => $roles + 'roles' => ['developer'] ]); $this->assertEquals(404, $response['headers']['status-code']); @@ -145,7 +144,7 @@ class TeamsConsoleClientTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'roles' => $roles + 'roles' => ['developer'] ]); $this->assertEquals(404, $response['headers']['status-code']); @@ -160,7 +159,7 @@ class TeamsConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ], [ - 'roles' => $roles + 'roles' => ['developer'] ]); $this->assertEquals(401, $response['headers']['status-code']); @@ -168,4 +167,89 @@ class TeamsConsoleClientTest extends Scope return $data; } + + /** + * @depends testUpdateTeamMembershipRoles + */ + public function testDeleteTeamMembership($data): array + { + $teamUid = $data['teamUid'] ?? ''; + $membershipUid = $data['membershipUid'] ?? ''; + $session = $data['session'] ?? ''; + + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + $ownerMembershipUid = $response['body']['memberships'][0]['$id']; + + /** + * Test deleting a membership that does not exists + */ + $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/dne', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ]); + + $this->assertEquals(404, $response['headers']['status-code']); + + /** + * Test deleting another user's membership + */ + $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/' . $ownerMembershipUid, [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + $this->assertEquals('The current user is not authorized to perform the requested action.', $response['body']['message']); + + $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/' . $membershipUid, [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ]); + + $this->assertEquals(204, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + + /** + * Test for when the owner tries to delete their membership + */ + $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/' . $ownerMembershipUid, array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('membership_deletion_prohibited', $response['body']['type']); + $this->assertEquals('There must be at least one owner in the organization.', $response['body']['message']); + + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships/' . $ownerMembershipUid, array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + + return []; + } } diff --git a/tests/e2e/Services/Teams/TeamsCustomClientTest.php b/tests/e2e/Services/Teams/TeamsCustomClientTest.php index 7286bb0827..e30dacac74 100644 --- a/tests/e2e/Services/Teams/TeamsCustomClientTest.php +++ b/tests/e2e/Services/Teams/TeamsCustomClientTest.php @@ -6,6 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; +use Utopia\CLI\Console; class TeamsCustomClientTest extends Scope { @@ -152,11 +153,14 @@ class TeamsCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $email = $this->getLastEmail(); + Console::log(json_encode([ + 'testTeamsInviteHTMLInjection' => $email + ], JSON_PRETTY_PRINT)); + $encoded = 'http://localhost:5000/join-us\"></a><h1>INJECTED</h1>?'; $this->assertStringNotContainsString('<h1>INJECTED</h1>', $email['html']); $this->assertStringContainsString($encoded, $email['html']); - $this->assertStringContainsString($encoded, $email['text']); $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/'.$response['body']['$id'], array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Tokens/TokensBase.php b/tests/e2e/Services/Tokens/TokensBase.php index af93f5fc73..a4461c06c2 100644 --- a/tests/e2e/Services/Tokens/TokensBase.php +++ b/tests/e2e/Services/Tokens/TokensBase.php @@ -5,6 +5,8 @@ namespace Tests\E2E\Services\Tokens; use CURLFile; use Tests\E2E\Client; use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; trait TokensBase { @@ -275,4 +277,88 @@ trait TokensBase $this->assertEquals($image->getImageHeight(), $original->getImageHeight()); $this->assertEquals('PNG', $image->getImageFormat()); } + + public function testFileAccessWithFileSecurity(): void + { + $bucket = $this->client->call( + Client::METHOD_POST, + '/storage/buckets', + [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], + [ + 'name' => 'Test Bucket', + 'bucketId' => ID::unique(), + 'fileSecurity' => true, + 'allowedFileExtensions' => ['jpg', 'png', 'jfif'], + ] + ); + + $this->assertEquals(201, $bucket['headers']['status-code']); + $this->assertNotEmpty($bucket['body']['$id']); + + $bucketId = $bucket['body']['$id']; + + $file = $this->client->call( + Client::METHOD_POST, + '/storage/buckets/' . $bucketId . '/files', + [ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], + [ + 'fileId' => ID::unique(), + 'permissions' => [ Permission::read(Role::label('devrel')) ], + 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'logo.png'), + ] + ); + + $fileId = $file['body']['$id']; + + $token = $this->client->call( + Client::METHOD_POST, + '/tokens/buckets/' . $bucketId . '/files/' . $fileId, + [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ] + ); + + $jwtToken = $token['body']['secret']; + + $endpoints = ['preview', 'view', 'download']; + + foreach ($endpoints as $endpoint) { + $response = $this->client->call( + Client::METHOD_GET, + "/storage/buckets/$bucketId/files/$fileId/$endpoint", + [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], + [ + 'token' => $jwtToken + ] + ); + + $this->assertNotEmpty($response['body']); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('image/png', $response['headers']['content-type']); + + if ($endpoint === 'download') { + $image = new \Imagick(); + $image->readImageBlob($response['body']); + $original = new \Imagick(__DIR__ . '/../../../resources/logo.png'); + + $this->assertEquals($original->getImageWidth(), $image->getImageWidth()); + $this->assertEquals($original->getImageHeight(), $image->getImageHeight()); + $this->assertEquals('PNG', $image->getImageFormat()); + } + } + + } } diff --git a/tests/e2e/Services/Tokens/TokensConsoleClientTest.php b/tests/e2e/Services/Tokens/TokensConsoleClientTest.php index 4a7aab474a..c0f94a55bf 100644 --- a/tests/e2e/Services/Tokens/TokensConsoleClientTest.php +++ b/tests/e2e/Services/Tokens/TokensConsoleClientTest.php @@ -2,6 +2,8 @@ namespace Tests\E2E\Services\Tokens; +use Ahc\Jwt\JWT; +use Ahc\Jwt\JWTException; use CURLFile; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; @@ -12,6 +14,7 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Datetime as DatetimeValidator; +use Utopia\System\System; class TokensConsoleClientTest extends Scope { @@ -67,6 +70,28 @@ class TokensConsoleClientTest extends Scope $this->assertEquals(201, $token['headers']['status-code']); $this->assertEquals('files', $token['body']['resourceType']); + $this->assertNotEmpty($token['body']['$id']); + $this->assertNotEmpty($token['body']['secret']); + + // Verify the generated token JWT contains correct resource information + $jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 86400 * 365 * 10, 10); // 10 years maxAge + try { + $payload = $jwt->decode($token['body']['secret']); + $this->assertIsArray($payload, 'JWT payload should decode to an array'); + $this->assertArrayHasKey('tokenId', $payload, 'JWT payload should contain tokenId'); + $this->assertArrayHasKey('resourceId', $payload, 'JWT payload should contain resourceId'); + $this->assertArrayHasKey('resourceType', $payload, 'JWT payload should contain resourceType'); + $this->assertArrayHasKey('resourceInternalId', $payload, 'JWT payload should contain resourceInternalId'); + + $this->assertEquals($token['body']['$id'], $payload['tokenId'], 'JWT tokenId should match token ID'); + $this->assertEquals($bucketId . ':' . $fileId, $payload['resourceId'], 'JWT resourceId should match bucketId:fileId format'); + $this->assertEquals('files', $payload['resourceType'], 'JWT resourceType should be files'); + + // For newly created tokens without expiry, should not have exp field + $this->assertArrayNotHasKey('exp', $payload, 'JWT payload should not contain exp field for tokens without expiry'); + } catch (JWTException $e) { + $this->fail('Failed to decode JWT: ' . $e->getMessage()); + } return [ 'fileId' => $fileId, @@ -94,6 +119,21 @@ class TokensConsoleClientTest extends Scope $dateValidator = new DatetimeValidator(); $this->assertTrue($dateValidator->isValid($token['body']['expire'])); + // Verify JWT contains correct expiration using native JWT decode + $this->assertNotEmpty($token['body']['secret']); + + $jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 86400 * 365 * 10, 10); // 10 years maxAge + try { + $payload = $jwt->decode($token['body']['secret']); + $this->assertIsArray($payload, 'JWT payload should decode to an array'); + $this->assertArrayHasKey('exp', $payload, 'JWT payload should contain exp field'); + + $expectedExp = (new \DateTime($expiry))->getTimestamp(); + $this->assertEquals($expectedExp, $payload['exp'], 'JWT exp should match token expiry'); + } catch (JWTException $e) { + $this->fail('Failed to decode JWT: ' . $e->getMessage()); + } + // Infinite expiry $token = $this->client->call(Client::METHOD_PATCH, '/tokens/' . $tokenId, array_merge([ 'content-type' => 'application/json', @@ -104,6 +144,15 @@ class TokensConsoleClientTest extends Scope $this->assertEmpty($token['body']['expire']); + // Verify JWT does not contain exp for infinite expiry using native JWT decode + try { + $payload = $jwt->decode($token['body']['secret']); + $this->assertIsArray($payload, 'JWT payload should decode to an array'); + $this->assertArrayNotHasKey('exp', $payload, 'JWT payload should not contain exp field for infinite expiry'); + } catch (JWTException $e) { + $this->fail('Failed to decode JWT: ' . $e->getMessage()); + } + return $data; } @@ -123,6 +172,38 @@ class TokensConsoleClientTest extends Scope $this->assertIsArray($res['body']); $this->assertEquals(200, $res['headers']['status-code']); + $this->assertArrayHasKey('tokens', $res['body']); + $this->assertIsArray($res['body']['tokens']); + $this->assertGreaterThan(0, count($res['body']['tokens']), 'Should have at least one token'); + + // Verify each token in the list + $jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 86400 * 365 * 10, 10); // 10 years maxAge + foreach ($res['body']['tokens'] as $token) { + $this->assertArrayHasKey('$id', $token, 'Token should have an ID'); + $this->assertArrayHasKey('secret', $token, 'Token should have a secret'); + $this->assertArrayHasKey('resourceType', $token, 'Token should have resourceType'); + $this->assertArrayHasKey('resourceId', $token, 'Token should have resourceId'); + + $this->assertEquals('files', $token['resourceType'], 'Token resourceType should be files'); + $this->assertEquals($data['bucketId'] . ':' . $data['fileId'], $token['resourceId'], 'Token resourceId should match bucketId:fileId format'); + + // Verify the JWT token is valid and contains correct information + try { + $payload = $jwt->decode($token['secret']); + $this->assertIsArray($payload, 'JWT payload should decode to an array'); + $this->assertArrayHasKey('tokenId', $payload, 'JWT payload should contain tokenId'); + $this->assertArrayHasKey('resourceId', $payload, 'JWT payload should contain resourceId'); + $this->assertArrayHasKey('resourceType', $payload, 'JWT payload should contain resourceType'); + $this->assertArrayHasKey('resourceInternalId', $payload, 'JWT payload should contain resourceInternalId'); + + $this->assertEquals($token['$id'], $payload['tokenId'], 'JWT tokenId should match token ID'); + $this->assertEquals($data['bucketId'] . ':' . $data['fileId'], $payload['resourceId'], 'JWT resourceId should match bucketId:fileId format'); + $this->assertEquals('files', $payload['resourceType'], 'JWT resourceType should be files'); + } catch (JWTException $e) { + $this->fail('Failed to decode JWT for token ' . $token['$id'] . ': ' . $e->getMessage()); + } + } + return $data; } diff --git a/tests/e2e/Services/Users/UsersBase.php b/tests/e2e/Services/Users/UsersBase.php index 00e999672f..2cf1e4c65d 100644 --- a/tests/e2e/Services/Users/UsersBase.php +++ b/tests/e2e/Services/Users/UsersBase.php @@ -445,6 +445,19 @@ trait UsersBase $user1 = $response['body']['users'][1]; + // This test ensures that by default, endpoints dont support select queries + // If we add select query to this endpoint, you will need to remove this test + // Please make sure to add it to another place, unless all endpoints support select queries + $response = $this->client->call(Client::METHOD_GET, '/users', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['name'])->toString() + ] + ]); + $this->assertEquals($response['headers']['status-code'], 400); + $response = $this->client->call(Client::METHOD_GET, '/users', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -1117,7 +1130,7 @@ trait UsersBase ]); $this->assertEquals(401, $session['headers']['status-code']); - + $this->updateProjectinvalidateSessionsProperty(true); $user = $this->client->call(Client::METHOD_PATCH, '/users/' . $data['userId'] . '/password', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -1129,6 +1142,15 @@ trait UsersBase $this->assertNotEmpty($user['body']['$id']); $this->assertNotEmpty($user['body']['password']); + $sessions = $this->client->call(Client::METHOD_GET, '/users/' . $data['userId'] . '/sessions', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals($sessions['headers']['status-code'], 200); + $this->assertIsArray($sessions['body']); + $this->assertEmpty($sessions['body']['sessions']); + $session = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -1138,7 +1160,7 @@ trait UsersBase ]); $this->assertEquals($session['headers']['status-code'], 201); - + $this->updateProjectinvalidateSessionsProperty(false); return $data; } diff --git a/tests/e2e/Services/Webhooks/WebhooksBase.php b/tests/e2e/Services/Webhooks/WebhooksBase.php index c743810feb..41f6c03c35 100644 --- a/tests/e2e/Services/Webhooks/WebhooksBase.php +++ b/tests/e2e/Services/Webhooks/WebhooksBase.php @@ -36,7 +36,7 @@ trait WebhooksBase return base64_encode(hash_hmac('sha1', $url . $payload, $signatureKey, true)); } - + // Collection APIs public function testCreateCollection(): array { /** @@ -389,6 +389,356 @@ trait WebhooksBase return $data; } + // Table APIs + public function testCreateTable(): array + { + /** + * Create database + */ + $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'Actors DB', + ]); + + $databaseId = $database['body']['$id']; + + /** + * Test for SUCCESS + */ + $actors = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Actors', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $actorsId = $actors['body']['$id']; + + $this->assertEquals($actors['headers']['status-code'], 201); + $this->assertNotEmpty($actors['body']['$id']); + + $webhook = $this->getLastRequest(); + $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); + + $this->assertEquals($webhook['method'], 'POST'); + $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); + $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.create', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.create", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); + $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); + $this->assertNotEmpty($webhook['data']['$id']); + $this->assertEquals($webhook['data']['name'], 'Actors'); + $this->assertIsArray($webhook['data']['$permissions']); + $this->assertCount(4, $webhook['data']['$permissions']); + + return array_merge(['actorsId' => $actorsId, 'databaseId' => $databaseId]); + } + + /** + * @depends testCreateTable + */ + public function testCreateColumns(array $data): array + { + $actorsId = $data['actorsId']; + $databaseId = $data['databaseId']; + + $firstName = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actorsId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'firstName', + 'size' => 256, + 'required' => true, + ]); + + $lastName = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actorsId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'lastName', + 'size' => 256, + 'required' => true, + ]); + + $extra = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actorsId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'extra', + 'size' => 64, + 'required' => false, + ]); + + $this->assertEquals($firstName['headers']['status-code'], 202); + $this->assertEquals($firstName['body']['key'], 'firstName'); + $this->assertEquals($lastName['headers']['status-code'], 202); + $this->assertEquals($lastName['body']['key'], 'lastName'); + $this->assertEquals($extra['headers']['status-code'], 202); + $this->assertEquals($extra['body']['key'], 'extra'); + + // wait for database worker to kick in + sleep(10); + + $webhook = $this->getLastRequest(); + $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); + + $this->assertEquals($webhook['method'], 'POST'); + $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); + $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.columns.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.columns.*.create', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.columns.*", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.columns.*.create", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); + $this->assertNotEmpty($webhook['data']['key']); + $this->assertEquals($webhook['data']['key'], 'extra'); + + $removed = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['actorsId'] . '/columns/' . $extra['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $removed['headers']['status-code']); + + $webhook = $this->getLastRequest(); + $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); + + // $this->assertEquals($webhook['method'], 'DELETE'); + $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); + $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.columns.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.columns.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.columns.*", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.columns.*.update", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); + $this->assertNotEmpty($webhook['data']['key']); + $this->assertEquals($webhook['data']['key'], 'extra'); + + return $data; + } + + /** + * @depends testCreateColumns + */ + public function testCreateRow(array $data): array + { + $actorsId = $data['actorsId']; + $databaseId = $data['databaseId']; + + /** + * Test for SUCCESS + */ + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actorsId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'firstName' => 'Chris', + 'lastName' => 'Evans', + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $documentId = $row['body']['$id']; + + $this->assertEquals($row['headers']['status-code'], 201); + $this->assertNotEmpty($row['body']['$id']); + + $webhook = $this->getLastRequest(); + $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); + + $this->assertEquals($webhook['method'], 'POST'); + $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); + $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.rows.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.rows.*.create', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.*.rows.{$documentId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.*.rows.{$documentId}.create", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.*", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.*.create", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.{$documentId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.{$documentId}.create", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); + $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertNotEmpty($webhook['data']['$id']); + $this->assertEquals($webhook['data']['firstName'], 'Chris'); + $this->assertEquals($webhook['data']['lastName'], 'Evans'); + $this->assertIsArray($webhook['data']['$permissions']); + $this->assertCount(3, $webhook['data']['$permissions']); + + $data['rowId'] = $row['body']['$id']; + + return $data; + } + + /** + * @depends testCreateRow + */ + public function testUpdateRow(array $data): array + { + $actorsId = $data['actorsId']; + $databaseId = $data['databaseId']; + + /** + * Test for SUCCESS + */ + $document = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $actorsId . '/rows/' . $data['rowId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'firstName' => 'Chris1', + 'lastName' => 'Evans2', + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $rowId = $document['body']['$id']; + + $this->assertEquals($document['headers']['status-code'], 200); + $this->assertNotEmpty($document['body']['$id']); + + $webhook = $this->getLastRequest(); + $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); + + $this->assertEquals($webhook['method'], 'POST'); + $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); + $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.rows.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.rows.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.*.rows.{$rowId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.*.rows.{$rowId}.update", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.*", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.*.update", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.{$rowId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.{$rowId}.update", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); + $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertNotEmpty($webhook['data']['$id']); + $this->assertEquals($webhook['data']['firstName'], 'Chris1'); + $this->assertEquals($webhook['data']['lastName'], 'Evans2'); + $this->assertIsArray($webhook['data']['$permissions']); + $this->assertCount(3, $webhook['data']['$permissions']); + + return $data; + } + + /** + * @depends testCreateTable + */ + #[Retry(count: 1)] + public function testDeleteRow(array $data): array + { + $actorsId = $data['actorsId']; + $databaseId = $data['databaseId']; + + /** + * Test for SUCCESS + */ + $row = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $actorsId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'firstName' => 'Bradly', + 'lastName' => 'Cooper', + + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $rowId = $row['body']['$id']; + + $this->assertEquals($row['headers']['status-code'], 201); + $this->assertNotEmpty($row['body']['$id']); + + $row = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $actorsId . '/rows/' . $row['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals($row['headers']['status-code'], 204); + + $webhook = $this->getLastRequest(); + $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); + + $this->assertEquals($webhook['method'], 'POST'); + $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); + $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.rows.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.rows.*.delete', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.*.rows.{$rowId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.*.rows.{$rowId}.delete", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.*", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.*.delete", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.{$rowId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.rows.{$rowId}.delete", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); + $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); + $this->assertNotEmpty($webhook['data']['$id']); + $this->assertEquals($webhook['data']['firstName'], 'Bradly'); + $this->assertEquals($webhook['data']['lastName'], 'Cooper'); + $this->assertIsArray($webhook['data']['$permissions']); + $this->assertCount(3, $webhook['data']['$permissions']); + + return $data; + } public function testCreateStorageBucket(): array { @@ -921,7 +1271,10 @@ trait WebhooksBase $lastEmail = $this->getLastEmail(); - $secret = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); + // `$isAppUser` — no email expected; + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html'] ?? ''); + + $secret = $tokens['secret'] ?? ''; $membershipId = $team['body']['$id']; $webhook = $this->getLastRequest(); diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php index a170492551..bcc4ede30a 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php @@ -894,9 +894,9 @@ class WebhooksCustomClientTest extends Scope $url = $webhook['url']; $signatureExpected = base64_encode(hash_hmac('sha1', $url . $payload, $signatureKey, true)); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); $this->assertStringContainsString('teams.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('teams.*.memberships.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('teams.*.memberships.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -919,8 +919,8 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['teamId']); $this->assertCount(2, $webhook['data']['roles']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($webhook['data']['joined'])); - $this->assertEquals(true, $webhook['data']['confirm']); + $this->assertTrue((new DatetimeValidator())->isValid($webhook['data']['joined'])); + $this->assertTrue($webhook['data']['confirm']); /** * Test for FAILURE diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index d2f132e960..1df6dfe9ae 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -19,6 +19,7 @@ class WebhooksCustomServerTest extends Scope use ProjectCustom; use SideServer; + // Collection APIs /** * @depends testCreateAttributes */ @@ -39,15 +40,15 @@ class WebhooksCustomServerTest extends Scope 'documentSecurity' => true, ]); - $this->assertEquals($actors['headers']['status-code'], 200); + $this->assertEquals(200, $actors['headers']['status-code']); $this->assertNotEmpty($actors['body']['$id']); $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); $this->assertStringContainsString('databases.' . $databaseId . '.collections.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('databases.' . $databaseId . '.collections.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString("databases.{$databaseId}.collections.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -55,9 +56,9 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); + $this->assertTrue(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? '')); $this->assertNotEmpty($webhook['data']['$id']); - $this->assertEquals($webhook['data']['name'], 'Actors1'); + $this->assertEquals('Actors1', $webhook['data']['name']); $this->assertIsArray($webhook['data']['$permissions']); $this->assertCount(4, $webhook['data']['$permissions']); @@ -84,8 +85,8 @@ class WebhooksCustomServerTest extends Scope ]); $indexKey = $index['body']['key']; - $this->assertEquals($index['headers']['status-code'], 202); - $this->assertEquals($index['body']['key'], 'fullname'); + $this->assertEquals(202, $index['headers']['status-code']); + $this->assertEquals('fullname', $index['body']['key']); // wait for database worker to create index sleep(5); @@ -93,9 +94,9 @@ class WebhooksCustomServerTest extends Scope $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); $this->assertStringContainsString('databases.' . $databaseId . '.collections.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('databases.' . $databaseId . '.collections.*.indexes.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('databases.' . $databaseId . '.collections.*.indexes.*.create', $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -105,7 +106,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); + $this->assertTrue(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? '')); // Remove index $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $data['actorsId'] . '/indexes/' . $index['body']['key'], array_merge([ @@ -119,8 +120,8 @@ class WebhooksCustomServerTest extends Scope $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); // $this->assertEquals($webhook['method'], 'DELETE'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); $this->assertStringContainsString('databases.' . $databaseId . '.collections.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('databases.' . $databaseId . '.collections.*.indexes.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('databases.' . $databaseId . '.collections.*.indexes.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -130,7 +131,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); + $this->assertTrue(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? '')); return $data; } @@ -172,7 +173,7 @@ class WebhooksCustomServerTest extends Scope $id = $actors['body']['$id']; - $this->assertEquals($actors['headers']['status-code'], 201); + $this->assertEquals(201, $actors['headers']['status-code']); $this->assertNotEmpty($actors['body']['$id']); $actors = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $actors['body']['$id'], array_merge([ @@ -181,14 +182,14 @@ class WebhooksCustomServerTest extends Scope 'x-appwrite-key' => $this->getProject()['apiKey'] ]), []); - $this->assertEquals($actors['headers']['status-code'], 204); + $this->assertEquals(204, $actors['headers']['status-code']); $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); $this->assertStringContainsString('databases.' . $databaseId . '.collections.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('databases.' . $databaseId . '.collections.*.delete', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString("databases.{$databaseId}.collections.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -196,9 +197,195 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); - $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), true); + $this->assertTrue(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? '')); $this->assertNotEmpty($webhook['data']['$id']); - $this->assertEquals($webhook['data']['name'], 'Demo'); + $this->assertEquals('Demo', $webhook['data']['name']); + $this->assertIsArray($webhook['data']['$permissions']); + $this->assertCount(4, $webhook['data']['$permissions']); + + return []; + } + + // Table APIs + /** + * @depends testCreateColumns + */ + public function testUpdateTable($data): array + { + $id = $data['actorsId']; + $databaseId = $data['databaseId']; + + /** + * Test for SUCCESS + */ + $actors = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Actors1', + 'rowSecurity' => true, + ]); + + $this->assertEquals(200, $actors['headers']['status-code']); + $this->assertNotEmpty($actors['body']['$id']); + + $webhook = $this->getLastRequest(); + $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); + + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$id}.update", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); + $this->assertEmpty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''); + $this->assertNotEmpty($webhook['data']['$id']); + $this->assertEquals('Actors1', $webhook['data']['name']); + $this->assertIsArray($webhook['data']['$permissions']); + $this->assertCount(4, $webhook['data']['$permissions']); + + return array_merge(['actorsId' => $actors['body']['$id']]); + } + + /** + * @depends testCreateColumns + */ + public function testCreateDeleteColumnIndexes($data): array + { + $actorsId = $data['actorsId']; + $databaseId = $data['databaseId']; + + $index = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $data['actorsId'] . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'fullname', + 'type' => 'key', + 'columns' => ['lastName', 'firstName'], + 'orders' => ['ASC', 'ASC'], + ]); + + $this->assertEquals(202, $index['headers']['status-code']); + $this->assertEquals('fullname', $index['body']['key']); + + // wait for database worker to create index + sleep(5); + + $webhook = $this->getLastRequest(); + $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); + + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.indexes.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.indexes.*.create', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.indexes.*", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.indexes.*.create", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); + $this->assertTrue(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? '')); + + // Remove index + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $data['actorsId'] . '/indexes/' . $index['body']['key'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + // // wait for database worker to remove index + $webhook = $this->getLastRequest(); + $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); + + // $this->assertEquals($webhook['method'], 'DELETE'); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.indexes.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.indexes.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.indexes.*", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$actorsId}.indexes.*.update", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); + $this->assertTrue(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? '')); + + return $data; + } + + public function testDeleteTable(): array + { + /** + * Create database + */ + $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders()), [ + 'databaseId' => ID::unique(), + 'name' => 'Actors DB', + ]); + + $databaseId = $database['body']['$id']; + + /** + * Test for SUCCESS + */ + $actors = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Demo', + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'rowSecurity' => true, + ]); + + $id = $actors['body']['$id']; + + $this->assertEquals(201, $actors['headers']['status-code']); + $this->assertNotEmpty($actors['body']['$id']); + + $actors = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $actors['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $actors['headers']['status-code']); + + $webhook = $this->getLastRequest(); + $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); + + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString('databases.' . $databaseId . '.tables.*.delete', $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertStringContainsString("databases.{$databaseId}.tables.{$id}.delete", $webhook['headers']['X-Appwrite-Webhook-Events']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); + $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); + $this->assertEmpty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''); + $this->assertNotEmpty($webhook['data']['$id']); + $this->assertEquals('Demo', $webhook['data']['name']); $this->assertIsArray($webhook['data']['$permissions']); $this->assertCount(4, $webhook['data']['$permissions']); @@ -224,7 +411,7 @@ class WebhooksCustomServerTest extends Scope 'name' => $name, ]); - $this->assertEquals($user['headers']['status-code'], 201); + $this->assertEquals(201, $user['headers']['status-code']); $this->assertNotEmpty($user['body']['$id']); $id = $user['body']['$id']; @@ -232,9 +419,9 @@ class WebhooksCustomServerTest extends Scope $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); $this->assertStringContainsString('users.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('users.*.create', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString("users.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -245,11 +432,11 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $name); - $this->assertEquals(true, (new DatetimeValidator())->isValid($webhook['data']['registration'])); - $this->assertEquals($webhook['data']['status'], true); + $this->assertTrue((new DatetimeValidator())->isValid($webhook['data']['registration'])); + $this->assertTrue($webhook['data']['status']); $this->assertEquals($webhook['data']['email'], $email); - $this->assertEquals($webhook['data']['emailVerification'], false); - $this->assertEquals($webhook['data']['prefs'], []); + $this->assertFalse($webhook['data']['emailVerification']); + $this->assertEquals([], $webhook['data']['prefs']); /** * Test for FAILURE @@ -274,15 +461,15 @@ class WebhooksCustomServerTest extends Scope 'prefs' => ['a' => 'b'] ]); - $this->assertEquals($user['headers']['status-code'], 200); - $this->assertEquals($user['body']['a'], 'b'); + $this->assertEquals(200, $user['headers']['status-code']); + $this->assertEquals('b', $user['body']['a']); $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); $this->assertStringContainsString('users.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('users.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('users.*.update.prefs', $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -293,7 +480,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); - $this->assertEquals($webhook['data']['a'], 'b'); + $this->assertEquals('b', $webhook['data']['a']); return $data; } @@ -315,15 +502,15 @@ class WebhooksCustomServerTest extends Scope 'status' => false, ]); - $this->assertEquals($user['headers']['status-code'], 200); + $this->assertEquals(200, $user['headers']['status-code']); $this->assertNotEmpty($user['body']['$id']); $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); $this->assertStringContainsString('users.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('users.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('users.*.update.status', $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -336,11 +523,11 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $data['name']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($webhook['data']['registration'])); - $this->assertEquals($webhook['data']['status'], false); + $this->assertTrue((new DatetimeValidator())->isValid($webhook['data']['registration'])); + $this->assertFalse($webhook['data']['status']); $this->assertEquals($webhook['data']['email'], $data['email']); - $this->assertEquals($webhook['data']['emailVerification'], false); - $this->assertEquals($webhook['data']['prefs']['a'], 'b'); + $this->assertFalse($webhook['data']['emailVerification']); + $this->assertEquals('b', $webhook['data']['prefs']['a']); return $data; } @@ -360,14 +547,14 @@ class WebhooksCustomServerTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); - $this->assertEquals($user['headers']['status-code'], 204); + $this->assertEquals(204, $user['headers']['status-code']); $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); $this->assertStringContainsString('users.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('users.*.delete', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString("users.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -378,11 +565,11 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $data['name']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($webhook['data']['registration'])); - $this->assertEquals($webhook['data']['status'], false); + $this->assertTrue((new DatetimeValidator())->isValid($webhook['data']['registration'])); + $this->assertFalse($webhook['data']['status']); $this->assertEquals($webhook['data']['email'], $data['email']); - $this->assertEquals($webhook['data']['emailVerification'], false); - $this->assertEquals($webhook['data']['prefs']['a'], 'b'); + $this->assertFalse($webhook['data']['emailVerification']); + $this->assertEquals('b', $webhook['data']['prefs']['a']); return $data; } @@ -399,22 +586,22 @@ class WebhooksCustomServerTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::any()->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, ]); $id = $function['body']['$id'] ?? ''; - $this->assertEquals($function['headers']['status-code'], 201); + $this->assertEquals(201, $function['headers']['status-code']); $this->assertNotEmpty($function['body']['$id']); $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); @@ -439,15 +626,15 @@ class WebhooksCustomServerTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'execute' => [Role::any()->toString()], 'vars' => [ 'key1' => 'value1', ] ]); - $this->assertEquals($function['headers']['status-code'], 200); + $this->assertEquals(200, $function['headers']['status-code']); $this->assertEquals($function['body']['$id'], $data['functionId']); // Create variable @@ -464,9 +651,9 @@ class WebhooksCustomServerTest extends Scope $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); // $this->assertStringContainsString('functions.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString('functions.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString("functions.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -496,7 +683,7 @@ class WebhooksCustomServerTest extends Scope 'content-type' => 'multipart/form-data', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'entrypoint' => 'index.php', + 'entrypoint' => 'index.js', 'code' => new CURLFile($code, 'application/x-gzip', \basename($code)), 'activate' => true ]); @@ -504,15 +691,15 @@ class WebhooksCustomServerTest extends Scope $functionId = $data['functionId'] ?? ''; $deploymentId = $deployment['body']['$id'] ?? ''; - $this->assertEquals($deployment['headers']['status-code'], 202); + $this->assertEquals(202, $deployment['headers']['status-code']); $this->assertNotEmpty($deployment['body']['$id']); $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); // $this->assertStringContainsString('functions.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString('functions.*.deployments.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString("functions.*.deployments.{$deploymentId}", $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -544,7 +731,7 @@ class WebhooksCustomServerTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); - $this->assertEquals($response['headers']['status-code'], 200); + $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); // Wait for deployment to be built. @@ -553,9 +740,9 @@ class WebhooksCustomServerTest extends Scope $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); // $this->assertStringContainsString('functions.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString('functions.*.deployments.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString('functions.*.deployments.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -596,14 +783,14 @@ class WebhooksCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - $this->assertEquals($execution['headers']['status-code'], 202); + $this->assertEquals(202, $execution['headers']['status-code']); $this->assertNotEmpty($execution['body']['$id']); $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); // $this->assertStringContainsString('functions.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString('functions.*.executions.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString('functions.*.executions.*.create', $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -624,9 +811,9 @@ class WebhooksCustomServerTest extends Scope $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); // $this->assertStringContainsString('functions.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString('functions.*.executions.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString('functions.*.executions.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -663,15 +850,15 @@ class WebhooksCustomServerTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); - $this->assertEquals($deployment['headers']['status-code'], 204); + $this->assertEquals(204, $deployment['headers']['status-code']); $this->assertEmpty($deployment['body']); $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); // $this->assertStringContainsString('functions.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString('functions.*.deployments.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString('functions.*.deployments.*.delete', $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -714,9 +901,9 @@ class WebhooksCustomServerTest extends Scope $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); // $this->assertStringContainsString('functions.*', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString('functions.*.delete', $webhook['headers']['X-Appwrite-Webhook-Events']); // $this->assertStringContainsString("functions.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']); diff --git a/tests/extensions/Async/Eventually.php b/tests/extensions/Async/Eventually.php index 9840b1a114..10f6b41eee 100644 --- a/tests/extensions/Async/Eventually.php +++ b/tests/extensions/Async/Eventually.php @@ -2,6 +2,7 @@ namespace Appwrite\Tests\Async; +use Appwrite\Tests\Async\Exceptions\Critical; use PHPUnit\Framework\Constraint\Constraint; final class Eventually extends Constraint @@ -23,6 +24,8 @@ final class Eventually extends Constraint try { $probe(); return true; + } catch (Critical $exception) { + throw $exception; } catch (\Exception $exception) { $lastException = $exception; } diff --git a/tests/extensions/Async/Exceptions/Critical.php b/tests/extensions/Async/Exceptions/Critical.php new file mode 100644 index 0000000000..92b6feb97e --- /dev/null +++ b/tests/extensions/Async/Exceptions/Critical.php @@ -0,0 +1,7 @@ +<?php + +namespace Appwrite\Tests\Async\Exceptions; + +class Critical extends \Exception +{ +} diff --git a/tests/resources/csv/documents-internals.csv b/tests/resources/csv/documents-internals.csv new file mode 100644 index 0000000000..ab8e192a0e --- /dev/null +++ b/tests/resources/csv/documents-internals.csv @@ -0,0 +1,26 @@ +$id,$createdAt,$updatedAt,$permissions,name,age +z1y2x3w4v5u6t7s8,2022-10-23T10:33:01+00:00,2023-03-15T12:00:41+00:00,"read(""any""),update(""user:123"")",Diamond Mendez,56 +r9q0p1o2n3m4l5k6,2021-08-11T21:05:13+00:00,2024-01-02T08:45:22+00:00,"read(""any""),update(""user:456"")",Michael Huff,20 +j7i8h9g0f1e2d3c4,2020-05-29T14:22:56+00:00,2022-11-30T18:19:33+00:00,"read(""any"")",Alyssa Rodriguez,37 +b5a6z7y8x9w0v1u2,2023-01-18T03:44:09+00:00,2023-09-07T23:50:17+00:00,"read(""any"")",Barbara Smith,26 +t3s4r5q6p7o8n9m0,2020-11-02T09:12:45+00:00,2021-07-21T15:30:55+00:00,"read(""any"")",Evelyn Edwards,54 +l1k2j3i4h5g6f7e8,2022-03-19T19:55:27+00:00,2024-05-14T06:28:11+00:00,"read(""any"")",Tina Richardson,41 +d9c0b1a2z3y4x5w6,2021-04-07T01:18:34+00:00,2023-06-25T11:47:04+00:00,"read(""any"")",Joel Hernandez,49 +v7u8t9s0r1q2p3o4,2023-08-22T16:40:18+00:00,2024-02-19T04:09:58+00:00,"read(""any"")",Zachary Cooper,59 +n5m6l7k8j9i0h1g2,2020-02-12T07:59:01+00:00,2022-09-08T13:21:49+00:00,"read(""any"")",Brittany Spears,20 +f3e4d5c6b7a8z9y0,2021-12-05T22:33:12+00:00,2023-11-11T02:55:37+00:00,"read(""any"")",Holly White,47 +x1w2v3u4t5s6r7q8,2022-07-14T05:01:50+00:00,2024-04-01T20:10:26+00:00,"read(""any"")",Kimberly Barnes,27 +p9o0n1m2l3k4j5i6,2020-09-28T11:27:36+00:00,2021-10-17T09:38:08+00:00,"read(""any"")",Stephen Miller,53 +h7g8f9e0d1c2b3a4,2023-04-04T08:15:59+00:00,2024-06-29T17:03:14+00:00,"read(""any"")",Yvonne Newman,41 +y5x6w7v8u9t0s1r2,2021-01-25T18:09:21+00:00,2022-08-16T22:44:51+00:00,"read(""any"")",Carol Kane,38 +q3p4o5n6m7l8k9j0,2022-06-09T12:53:47+00:00,2023-12-24T01:16:05+00:00,"read(""any"")",Doris Foster,44 +i1h2g3f4e5d6c7b8,2020-07-03T23:37:02+00:00,2021-05-09T05:52:43+00:00,"read(""any"")",Joseph Stokes,28 +a9z0y1x2w3v4u5t6,2023-10-10T02:20:15+00:00,2024-03-28T14:33:29+00:00,"read(""any"")",Steve Williams,31 +s7r8q9p0o1n2m3l4,2021-06-16T13:48:53+00:00,2022-04-22T07:07:19+00:00,"read(""any"")",James Carey,29 +k5j6i7h8g9f0e1d2,2022-12-27T20:06:38+00:00,2023-08-03T10:25:57+00:00,"read(""any"")",Kathryn Henry,38 +c3b4a5z6y7x8w9v0,2020-04-20T04:41:24+00:00,2021-02-13T19:14:06+00:00,"read(""any"")",Christopher Landry,23 +u1t2s3r4q5p6o7n8,2023-05-08T00:58:10+00:00,2024-07-05T03:36:48+00:00,"read(""any"")",Jennifer Mcgee,62 +m9l0k1j2i3h4g5f6,2021-09-01T06:11:42+00:00,2022-01-26T16:59:23+00:00,"read(""any"")",Cathy Church,35 +e7d8c9b0a1z2y3x4,2022-02-18T15:24:07+00:00,2023-04-12T00:40:31+00:00,"read(""any"")",Jose Lopez,41 +w5v6u7t8s9r0q1p2,2020-12-13T09:03:55+00:00,2021-11-06T11:23:16+00:00,"read(""any"")",William Rose,30 +o3n4m5l6k7j8i9h0,2021-12-13T09:03:55+00:00,2022-11-06T11:23:16+00:00,"read(""any"")",Charles Hammer,61 diff --git a/tests/resources/csv/irrelevant-column.csv b/tests/resources/csv/irrelevant-column.csv index 92105ceaa2..7b690ab71a 100644 --- a/tests/resources/csv/irrelevant-column.csv +++ b/tests/resources/csv/irrelevant-column.csv @@ -1,101 +1,101 @@ -$id,name,age,email -hxfcwpcas5xokpwe,Diamond Mendez,56,diamond.mendez@example.com -gw8nxwf6esn3tfwf,Michael Huff,20,michael.huff@example.com -xb6bxg56lral1qy9,Alyssa Rodriguez,37,alyssa.rodriguez@example.com -imerjq5j36y3agh2,Barbara Smith,26,barbara.smith@example.com -07yq9qdlhmbzmr35,Evelyn Edwards,54,evelyn.edwards@example.com -ksqo631sbhwj5ltg,Tina Richardson,41,tina.richardson@example.com -j7zlndgu0gbshp15,Joel Hernandez,49,joel.hernandez@example.com -mfntvnljrcmf7h6v,Zachary Cooper,59,zachary.cooper@example.com -5f9b01nziqu2h8ed,Brittany Spears,20,brittany.spears@example.com -4vxzbnzraqznk5u8,Holly White,47,holly.white@example.com -d4ywy3mtphaatbpf,Kimberly Barnes,27,kimberly.barnes@example.com -88odnk6nthyyvbal,Stephen Miller,53,stephen.miller@example.com -08oekee3fn7mzaa5,Yvonne Newman,41,yvonne.newman@example.com -quw55kn9895i5e4v,Carol Kane,38,carol.kane@example.com -nge6bm8ykripei6f,Doris Foster,44,doris.foster@example.com -4k16i33s0xl2ypx9,Joseph Stokes,28,joseph.stokes@example.com -q0j5rxbgid66snyf,Steve Williams,31,steve.williams@example.com -n1oxun7mqq3p103y,James Carey,29,james.carey@example.com -0dbvs840jkf8i0ye,Kathryn Henry,38,kathryn.henry@example.com -5sfaidgs1h87v15v,Christopher Landry,23,christopher.landry@example.com -vg3punvfu5khmf41,Jennifer Mcgee,62,jennifer.mcgee@example.com -f933qydr9u5b2r11,Cathy Church,35,cathy.church@example.com -wjv87y1inf8yk32s,Jose Lopez,41,jose.lopez@example.com -uljysdvdlcyrbrwk,William Rose,30,william.rose@example.com -ot8xtzh77j55wq0s,Sarah Ford,26,sarah.ford@example.com -9t76vnsv2u36s43t,Alisha Jones,61,alisha.jones@example.com -66y4tnty62hw8c02,Kristin Kelly,61,kristin.kelly@example.com -2punfblazi5v16ar,Brendan Stout,40,brendan.stout@example.com -sxhr4nf5w2gx4wbg,Kelly Cruz,18,kelly.cruz@example.com -68dvrqfwqnkq5el9,Samantha Martin,50,samantha.martin@example.com -20192l6dbeinhkh0,David Santos,46,david.santos@example.com -si0l4dgay09ebfmf,Elizabeth Carroll,22,elizabeth.carroll@example.com -lhse40vbldqb6ap1,Corey Owens,46,corey.owens@example.com -h5t3pslykyx3kxfm,Shelby Mueller,65,shelby.mueller@example.com -ldc0luydrw6jub0f,Dr. Sylvia Myers,29,sylvia.myers@example.com -voc9628xg4dsgw2y,Scott Freeman,48,scott.freeman@example.com -o4y0gk3gqv1ax2fz,Christopher Atkinson,21,christopher.atkinson@example.com -u1n3x4e4u7e0vzj6,Sean Diaz,31,sean.diaz@example.com -s36eskwtm0w7lwr7,Bobby Dyer,57,bobby.dyer@example.com -4hjnag1p5iwvtixd,Daniel Hall,62,daniel.hall@example.com -m91d80oxsa216zbh,Jennifer Ramirez,65,jennifer.ramirez@example.com -5hj6858zo2g85n6v,Angela Jackson,57,angela.jackson@example.com -8m8oihv9a1e7nn92,Kelly Lewis,36,kelly.lewis@example.com -7azy39la0no0mxi7,Jessica Munoz,55,jessica.munoz@example.com -47pmjkhnnqhyit8c,Kelly George,65,kelly.george@example.com -6j6cpy4kgneg1mmh,Anthony Johnson,65,anthony.johnson@example.com -tnlmtvap1zz89km9,Regina Fields,61,regina.fields@example.com -6cyuvnwwqdmrpfzh,Sharon Schaefer,30,sharon.schaefer@example.com -p1v4pyu2pqodc0ey,Jacob French,62,jacob.french@example.com -6npynnhjt2jd05xo,Jessica Costa,23,jessica.costa@example.com -wcxedf13n2e9qi4l,George Hardy,53,george.hardy@example.com -yf2xlcmszk2tqeig,Andrea Allison,20,andrea.allison@example.com -3bf2zzv7poststwa,Kevin Ferguson,32,kevin.ferguson@example.com -c2iataz0hhv39q63,Joseph Johnson,58,joseph.johnson@example.com -3e8npxhov4a39pvq,Ashley Martinez,18,ashley.martinez@example.com -t7dp41tysipytywq,Charles Nixon,23,charles.nixon@example.com -z8cztq7c47phyfhk,Carol Dudley,40,carol.dudley@example.com -2636f9d8r4ipm3h6,David Weber,51,david.weber@example.com -eh3f6wxtvkjq6ykq,Scott Robinson,32,scott.robinson@example.com -raskbwpsje69a59h,Anthony Hardy,38,anthony.hardy@example.com -90hn1p0b4cs9e2og,Mackenzie Owens,52,mackenzie.owens@example.com -am3swwfbo076x0v1,Brian Foster,27,brian.foster@example.com -5uw7utb9lq5cfncw,Hannah Forbes,56,hannah.forbes@example.com -cs6mbfzkzifefx6r,Lauren Reed,26,lauren.reed@example.com -ftw3uvztziiz9x00,Morgan Smith,28,morgan.smith@example.com -uhrqseeo43mozpaq,Samantha Alexander,65,samantha.alexander@example.com -pvvmzyfc1lxor11e,Tiffany Roberts,20,tiffany.roberts@example.com -jia7bdag4abz123s,Emily Hayes,34,emily.hayes@example.com -h6oozcngbz8o5x4y,Rebecca Villegas,52,rebecca.villegas@example.com -9v6z1pn2f9twcy12,Donald Shah,61,donald.shah@example.com -wzz3jduioso77o7f,Denise Cain,59,denise.cain@example.com -u51plhgvjodkswnr,Kristine Ramirez,53,kristine.ramirez@example.com -t1uhkmiytfyc13vc,Stacey Adkins,61,stacey.adkins@example.com -iqaqnf0ybg2ct507,Daniel Hunt,20,daniel.hunt@example.com -idwrwv2uu4hcpv2i,Roberta Johnson,48,roberta.johnson@example.com -2yd2hd6auetjacyo,Jason Williamson,39,jason.williamson@example.com -egrmdbibnjhi914x,Sandra Robinson,50,sandra.robinson@example.com -15m1pz2bb0ercgyk,Steve Rice,25,steve.rice@example.com -0i21bhkxdagjurb7,Kimberly Fritz,53,kimberly.fritz@example.com -726ofi7h5snreq67,Brianna Reynolds,33,brianna.reynolds@example.com -csqxse3wym56eim6,Alexander Williams,50,alexander.williams@example.com -qeaoylnrsf8p3byg,Andrew Thomas,25,andrew.thomas@example.com -edsswobumzyzbvhf,Austin Williams,57,austin.williams@example.com -hdzhzpt0ahy5hkib,Nicholas Williams,24,nicholas.williams@example.com -w1qmvmg4roa8xnwu,Mrs. Michelle Cisneros,48,michelle.cisneros@example.com -3z3o73x7adyuo6w0,Stacey Smith,39,stacey.smith@example.com -sse2u5zlgoqrgmcf,Laura Beck,20,laura.beck@example.com -rvovijmvch58r4yx,Molly Clark,51,molly.clark@example.com -doe06nrx8sg5mcuv,Carmen Morris,41,carmen.morris@example.com -jbjdwuvj5s4kw04y,Amanda Munoz,20,amanda.munoz@example.com -6k2ewkla7js0yw23,Rachel Collins,44,rachel.collins@example.com -fcxuyr4kkhrnigu1,John Alexander,18,john.alexander@example.com -d25fuwlos5mk07o0,Stacy Hunter,22,stacy.hunter@example.com -1vdai2rxmwd57oet,Eric Massey,40,eric.massey@example.com -pq4jnt9izu1wlrzd,Scott Garcia,20,scott.garcia@example.com -lz9kfc0lty5xcz14,Cassandra Nelson,35,cassandra.nelson@example.com -pu7w6tyab5jd4we9,Aaron Johnson,50,aaron.johnson@example.com -8dupswd2kqwdyn8v,Shannon Sherman,45,shannon.sherman@example.com -ye466l71jthiz2p6,April Garcia,60,april.garcia@example.com -xogsmfwb73l16qdt,Evan Lynn,20,evan.lynn@example.com +$id,name,age,email +r5ctmrqwqn1m3rc0,Diamond Mendez,56,diamond.mendez@example.com +wxwp7e7q7nx3ltfx,Michael Huff,20,michael.huff@example.com +4ct0b38fwaojawlv,Alyssa Rodriguez,37,alyssa.rodriguez@example.com +o0jjcuygbta2zvga,Barbara Smith,26,barbara.smith@example.com +bdy6l2ofl8klb4pb,Evelyn Edwards,54,evelyn.edwards@example.com +rkccl72v7zwtbila,Tina Richardson,41,tina.richardson@example.com +cilw7um0cd927esj,Joel Hernandez,49,joel.hernandez@example.com +60povvz0votkve1j,Zachary Cooper,59,zachary.cooper@example.com +ayow5dzwktvbbtp2,Brittany Spears,20,brittany.spears@example.com +cfru98od0lab0b2n,Holly White,47,holly.white@example.com +vjxjldvu3r6uylq6,Kimberly Barnes,27,kimberly.barnes@example.com +d1p47hl97pw6xowb,Stephen Miller,53,stephen.miller@example.com +yxk6qaa5ryb3gqrb,Yvonne Newman,41,yvonne.newman@example.com +ifkeo7j8t7hfd7z8,Carol Kane,38,carol.kane@example.com +e1q4lq8vvpxp9ysb,Doris Foster,44,doris.foster@example.com +obec6d52dc6swzsf,Joseph Stokes,28,joseph.stokes@example.com +26v06la6ug8wkvim,Steve Williams,31,steve.williams@example.com +m4glre4ch12vkxp6,James Carey,29,james.carey@example.com +jee8fyfffnjugsd5,Kathryn Henry,38,kathryn.henry@example.com +miquc6ljb9l3a31r,Christopher Landry,23,christopher.landry@example.com +ghf7da7seeuj1zdl,Jennifer Mcgee,62,jennifer.mcgee@example.com +x7h11phjrz77w0q8,Cathy Church,35,cathy.church@example.com +dn8u5lsux4708z6j,Jose Lopez,41,jose.lopez@example.com +zb7fdlyohuyy5i9k,William Rose,30,william.rose@example.com +qyrj8m9krp4dt4wt,Sarah Ford,26,sarah.ford@example.com +t6t673zpfyhhz8pg,Alisha Jones,61,alisha.jones@example.com +0hfbo0iy1q9bwc2n,Kristin Kelly,61,kristin.kelly@example.com +8alv4e4xrpcj443z,Brendan Stout,40,brendan.stout@example.com +qxm7a0z32xdkzxdj,Kelly Cruz,18,kelly.cruz@example.com +885mti7j7oiz5p5g,Samantha Martin,50,samantha.martin@example.com +v8i7dvhby6711m66,David Santos,46,david.santos@example.com +rggc0ow8ccd2jgvp,Elizabeth Carroll,22,elizabeth.carroll@example.com +012472s64rvzq1c4,Corey Owens,46,corey.owens@example.com +0k2xrwj4g33ut14y,Shelby Mueller,65,shelby.mueller@example.com +s3y9rl4uzf3difiq,Dr. Sylvia Myers,29,sylvia.myers@example.com +ntpc2td892t7f6an,Scott Freeman,48,scott.freeman@example.com +7f703gibyr5ijdmt,Christopher Atkinson,21,christopher.atkinson@example.com +r2jdf2pivkxmqd0l,Sean Diaz,31,sean.diaz@example.com +fj98fji1lrxeigs9,Bobby Dyer,57,bobby.dyer@example.com +mehqmzp9u7xv1z3j,Daniel Hall,62,daniel.hall@example.com +4cd5ln65qjfv3h4j,Jennifer Ramirez,65,jennifer.ramirez@example.com +wdi6ap0oa7m1ab1d,Angela Jackson,57,angela.jackson@example.com +l2foqjhxvjhjzijb,Kelly Lewis,36,kelly.lewis@example.com +d963t5yu35uagwm4,Jessica Munoz,55,jessica.munoz@example.com +99ez9uxsim8zp64m,Kelly George,65,kelly.george@example.com +v7wl221gycftl63d,Anthony Johnson,65,anthony.johnson@example.com +p2zzj0lnmjvqzfc3,Regina Fields,61,regina.fields@example.com +fk655e243z2ivvx6,Sharon Schaefer,30,sharon.schaefer@example.com +4ywsv6fw8g2d8ncw,Jacob French,62,jacob.french@example.com +y61q9k6g4h0fxxz4,Jessica Costa,23,jessica.costa@example.com +knj4hfzsthk7vx5n,George Hardy,53,george.hardy@example.com +a88u9w2pct2nn8l6,Andrea Allison,20,andrea.allison@example.com +hw960v1ybycrwr5o,Kevin Ferguson,32,kevin.ferguson@example.com +j9garslpgx6jgzgb,Joseph Johnson,58,joseph.johnson@example.com +gv101bz36elm84cd,Ashley Martinez,18,ashley.martinez@example.com +xrvzgt3gc0c7g4cl,Charles Nixon,23,charles.nixon@example.com +awjlu7uk0eutcfpb,Carol Dudley,40,carol.dudley@example.com +95oi26p2zdudpime,David Weber,51,david.weber@example.com +h8x7pkhdvu5bcp89,Scott Robinson,32,scott.robinson@example.com +oj6cu4jm1z2afe7s,Anthony Hardy,38,anthony.hardy@example.com +hgsdi1g30poqqmf0,Mackenzie Owens,52,mackenzie.owens@example.com +8fzdz914bqlqk2tc,Brian Foster,27,brian.foster@example.com +fwlqoeiunjhczpl0,Hannah Forbes,56,hannah.forbes@example.com +rsv8156goe8z4j6j,Lauren Reed,26,lauren.reed@example.com +1fjqv3w7uwbswe2p,Morgan Smith,28,morgan.smith@example.com +soqrzmhhg05hhzn4,Samantha Alexander,65,samantha.alexander@example.com +8quy52cto9kjjokp,Tiffany Roberts,20,tiffany.roberts@example.com +e3i1g1lw04v7jd89,Emily Hayes,34,emily.hayes@example.com +s7n8lzb0sw7h93z1,Rebecca Villegas,52,rebecca.villegas@example.com +e2lc7i81tpkqs1rp,Donald Shah,61,donald.shah@example.com +3oe2mysup1xluiw0,Denise Cain,59,denise.cain@example.com +1vqypc37f85nuqz4,Kristine Ramirez,53,kristine.ramirez@example.com +m0uh7r3dc6z8ucb4,Stacey Adkins,61,stacey.adkins@example.com +jdofz6x1ahganmqf,Daniel Hunt,20,daniel.hunt@example.com +vbe903c2q4m4q97g,Roberta Johnson,48,roberta.johnson@example.com +sndngrxuwpd93pdb,Jason Williamson,39,jason.williamson@example.com +66hvaw2p5xwf07p8,Sandra Robinson,50,sandra.robinson@example.com +9pvingfsl8cmag5c,Steve Rice,25,steve.rice@example.com +qe154m5hh00u4iiz,Kimberly Fritz,53,kimberly.fritz@example.com +avqnbrco2f0tfupk,Brianna Reynolds,33,brianna.reynolds@example.com +cqs10gi2qu1r3ugb,Alexander Williams,50,alexander.williams@example.com +jrpmfi6hmm7pmegp,Andrew Thomas,25,andrew.thomas@example.com +heeab2qqf0zm446f,Austin Williams,57,austin.williams@example.com +bkhugvnil7kjchm6,Nicholas Williams,24,nicholas.williams@example.com +b045j302pvv8l1p4,Mrs. Michelle Cisneros,48,michelle.cisneros@example.com +aikhii5q210lrfpr,Stacey Smith,39,stacey.smith@example.com +x0zajitea1z2dfo0,Laura Beck,20,laura.beck@example.com +abeecki7mdff1tv0,Molly Clark,51,molly.clark@example.com +yizama8r3i1to548,Carmen Morris,41,carmen.morris@example.com +8690yh971g4rgspj,Amanda Munoz,20,amanda.munoz@example.com +cd9vk5v97t359ul2,Rachel Collins,44,rachel.collins@example.com +wrkgmx1v0w9ja4l8,John Alexander,18,john.alexander@example.com +kxp3ucqo6ped4ss7,Stacy Hunter,22,stacy.hunter@example.com +dbvv8okae2qgo0gm,Eric Massey,40,eric.massey@example.com +9tn3nm6ppnayisje,Scott Garcia,20,scott.garcia@example.com +1xuc5t60xpcvd4qi,Cassandra Nelson,35,cassandra.nelson@example.com +qao1nulwn0kqyfkc,Aaron Johnson,50,aaron.johnson@example.com +kd2q6owvuwsy5knx,Shannon Sherman,45,shannon.sherman@example.com +wsl37kjo0bib4wrc,April Garcia,60,april.garcia@example.com +ujlz7k84xzfx4khs,Evan Lynn,20,evan.lynn@example.com diff --git a/tests/resources/functions/basic/index.js b/tests/resources/functions/basic/index.js new file mode 100644 index 0000000000..47f7100b5b --- /dev/null +++ b/tests/resources/functions/basic/index.js @@ -0,0 +1,48 @@ +module.exports = async(context) => { + context.log('log-works'); + context.error('error-log-works'); + + if(context.req.headers['x-appwrite-user-jwt']) { + context.log('jwt-is-valid'); + } else { + context.log('jwt-is-invalid'); + } + + if(context.req.path === '/custom-response') { + const code = +(context.req.query['code'] || '200'); + const body = context.req.query['body'] || ''; + return context.res.send(body, code); + } + + context.log('body-is-' + (context.req.body ?? '')); + context.log('custom-header-is-' + (context.req.headers['x-custom-header'] ?? '')); + context.log('method-is-' + (context.req.method ?? '').toLowerCase()); + context.log('path-is-' + (context.req.path ?? '')); + context.log('user-is-' + (context.req.headers['x-appwrite-user-id'] ?? '')); + + const statusCode = context.req.query['code'] || '200'; + + return context.res.json({ + 'APPWRITE_FUNCTION_ID' : process.env.APPWRITE_FUNCTION_ID ?? '', + 'APPWRITE_FUNCTION_NAME' : process.env.APPWRITE_FUNCTION_NAME ?? '', + 'APPWRITE_FUNCTION_DEPLOYMENT' : process.env.APPWRITE_FUNCTION_DEPLOYMENT ?? '', + 'APPWRITE_FUNCTION_TRIGGER' : context.req.headers['x-appwrite-trigger'] ?? '', + 'APPWRITE_FUNCTION_RUNTIME_NAME' : process.env.APPWRITE_FUNCTION_RUNTIME_NAME, + 'APPWRITE_FUNCTION_RUNTIME_VERSION' : process.env.APPWRITE_FUNCTION_RUNTIME_VERSION, + 'APPWRITE_VERSION' : process.env.APPWRITE_VERSION ?? '', + 'APPWRITE_REGION' : process.env.APPWRITE_REGION ?? '', + 'UNICODE_TEST' : "êä", + 'GLOBAL_VARIABLE' : process.env.GLOBAL_VARIABLE ?? '', + 'APPWRITE_FUNCTION_EVENT' : context.req.headers['x-appwrite-event'] ?? '', + 'APPWRITE_FUNCTION_EVENT_DATA' : context.req.bodyRaw ?? '', + 'APPWRITE_FUNCTION_DATA' : context.req.bodyRaw ?? '', + 'APPWRITE_FUNCTION_USER_ID' : context.req.headers['x-appwrite-user-id'] ?? '', + 'APPWRITE_FUNCTION_JWT' : context.req.headers['x-appwrite-user-jwt'] ?? '', + 'APPWRITE_FUNCTION_PROJECT_ID' : process.env.APPWRITE_FUNCTION_PROJECT_ID, + 'APPWRITE_FUNCTION_MEMORY' : process.env.APPWRITE_FUNCTION_MEMORY, + 'APPWRITE_FUNCTION_CPUS' : process.env.APPWRITE_FUNCTION_CPUS, + 'APPWRITE_FUNCTION_EXECUTION_ID': context.req.headers['x-appwrite-execution-id'] ?? '', + 'APPWRITE_FUNCTION_CLIENT_IP': context.req.headers['x-appwrite-client-ip'] ?? '', + 'CUSTOM_VARIABLE' : process.env.CUSTOM_VARIABLE + }, +statusCode); +} \ No newline at end of file diff --git a/tests/resources/functions/node/maintenance.js b/tests/resources/functions/basic/maintenance.js similarity index 100% rename from tests/resources/functions/node/maintenance.js rename to tests/resources/functions/basic/maintenance.js diff --git a/tests/resources/functions/binary-request/index.js b/tests/resources/functions/binary-request/index.js new file mode 100644 index 0000000000..227df8dce6 --- /dev/null +++ b/tests/resources/functions/binary-request/index.js @@ -0,0 +1,6 @@ +const crypto = require('crypto') + +module.exports = async(context) => { + const hash = crypto.createHash('md5').update(context.req.bodyBinary).digest("hex") + return context.res.send(hash); +}; diff --git a/tests/resources/functions/binary-response/index.js b/tests/resources/functions/binary-response/index.js new file mode 100644 index 0000000000..284a593df0 --- /dev/null +++ b/tests/resources/functions/binary-response/index.js @@ -0,0 +1,4 @@ +module.exports = async(context) => { + const bytes = Buffer.from(Uint8Array.from([0, 10, 255])); + return context.res.binary(bytes); +}; diff --git a/tests/resources/functions/cookies/index.js b/tests/resources/functions/cookies/index.js new file mode 100644 index 0000000000..dd5dd7bd19 --- /dev/null +++ b/tests/resources/functions/cookies/index.js @@ -0,0 +1,3 @@ +module.exports = async(context) => { + return context.res.send(context.req.headers['cookie'] ?? ''); +}; diff --git a/tests/resources/functions/dart/main.dart b/tests/resources/functions/dart/main.dart deleted file mode 100644 index 1ed09c3485..0000000000 --- a/tests/resources/functions/dart/main.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'dart:io' show Platform; - -Future<dynamic> main(final context) async { - context.log('Amazing Function Log'); - - response.json({ - 'APPWRITE_FUNCTION_ID' : Platform.environment['APPWRITE_FUNCTION_ID'] ?? '', - 'APPWRITE_FUNCTION_NAME' : Platform.environment['APPWRITE_FUNCTION_NAME'] ?? '', - 'APPWRITE_FUNCTION_DEPLOYMENT' : Platform.environment['APPWRITE_FUNCTION_DEPLOYMENT'] ?? '', - 'APPWRITE_FUNCTION_TRIGGER' : context.req.headers['x-appwrite-trigger'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' : Platform.environment['APPWRITE_FUNCTION_RUNTIME_NAME'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_VERSION' : Platform.environment['APPWRITE_FUNCTION_RUNTIME_VERSION'] ?? '', - 'APPWRITE_FUNCTION_EVENT' : context.req.headers['x-appwrite-event'] ?? '', - 'APPWRITE_FUNCTION_EVENT_DATA' : context.req.bodyRaw ?? '', - 'APPWRITE_FUNCTION_DATA' : context.req.bodyRaw ?? '', - 'APPWRITE_FUNCTION_USER_ID' : context.req.headers['x-appwrite-user-id'] ?? '', - 'APPWRITE_FUNCTION_JWT' : context.req.headers['x-appwrite-user-jwt'] ?? '', - 'APPWRITE_FUNCTION_PROJECT_ID' : Platform.environment['APPWRITE_FUNCTION_PROJECT_ID'] ?? '', - 'CUSTOM_VARIABLE' : request.variables['CUSTOM_VARIABLE'] - }); -} \ No newline at end of file diff --git a/tests/resources/functions/dynamic-api-key/index.js b/tests/resources/functions/dynamic-api-key/index.js new file mode 100644 index 0000000000..6c98f819c6 --- /dev/null +++ b/tests/resources/functions/dynamic-api-key/index.js @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +module.exports = async(context) => { + const client = new sdk.Client(); + client.setEndpoint(process.env.APPWRITE_FUNCTION_API_ENDPOINT); + client.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID); + client.setKey(context.req.headers['x-appwrite-key']); + + const users = new sdk.Users(client); + + const response = await users.list(); + context.log(JSON.stringify(response)); + + return context.res.json(response); +}; diff --git a/tests/resources/functions/dynamic-api-key/package-lock.json b/tests/resources/functions/dynamic-api-key/package-lock.json new file mode 100644 index 0000000000..2d86fe18d3 --- /dev/null +++ b/tests/resources/functions/dynamic-api-key/package-lock.json @@ -0,0 +1,31 @@ +{ + "name": "dynamic-api-key", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "dynamic-api-key", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "node-appwrite": "^17.0.0" + } + }, + "node_modules/node-appwrite": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-17.0.0.tgz", + "integrity": "sha512-5Moi5ENPnoAfU1/6CZP9K2NTuB6Nm3dSyhokno+24RDuP7czjXCdwzfeyjmyHieggbrLkN89AYSOv9W1XkCL9w==", + "license": "BSD-3-Clause", + "dependencies": { + "node-fetch-native-with-agent": "1.7.2" + } + }, + "node_modules/node-fetch-native-with-agent": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/node-fetch-native-with-agent/-/node-fetch-native-with-agent-1.7.2.tgz", + "integrity": "sha512-5MaOOCuJEvcckoz7/tjdx1M6OusOY6Xc5f459IaruGStWnKzlI1qpNgaAwmn4LmFYcsSlj+jBMk84wmmRxfk5g==", + "license": "MIT" + } + } +} diff --git a/tests/resources/functions/dynamic-api-key/package.json b/tests/resources/functions/dynamic-api-key/package.json new file mode 100644 index 0000000000..19b8158131 --- /dev/null +++ b/tests/resources/functions/dynamic-api-key/package.json @@ -0,0 +1,15 @@ +{ + "name": "dynamic-api-key", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "node-appwrite": "^17.0.0" + } +} diff --git a/tests/resources/functions/php-scopes/setup.sh b/tests/resources/functions/dynamic-api-key/setup.sh similarity index 94% rename from tests/resources/functions/php-scopes/setup.sh rename to tests/resources/functions/dynamic-api-key/setup.sh index a2f78a4f3d..c0bb3cec58 100644 --- a/tests/resources/functions/php-scopes/setup.sh +++ b/tests/resources/functions/dynamic-api-key/setup.sh @@ -1,6 +1,7 @@ - ENDPOINT="$APPWRITE_FUNCTION_API_ENDPOINT/users" PROJECT_ID="$APPWRITE_FUNCTION_PROJECT_ID" API_KEY="$APPWRITE_FUNCTION_API_KEY" +apk add curl + curl -v -X GET $ENDPOINT -H "x-appwrite-project: $PROJECT_ID" -H "x-appwrite-key: $API_KEY" \ No newline at end of file diff --git a/tests/resources/functions/event-handler/index.js b/tests/resources/functions/event-handler/index.js new file mode 100644 index 0000000000..6df3b7fb35 --- /dev/null +++ b/tests/resources/functions/event-handler/index.js @@ -0,0 +1,5 @@ +module.exports = async(context) => { + context.log(context.req.body.$id); + context.log(context.req.body.name); + return context.res.empty(); +}; diff --git a/tests/resources/functions/php-large/blue.mp4 b/tests/resources/functions/large/blue.mp4 similarity index 100% rename from tests/resources/functions/php-large/blue.mp4 rename to tests/resources/functions/large/blue.mp4 diff --git a/tests/resources/functions/large/index.js b/tests/resources/functions/large/index.js new file mode 100644 index 0000000000..5e8719bcf3 --- /dev/null +++ b/tests/resources/functions/large/index.js @@ -0,0 +1,3 @@ +module.exports = async(context) => { + return context.res.empty(); +}; diff --git a/tests/resources/functions/log-error-truncation/index.js b/tests/resources/functions/log-error-truncation/index.js new file mode 100644 index 0000000000..7e94fa5028 --- /dev/null +++ b/tests/resources/functions/log-error-truncation/index.js @@ -0,0 +1,14 @@ +module.exports = async(context) => { + // Create a string that is 1000001 characters long (exceeds the 1000000 limit) + const longString = 'z' + 'a'.repeat(1000000); + + context.log(longString); + context.error(longString); + + return context.res.json({ + motto: 'Build like a team of hundreds_', + learn: 'https://appwrite.io/docs', + connect: 'https://appwrite.io/discord', + getInspired: 'https://builtwith.appwrite.io', + }); + }; \ No newline at end of file diff --git a/tests/resources/functions/node/index.js b/tests/resources/functions/node/index.js index e8eb938a15..a43ed308ac 100644 --- a/tests/resources/functions/node/index.js +++ b/tests/resources/functions/node/index.js @@ -1,21 +1,3 @@ module.exports = async(context) => { - context.log('Amazing Function Log'); - - return context.res.json({ - 'APPWRITE_FUNCTION_ID' : process.env.APPWRITE_FUNCTION_ID ?? '', - 'APPWRITE_FUNCTION_NAME' : process.env.APPWRITE_FUNCTION_NAME ?? '', - 'APPWRITE_FUNCTION_DEPLOYMENT' : process.env.APPWRITE_FUNCTION_DEPLOYMENT ?? '', - 'APPWRITE_FUNCTION_TRIGGER' : context.req.headers['x-appwrite-trigger'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' : process.env.APPWRITE_FUNCTION_RUNTIME_NAME, - 'APPWRITE_FUNCTION_RUNTIME_VERSION' : process.env.APPWRITE_FUNCTION_RUNTIME_VERSION, - 'APPWRITE_FUNCTION_EVENT' : context.req.headers['x-appwrite-event'] ?? '', - 'APPWRITE_FUNCTION_EVENT_DATA' : context.req.bodyRaw ?? '', - 'APPWRITE_FUNCTION_DATA' : context.req.bodyRaw ?? '', - 'APPWRITE_FUNCTION_USER_ID' : context.req.headers['x-appwrite-user-id'] ?? '', - 'APPWRITE_FUNCTION_JWT' : context.req.headers['x-appwrite-user-jwt'] ?? '', - 'APPWRITE_FUNCTION_PROJECT_ID' : process.env.APPWRITE_FUNCTION_PROJECT_ID, - 'APPWRITE_FUNCTION_MEMORY' : process.env.APPWRITE_FUNCTION_MEMORY, - 'APPWRITE_FUNCTION_CPUS' : process.env.APPWRITE_FUNCTION_CPUS, - 'CUSTOM_VARIABLE' : process.env.CUSTOM_VARIABLE - }); + return context.res.send('OK'); } \ No newline at end of file diff --git a/tests/resources/functions/php-binary-request/index.php b/tests/resources/functions/php-binary-request/index.php deleted file mode 100644 index 53df8705e5..0000000000 --- a/tests/resources/functions/php-binary-request/index.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -return function ($context) { - $hash = md5($context->req->bodyBinary); - return $context->res->send($hash); -}; diff --git a/tests/resources/functions/php-binary-response/index.php b/tests/resources/functions/php-binary-response/index.php deleted file mode 100644 index 7715663388..0000000000 --- a/tests/resources/functions/php-binary-response/index.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -return function ($context) { - $bytes = pack('C*', ...[0, 10, 255]); - return $context->res->binary($bytes); -}; diff --git a/tests/resources/functions/php-cookie/index.php b/tests/resources/functions/php-cookie/index.php deleted file mode 100644 index 8f38f752cb..0000000000 --- a/tests/resources/functions/php-cookie/index.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - -return function ($context) { - return $context->res->send($context->req->headers['cookie'] ?? ''); -}; diff --git a/tests/resources/functions/php-event/index.php b/tests/resources/functions/php-event/index.php deleted file mode 100644 index 550fd57729..0000000000 --- a/tests/resources/functions/php-event/index.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -return function ($context) { - $context->log($context->req->body['$id']); - $context->log($context->req->body['name']); - - return $context->res->empty(); -}; diff --git a/tests/resources/functions/php-fn/index.php b/tests/resources/functions/php-fn/index.php deleted file mode 100644 index 0b6e3d206c..0000000000 --- a/tests/resources/functions/php-fn/index.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -return function ($context) { - $context->log('Amazing Function Log'); - - return $context->res->json([ - 'APPWRITE_FUNCTION_ID' => \getenv('APPWRITE_FUNCTION_ID') ?: '', - 'APPWRITE_FUNCTION_NAME' => \getenv('APPWRITE_FUNCTION_NAME') ?: '', - 'APPWRITE_FUNCTION_DEPLOYMENT' => \getenv('APPWRITE_FUNCTION_DEPLOYMENT') ?: '', - 'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '', - 'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '', - 'APPWRITE_VERSION' => \getenv('APPWRITE_VERSION') ?: '', - 'APPWRITE_REGION' => \getenv('APPWRITE_REGION') ?: '', - 'APPWRITE_FUNCTION_EVENT' => $context->req->headers['x-appwrite-event'] ?? '', - 'APPWRITE_FUNCTION_EVENT_DATA' => $context->req->bodyRaw ?? '', - 'APPWRITE_FUNCTION_DATA' => $context->req->bodyRaw ?? '', - 'APPWRITE_FUNCTION_USER_ID' => $context->req->headers['x-appwrite-user-id'] ?? '', - 'APPWRITE_FUNCTION_JWT' => $context->req->headers['x-appwrite-user-jwt'] ?? '', - 'APPWRITE_FUNCTION_PROJECT_ID' => \getenv('APPWRITE_FUNCTION_PROJECT_ID') ?: '', - 'CUSTOM_VARIABLE' => \getenv('CUSTOM_VARIABLE') ?: '', - ]); -}; diff --git a/tests/resources/functions/php-large/composer.json b/tests/resources/functions/php-large/composer.json deleted file mode 100644 index e3c6db23e9..0000000000 --- a/tests/resources/functions/php-large/composer.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "appwrite/cloud-function-demo", - "description": "Demo cloud function script", - "type": "library", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Team Appwrite", - "email": "team@appwrite.io" - } - ], - "require": { - "php": ">=7.4.0", - "ext-curl": "*", - "ext-json": "*", - "appwrite/appwrite": "1.1.*" - } -} diff --git a/tests/resources/functions/php-large/composer.lock b/tests/resources/functions/php-large/composer.lock deleted file mode 100644 index 758c73c3f9..0000000000 --- a/tests/resources/functions/php-large/composer.lock +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "afdff6a172e6c44aee11f1562175f81a", - "packages": [ - { - "name": "appwrite/appwrite", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/appwrite/sdk-for-php.git", - "reference": "98b327d3fd18a72f4582019916afd735a0e9e0e7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/98b327d3fd18a72f4582019916afd735a0e9e0e7", - "reference": "98b327d3fd18a72f4582019916afd735a0e9e0e7", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "php": ">=7.1.0" - }, - "require-dev": { - "phpunit/phpunit": "3.7.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "Appwrite\\": "src/Appwrite" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks", - "support": { - "email": "team@localhost.test", - "issues": "https://github.com/appwrite/sdk-for-php/issues", - "source": "https://github.com/appwrite/sdk-for-php/tree/1.1.2", - "url": "https://appwrite.io/support" - }, - "time": "2020-08-15T18:24:32+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=7.4.0", - "ext-curl": "*", - "ext-json": "*" - }, - "platform-dev": [], - "plugin-api-version": "2.0.0" -} diff --git a/tests/resources/functions/php-large/index.php b/tests/resources/functions/php-large/index.php deleted file mode 100644 index abcb2e53d9..0000000000 --- a/tests/resources/functions/php-large/index.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -return function ($context) { - return $context->res->json([ - 'APPWRITE_FUNCTION_ID' => \getenv('APPWRITE_FUNCTION_ID') ?: '', - 'APPWRITE_FUNCTION_NAME' => \getenv('APPWRITE_FUNCTION_NAME') ?: '', - 'APPWRITE_FUNCTION_DEPLOYMENT' => \getenv('APPWRITE_FUNCTION_DEPLOYMENT') ?: '', - 'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '', - 'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '', - 'APPWRITE_REGION' => \getenv('APPWRITE_REGION') ?: '', - 'APPWRITE_FUNCTION_CPUS' => \getenv('APPWRITE_FUNCTION_CPUS') ?: '', - 'APPWRITE_FUNCTION_MEMORY' => \getenv('APPWRITE_FUNCTION_MEMORY') ?: '', - 'UNICODE_TEST' => "êä" - ]); -}; diff --git a/tests/resources/functions/php-scopes/composer.json b/tests/resources/functions/php-scopes/composer.json deleted file mode 100644 index 8eacdab3ec..0000000000 --- a/tests/resources/functions/php-scopes/composer.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "appwrite/php-scopes", - "description": "PHP scopes test script", - "type": "library", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Team Appwrite", - "email": "team@appwrite.io" - } - ], - "require": { - "php": ">=7.4.0", - "ext-curl": "*", - "ext-json": "*", - "appwrite/appwrite": "11.0.*" - } -} diff --git a/tests/resources/functions/php-scopes/index.php b/tests/resources/functions/php-scopes/index.php deleted file mode 100644 index 905d924eb7..0000000000 --- a/tests/resources/functions/php-scopes/index.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -require 'vendor/autoload.php'; - -use Appwrite\Client; -use Appwrite\Services\Users; - -return function ($context) { - $client = new Client(); - $client - ->setEndpoint(getenv('APPWRITE_FUNCTION_API_ENDPOINT')) - ->setProject(getenv('APPWRITE_FUNCTION_PROJECT_ID')) - ->setKey($context->req->headers['x-appwrite-key']); - $users = new Users($client); - $response = $users->list(); - $context->log($response); - return $context->res->json($response); -}; diff --git a/tests/resources/functions/php-v2/index.php b/tests/resources/functions/php-v2/index.php deleted file mode 100644 index 2bf5d83304..0000000000 --- a/tests/resources/functions/php-v2/index.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - -return function ($req, $res) { - $res->json([ - 'v2Woks' => true - ]); -}; diff --git a/tests/resources/functions/php/index.php b/tests/resources/functions/php/index.php deleted file mode 100644 index 6c67f27ee1..0000000000 --- a/tests/resources/functions/php/index.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -return function ($context) { - if ($context->req->path === '/custom-response') { - $code = (int) ($context->req->query['code'] ?? '200'); - $body = $context->req->query['body'] ?? ''; - return $context->res->send($body, $code); - } - - $context->log('body-is-' . ($context->req->body ?? '')); - $context->log('custom-header-is-' . ($context->req->headers['x-custom-header'] ?? '')); - $context->log('method-is-' . \strtolower($context->req->method ?? '')); - $context->log('path-is-' . ($context->req->path ?? '')); - $context->log('user-is-' . $context->req->headers['x-appwrite-user-id'] ?? ''); - - if (empty($context->req->headers['x-appwrite-user-jwt'] ?? '')) { - $context->log('jwt-is-invalid'); - } else { - $context->log('jwt-is-valid'); - } - - $context->error('error-log-works'); - - $statusCode = $context->req->query['code'] ?? '200'; - - return $context->res->json([ - 'APPWRITE_FUNCTION_ID' => \getenv('APPWRITE_FUNCTION_ID') ?: '', - 'APPWRITE_FUNCTION_NAME' => \getenv('APPWRITE_FUNCTION_NAME') ?: '', - 'APPWRITE_FUNCTION_DEPLOYMENT' => \getenv('APPWRITE_FUNCTION_DEPLOYMENT') ?: '', - 'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '', - 'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '', - 'APPWRITE_REGION' => \getenv('APPWRITE_REGION') ?: '', - 'UNICODE_TEST' => "êä", - 'GLOBAL_VARIABLE' => \getenv('GLOBAL_VARIABLE') ?: '', - 'APPWRITE_FUNCTION_CPUS' => \getenv('APPWRITE_FUNCTION_CPUS') ?: '', - 'APPWRITE_FUNCTION_MEMORY' => \getenv('APPWRITE_FUNCTION_MEMORY') ?: '', - ], \intval($statusCode)); -}; diff --git a/tests/resources/functions/python/main.py b/tests/resources/functions/python/main.py deleted file mode 100644 index fda0b36f0e..0000000000 --- a/tests/resources/functions/python/main.py +++ /dev/null @@ -1,21 +0,0 @@ -import json -import os - -def main(context): - context.log('Amazing Function Log') - - return context.res.json({ - 'APPWRITE_FUNCTION_ID' : os.environ.get('APPWRITE_FUNCTION_ID',''), - 'APPWRITE_FUNCTION_NAME' : os.environ.get('APPWRITE_FUNCTION_NAME',''), - 'APPWRITE_FUNCTION_DEPLOYMENT' : os.environ.get('APPWRITE_FUNCTION_DEPLOYMENT',''), - 'APPWRITE_FUNCTION_TRIGGER' : context.req.headers.get('x-appwrite-trigger', ''), - 'APPWRITE_FUNCTION_RUNTIME_NAME' : os.environ.get('APPWRITE_FUNCTION_RUNTIME_NAME',''), - 'APPWRITE_FUNCTION_RUNTIME_VERSION' : os.environ.get('APPWRITE_FUNCTION_RUNTIME_VERSION',''), - 'APPWRITE_FUNCTION_EVENT' : context.req.headers.get('x-appwrite-event', ''), - 'APPWRITE_FUNCTION_EVENT_DATA' : context.req.body_raw, - 'APPWRITE_FUNCTION_DATA' : context.req.body_raw, - 'APPWRITE_FUNCTION_USER_ID' : context.req.headers.get('x-appwrite-user-id', ''), - 'APPWRITE_FUNCTION_JWT' : context.req.headers.get('x-appwrite-user-jwt', ''), - 'APPWRITE_FUNCTION_PROJECT_ID' : os.environ.get('APPWRITE_FUNCTION_PROJECT_ID',''), - 'CUSTOM_VARIABLE' : os.environ.get('CUSTOM_VARIABLE',''), - }) \ No newline at end of file diff --git a/tests/resources/functions/ruby/main.rb b/tests/resources/functions/ruby/main.rb deleted file mode 100644 index c14f591fa1..0000000000 --- a/tests/resources/functions/ruby/main.rb +++ /dev/null @@ -1,19 +0,0 @@ -def main(context) - context.log('Amazing Function Log') - - return context.res.json({ - 'APPWRITE_FUNCTION_ID' => ENV['APPWRITE_FUNCTION_ID'] || '', - 'APPWRITE_FUNCTION_NAME' => ENV['APPWRITE_FUNCTION_NAME'] || '', - 'APPWRITE_FUNCTION_DEPLOYMENT' => ENV['APPWRITE_FUNCTION_DEPLOYMENT'] || '', - 'APPWRITE_FUNCTION_TRIGGER' => context.req.headers['x-appwrite-trigger'] || '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' => ENV['APPWRITE_FUNCTION_RUNTIME_NAME'] || '', - 'APPWRITE_FUNCTION_RUNTIME_VERSION' => ENV['APPWRITE_FUNCTION_RUNTIME_VERSION'] || '', - 'APPWRITE_FUNCTION_EVENT' => context.req.headers['x-appwrite-event'] || '', - 'APPWRITE_FUNCTION_EVENT_DATA' => context.req.body_raw || '', - 'APPWRITE_FUNCTION_DATA' => context.req.body_raw || '', - 'APPWRITE_FUNCTION_USER_ID' => context.req.headers['x-appwrite-user-id'] || '', - 'APPWRITE_FUNCTION_JWT' => context.req.headers['x-appwrite-user-jwt'] || '', - 'APPWRITE_FUNCTION_PROJECT_ID' => ENV['APPWRITE_FUNCTION_PROJECT_ID'] || '', - 'CUSTOM_VARIABLE' => ENV['CUSTOM_VARIABLE'] || '' - }) -end \ No newline at end of file diff --git a/tests/resources/functions/swift/index.swift b/tests/resources/functions/swift/index.swift deleted file mode 100644 index b3dcdbc91a..0000000000 --- a/tests/resources/functions/swift/index.swift +++ /dev/null @@ -1,17 +0,0 @@ -func main(req: RequestValue, res: RequestResponse) throws -> RequestResponse { - return res.json(data: [ - "APPWRITE_FUNCTION_ID": req.variables["APPWRITE_FUNCTION_ID"], - "APPWRITE_FUNCTION_NAME": req.variables["APPWRITE_FUNCTION_NAME"], - "APPWRITE_FUNCTION_DEPLOYMENT": req.variables["APPWRITE_FUNCTION_DEPLOYMENT"], - "APPWRITE_FUNCTION_TRIGGER": req.variables["APPWRITE_FUNCTION_TRIGGER"], - "APPWRITE_FUNCTION_RUNTIME_NAME": req.variables["APPWRITE_FUNCTION_RUNTIME_NAME"], - "APPWRITE_FUNCTION_RUNTIME_VERSION": req.variables["APPWRITE_FUNCTION_RUNTIME_VERSION"], - "APPWRITE_FUNCTION_EVENT": req.variables["APPWRITE_FUNCTION_EVENT"], - "APPWRITE_FUNCTION_EVENT_DATA": req.variables["APPWRITE_FUNCTION_EVENT_DATA"], - "APPWRITE_FUNCTION_DATA": req.variables["APPWRITE_FUNCTION_DATA"], - "APPWRITE_FUNCTION_USER_ID": req.variables["APPWRITE_FUNCTION_USER_ID"], - "APPWRITE_FUNCTION_JWT": req.variables["APPWRITE_FUNCTION_JWT"], - "APPWRITE_FUNCTION_PROJECT_ID": req.variables["APPWRITE_FUNCTION_PROJECT_ID"], - "CUSTOM_VARIABLE": req.variables["CUSTOM_VARIABLE"] - ]) -} \ No newline at end of file diff --git a/tests/resources/functions/timeout/index.js b/tests/resources/functions/timeout/index.js new file mode 100644 index 0000000000..45ad72a323 --- /dev/null +++ b/tests/resources/functions/timeout/index.js @@ -0,0 +1,4 @@ +module.exports = async(context) => { + await new Promise(resolve => setTimeout(resolve, 1000 * 60)); + return context.res.send('OK'); +}; diff --git a/tests/resources/functions/timeout/index.php b/tests/resources/functions/timeout/index.php deleted file mode 100644 index c9aedb3a30..0000000000 --- a/tests/resources/functions/timeout/index.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -return function ($context) { - sleep(60); - return $context->res->send('OK'); -}; diff --git a/tests/resources/sites/astro/src/pages/cookies.js b/tests/resources/sites/astro/src/pages/cookies.js new file mode 100644 index 0000000000..65911c8aeb --- /dev/null +++ b/tests/resources/sites/astro/src/pages/cookies.js @@ -0,0 +1,9 @@ +export async function GET(context) { + const sessionId = context.cookies.get("custom-session-id")?.value ?? 'Custom session ID missing'; + const userId = context.cookies.get("custom-user-id")?.value ?? 'Custom user ID missing'; + + context.cookies.set('my-cookie-one', 'value-one'); + context.cookies.set('my-cookie-two', 'value-two'); + + return new Response(sessionId + ";" + userId); +} diff --git a/tests/unit/Event/EventTest.php b/tests/unit/Event/EventTest.php index c852cf2757..d5936e4b8f 100644 --- a/tests/unit/Event/EventTest.php +++ b/tests/unit/Event/EventTest.php @@ -93,57 +93,57 @@ class EventTest extends TestCase $this->assertContains('users.*.update', $event); $this->assertContains('users.*', $event); - $event = Event::generateEvents('collections.[collectionId].documents.[documentId].create', [ - 'collectionId' => 'chapters', - 'documentId' => 'prolog', + $event = Event::generateEvents('tables.[tableId].rows.[rowId].create', [ + 'tableId' => 'chapters', + 'rowId' => 'prolog', ]); $this->assertCount(10, $event); - $this->assertContains('collections.chapters.documents.prolog.create', $event); - $this->assertContains('collections.chapters.documents.prolog', $event); - $this->assertContains('collections.chapters.documents.*.create', $event); - $this->assertContains('collections.chapters.documents.*', $event); - $this->assertContains('collections.chapters', $event); - $this->assertContains('collections.*.documents.prolog.create', $event); - $this->assertContains('collections.*.documents.prolog', $event); - $this->assertContains('collections.*.documents.*.create', $event); - $this->assertContains('collections.*.documents.*', $event); - $this->assertContains('collections.*', $event); + $this->assertContains('tables.chapters.rows.prolog.create', $event); + $this->assertContains('tables.chapters.rows.prolog', $event); + $this->assertContains('tables.chapters.rows.*.create', $event); + $this->assertContains('tables.chapters.rows.*', $event); + $this->assertContains('tables.chapters', $event); + $this->assertContains('tables.*.rows.prolog.create', $event); + $this->assertContains('tables.*.rows.prolog', $event); + $this->assertContains('tables.*.rows.*.create', $event); + $this->assertContains('tables.*.rows.*', $event); + $this->assertContains('tables.*', $event); - $event = Event::generateEvents('databases.[databaseId].collections.[collectionId].documents.[documentId].create', [ + $event = Event::generateEvents('databases.[databaseId].tables.[tableId].rows.[rowId].create', [ 'databaseId' => 'chaptersDB', - 'collectionId' => 'chapters', - 'documentId' => 'prolog', + 'tableId' => 'chapters', + 'rowId' => 'prolog', ]); $this->assertCount(22, $event); - $this->assertContains('databases.chaptersDB.collections.chapters.documents.prolog.create', $event); - $this->assertContains('databases.chaptersDB.collections.chapters.documents.prolog', $event); - $this->assertContains('databases.chaptersDB.collections.chapters.documents.*.create', $event); - $this->assertContains('databases.chaptersDB.collections.chapters.documents.*', $event); - $this->assertContains('databases.chaptersDB.collections.chapters', $event); - $this->assertContains('databases.chaptersDB.collections.*.documents.prolog.create', $event); - $this->assertContains('databases.chaptersDB.collections.*.documents.prolog', $event); - $this->assertContains('databases.chaptersDB.collections.*', $event); + $this->assertContains('databases.chaptersDB.tables.chapters.rows.prolog.create', $event); + $this->assertContains('databases.chaptersDB.tables.chapters.rows.prolog', $event); + $this->assertContains('databases.chaptersDB.tables.chapters.rows.*.create', $event); + $this->assertContains('databases.chaptersDB.tables.chapters.rows.*', $event); + $this->assertContains('databases.chaptersDB.tables.chapters', $event); + $this->assertContains('databases.chaptersDB.tables.*.rows.prolog.create', $event); + $this->assertContains('databases.chaptersDB.tables.*.rows.prolog', $event); + $this->assertContains('databases.chaptersDB.tables.*', $event); $this->assertContains('databases.chaptersDB', $event); - $this->assertContains('databases.*.collections.chapters.documents.prolog.create', $event); - $this->assertContains('databases.*.collections.chapters.documents.prolog', $event); - $this->assertContains('databases.*.collections.chapters', $event); - $this->assertContains('databases.*.collections.*.documents.*.create', $event); - $this->assertContains('databases.*.collections.*.documents.*', $event); - $this->assertContains('databases.*.collections.*', $event); + $this->assertContains('databases.*.tables.chapters.rows.prolog.create', $event); + $this->assertContains('databases.*.tables.chapters.rows.prolog', $event); + $this->assertContains('databases.*.tables.chapters', $event); + $this->assertContains('databases.*.tables.*.rows.*.create', $event); + $this->assertContains('databases.*.tables.*.rows.*', $event); + $this->assertContains('databases.*.tables.*', $event); $this->assertContains('databases.*', $event); - $this->assertContains('databases.*.collections.*.documents.prolog', $event); - $this->assertContains('databases.*.collections.*.documents.prolog.create', $event); - $this->assertContains('databases.*.collections.chapters.documents.*', $event); - $this->assertContains('databases.*.collections.chapters.documents.*.create', $event); - $this->assertContains('databases.chaptersDB.collections.*.documents.*', $event); - $this->assertContains('databases.chaptersDB.collections.*.documents.*.create', $event); + $this->assertContains('databases.*.tables.*.rows.prolog', $event); + $this->assertContains('databases.*.tables.*.rows.prolog.create', $event); + $this->assertContains('databases.*.tables.chapters.rows.*', $event); + $this->assertContains('databases.*.tables.chapters.rows.*.create', $event); + $this->assertContains('databases.chaptersDB.tables.*.rows.*', $event); + $this->assertContains('databases.chaptersDB.tables.*.rows.*.create', $event); try { - $event = Event::generateEvents('collections.[collectionId].documents.[documentId].create', [ - 'collectionId' => 'chapters' + $event = Event::generateEvents('tables.[tableId].rows.[rowId].create', [ + 'tableId' => 'chapters' ]); $this->fail(); } catch (\Throwable $th) { @@ -151,7 +151,7 @@ class EventTest extends TestCase } try { - $event = Event::generateEvents('collections.[collectionId].documents.[documentId].create'); + $event = Event::generateEvents('tables.[tableId].rows.[rowId].create'); $this->fail(); } catch (\Throwable $th) { $this->assertInstanceOf(InvalidArgumentException::class, $th, 'An invalid exception was thrown'); diff --git a/tests/unit/Event/MockPublisher.php b/tests/unit/Event/MockPublisher.php index 54fcc89358..0b812e7032 100644 --- a/tests/unit/Event/MockPublisher.php +++ b/tests/unit/Event/MockPublisher.php @@ -7,7 +7,7 @@ use Utopia\Queue\Queue; class MockPublisher implements Publisher { - private $events = []; + private array $events = []; public function enqueue(Queue $queue, array $payload): bool { diff --git a/tests/unit/Event/Validator/EventValidatorTest.php b/tests/unit/Event/Validator/EventValidatorTest.php index e9f652adeb..6885d20bfb 100644 --- a/tests/unit/Event/Validator/EventValidatorTest.php +++ b/tests/unit/Event/Validator/EventValidatorTest.php @@ -29,27 +29,27 @@ class EventValidatorTest extends TestCase $this->assertTrue($this->object->isValid('users.*.update.email')); $this->assertTrue($this->object->isValid('users.*.update')); $this->assertTrue($this->object->isValid('users.*')); - $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.prolog.create')); - $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.prolog')); - $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.*.create')); - $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.*')); - $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.prolog.create')); - $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.prolog')); - $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.*.create')); - $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.*')); - $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.prolog.create')); - $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.prolog')); - $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.*.create')); - $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.*')); - $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.prolog.create')); - $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.prolog')); - $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.*.create')); - $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.*')); - $this->assertTrue($this->object->isValid('databases.*.collections.*')); + $this->assertTrue($this->object->isValid('databases.books.tables.chapters.rows.prolog.create')); + $this->assertTrue($this->object->isValid('databases.books.tables.chapters.rows.prolog')); + $this->assertTrue($this->object->isValid('databases.books.tables.chapters.rows.*.create')); + $this->assertTrue($this->object->isValid('databases.books.tables.chapters.rows.*')); + $this->assertTrue($this->object->isValid('databases.books.tables.*.rows.prolog.create')); + $this->assertTrue($this->object->isValid('databases.books.tables.*.rows.prolog')); + $this->assertTrue($this->object->isValid('databases.books.tables.*.rows.*.create')); + $this->assertTrue($this->object->isValid('databases.books.tables.*.rows.*')); + $this->assertTrue($this->object->isValid('databases.*.tables.chapters.rows.prolog.create')); + $this->assertTrue($this->object->isValid('databases.*.tables.chapters.rows.prolog')); + $this->assertTrue($this->object->isValid('databases.*.tables.chapters.rows.*.create')); + $this->assertTrue($this->object->isValid('databases.*.tables.chapters.rows.*')); + $this->assertTrue($this->object->isValid('databases.*.tables.*.rows.prolog.create')); + $this->assertTrue($this->object->isValid('databases.*.tables.*.rows.prolog')); + $this->assertTrue($this->object->isValid('databases.*.tables.*.rows.*.create')); + $this->assertTrue($this->object->isValid('databases.*.tables.*.rows.*')); + $this->assertTrue($this->object->isValid('databases.*.tables.*')); $this->assertTrue($this->object->isValid('databases.*')); $this->assertTrue($this->object->isValid('databases.books')); - $this->assertTrue($this->object->isValid('databases.books.collections.chapters')); - $this->assertTrue($this->object->isValid('databases.books.collections.*')); + $this->assertTrue($this->object->isValid('databases.books.tables.chapters')); + $this->assertTrue($this->object->isValid('databases.books.tables.*')); $this->assertTrue($this->object->isValid('functions.*')); $this->assertTrue($this->object->isValid('buckets.*')); $this->assertTrue($this->object->isValid('teams.*')); @@ -63,9 +63,9 @@ class EventValidatorTest extends TestCase $this->assertFalse($this->object->isValid(null)); $this->assertFalse($this->object->isValid('')); $this->assertFalse($this->object->isValid('unknown.*')); - $this->assertFalse($this->object->isValid('collections')); - $this->assertFalse($this->object->isValid('collections.*.unknown')); - $this->assertFalse($this->object->isValid('collections.*.documents.*.unknown')); + $this->assertFalse($this->object->isValid('tables')); + $this->assertFalse($this->object->isValid('tables.*.unknown')); + $this->assertFalse($this->object->isValid('tables.*.rows.*.unknown')); $this->assertFalse($this->object->isValid('users.torsten.unknown')); $this->assertFalse($this->object->isValid('users.torsten.delete.email')); $this->assertFalse($this->object->isValid('teams.*.memberships.*.update.unknown')); diff --git a/tests/unit/Event/Validator/FunctionEventValidatorTest.php b/tests/unit/Event/Validator/FunctionEventValidatorTest.php index ea59f6771a..9b6e05b9f7 100644 --- a/tests/unit/Event/Validator/FunctionEventValidatorTest.php +++ b/tests/unit/Event/Validator/FunctionEventValidatorTest.php @@ -29,27 +29,27 @@ class FunctionEventValidatorTest extends TestCase $this->assertTrue($this->object->isValid('users.*.update.email')); $this->assertTrue($this->object->isValid('users.*.update')); $this->assertTrue($this->object->isValid('users.*')); - $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.prolog.create')); - $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.prolog')); - $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.*.create')); - $this->assertTrue($this->object->isValid('databases.books.collections.chapters.documents.*')); - $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.prolog.create')); - $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.prolog')); - $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.*.create')); - $this->assertTrue($this->object->isValid('databases.books.collections.*.documents.*')); - $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.prolog.create')); - $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.prolog')); - $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.*.create')); - $this->assertTrue($this->object->isValid('databases.*.collections.chapters.documents.*')); - $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.prolog.create')); - $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.prolog')); - $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.*.create')); - $this->assertTrue($this->object->isValid('databases.*.collections.*.documents.*')); - $this->assertTrue($this->object->isValid('databases.*.collections.*')); + $this->assertTrue($this->object->isValid('databases.books.tables.chapters.rows.prolog.create')); + $this->assertTrue($this->object->isValid('databases.books.tables.chapters.rows.prolog')); + $this->assertTrue($this->object->isValid('databases.books.tables.chapters.rows.*.create')); + $this->assertTrue($this->object->isValid('databases.books.tables.chapters.rows.*')); + $this->assertTrue($this->object->isValid('databases.books.tables.*.rows.prolog.create')); + $this->assertTrue($this->object->isValid('databases.books.tables.*.rows.prolog')); + $this->assertTrue($this->object->isValid('databases.books.tables.*.rows.*.create')); + $this->assertTrue($this->object->isValid('databases.books.tables.*.rows.*')); + $this->assertTrue($this->object->isValid('databases.*.tables.chapters.rows.prolog.create')); + $this->assertTrue($this->object->isValid('databases.*.tables.chapters.rows.prolog')); + $this->assertTrue($this->object->isValid('databases.*.tables.chapters.rows.*.create')); + $this->assertTrue($this->object->isValid('databases.*.tables.chapters.rows.*')); + $this->assertTrue($this->object->isValid('databases.*.tables.*.rows.prolog.create')); + $this->assertTrue($this->object->isValid('databases.*.tables.*.rows.prolog')); + $this->assertTrue($this->object->isValid('databases.*.tables.*.rows.*.create')); + $this->assertTrue($this->object->isValid('databases.*.tables.*.rows.*')); + $this->assertTrue($this->object->isValid('databases.*.tables.*')); $this->assertTrue($this->object->isValid('databases.*')); $this->assertTrue($this->object->isValid('databases.books')); - $this->assertTrue($this->object->isValid('databases.books.collections.chapters')); - $this->assertTrue($this->object->isValid('databases.books.collections.*')); + $this->assertTrue($this->object->isValid('databases.books.tables.chapters')); + $this->assertTrue($this->object->isValid('databases.books.tables.*')); $this->assertTrue($this->object->isValid('buckets.*')); $this->assertTrue($this->object->isValid('teams.*')); $this->assertTrue($this->object->isValid('users.*')); @@ -62,9 +62,9 @@ class FunctionEventValidatorTest extends TestCase $this->assertFalse($this->object->isValid(null)); $this->assertFalse($this->object->isValid('')); $this->assertFalse($this->object->isValid('unknown.*')); - $this->assertFalse($this->object->isValid('collections')); - $this->assertFalse($this->object->isValid('collections.*.unknown')); - $this->assertFalse($this->object->isValid('collections.*.documents.*.unknown')); + $this->assertFalse($this->object->isValid('tables')); + $this->assertFalse($this->object->isValid('tables.*.unknown')); + $this->assertFalse($this->object->isValid('tables.*.rows.*.unknown')); $this->assertFalse($this->object->isValid('users.torsten.unknown')); $this->assertFalse($this->object->isValid('users.torsten.delete.email')); $this->assertFalse($this->object->isValid('teams.*.memberships.*.update.unknown')); diff --git a/tests/unit/GraphQL/BuilderTest.php b/tests/unit/GraphQL/BuilderTest.php index d79a104c90..3dd1bcadc7 100644 --- a/tests/unit/GraphQL/BuilderTest.php +++ b/tests/unit/GraphQL/BuilderTest.php @@ -22,8 +22,8 @@ class BuilderTest extends TestCase */ public function testCreateTypeMapping() { - $model = $this->response->getModel(Response::MODEL_COLLECTION); + $model = $this->response->getModel(Response::MODEL_TABLE); $type = Mapper::model(\ucfirst($model->getType())); - $this->assertEquals('Collection', $type->name); + $this->assertEquals('Table', $type->name); } } diff --git a/tests/unit/Migration/MigrationTest.php b/tests/unit/Migration/MigrationTest.php index 536278d55b..bb6c49d2fc 100644 --- a/tests/unit/Migration/MigrationTest.php +++ b/tests/unit/Migration/MigrationTest.php @@ -41,6 +41,7 @@ abstract class MigrationTest extends TestCase foreach (Migration::$versions as $class) { $this->assertTrue(class_exists('Appwrite\\Migration\\Version\\' . $class)); } + // Test if current version exists // Only test official releases - skip if latest is release candidate if (!(\str_contains(APP_VERSION_STABLE, 'RC'))) { diff --git a/tests/unit/Network/Validators/DNSTest.php b/tests/unit/Network/Validators/DNSTest.php index 5e8652381a..c3e819e7dc 100644 --- a/tests/unit/Network/Validators/DNSTest.php +++ b/tests/unit/Network/Validators/DNSTest.php @@ -3,8 +3,18 @@ namespace Tests\Unit\Network\Validators; use Appwrite\Network\Validator\DNS; +use Appwrite\Tests\Retry; use PHPUnit\Framework\TestCase; +/* +DNS Setup (on Appwrite Labs digital ocean team, network tab): + +certainly.caa.appwrite.org: CAA 0 issue "certainly.com" +certainly-full.caa.appwrite.org: CAA 128 issuewild "certainly.com;account=123456;validationmethods=dns-01" +letsencrypt.certainly.caa.appwrite.org: CAA 0 issue "letsencrypt.org" + +*/ + class DNSTest extends TestCase { public function setUp(): void @@ -47,4 +57,52 @@ class DNSTest extends TestCase $this->assertEquals($validator->isValid('aaaa-unit-test.appwrite.org'), true); $this->assertEquals($validator->isValid('test1.appwrite.org'), false); } + + #[Retry(count: 5)] + public function testCAA(): void + { + $certainly = new DNS('certainly.com', DNS::RECORD_CAA, 'ns1.digitalocean.com'); + $letsencrypt = new DNS('letsencrypt.org', DNS::RECORD_CAA, 'ns1.digitalocean.com'); + + // No CAA record succeeds on main domain & subdomains for any issuer + $this->assertEquals($certainly->isValid('caa.appwrite.org'), true); + $this->assertEquals($certainly->isValid('sub.caa.appwrite.org'), true); + $this->assertEquals($certainly->isValid('sub.sub.caa.appwrite.org'), true); + + $this->assertEquals($letsencrypt->isValid('caa.appwrite.org'), true); + $this->assertEquals($letsencrypt->isValid('sub.caa.appwrite.org'), true); + $this->assertEquals($letsencrypt->isValid('sub.sub.caa.appwrite.org'), true); + + // Custom flags and tag is allowed, but only for Certainly + $this->assertEquals($certainly->isValid('certainly-full.caa.appwrite.org'), true); + $this->assertEquals($letsencrypt->isValid('certainly-full.caa.appwrite.org'), false); + + // Custom flags&tag are not allowed if validator includes specific flags&tag + $certainlyFull = new DNS('0 issue "certainly.com"', DNS::RECORD_CAA); + $this->assertEquals($certainlyFull->isValid('certainly-full.caa.appwrite.org'), false); + + // Custom flags&tag still allows if they match exactly + $certainlyFull = new DNS('128 issuewild "certainly.com;account=123456;validationmethods=dns-01"', DNS::RECORD_CAA); + $this->assertEquals($certainlyFull->isValid('certainly-full.caa.appwrite.org'), true); + + // Certainly CAA allows Certainly, but not LetsEncrypt; Same for subdomains + $this->assertEquals($certainly->isValid('certainly.caa.appwrite.org'), true); + $this->assertEquals($letsencrypt->isValid('certainly.caa.appwrite.org'), false); + + $this->assertEquals($certainly->isValid('sub.certainly.caa.appwrite.org'), true); + $this->assertEquals($letsencrypt->isValid('sub.certainly.caa.appwrite.org'), false); + + $this->assertEquals($certainly->isValid('sub.sub.certainly.caa.appwrite.org'), true); + $this->assertEquals($letsencrypt->isValid('sub.sub.certainly.caa.appwrite.org'), false); + + // LetsEncrypt CAA on subdomain with parent allowing Certainly. Only LetsEncrypt is allowed; Same for subdomains + $this->assertEquals($certainly->isValid('letsencrypt.certainly.caa.appwrite.org'), false); + $this->assertEquals($letsencrypt->isValid('letsencrypt.certainly.caa.appwrite.org'), true); + + $this->assertEquals($certainly->isValid('sub.letsencrypt.certainly.caa.appwrite.org'), false); + $this->assertEquals($letsencrypt->isValid('sub.letsencrypt.certainly.caa.appwrite.org'), true); + + $this->assertEquals($certainly->isValid('sub.sub.letsencrypt.certainly.caa.appwrite.org'), false); + $this->assertEquals($letsencrypt->isValid('sub.sub.letsencrypt.certainly.caa.appwrite.org'), true); + } } diff --git a/tests/unit/Network/Validators/OriginTest.php b/tests/unit/Network/Validators/OriginTest.php index d9bc77c19f..d312f8c5a5 100644 --- a/tests/unit/Network/Validators/OriginTest.php +++ b/tests/unit/Network/Validators/OriginTest.php @@ -2,6 +2,7 @@ namespace Tests\Unit\Network\Validators; +use Appwrite\Network\Platform; use Appwrite\Network\Validator\Origin; use PHPUnit\Framework\TestCase; use Utopia\Database\Helpers\ID; @@ -14,62 +15,99 @@ class OriginTest extends TestCase [ '$collection' => ID::custom('platforms'), 'name' => 'Production', - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'hostname' => 'appwrite.io', ], [ '$collection' => ID::custom('platforms'), 'name' => 'Development', - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'hostname' => 'appwrite.test', ], [ '$collection' => ID::custom('platforms'), 'name' => 'Localhost', - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'hostname' => 'localhost', ], [ '$collection' => ID::custom('platforms'), 'name' => 'Flutter', - 'type' => Origin::CLIENT_TYPE_FLUTTER_WEB, + 'type' => Platform::TYPE_FLUTTER_WEB, 'hostname' => 'appwrite.flutter', ], + [ + '$collection' => ID::custom('platforms'), + 'name' => 'Expo', + 'type' => Platform::TYPE_SCHEME, + 'key' => 'exp', + ], + [ + '$collection' => ID::custom('platforms'), + 'name' => 'Appwrite Callback', + 'type' => Platform::TYPE_SCHEME, + 'key' => 'appwrite-callback-123', + ], ]); - $this->assertEquals($validator->isValid('https://localhost'), true); - $this->assertEquals($validator->isValid('http://localhost'), true); - $this->assertEquals($validator->isValid('http://localhost:80'), true); + $this->assertEquals(false, $validator->isValid('')); + $this->assertEquals(false, $validator->isValid('/')); - $this->assertEquals($validator->isValid('https://appwrite.io'), true); - $this->assertEquals($validator->isValid('http://appwrite.io'), true); - $this->assertEquals($validator->isValid('http://appwrite.io:80'), true); + $this->assertEquals(true, $validator->isValid('https://localhost')); + $this->assertEquals(true, $validator->isValid('http://localhost')); + $this->assertEquals(true, $validator->isValid('http://localhost:80')); - $this->assertEquals($validator->isValid('https://appwrite.test'), true); - $this->assertEquals($validator->isValid('http://appwrite.test'), true); - $this->assertEquals($validator->isValid('http://appwrite.test:80'), true); + $this->assertEquals(true, $validator->isValid('https://appwrite.io')); + $this->assertEquals(true, $validator->isValid('http://appwrite.io')); + $this->assertEquals(true, $validator->isValid('http://appwrite.io:80')); - $this->assertEquals($validator->isValid('https://appwrite.flutter'), true); - $this->assertEquals($validator->isValid('http://appwrite.flutter'), true); - $this->assertEquals($validator->isValid('http://appwrite.flutter:80'), true); + $this->assertEquals(true, $validator->isValid('https://appwrite.test')); + $this->assertEquals(true, $validator->isValid('http://appwrite.test')); + $this->assertEquals(true, $validator->isValid('http://appwrite.test:80')); - $this->assertEquals($validator->isValid('https://example.com'), false); - $this->assertEquals($validator->isValid('http://example.com'), false); - $this->assertEquals($validator->isValid('http://example.com:80'), false); + $this->assertEquals(true, $validator->isValid('https://appwrite.flutter')); + $this->assertEquals(true, $validator->isValid('http://appwrite.flutter')); + $this->assertEquals(true, $validator->isValid('http://appwrite.flutter:80')); - $this->assertEquals($validator->isValid('appwrite-ios://com.company.appname'), false); - $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new iOS platform on your project console dashboard'); + $this->assertEquals(false, $validator->isValid('https://example.com')); + $this->assertEquals(false, $validator->isValid('http://example.com')); + $this->assertEquals(false, $validator->isValid('http://example.com:80')); - $this->assertEquals($validator->isValid('appwrite-android://com.company.appname'), false); - $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new Android platform on your project console dashboard'); + $this->assertEquals(true, $validator->isValid('exp://')); + $this->assertEquals(true, $validator->isValid('exp:///')); + $this->assertEquals(true, $validator->isValid('exp://index')); - $this->assertEquals($validator->isValid('appwrite-macos://com.company.appname'), false); - $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new macOS platform on your project console dashboard'); + $this->assertEquals(true, $validator->isValid('appwrite-callback-123://')); + $this->assertEquals(false, $validator->isValid('appwrite-callback-456://')); - $this->assertEquals($validator->isValid('appwrite-linux://com.company.appname'), false); - $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new Linux platform on your project console dashboard'); + $this->assertEquals(false, $validator->isValid('appwrite-ios://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new iOS platform on your project console dashboard', $validator->getDescription()); - $this->assertEquals($validator->isValid('appwrite-windows://com.company.appname'), false); - $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new Windows platform on your project console dashboard'); + $this->assertEquals(false, $validator->isValid('appwrite-android://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Android platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('appwrite-macos://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new macOS platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('appwrite-linux://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Linux platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('appwrite-windows://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Windows platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('chrome-extension://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Web (Chrome Extension) platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('moz-extension://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Web (Firefox Extension) platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('safari-web-extension://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Web (Safari Extension) platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('ms-browser-extension://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Web (Edge Extension) platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('random-scheme://localhost')); + $this->assertEquals('Invalid Scheme. The scheme used (random-scheme) in the Origin (random-scheme://localhost) is not supported. If you are using a custom scheme, please change it to `appwrite-callback-<PROJECT_ID>`', $validator->getDescription()); } } diff --git a/tests/unit/URL/URLTest.php b/tests/unit/URL/URLTest.php index fecaf25bca..ceca1c6304 100644 --- a/tests/unit/URL/URLTest.php +++ b/tests/unit/URL/URLTest.php @@ -26,6 +26,15 @@ class URLTest extends TestCase $this->assertEquals(null, $url['port']); $this->assertEquals('', $url['path']); $this->assertEquals('', $url['query']); + + $url = URL::parse('appwrite-callback-project://'); + + $this->assertIsArray($url); + $this->assertEquals('appwrite-callback-project', $url['scheme']); + $this->assertEquals('', $url['host']); + $this->assertEquals(null, $url['port']); + $this->assertEquals('', $url['path']); + $this->assertEquals('', $url['query']); } public function testUnparse(): void @@ -86,6 +95,19 @@ class URLTest extends TestCase $this->assertIsString($url); $this->assertEquals('https://eldad:fux@appwrite.io/#bottom', $url); + + $url = URL::unparse([ + 'scheme' => 'https', + 'user' => '', + 'pass' => '', + 'host' => 'appwrite.io', + 'port' => null, + 'path' => '', + 'fragment' => '', + ]); + + $this->assertIsString($url); + $this->assertEquals('https://appwrite.io/#', $url); } public function testParseQuery(): void